Skip to content

Commit

Permalink
multiple code improvements: squid:S1066, squid:S1155, squid:S1118, sq…
Browse files Browse the repository at this point in the history
…uid:S2325
  • Loading branch information
George Kankava committed Mar 11, 2016
1 parent df1decd commit d420de4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/src/main/java/org/jboss/forge/roaster/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ else if (file.getName().endsWith(".java"))
}
}

private String help()
private static String help()
{
StringBuilder sb = new StringBuilder();
sb.append("Usage: roaster [OPTION]... FILES ... \n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void removeAllAnnotations(final SingleVariableDeclaration variableDeclara
removeAllAnnotations(variableDeclaration.modifiers());
}

private void removeAllAnnotations(final List<?> modifiers)
private static void removeAllAnnotations(final List<?> modifiers)
{
Iterator<?> iterator = modifiers.iterator();
while (iterator.hasNext())
Expand Down Expand Up @@ -244,7 +244,7 @@ private AnnotationSource<O> getAnnotation(final AnnotationTargetSource<O, T> tar
return null;
}

private List<?> getModifiers(final ASTNode body)
private static List<?> getModifiers(final ASTNode body)
{
if (body instanceof BodyDeclaration)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void removeModifier(ASTNode body, ModifierKeyword keyword)
}

@SuppressWarnings("unchecked")
private List<Modifier> getInternalModifiers(final ASTNode body)
private static List<Modifier> getInternalModifiers(final ASTNode body)
{
if (body instanceof BodyDeclaration)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,9 @@ public String resolveType(final String type)
}

// No import matches and no wild-card/on-demand import matches means this class is in the same package.
if (Types.isSimpleName(result))
if (Types.isSimpleName(result) && getPackage() != null)
{
if (getPackage() != null)
result = getPackage() + "." + result;
result = getPackage() + "." + result;
}

return result;
Expand All @@ -387,7 +386,7 @@ private List<WildcardImportResolver> getImportResolvers()
resolvers.add(r);
}
}
if (resolvers.size() == 0)
if (resolvers.isEmpty())
{
throw new IllegalStateException("No instances of [" + WildcardImportResolver.class.getName()
+ "] were found on the classpath.");
Expand Down

0 comments on commit d420de4

Please sign in to comment.