417561 Refactor annotation related code

Log a warning if not able to check valid classname when scanning a directory (wars that are not unpacked are still able to be scanned even though Resource.getFile().getName() will return null).
This commit is contained in:
Jan Bartel 2013-09-20 18:08:19 +10:00
parent 07f3230784
commit 911f271817
1 changed files with 9 additions and 2 deletions

View File

@ -18,6 +18,7 @@
package org.eclipse.jetty.annotations;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
@ -726,8 +727,14 @@ public class AnnotationParser
else
{
//we've already verified the directories, so just verify the class file name
String filename = res.getFile().getName();
if (isValidClassFileName(filename))
boolean valid = true;
File file = res.getFile();
if (file == null)
LOG.warn("Unable to validate class file name for {}", res);
else
valid = isValidClassFileName(file.getName());
if (valid)
{
String name = res.getName();
if ((resolver == null)|| (!resolver.isExcluded(name) && (!isParsed(name) || resolver.shouldOverride(name))))