return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return FilePredicates.hasType(org.sonar.api.batch.fs.InputFile.Type.valueOf(s));
+ return s == null ? FilePredicates.all() : FilePredicates.hasType(org.sonar.api.batch.fs.InputFile.Type.valueOf(s));
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return FilePredicates.hasStatus(org.sonar.api.batch.fs.InputFile.Status.valueOf(s));
+ return s == null ? FilePredicates.all() : FilePredicates.hasStatus(org.sonar.api.batch.fs.InputFile.Status.valueOf(s));
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return FilePredicates.hasLanguage(s);
+ return s == null ? FilePredicates.all() : FilePredicates.hasLanguage(s);
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return new FilePredicateAdapters.KeyPredicate(s);
+ return s == null ? FilePredicates.all() : new FilePredicateAdapters.KeyPredicate(s);
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return new FilePredicateAdapters.DeprecatedKeyPredicate(s);
+ return s == null ? FilePredicates.all() : new FilePredicateAdapters.DeprecatedKeyPredicate(s);
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return new FilePredicateAdapters.SourceRelativePathPredicate(s);
+ return s == null ? FilePredicates.all() : new FilePredicateAdapters.SourceRelativePathPredicate(s);
}
}));
}
return FilePredicates.or(Collections2.transform(value, new Function<String, FilePredicate>() {
@Override
public FilePredicate apply(@Nullable String s) {
- return new FilePredicateAdapters.SourceDirPredicate(s);
+ return s == null ? FilePredicates.all() : new FilePredicateAdapters.SourceDirPredicate(s);
}
}));
}
return this.key;
}
- public NewRule setName(String s) {
+ public NewRule setName(@Nullable String s) {
this.name = StringUtils.trim(s);
return this;
}
try {
setHtmlDescription(IOUtils.toString(classpathUrl));
} catch (IOException e) {
- throw new IllegalStateException("Fail to read: " + classpathUrl);
+ throw new IllegalStateException("Fail to read: " + classpathUrl, e);
}
} else {
this.htmlDescription = null;