aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-06-10 12:00:05 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-06-10 12:00:05 +0200
commit01d2115b4f30db85a3c8efbb6dd1bbc8aba16f8a (patch)
treed0e670af4872bd43c8f72b02c8a7af28e83321e0 /src/core/lombok/eclipse
parente453c2fafab13c066a7260434f0c08f61e437c8b (diff)
downloadlombok-01d2115b4f30db85a3c8efbb6dd1bbc8aba16f8a.tar.gz
lombok-01d2115b4f30db85a3c8efbb6dd1bbc8aba16f8a.tar.bz2
lombok-01d2115b4f30db85a3c8efbb6dd1bbc8aba16f8a.zip
remarked out the work in progress on resolving file paths in eclipse; this causes ClassNotFoundErrors in ecj mode
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/EclipseAST.java70
1 files changed, 33 insertions, 37 deletions
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java
index 6e3f1847..560cbf5c 100644
--- a/src/core/lombok/eclipse/EclipseAST.java
+++ b/src/core/lombok/eclipse/EclipseAST.java
@@ -22,7 +22,6 @@
package lombok.eclipse;
import java.io.File;
-import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URI;
@@ -51,9 +50,6 @@ import org.eclipse.jdt.internal.compiler.ast.Initializer;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Statement;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
-import org.eclipse.jdt.internal.core.Openable;
-import org.eclipse.jdt.internal.core.builder.SourceFile;
/**
* Wraps around Eclipse's internal AST view to add useful features as well as the ability to visit parents from children,
@@ -119,39 +115,39 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
}
}
- /** This is ongoing research for issues with lombok.config resolution. */
- @SuppressWarnings("unused") private String getAlternativeAbsolutePathDEBUG() {
- try {
- ICompilationUnit cu = this.compilationUnitDeclaration.compilationResult.compilationUnit;
-
- if (cu instanceof Openable) {
- String x = ((Openable) cu).getResource().getFullPath().makeAbsolute().toString();
- int lastLoc = x.lastIndexOf('/');
- x = x.substring(0, lastLoc + 1) + "lombok.config";
- URI lombokConfigLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(x)).getLocationURI();
- InputStream in = ResourcesPlugin.getWorkspace().getRoot().getFile(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(x)).getFullPath()).getContents(true);
- byte[] b = new byte[100000];
- int p = 0;
- while (true) {
- int r = in.read(b, p, b.length - p);
- if (r == -1) break;
- p += r;
- }
- in.close();
- return "(Contents of lombok.config: " + new String(b, 0, p, "UTF-8");
-
-// return "(alt strategy result C: '" + ((Openable) cu).getResource().getFullPath().makeAbsolute().toString() + "'): resolved: " + EclipseWorkspaceBasedFileResolver.resolve(((Openable) cu).getResource().getFullPath().makeAbsolute().toString());
- }
- if (cu instanceof SourceFile) {
- String cuFileName = new String(((SourceFile) cu).getFileName());
- String cuIFilePath = ((SourceFile) cu).resource.getFullPath().toString();
- return "(alt strategy result A: \"" + cuFileName + "\" B: \"" + cuIFilePath + "\")";
- }
- return "(alt strategy failed: cu isn't a SourceFile or Openable but a " + cu.getClass() + ")";
- } catch (Exception e) {
- return "(alt strategy failed: " + e + ")";
- }
- }
+// /** This is ongoing research for issues with lombok.config resolution. */
+// @SuppressWarnings("unused") private String getAlternativeAbsolutePathDEBUG() {
+// try {
+// ICompilationUnit cu = this.compilationUnitDeclaration.compilationResult.compilationUnit;
+//
+// if (cu instanceof Openable) {
+// String x = ((Openable) cu).getResource().getFullPath().makeAbsolute().toString();
+// int lastLoc = x.lastIndexOf('/');
+// x = x.substring(0, lastLoc + 1) + "lombok.config";
+// URI lombokConfigLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(x)).getLocationURI();
+// InputStream in = ResourcesPlugin.getWorkspace().getRoot().getFile(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(x)).getFullPath()).getContents(true);
+// byte[] b = new byte[100000];
+// int p = 0;
+// while (true) {
+// int r = in.read(b, p, b.length - p);
+// if (r == -1) break;
+// p += r;
+// }
+// in.close();
+// return "(Contents of lombok.config: " + new String(b, 0, p, "UTF-8");
+//
+//// return "(alt strategy result C: '" + ((Openable) cu).getResource().getFullPath().makeAbsolute().toString() + "'): resolved: " + EclipseWorkspaceBasedFileResolver.resolve(((Openable) cu).getResource().getFullPath().makeAbsolute().toString());
+// }
+// if (cu instanceof SourceFile) {
+// String cuFileName = new String(((SourceFile) cu).getFileName());
+// String cuIFilePath = ((SourceFile) cu).resource.getFullPath().toString();
+// return "(alt strategy result A: \"" + cuFileName + "\" B: \"" + cuIFilePath + "\")";
+// }
+// return "(alt strategy failed: cu isn't a SourceFile or Openable but a " + cu.getClass() + ")";
+// } catch (Exception e) {
+// return "(alt strategy failed: " + e + ")";
+// }
+// }
private static class EclipseWorkspaceBasedFileResolver {
public static URI resolve(String path) {