getNameWithoutExtension return null if "." not found #1

Open
opened 2018-01-14 18:08:20 +01:00 by basman93 · 1 comment
basman93 commented 2018-01-14 18:08:20 +01:00 (Migrated from gitlab.com)
private String getNameWithoutExtension(String name)
{
  int pos = name.lastIndexOf(".");
	
  if(pos != -1)
    return name.substring(0, pos);
		
  return null;
}

should be

private String getNameWithoutExtension(String name)
{
  int pos = name.lastIndexOf(".");

  if(pos != -1)
    return name.substring(0, pos);

  return name;
}
```java private String getNameWithoutExtension(String name) { int pos = name.lastIndexOf("."); if(pos != -1) return name.substring(0, pos); return null; } ``` should be ```java private String getNameWithoutExtension(String name) { int pos = name.lastIndexOf("."); if(pos != -1) return name.substring(0, pos); return name; } ```
basman93 commented 2018-01-14 18:09:20 +01:00 (Migrated from gitlab.com)

assigned to @basman93

assigned to @basman93
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bas/CustomCrafting#1
No description provided.