fixes based on Sonar reports

This commit is contained in:
Timo Westkämper 2010-04-08 08:33:20 +00:00
parent e762202f59
commit cb2e617542
3 changed files with 7 additions and 8 deletions

View File

@ -54,8 +54,7 @@ public class EvaluatorFactory {
}
private void compile(String source, Class<?> projectionType,
String[] names, Class<?>[] types, String id) throws IOException,
UnsupportedEncodingException {
String[] names, Class<?>[] types, String id) throws IOException {
// create source
StringWriter writer = new StringWriter();
JavaWriter javaw = new JavaWriter(writer);

View File

@ -17,7 +17,7 @@ import javax.tools.JavaFileManager;
* @author tiwe
*
*/
public class MemFileSystemRegistry {
public final class MemFileSystemRegistry {
public static final MemFileSystemRegistry DEFAULT = new MemFileSystemRegistry();
@ -31,9 +31,9 @@ public class MemFileSystemRegistry {
private MemFileSystemRegistry() {
String pkgName = MemFileSystemRegistry.class.getPackage().getName();
protocolName = pkgName.substring(pkgName.lastIndexOf(".") + 1);
protocolName = pkgName.substring(pkgName.lastIndexOf('.') + 1);
String pkgs = System.getProperty("java.protocol.handler.pkgs");
String parentPackage = pkgName.substring(0,pkgName.lastIndexOf("."));
String parentPackage = pkgName.substring(0,pkgName.lastIndexOf('.'));
pkgs = pkgs == null ? parentPackage : pkgs + "|" + parentPackage;
System.setProperty("java.protocol.handler.pkgs",pkgs);
}

View File

@ -34,7 +34,7 @@ public class MemJavaFileObject extends SimpleJavaFileObject {
@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors)
throws IOException, IllegalStateException, UnsupportedOperationException {
throws IOException, UnsupportedOperationException {
if(baos == null){
throw new FileNotFoundException(name);
}
@ -51,7 +51,7 @@ public class MemJavaFileObject extends SimpleJavaFileObject {
}
@Override
public InputStream openInputStream() throws IOException, IllegalStateException, UnsupportedOperationException {
public InputStream openInputStream() throws IOException, UnsupportedOperationException {
if(baos == null){
throw new FileNotFoundException(name);
}
@ -59,7 +59,7 @@ public class MemJavaFileObject extends SimpleJavaFileObject {
}
@Override
public OutputStream openOutputStream() throws IOException, IllegalStateException, UnsupportedOperationException {
public OutputStream openOutputStream() throws IOException, UnsupportedOperationException {
if (baos == null){
baos = new ByteArrayOutputStream();
}