Skip to content

Commit

Permalink
Issue #1692
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel authored and joakime committed Aug 8, 2017
1 parent 98eb354 commit e81e17d
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,19 +978,26 @@ private boolean isValidClassFileName (String name)
return false;

//skip anything that is not a class file
if (!name.toLowerCase(Locale.ENGLISH).endsWith(".class"))
String lc = name.toLowerCase(Locale.ENGLISH);
if (!lc.endsWith(".class"))
{
if (LOG.isDebugEnabled()) LOG.debug("Not a class: {}",name);
return false;
}

if (lc.equals("module-info.class"))
{
if (LOG.isDebugEnabled()) LOG.debug("Skipping module-info.class");
return false;
}

//skip any classfiles that are not a valid java identifier
int c0 = 0;
int ldir = name.lastIndexOf('/', name.length()-6);
c0 = (ldir > -1 ? ldir+1 : c0);
if (!Character.isJavaIdentifierStart(name.charAt(c0)))
{
if (LOG.isDebugEnabled()) LOG.debug("Not a java identifier: {}"+name);
if (LOG.isDebugEnabled()) LOG.debug("Not a java identifier: {}",name);
return false;
}

Expand Down

0 comments on commit e81e17d

Please sign in to comment.