Skip to content

Commit

Permalink
Merge pull request #60 from DevFactory/release/multiple-code-improvem…
Browse files Browse the repository at this point in the history
…ents-fix-1

multiple code improvements: squid:S1118, squid:S1155, squid:S1488
  • Loading branch information
gastaldi committed Mar 11, 2016
2 parents f3f80ee + 946c4d1 commit b12228d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/src/main/java/org/jboss/forge/roaster/Roaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*/
public final class Roaster
{
private Roaster() {}

private static List<JavaParser> parsers;
private static List<FormatterProvider> formatters;

Expand All @@ -46,7 +48,7 @@ private static List<JavaParser> getParsers()
parsers.add(p);
}
}
if (parsers.size() == 0)
if (parsers.isEmpty())
{
throw new IllegalStateException("No instances of [" + JavaParser.class.getName()
+ "] were found on the classpath.");
Expand All @@ -67,7 +69,7 @@ private static List<FormatterProvider> getFormatters()
formatters.add(p);
}
}
if (formatters.size() == 0)
if (formatters.isEmpty())
{
throw new IllegalStateException("No instances of [" + FormatterProvider.class.getName()
+ "] were found on the classpath.");
Expand Down Expand Up @@ -173,8 +175,7 @@ public static <T extends JavaType<?>> T parse(final Class<T> type, final String

if (type.isInstance(unit.getGoverningType()))
{
final T result = (T) unit.getGoverningType();
return result;
return (T) unit.getGoverningType();
}
else if (unit != null)
{
Expand Down

0 comments on commit b12228d

Please sign in to comment.