mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
fixes based on Sonar reports
This commit is contained in:
parent
e762202f59
commit
cb2e617542
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user