Added checkstyle for tests
This commit is contained in:
@@ -43,7 +43,7 @@ public class CompilationMessage {
|
||||
this.sourceCode = sourceCode;
|
||||
this.startPosition = startPosition;
|
||||
this.endPosition = endPosition;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type of message
|
||||
@@ -84,7 +84,7 @@ public class CompilationMessage {
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append("==========\n");
|
||||
if (this.sourceCode != null) { // Cannot include source context if no source
|
||||
// available
|
||||
// available
|
||||
int[] lineStartEnd = getLineStartEnd(this.startPosition);
|
||||
s.append(this.sourceCode.substring(lineStartEnd[0], lineStartEnd[1]))
|
||||
.append("\n");
|
||||
|
||||
@@ -201,7 +201,7 @@ public final class InMemoryJavaFileObject implements JavaFileObject {
|
||||
InMemoryJavaFileObject.this.lastModifiedTime = System.currentTimeMillis();
|
||||
InMemoryJavaFileObject.this.content = new String(toCharArray())
|
||||
.getBytes(); // Ignoring encoding...
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class JrtEntryJavaFileObject implements JavaFileObject {
|
||||
*/
|
||||
public JrtEntryJavaFileObject(Path path) {
|
||||
this.pathToClassString = path.subpath(2, path.getNameCount()).toString(); // e.g.
|
||||
// java/lang/Object.class
|
||||
// java/lang/Object.class
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,8 +127,8 @@ public class JrtFsEnumeration implements Enumeration<JrtEntryJavaFileObject> {
|
||||
throws IOException {
|
||||
int fnc = file.getNameCount();
|
||||
if (fnc >= 3 && file.toString().endsWith(".class")) { // There is a preceeding
|
||||
// module name - e.g.
|
||||
// /modules/java.base/java/lang/Object.class
|
||||
// module name - e.g.
|
||||
// /modules/java.base/java/lang/Object.class
|
||||
// file.subpath(2, fnc); // e.g. java/lang/Object.class
|
||||
JrtFsEnumeration.this.jfos.add(new JrtEntryJavaFileObject(file));
|
||||
}
|
||||
|
||||
@@ -207,8 +207,8 @@ public class MemoryBasedJavaFileManager implements JavaFileManager {
|
||||
URL[] urls = loader.getURLs();
|
||||
if (urls.length > 1) { // heuristic that catches Maven surefire tests
|
||||
if (!urls[0].toString().startsWith("jar:file:")) { // heuristic for
|
||||
// Spring Boot fat
|
||||
// jar
|
||||
// Spring Boot fat
|
||||
// jar
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (URL url : urls) {
|
||||
if (builder.length() > 0) {
|
||||
@@ -627,7 +627,7 @@ public class MemoryBasedJavaFileManager implements JavaFileManager {
|
||||
if (file.getNameCount() > 3 && file.toString().endsWith(".class")) {
|
||||
int fnc = file.getNameCount();
|
||||
if (fnc > 3) { // There is a package name - e.g.
|
||||
// /modules/java.base/java/lang/Object.class
|
||||
// /modules/java.base/java/lang/Object.class
|
||||
Path packagePath = file.subpath(2, fnc - 1); // e.g. java/lang
|
||||
String packagePathString = packagePath.toString() + "/";
|
||||
CompilationInfoCache.this.packageCache.put(packagePathString,
|
||||
|
||||
Reference in New Issue
Block a user