issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
continue;
} else {
IBinaryMethod existing = existingMs[j];
if (!modifiersEqual(method.getModifiers(), existing.getModifiers())) {
return true;
}
if (exceptionClausesDiffer(existing, method)) {
return true;
}
char[] existingGSig = existing.getGenericSignature();
char[] methodGSig = method.getGenericSignature();
if ((existingGSig == null && methodGSig != null) || (existingGSig != null && methodGSig == null)) {
return true;
}
if (existingGSig != null) {
if (!CharOperation.equals(existingGSig, methodGSig)) {
return true;
}
}
continue new_method_loop;
}
}
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
return true;
}
IBinaryNestedType[] binaryNestedTypes = reader.getMemberTypes();
IBinaryNestedType[] existingBinaryNestedTypes = existingType.getMemberTypes();
if ((binaryNestedTypes == null && existingBinaryNestedTypes != null)
|| (binaryNestedTypes != null && existingBinaryNestedTypes == null)) {
return true;
}
if (binaryNestedTypes != null) {
int bnLength = binaryNestedTypes.length;
for (int m = 0; m < bnLength; m++) {
IBinaryNestedType bnt = binaryNestedTypes[m];
IBinaryNestedType existingBnt = existingBinaryNestedTypes[m];
if (!CharOperation.equals(bnt.getName(), existingBnt.getName())) {
return true;
}
}
}
return false;
}
/**
* For two methods, discover if there has been a change in the exception types specified.
*
* @return true if the exception types have changed
*/
private boolean exceptionClausesDiffer(IBinaryMethod lastMethod, IBinaryMethod newMethod) {
char[][] previousExceptionTypeNames = lastMethod.getExceptionTypeNames();
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
char[][] newExceptionTypeNames = newMethod.getExceptionTypeNames();
int pLength = previousExceptionTypeNames.length;
int nLength = newExceptionTypeNames.length;
if (pLength != nLength) {
return true;
}
if (pLength == 0) {
return false;
}
for (int i = 0; i < pLength; i++) {
if (!CharOperation.equals(previousExceptionTypeNames[i], newExceptionTypeNames[i])) {
return true;
}
}
return false;
}
private boolean modifiersEqual(int eclipseModifiers, int resolvedTypeModifiers) {
resolvedTypeModifiers = resolvedTypeModifiers & ExtraCompilerModifiers.AccJustFlag;
eclipseModifiers = eclipseModifiers & ExtraCompilerModifiers.AccJustFlag;
return (eclipseModifiers == resolvedTypeModifiers);
}
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private String stringifySet(Set<?> l) {
StringBuffer sb = new StringBuffer();
sb.append("{");
for (Iterator<?> iter = l.iterator(); iter.hasNext();) {
Object el = iter.next();
sb.append(el);
if (iter.hasNext()) {
sb.append(",");
}
}
sb.append("}");
return sb.toString();
}
protected void addAffectedSourceFiles(Set<File> addTo, Set<File> lastTimeSources) {
if (qualifiedStrings.elementSize == 0 && simpleStrings.elementSize == 0) {
return;
}
if (listenerDefined()) {
getListener().recordDecision(
"Examining whether any other files now need compilation based on just compiling: '"
+ stringifySet(lastTimeSources) + "'");
}
char[][][] qualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedStrings);
if (qualifiedNames.length < qualifiedStrings.elementSize) {
qualifiedNames = null;
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings);
if (simpleNames.length < simpleStrings.elementSize) {
simpleNames = null;
}
for (Iterator<Map.Entry<File, ReferenceCollection>> i = references.entrySet().iterator(); i.hasNext();) {
Map.Entry<File, ReferenceCollection> entry = i.next();
ReferenceCollection refs = entry.getValue();
if (refs != null && refs.includes(qualifiedNames, simpleNames)) {
File file = entry.getKey();
if (file.exists()) {
if (!lastTimeSources.contains(file)) {
if (listenerDefined()) {
getListener().recordDecision("Need to recompile '" + file.getName().toString() + "'");
}
addTo.add(file);
}
}
}
}
if (addTo.size() > 0) {
addTo.addAll(lastTimeSources);
}
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
qualifiedStrings.clear();
simpleStrings.clear();
}
/**
* Record that a particular type has been touched during a compilation run. Information is used to ensure any types depending
* upon this one are also recompiled.
*
* @param typename (possibly qualified) type name
*/
protected void recordTypeChanged(String typename) {
int lastDot = typename.lastIndexOf('.');
String typeName;
if (lastDot != -1) {
String packageName = typename.substring(0, lastDot).replace('.', '/');
qualifiedStrings.add(packageName);
typeName = typename.substring(lastDot + 1);
} else {
qualifiedStrings.add("");
typeName = typename;
}
int memberIndex = typeName.indexOf('$');
if (memberIndex > 0) {
typeName = typeName.substring(0, memberIndex);
}
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
simpleStrings.add(typeName);
}
protected void addDependentsOf(File sourceFile) {
List<ClassFile> cfs = this.fullyQualifiedTypeNamesResultingFromCompilationUnit.get(sourceFile);
if (cfs != null) {
for (ClassFile cf : cfs) {
recordTypeChanged(cf.fullyQualifiedTypeName);
}
}
}
public void setStructureModel(AsmManager structureModel) {
this.structureModel = structureModel;
}
public AsmManager getStructureModel() {
return structureModel;
}
public void setWeaver(BcelWeaver bw) {
weaver = bw;
}
public BcelWeaver getWeaver() {
return weaver;
}
public void setWorld(BcelWorld bw) {
world = bw;
world.addTypeDelegateResolver(this);
}
public BcelWorld getBcelWorld() {
return world;
}
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
public int getNumberOfStructuralChangesSinceLastFullBuild() {
return structuralChangesSinceLastFullBuild.size();
}
public long getLastBuildTime() {
return lastSuccessfulBuildTime;
}
public long getLastFullBuildTime() {
return lastSuccessfulFullBuildTime;
}
/**
* @return Returns the buildConfig.
*/
public AjBuildConfig getBuildConfig() {
return this.buildConfig;
}
public void clearBinarySourceFiles() {
this.binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>();
}
public void recordBinarySource(String fromPathName, List<UnwovenClassFile> unwovenClassFiles) {
this.binarySourceFiles.put(fromPathName, unwovenClassFiles);
if (this.maybeIncremental()) {
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
List<ClassFile> simpleClassFiles = new LinkedList<ClassFile>();
for (UnwovenClassFile ucf : unwovenClassFiles) {
ClassFile cf = getClassFileFor(ucf);
simpleClassFiles.add(cf);
}
this.inputClassFilesBySource.put(fromPathName, simpleClassFiles);
}
}
/**
* @param ucf
* @return
*/
private ClassFile getClassFileFor(UnwovenClassFile ucf) {
return new ClassFile(ucf.getClassName(), new File(ucf.getFilename()));
}
public Map<String, List<UnwovenClassFile>> getBinarySourceMap() {
return this.binarySourceFiles;
}
public Map<String, File> getClassNameToFileMap() {
return this.classesFromName;
}
public boolean hasResource(String resourceName) {
return this.resources.keySet().contains(resourceName);
}
public void recordResource(String resourceName, File resourceSourceLocation) {
this.resources.put(resourceName, resourceSourceLocation);
}
/**
* @return Returns the addedFiles.
*/
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
public Set<File> getAddedFiles() {
return this.addedFiles;
}
/**
* @return Returns the deletedFiles.
*/
public Set<File> getDeletedFiles() {
return this.deletedFiles;
}
public void forceBatchBuildNextTimeAround() {
this.batchBuildRequiredThisTime = true;
}
public boolean requiresFullBatchBuild() {
return this.batchBuildRequiredThisTime;
}
private static class ClassFile {
public String fullyQualifiedTypeName;
public File locationOnDisk;
public ClassFile(String fqn, File location) {
this.fullyQualifiedTypeName = fqn;
this.locationOnDisk = location;
}
public String toString() {
StringBuilder s = new StringBuilder();
s.append("ClassFile(type=").append(fullyQualifiedTypeName).append(",location=").append(locationOnDisk).append(")");
return s.toString();
}
public void deleteFromFileSystem(AjBuildConfig buildConfig) {
String namePrefix = locationOnDisk.getName();
namePrefix = namePrefix.substring(0, namePrefix.lastIndexOf('.'));
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
final String targetPrefix = namePrefix + BcelWeaver.CLOSURE_CLASS_PREFIX;
File dir = locationOnDisk.getParentFile();
if (dir != null) {
File[] weaverGenerated = dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.startsWith(targetPrefix);
}
});
if (weaverGenerated != null) {
for (int i = 0; i < weaverGenerated.length; i++) {
weaverGenerated[i].delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(weaverGenerated[i].getPath(),
CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}
}
locationOnDisk.delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(locationOnDisk.getPath(),
CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}
public void wipeAllKnowledge() {
buildManager.state = null;
}
public Map<String, char[]> getAspectNamesToFileNameMap() {
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return aspectsFromFileNames;
}
public void initializeAspectNamesToFileNameMap() {
this.aspectsFromFileNames = new HashMap<String, char[]>();
}
public boolean listenerDefined() {
return stateListener != null;
}
public IStateListener getListener() {
return stateListener;
}
public IBinaryType checkPreviousBuild(String name) {
return resolvedTypeStructuresFromLastBuild.get(name);
}
public AjBuildManager getAjBuildManager() {
return buildManager;
}
public INameEnvironment getNameEnvironment() {
return this.nameEnvironment;
}
public void setNameEnvironment(INameEnvironment nameEnvironment) {
this.nameEnvironment = nameEnvironment;
}
/**
* Record an aspect that came in on the aspect path. When a .class file changes on the aspect path we can then recognize it as
* an aspect and know to do more than just a tiny incremental build. <br>
* TODO but this doesn't allow for a new aspect created on the aspectpath?
*
* @param aspectFile path to the file, eg. c:/temp/foo/Fred.class
|
324,135 |
Bug 324135 ArrayIndexOutOfBoundsException at AjState.java:1767
|
Build Identifier: 20100617-1415 Using AspectJ version: 1.6.10.20100817163700 I hit the blow exception after saving a edited java file. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.ajdt.internal.core.builder.AjState.hasStructuralChanges(AjState.java:1767) at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1510) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1322) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1049) at org.aspectj.ajdt.internal.compiler.AjPipeli ... b.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: ArrayIndexOutOfBoundsException thrown: 14 Reproducible: Didn't try
|
resolved fixed
|
88fab6a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T00:29:30Z | 2010-08-31T21:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
*/
public void recordAspectClassFile(String aspectFile) {
aspectClassFiles.add(aspectFile);
}
public void write(CompressingDataOutputStream dos) throws IOException {
weaver.write(dos);
}
/**
* See if we can create a delegate from a CompactTypeStructure - TODO better comment
*/
public ReferenceTypeDelegate getDelegate(ReferenceType referenceType) {
File f = classesFromName.get(referenceType.getName());
if (f == null) {
return null;
}
try {
ClassParser parser = new ClassParser(f.toString());
return world.buildBcelDelegate(referenceType, parser.parse(), true, false);
} catch (IOException e) {
System.err.println("Failed to recover "+referenceType);
e.printStackTrace();
}
return null;
}
}
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
/* *******************************************************************
* Copyright (c) 2005 Contributors.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Adrian Colyer Initial implementation
* ******************************************************************/
package org.aspectj.weaver.reflect;
import java.lang.reflect.Member;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.And;
import org.aspectj.weaver.ast.Call;
import org.aspectj.weaver.ast.FieldGetCall;
import org.aspectj.weaver.ast.HasAnnotation;
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
import org.aspectj.weaver.ast.ITestVisitor;
import org.aspectj.weaver.ast.Instanceof;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Not;
import org.aspectj.weaver.ast.Or;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
import org.aspectj.weaver.internal.tools.MatchingContextBasedTest;
import org.aspectj.weaver.patterns.ExposedState;
import org.aspectj.weaver.tools.DefaultMatchingContext;
import org.aspectj.weaver.tools.JoinPointMatch;
import org.aspectj.weaver.tools.MatchingContext;
import org.aspectj.weaver.tools.PointcutParameter;
import org.aspectj.weaver.tools.ShadowMatch;
/**
* @author colyer Implementation of ShadowMatch for reflection based worlds.
*/
public class ShadowMatchImpl implements ShadowMatch {
private FuzzyBoolean match;
private ExposedState state;
private Test residualTest;
private PointcutParameter[] params;
private Member withinCode;
private Member subject;
private Class<?> withinType;
private MatchingContext matchContext = new DefaultMatchingContext();
public ShadowMatchImpl(FuzzyBoolean match, Test test, ExposedState state, PointcutParameter[] params) {
this.match = match;
this.residualTest = test;
this.state = state;
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
this.params = params;
}
public void setWithinCode(Member aMember) {
this.withinCode = aMember;
}
public void setSubject(Member aMember) {
this.subject = aMember;
}
public void setWithinType(Class<?> aClass) {
this.withinType = aClass;
}
public boolean alwaysMatches() {
return match.alwaysTrue();
}
public boolean maybeMatches() {
return match.maybeTrue();
}
public boolean neverMatches() {
return match.alwaysFalse();
}
public JoinPointMatch matchesJoinPoint(Object thisObject, Object targetObject, Object[] args) {
if (neverMatches()) {
return JoinPointMatchImpl.NO_MATCH;
}
if (new RuntimeTestEvaluator(residualTest, thisObject, targetObject, args, this.matchContext).matches()) {
return new JoinPointMatchImpl(getPointcutParameters(thisObject, targetObject, args));
} else {
return JoinPointMatchImpl.NO_MATCH;
}
}
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
/*
* (non-Javadoc)
*
* @see org.aspectj.weaver.tools.ShadowMatch#setMatchingContext(org.aspectj.weaver.tools.MatchingContext)
*/
public void setMatchingContext(MatchingContext aMatchContext) {
this.matchContext = aMatchContext;
}
private PointcutParameter[] getPointcutParameters(Object thisObject, Object targetObject, Object[] args) {
Var[] vars = state.vars;
PointcutParameterImpl[] bindings = new PointcutParameterImpl[params.length];
for (int i = 0; i < bindings.length; i++) {
bindings[i] = new PointcutParameterImpl(params[i].getName(), params[i].getType());
bindings[i].setBinding(((ReflectionVar) vars[i]).getBindingAtJoinPoint(thisObject, targetObject, args, subject,
withinCode, withinType));
}
return bindings;
}
private static class RuntimeTestEvaluator implements ITestVisitor {
private boolean matches = true;
private final Test test;
private final Object thisObject;
private final Object targetObject;
private final Object[] args;
private final MatchingContext matchContext;
public RuntimeTestEvaluator(Test aTest, Object thisObject, Object targetObject, Object[] args, MatchingContext context) {
this.test = aTest;
this.thisObject = thisObject;
this.targetObject = targetObject;
this.args = args;
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
this.matchContext = context;
}
public boolean matches() {
test.accept(this);
return matches;
}
public void visit(And e) {
boolean leftMatches = new RuntimeTestEvaluator(e.getLeft(), thisObject, targetObject, args, matchContext).matches();
if (!leftMatches) {
matches = false;
} else {
matches = new RuntimeTestEvaluator(e.getRight(), thisObject, targetObject, args, matchContext).matches();
}
}
public void visit(Instanceof instanceofTest) {
ReflectionVar v = (ReflectionVar) instanceofTest.getVar();
Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
World world = v.getType().getWorld();
ResolvedType desiredType = instanceofTest.getType().resolve(world);
ResolvedType actualType = world.resolve(value.getClass().getName());
matches = desiredType.isAssignableFrom(actualType);
}
public void visit(MatchingContextBasedTest matchingContextTest) {
matches = matchingContextTest.matches(this.matchContext);
}
public void visit(Not not) {
matches = !new RuntimeTestEvaluator(not.getBody(), thisObject, targetObject, args, matchContext).matches();
}
public void visit(Or or) {
boolean leftMatches = new RuntimeTestEvaluator(or.getLeft(), thisObject, targetObject, args, matchContext).matches();
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/reflect/ShadowMatchImpl.java
|
if (leftMatches) {
matches = true;
} else {
matches = new RuntimeTestEvaluator(or.getRight(), thisObject, targetObject, args, matchContext).matches();
}
}
public void visit(Literal literal) {
if (literal == Literal.FALSE) {
matches = false;
} else {
matches = true;
}
}
public void visit(Call call) {
throw new UnsupportedOperationException("Can't evaluate call test at runtime");
}
public void visit(FieldGetCall fieldGetCall) {
throw new UnsupportedOperationException("Can't evaluate fieldGetCall test at runtime");
}
public void visit(HasAnnotation hasAnnotation) {
ReflectionVar v = (ReflectionVar) hasAnnotation.getVar();
Object value = v.getBindingAtJoinPoint(thisObject, targetObject, args);
World world = v.getType().getWorld();
ResolvedType actualVarType = world.resolve(value.getClass().getName());
ResolvedType requiredAnnotationType = hasAnnotation.getAnnotationType().resolve(world);
matches = actualVarType.hasAnnotation(requiredAnnotationType);
}
}
}
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ThisOrTargetTestCase.java
|
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* 2005 Contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* Adrian Colyer, runtime reflection extensions
* ******************************************************************/
package org.aspectj.weaver.patterns;
import java.io.IOException;
import java.lang.reflect.Method;
import junit.framework.TestCase;
import org.aspectj.util.LangUtil;
import org.aspectj.weaver.tools.JoinPointMatch;
import org.aspectj.weaver.tools.PointcutExpression;
import org.aspectj.weaver.tools.PointcutParameter;
import org.aspectj.weaver.tools.PointcutParser;
import org.aspectj.weaver.tools.ShadowMatch;
/**
* @author hugunin
*
* To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To enable
* and disable the creation of type comments go to Window>Preferences>Java>Code Generation.
*/
public class ThisOrTargetTestCase extends TestCase {
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ThisOrTargetTestCase.java
|
private boolean needToSkip = false;
private boolean needToSkipPointcutParserTests() {
if (!LangUtil.is15VMOrGreater())
return false;
try {
Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate", false, this.getClass()
.getClassLoader());
} catch (ClassNotFoundException cnfEx) {
return true;
}
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ThisOrTargetTestCase.java
|
return false;
}
protected void setUp() throws Exception {
super.setUp();
needToSkip = needToSkipPointcutParserTests();
}
/**
* Constructor for PatternTestCase.
*
* @param name
*/
public ThisOrTargetTestCase(String name) {
super(name);
}
public void testMatchJP() throws Exception {
if (needToSkip)
return;
PointcutParser parser = PointcutParser
.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader());
PointcutExpression thisEx = parser.parsePointcutExpression("this(Exception)");
PointcutExpression thisIOEx = parser.parsePointcutExpression("this(java.io.IOException)");
PointcutExpression targetEx = parser.parsePointcutExpression("target(Exception)");
PointcutExpression targetIOEx = parser.parsePointcutExpression("target(java.io.IOException)");
Method toString = Object.class.getMethod("toString", new Class[0]);
checkMatches(thisEx.matchesMethodCall(toString, toString), new Exception(), null, null);
checkNoMatch(thisIOEx.matchesMethodCall(toString, toString), new Exception(), null, null);
checkNoMatch(targetEx.matchesMethodCall(toString, toString), new Exception(), new Object(), null);
checkNoMatch(targetIOEx.matchesMethodCall(toString, toString), new Exception(), new Exception(), null);
checkMatches(thisEx.matchesMethodCall(toString, toString), new IOException(), null, null);
checkMatches(thisIOEx.matchesMethodCall(toString, toString), new IOException(), null, null);
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ThisOrTargetTestCase.java
|
checkNoMatch(thisEx.matchesMethodCall(toString, toString), new Object(), null, null);
checkNoMatch(thisIOEx.matchesMethodCall(toString, toString), new Exception(), null, null);
checkMatches(targetEx.matchesMethodCall(toString, toString), new Exception(), new Exception(), null);
checkNoMatch(targetIOEx.matchesMethodCall(toString, toString), new Exception(), new Exception(), null);
checkMatches(targetIOEx.matchesMethodCall(toString, toString), new Exception(), new IOException(), null);
}
public void testBinding() throws Exception {
if (needToSkip)
return;
PointcutParser parser = PointcutParser
.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader());
PointcutParameter ex = parser.createPointcutParameter("ex", Exception.class);
PointcutParameter ioEx = parser.createPointcutParameter("ioEx", IOException.class);
PointcutExpression thisEx = parser.parsePointcutExpression("this(ex)", Exception.class, new PointcutParameter[] { ex });
PointcutExpression targetIOEx = parser.parsePointcutExpression("target(ioEx)", Exception.class,
new PointcutParameter[] { ioEx });
Method toString = Object.class.getMethod("toString", new Class[0]);
ShadowMatch sMatch = thisEx.matchesMethodCall(toString, toString);
Exception exceptionParameter = new Exception();
IOException ioExceptionParameter = new IOException();
JoinPointMatch jpMatch = sMatch.matchesJoinPoint(exceptionParameter, null, null);
assertTrue("should match", jpMatch.matches());
PointcutParameter[] bindings = jpMatch.getParameterBindings();
assertEquals("one binding", 1, bindings.length);
assertEquals("should be exceptionParameter", exceptionParameter, bindings[0].getBinding());
assertEquals("ex", bindings[0].getName());
sMatch = targetIOEx.matchesMethodCall(toString, toString);
jpMatch = sMatch.matchesJoinPoint(exceptionParameter, ioExceptionParameter, null);
assertTrue("should match", jpMatch.matches());
bindings = jpMatch.getParameterBindings();
|
318,899 |
Bug 318899 NPE with @args matching Argument by Type
| null |
resolved fixed
|
2a8d684
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T04:19:01Z | 2010-07-05T14:26:40Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ThisOrTargetTestCase.java
|
assertEquals("one binding", 1, bindings.length);
assertEquals("should be ioExceptionParameter", ioExceptionParameter, bindings[0].getBinding());
assertEquals("ioEx", bindings[0].getName());
}
private void checkMatches(ShadowMatch sMatch, Object thisObj, Object targetObj, Object[] args) {
assertTrue("match expected", sMatch.matchesJoinPoint(thisObj, targetObj, args).matches());
}
private void checkNoMatch(ShadowMatch sMatch, Object thisObj, Object targetObj, Object[] args) {
assertFalse("no match expected", sMatch.matchesJoinPoint(thisObj, targetObj, args).matches());
}
/**
* Method checkSerialization.
*
* @param string
*/
}
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* ******************************************************************/
package org.aspectj.ajdt.internal.core.builder;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import org.aspectj.ajdt.internal.compiler.AjCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager;
import org.aspectj.ajdt.internal.compiler.IBinarySourceProvider;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapter;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapterFactory;
import org.aspectj.ajdt.internal.compiler.IIntermediateResultsRequestor;
import org.aspectj.ajdt.internal.compiler.IOutputClassFileNameProvider;
import org.aspectj.ajdt.internal.compiler.InterimCompilationResult;
import org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment;
import org.aspectj.ajdt.internal.compiler.lookup.AnonymousClassPublisher;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.CountingMessageHandler;
import org.aspectj.bridge.ILifecycleAware;
import org.aspectj.bridge.IMessage;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.IProgressListener;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.SourceLocation;
import org.aspectj.bridge.Version;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.bridge.context.ContextFormatter;
import org.aspectj.bridge.context.ContextToken;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
import org.aspectj.org.eclipse.jdt.internal.compiler.ICompilerRequestor;
import org.aspectj.org.eclipse.jdt.internal.compiler.IProblemFactory;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
import org.aspectj.tools.ajc.Main;
import org.aspectj.util.FileUtil;
import org.aspectj.weaver.CustomMungerFactory;
import org.aspectj.weaver.Dump;
import org.aspectj.weaver.ResolvedType;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
import org.aspectj.weaver.bcel.UnwovenClassFile;
import org.eclipse.core.runtime.OperationCanceledException;
public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySourceProvider, ICompilerAdapterFactory {
private static final String CROSSREFS_FILE_NAME = "build.lst";
private static final String CANT_WRITE_RESULT = "unable to write compilation result";
private static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
public static boolean COPY_INPATH_DIR_RESOURCES = false;
private static boolean DO_RUNTIME_VERSION_CHECK = false;
static final boolean FAIL_IF_RUNTIME_NOT_FOUND = false;
private static final FileFilter binarySourceFilter = new FileFilter() {
public boolean accept(File f) {
return f.getName().endsWith(".class");
}
};
/**
* This builder is static so that it can be subclassed and reset. However, note that there is only one builder present, so if
* two extendsion reset it, only the latter will get used.
*/
public static AsmHierarchyBuilder asmHierarchyBuilder = new AsmHierarchyBuilder();
static {
CompilationAndWeavingContext.registerFormatter(CompilationAndWeavingContext.BATCH_BUILD, new AjBuildContexFormatter());
CompilationAndWeavingContext
.registerFormatter(CompilationAndWeavingContext.INCREMENTAL_BUILD, new AjBuildContexFormatter());
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private IProgressListener progressListener = null;
private boolean environmentSupportsIncrementalCompilation = false;
private int compiledCount;
private int sourceFileCount;
private JarOutputStream zos;
private boolean batchCompile = true;
private INameEnvironment environment;
private Map binarySourcesForTheNextCompile = new HashMap();
public AjBuildConfig buildConfig;
private boolean ignoreOutxml;
private boolean wasFullBuild = true;
AjState state = new AjState(this);
/**
* Enable check for runtime version, used only by Ant/command-line Main.
*
* @param main Main unused except to limit to non-null clients.
*/
public static void enableRuntimeVersionCheck(Main caller) {
DO_RUNTIME_VERSION_CHECK = null != caller;
}
public BcelWeaver getWeaver() {
return state.getWeaver();
}
public BcelWorld getBcelWorld() {
return state.getBcelWorld();
}
public CountingMessageHandler handler;
private CustomMungerFactory customMungerFactory;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
public AjBuildManager(IMessageHandler holder) {
super();
this.handler = CountingMessageHandler.makeCountingMessageHandler(holder);
}
public void environmentSupportsIncrementalCompilation(boolean itDoes) {
this.environmentSupportsIncrementalCompilation = itDoes;
}
public boolean doGenerateModel() {
return buildConfig.isGenerateModelMode();
}
public boolean batchBuild(AjBuildConfig buildConfig, IMessageHandler baseHandler) throws IOException, AbortException {
return performBuild(buildConfig, baseHandler, true);
}
public boolean incrementalBuild(AjBuildConfig buildConfig, IMessageHandler baseHandler) throws IOException, AbortException {
return performBuild(buildConfig, baseHandler, false);
}
/**
* Perform a build.
*
* @return true if the build was successful (ie. no errors)
*/
private boolean performBuild(AjBuildConfig buildConfig, IMessageHandler baseHandler, boolean isFullBuild) throws IOException,
AbortException {
boolean ret = true;
batchCompile = isFullBuild;
wasFullBuild = isFullBuild;
if (baseHandler instanceof ILifecycleAware) {
((ILifecycleAware) baseHandler).buildStarting(!isFullBuild);
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
CompilationAndWeavingContext.reset();
int phase = isFullBuild ? CompilationAndWeavingContext.BATCH_BUILD : CompilationAndWeavingContext.INCREMENTAL_BUILD;
ContextToken ct = CompilationAndWeavingContext.enteringPhase(phase, buildConfig);
try {
if (isFullBuild) {
this.state = new AjState(this);
}
this.state.setCouldBeSubsequentIncrementalBuild(this.environmentSupportsIncrementalCompilation);
boolean canIncremental = state.prepareForNextBuild(buildConfig);
if (!canIncremental && !isFullBuild) {
CompilationAndWeavingContext.leavingPhase(ct);
if (state.listenerDefined()) {
state.getListener().recordDecision("Falling back to batch compilation");
}
return performBuild(buildConfig, baseHandler, true);
}
this.handler = CountingMessageHandler.makeCountingMessageHandler(baseHandler);
if (buildConfig == null || buildConfig.isCheckRuntimeVersion()) {
if (DO_RUNTIME_VERSION_CHECK) {
String check = checkRtJar(buildConfig);
if (check != null) {
if (FAIL_IF_RUNTIME_NOT_FOUND) {
MessageUtil.error(handler, check);
CompilationAndWeavingContext.leavingPhase(ct);
return false;
} else {
MessageUtil.warn(handler, check);
}
}
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
setBuildConfig(buildConfig);
if (isFullBuild || !AsmManager.attemptIncrementalModelRepairs) {
setupModel(buildConfig);
}
if (isFullBuild) {
initBcelWorld(handler);
}
if (handler.hasErrors()) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
if (buildConfig.getOutputJar() != null) {
if (!openOutputStream(buildConfig.getOutputJar())) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
}
if (isFullBuild) {
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
AsmManager.setLastActiveStructureModel(state.getStructureModel());
getWorld().setModel(state.getStructureModel());
}
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true);
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
performCompilation(buildConfig.getFiles());
state.clearBinarySourceFiles();
if (!proceedOnError() && handler.hasErrors()) {
CompilationAndWeavingContext.leavingPhase(ct);
if (AsmManager.isReporting()) {
state.getStructureModel().reportModelInfo("After a batch build");
}
return false;
}
if (AsmManager.isReporting()) {
state.getStructureModel().reportModelInfo("After a batch build");
}
} else {
AsmManager.setLastActiveStructureModel(state.getStructureModel());
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true);
Set<File> files = state.getFilesToCompile(true);
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
if (AsmManager.attemptIncrementalModelRepairs) {
state.getStructureModel().resetDeltaProcessing();
state.getStructureModel().processDelta(files, state.getAddedFiles(), state.getDeletedFiles());
}
}
boolean hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
for (int i = 0; (i < 5) && hereWeGoAgain; i++) {
if (state.listenerDefined()) {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
state.getListener()
.recordInformation("Starting incremental compilation loop " + (i + 1) + " of possibly 5");
}
performCompilation(files);
if ((!proceedOnError() && handler.hasErrors())
|| (progressListener != null && progressListener.isCancelledRequested())) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
if (state.requiresFullBatchBuild()) {
if (state.listenerDefined()) {
state.getListener().recordInformation(" Dropping back to full build");
}
return batchBuild(buildConfig, baseHandler);
}
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(false);
files = state.getFilesToCompile(false);
hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
if (hereWeGoAgain) {
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
if (AsmManager.attemptIncrementalModelRepairs) {
state.getStructureModel().processDelta(files, state.getAddedFiles(), state.getDeletedFiles());
}
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
}
if (!files.isEmpty()) {
CompilationAndWeavingContext.leavingPhase(ct);
return batchBuild(buildConfig, baseHandler);
} else {
if (AsmManager.isReporting()) {
state.getStructureModel().reportModelInfo("After an incremental build");
}
}
}
if (buildConfig.isEmacsSymMode()) {
new org.aspectj.ajdt.internal.core.builder.EmacsStructureModelManager().externalizeModel(state.getStructureModel());
}
if (buildConfig.isGenerateCrossRefsMode()) {
File configFileProxy = new File(buildConfig.getOutputDir(), CROSSREFS_FILE_NAME);
state.getStructureModel().writeStructureModel(configFileProxy.getAbsolutePath());
}
state.successfulCompile(buildConfig, isFullBuild);
if (isFullBuild) {
copyResourcesToDestination();
}
if (buildConfig.getOutxmlName() != null) {
writeOutxmlFile();
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
if (buildConfig.isGenerateModelMode()) {
state.getStructureModel().fireModelUpdated();
}
CompilationAndWeavingContext.leavingPhase(ct);
} finally {
if (baseHandler instanceof ILifecycleAware) {
((ILifecycleAware) baseHandler).buildFinished(!isFullBuild);
}
if (zos != null) {
closeOutputStream(buildConfig.getOutputJar());
}
ret = !handler.hasErrors();
if (getBcelWorld() != null) {
BcelWorld bcelWorld = getBcelWorld();
bcelWorld.reportTimers();
bcelWorld.tidyUp();
}
if (getWeaver() != null) {
getWeaver().tidyUp();
}
}
return ret;
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
/**
* Open an output jar file in which to write the compiler output.
*
* @param outJar the jar file to open
* @return true if successful
*/
private boolean openOutputStream(File outJar) {
try {
OutputStream os = FileUtil.makeOutputStream(buildConfig.getOutputJar());
zos = new JarOutputStream(os, getWeaver().getManifest(true));
} catch (IOException ex) {
IMessage message = new Message("Unable to open outjar " + outJar.getPath() + "(" + ex.getMessage() + ")",
new SourceLocation(outJar, 0), true);
handler.handleMessage(message);
return false;
}
return true;
}
private void closeOutputStream(File outJar) {
try {
if (zos != null) {
zos.close();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileWrite(outJar.getPath(),
CompilationResultDestinationManager.FILETYPE_OUTJAR);
}
}
zos = null;
if (handler.hasErrors()) {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
outJar.delete();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(outJar.getPath(),
CompilationResultDestinationManager.FILETYPE_OUTJAR);
}
}
} catch (IOException ex) {
IMessage message = new Message("Unable to write outjar " + outJar.getPath() + "(" + ex.getMessage() + ")",
new SourceLocation(outJar, 0), true);
handler.handleMessage(message);
}
}
private void copyResourcesToDestination() throws IOException {
for (Iterator i = buildConfig.getInJars().iterator(); i.hasNext();) {
File inJar = (File) i.next();
copyResourcesFromJarFile(inJar);
}
for (Iterator i = buildConfig.getInpath().iterator(); i.hasNext();) {
File inPathElement = (File) i.next();
if (inPathElement.isDirectory()) {
copyResourcesFromDirectory(inPathElement);
} else {
copyResourcesFromJarFile(inPathElement);
}
}
if (buildConfig.getSourcePathResources() != null) {
for (Iterator i = buildConfig.getSourcePathResources().keySet().iterator(); i.hasNext();) {
String resource = (String) i.next();
File from = buildConfig.getSourcePathResources().get(resource);
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
copyResourcesFromFile(from, resource, from);
}
}
writeManifest();
}
private void copyResourcesFromJarFile(File jarFile) throws IOException {
JarInputStream inStream = null;
try {
inStream = new JarInputStream(new FileInputStream(jarFile));
while (true) {
ZipEntry entry = inStream.getNextEntry();
if (entry == null) {
break;
}
String filename = entry.getName();
if (entry.isDirectory()) {
writeDirectory(filename, jarFile);
} else if (acceptResource(filename, false)) {
byte[] bytes = FileUtil.readAsByteArray(inStream);
writeResource(filename, bytes, jarFile);
}
inStream.closeEntry();
}
} finally {
if (inStream != null) {
inStream.close();
}
}
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private void copyResourcesFromDirectory(File dir) throws IOException {
if (!COPY_INPATH_DIR_RESOURCES) {
return;
}
File[] files = FileUtil.listFiles(dir, new FileFilter() {
public boolean accept(File f) {
boolean accept = !(f.isDirectory() || f.getName().endsWith(".class"));
return accept;
}
});
for (int i = 0; i < files.length; i++) {
String filename = files[i].getAbsolutePath().substring(dir.getAbsolutePath().length() + 1);
copyResourcesFromFile(files[i], filename, dir);
}
}
private void copyResourcesFromFile(File f, String filename, File src) throws IOException {
if (!acceptResource(filename, true)) {
return;
}
FileInputStream fis = null;
try {
fis = new FileInputStream(f);
byte[] bytes = FileUtil.readAsByteArray(fis);
writeResource(filename, bytes, src);
} finally {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (fis != null) {
fis.close();
}
}
}
/**
* Add a directory entry to the output zip file. Don't do anything if not writing out to a zip file. A directory entry is one
* whose filename ends with '/'
*
* @param directory the directory path
* @param srcloc the src of the directory entry, for use when creating a warning message
* @throws IOException if something goes wrong creating the new zip entry
*/
private void writeDirectory(String directory, File srcloc) throws IOException {
if (state.hasResource(directory)) {
IMessage msg = new Message("duplicate resource: '" + directory + "'", IMessage.WARNING, null, new SourceLocation(
srcloc, 0));
handler.handleMessage(msg);
return;
}
if (zos != null) {
ZipEntry newEntry = new ZipEntry(directory);
zos.putNextEntry(newEntry);
zos.closeEntry();
state.recordResource(directory, srcloc);
}
}
private void writeResource(String filename, byte[] content, File srcLocation) throws IOException {
if (state.hasResource(filename)) {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
IMessage msg = new Message("duplicate resource: '" + filename + "'", IMessage.WARNING, null, new SourceLocation(
srcLocation, 0));
handler.handleMessage(msg);
return;
}
if (filename.equals(buildConfig.getOutxmlName())) {
ignoreOutxml = true;
IMessage msg = new Message("-outxml/-outxmlfile option ignored because resource already exists: '" + filename + "'",
IMessage.WARNING, null, new SourceLocation(srcLocation, 0));
handler.handleMessage(msg);
}
if (zos != null) {
ZipEntry newEntry = new ZipEntry(filename);
zos.putNextEntry(newEntry);
zos.write(content);
zos.closeEntry();
} else {
File destDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
destDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForResource(srcLocation);
}
try {
File outputLocation = new File(destDir, filename);
OutputStream fos = FileUtil.makeOutputStream(outputLocation);
fos.write(content);
fos.close();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileWrite(outputLocation.getPath(),
CompilationResultDestinationManager.FILETYPE_RESOURCE);
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
} catch (FileNotFoundException fnfe) {
IMessage msg = new Message("unable to copy resource to output folder: '" + filename + "' - reason: "
+ fnfe.getMessage(), IMessage.ERROR, null, new SourceLocation(srcLocation, 0));
handler.handleMessage(msg);
}
}
state.recordResource(filename, srcLocation);
}
/*
* If we are writing to an output directory copy the manifest but only if we already have one
*/
private void writeManifest() throws IOException {
Manifest manifest = getWeaver().getManifest(false);
if (manifest != null && zos == null) {
File outputDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
if (outputDir == null) {
return;
}
File outputLocation = new File(outputDir, MANIFEST_NAME);
OutputStream fos = FileUtil.makeOutputStream(outputLocation);
manifest.write(fos);
fos.close();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileWrite(outputLocation.getPath(),
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
CompilationResultDestinationManager.FILETYPE_RESOURCE);
}
}
}
private boolean acceptResource(String resourceName, boolean fromFile) {
if ((resourceName.startsWith("CVS/")) || (resourceName.indexOf("/CVS/") != -1) || (resourceName.endsWith("/CVS"))
|| (resourceName.endsWith(".class")) || (resourceName.startsWith(".svn/"))
|| (resourceName.indexOf("/.svn/") != -1) || (resourceName.endsWith("/.svn")) ||
(resourceName.toUpperCase().equals(MANIFEST_NAME) && (!fromFile || zos != null))) {
return false;
} else {
return true;
}
}
private void writeOutxmlFile() throws IOException {
if (ignoreOutxml) {
return;
}
String filename = buildConfig.getOutxmlName();
Map<File, List<String>> outputDirsAndAspects = findOutputDirsForAspects();
Set<Map.Entry<File, List<String>>> outputDirs = outputDirsAndAspects.entrySet();
for (Iterator<Map.Entry<File, List<String>>> iterator = outputDirs.iterator(); iterator.hasNext();) {
Map.Entry<File, List<String>> entry = iterator.next();
File outputDir = entry.getKey();
List<String> aspects = entry.getValue();
ByteArrayOutputStream baos = getOutxmlContents(aspects);
if (zos != null) {
ZipEntry newEntry = new ZipEntry(filename);
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
zos.putNextEntry(newEntry);
zos.write(baos.toByteArray());
zos.closeEntry();
} else {
File outputFile = new File(outputDir, filename);
OutputStream fos = FileUtil.makeOutputStream(outputFile);
fos.write(baos.toByteArray());
fos.close();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileWrite(outputFile.getPath(),
CompilationResultDestinationManager.FILETYPE_RESOURCE);
}
}
}
}
private ByteArrayOutputStream getOutxmlContents(List aspectNames) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
ps.println("<aspectj>");
ps.println("<aspects>");
if (aspectNames != null) {
for (Iterator i = aspectNames.iterator(); i.hasNext();) {
String name = (String) i.next();
ps.println("<aspect name=\"" + name + "\"/>");
}
}
ps.println("</aspects>");
ps.println("</aspectj>");
ps.println();
ps.close();
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
return baos;
}
/**
* Returns a map where the keys are File objects corresponding to all the output directories and the values are a list of
* aspects which are sent to that ouptut directory
*/
private Map<File, List<String>> findOutputDirsForAspects() {
Map<File, List<String>> outputDirsToAspects = new HashMap<File, List<String>>();
Map<String, char[]> aspectNamesToFileNames = state.getAspectNamesToFileNameMap();
if (buildConfig.getCompilationResultDestinationManager() == null
|| buildConfig.getCompilationResultDestinationManager().getAllOutputLocations().size() == 1) {
File outputDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
List<String> aspectNames = new ArrayList<String>();
if (aspectNamesToFileNames != null) {
Set<String> keys = aspectNamesToFileNames.keySet();
for (String name : keys) {
aspectNames.add(name);
}
}
outputDirsToAspects.put(outputDir, aspectNames);
} else {
List outputDirs = buildConfig.getCompilationResultDestinationManager().getAllOutputLocations();
for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
File outputDir = (File) iterator.next();
outputDirsToAspects.put(outputDir, new ArrayList<String>());
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
Set<Map.Entry<String, char[]>> entrySet = aspectNamesToFileNames.entrySet();
for (Iterator<Map.Entry<String, char[]>> iterator = entrySet.iterator(); iterator.hasNext();) {
Map.Entry<String, char[]> entry = iterator.next();
String aspectName = entry.getKey();
char[] fileName = entry.getValue();
File outputDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForClass(
new File(new String(fileName)));
if (!outputDirsToAspects.containsKey(outputDir)) {
outputDirsToAspects.put(outputDir, new ArrayList<String>());
}
((List) outputDirsToAspects.get(outputDir)).add(aspectName);
}
}
return outputDirsToAspects;
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
/**
* Responsible for managing the ASM model between builds. Contains the policy for maintaining the persistance of elements in the
* model.
*
* This code is driven before each 'fresh' (batch) build to create a new model.
*/
private void setupModel(AjBuildConfig config) {
if (!(config.isEmacsSymMode() || config.isGenerateModelMode())) {
return;
}
CompilationResultDestinationManager crdm = config.getCompilationResultDestinationManager();
AsmManager structureModel = AsmManager.createNewStructureModel(crdm == null ? Collections.EMPTY_MAP : crdm.getInpathMap());
IHierarchy model = structureModel.getHierarchy();
String rootLabel = "<root>";
IProgramElement.Kind kind = IProgramElement.Kind.FILE_JAVA;
if (buildConfig.getConfigFile() != null) {
rootLabel = buildConfig.getConfigFile().getName();
model.setConfigFile(buildConfig.getConfigFile().getAbsolutePath());
kind = IProgramElement.Kind.FILE_LST;
}
model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList()));
model.setFileMap(new HashMap<String, IProgramElement>());
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
state.setStructureModel(structureModel);
}
public void setCustomMungerFactory(Object o) {
customMungerFactory = (CustomMungerFactory) o;
}
public Object getCustomMungerFactory() {
return customMungerFactory;
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private void initBcelWorld(IMessageHandler handler) throws IOException {
List cp = buildConfig.getFullClasspath();
BcelWorld bcelWorld = new BcelWorld(cp, handler, null);
bcelWorld.setBehaveInJava5Way(buildConfig.getBehaveInJava5Way());
bcelWorld.setTiming(buildConfig.isTiming(), false);
bcelWorld.setAddSerialVerUID(buildConfig.isAddSerialVerUID());
bcelWorld.setXmlConfigured(buildConfig.isXmlConfigured());
bcelWorld.setXmlFiles(buildConfig.getXmlFiles());
bcelWorld.performExtraConfiguration(buildConfig.getXconfigurationInfo());
bcelWorld.setTargetAspectjRuntimeLevel(buildConfig.getTargetAspectjRuntimeLevel());
bcelWorld.setOptionalJoinpoints(buildConfig.getXJoinpoints());
bcelWorld.setXnoInline(buildConfig.isXnoInline());
bcelWorld.setXlazyTjp(buildConfig.isXlazyTjp());
bcelWorld.setXHasMemberSupportEnabled(buildConfig.isXHasMemberEnabled());
bcelWorld.setPinpointMode(buildConfig.isXdevPinpoint());
bcelWorld.setErrorAndWarningThreshold(buildConfig.getOptions().errorThreshold, buildConfig.getOptions().warningThreshold);
BcelWeaver bcelWeaver = new BcelWeaver(bcelWorld);
bcelWeaver.setCustomMungerFactory(customMungerFactory);
state.setWorld(bcelWorld);
state.setWeaver(bcelWeaver);
state.clearBinarySourceFiles();
if (buildConfig.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)) {
bcelWorld.getLint().loadDefaultProperties();
} else {
bcelWorld.getLint().setAll(buildConfig.getLintMode());
}
if (buildConfig.getLintSpecFile() != null) {
bcelWorld.getLint().setFromProperties(buildConfig.getLintSpecFile());
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
for (Iterator i = buildConfig.getAspectpath().iterator(); i.hasNext();) {
File f = (File) i.next();
if (!f.exists()) {
IMessage message = new Message("invalid aspectpath entry: " + f.getName(), null, true);
handler.handleMessage(message);
} else {
bcelWeaver.addLibraryJarFile(f);
}
}
File outputDir = buildConfig.getOutputDir();
if (outputDir == null && buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
for (File inJar : buildConfig.getInJars()) {
List<UnwovenClassFile> unwovenClasses = bcelWeaver.addJarFile(inJar, outputDir, false);
state.recordBinarySource(inJar.getPath(), unwovenClasses);
}
for (File inPathElement : buildConfig.getInpath()) {
if (!inPathElement.isDirectory()) {
List<UnwovenClassFile> unwovenClasses = bcelWeaver.addJarFile(inPathElement, outputDir, true);
state.recordBinarySource(inPathElement.getPath(), unwovenClasses);
} else {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
File[] binSrcs = FileUtil.listFiles(inPathElement, binarySourceFilter);
for (int j = 0; j < binSrcs.length; j++) {
UnwovenClassFile ucf = bcelWeaver.addClassFile(binSrcs[j], inPathElement, outputDir);
List<UnwovenClassFile> ucfl = new ArrayList<UnwovenClassFile>();
ucfl.add(ucf);
state.recordBinarySource(binSrcs[j].getPath(), ucfl);
}
}
}
bcelWeaver.setReweavableMode(buildConfig.isXNotReweavable());
ResolvedType joinPoint = bcelWorld.resolve("org.aspectj.lang.JoinPoint");
if (joinPoint.isMissing()) {
IMessage message = new Message(
"classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)",
null, true);
handler.handleMessage(message);
}
}
public World getWorld() {
return getBcelWorld();
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
public FileSystem getLibraryAccess(String[] classpaths, String[] filenames) {
String defaultEncoding = buildConfig.getOptions().defaultEncoding;
if ("".equals(defaultEncoding)) {
defaultEncoding = null;
}
return new FileSystem(classpaths, filenames, defaultEncoding, ClasspathLocation.BINARY);
}
public IProblemFactory getProblemFactory() {
return new DefaultProblemFactory(Locale.getDefault());
}
/*
* Build the set of compilation source units
*/
public CompilationUnit[] getCompilationUnits(String[] filenames) {
int fileCount = filenames.length;
CompilationUnit[] units = new CompilationUnit[fileCount];
String defaultEncoding = buildConfig.getOptions().defaultEncoding;
if ("".equals(defaultEncoding)) {
defaultEncoding = null;
}
for (int i = 0; i < fileCount; i++) {
units[i] = new CompilationUnit(null, filenames[i], defaultEncoding);
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
return units;
}
public String extractDestinationPathFromSourceFile(CompilationResult result) {
ICompilationUnit compilationUnit = result.compilationUnit;
if (compilationUnit != null) {
char[] fileName = compilationUnit.getFileName();
int lastIndex = CharOperation.lastIndexOf(java.io.File.separatorChar, fileName);
if (lastIndex == -1) {
return System.getProperty("user.dir");
}
return new String(CharOperation.subarray(fileName, 0, lastIndex));
}
return System.getProperty("user.dir");
}
public void performCompilation(Collection<File> files) {
if (progressListener != null) {
compiledCount = 0;
sourceFileCount = files.size();
progressListener.setText("compiling source files");
}
String[] filenames = new String[files.size()];
int idx = 0;
for (Iterator<File> fIterator = files.iterator(); fIterator.hasNext();) {
File f = fIterator.next();
filenames[idx++] = f.getPath();
}
environment = state.getNameEnvironment();
boolean environmentNeedsRebuilding = false;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (buildConfig.getChanged() != AjBuildConfig.NO_CHANGES) {
environmentNeedsRebuilding = true;
}
if (environment == null || environmentNeedsRebuilding) {
List<String> cps = buildConfig.getFullClasspath();
Dump.saveFullClasspath(cps);
String[] classpaths = new String[cps.size()];
for (int i = 0; i < cps.size(); i++) {
classpaths[i] = cps.get(i);
}
environment = new StatefulNameEnvironment(getLibraryAccess(classpaths, filenames), state.getClassNameToFileMap(), state);
state.setNameEnvironment(environment);
} else {
((StatefulNameEnvironment) environment).update(state.getClassNameToFileMap(), state.deltaAddedClasses);
state.deltaAddedClasses.clear();
}
org.aspectj.ajdt.internal.compiler.CompilerAdapter.setCompilerAdapterFactory(this);
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler compiler = new org.aspectj.org.eclipse.jdt.internal.compiler.Compiler(
environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(), buildConfig.getOptions().getMap(),
getBatchRequestor(), getProblemFactory());
compiler.options.produceReferenceInfo = true;
try {
compiler.compile(getCompilationUnits(filenames));
} catch (OperationCanceledException oce) {
handler.handleMessage(new Message("build cancelled:" + oce.getMessage(), IMessage.WARNING, null, null));
}
org.aspectj.ajdt.internal.compiler.CompilerAdapter.setCompilerAdapterFactory(null);
AnonymousClassPublisher.aspectOf().setAnonymousClassCreationListener(null);
environment.cleanup();
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
public void cleanupEnvironment() {
if (environment != null) {
environment.cleanup();
environment = null;
}
}
/*
* Answer the component to which will be handed back compilation results from the compiler
*/
public IIntermediateResultsRequestor getInterimResultRequestor() {
return new IIntermediateResultsRequestor() {
public void acceptResult(InterimCompilationResult result) {
if (progressListener != null) {
compiledCount++;
progressListener.setProgress((compiledCount / 2.0) / sourceFileCount);
progressListener.setText("compiled: " + result.fileName());
}
state.noteResult(result);
if (progressListener != null && progressListener.isCancelledRequested()) {
throw new AbortCompilation(true, new OperationCanceledException("Compilation cancelled as requested"));
}
}
};
}
public ICompilerRequestor getBatchRequestor() {
return new ICompilerRequestor() {
public void acceptResult(CompilationResult unitResult) {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
boolean hasErrors = unitResult.hasErrors();
if (!hasErrors || proceedOnError()) {
Collection<ClassFile> classFiles = unitResult.compiledTypes.values();
boolean shouldAddAspectName = (buildConfig.getOutxmlName() != null);
for (Iterator<ClassFile> iter = classFiles.iterator(); iter.hasNext();) {
ClassFile classFile = iter.next();
String filename = new String(classFile.fileName());
String classname = filename.replace('/', '.');
filename = filename.replace('/', File.separatorChar) + ".class";
try {
if (buildConfig.getOutputJar() == null) {
String outfile = writeDirectoryEntry(unitResult, classFile, filename);
getWorld().classWriteEvent(classFile.getCompoundName());
if (environmentSupportsIncrementalCompilation) {
if (!classname.endsWith("$ajcMightHaveAspect")) {
ResolvedType type = getBcelWorld().resolve(classname);
if (type.isAspect()) {
state.recordAspectClassFile(outfile);
}
}
}
} else {
writeZipEntry(classFile, filename);
}
if (shouldAddAspectName && !classname.endsWith("$ajcMightHaveAspect")) {
addAspectName(classname, unitResult.getFileName());
}
} catch (IOException ex) {
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
IMessage message = EclipseAdapterUtils.makeErrorMessage(new String(unitResult.fileName),
CANT_WRITE_RESULT, ex);
handler.handleMessage(message);
}
}
state.noteNewResult(unitResult);
unitResult.compiledTypes.clear();
}
if (unitResult.hasProblems() || unitResult.hasTasks()) {
IProblem[] problems = unitResult.getAllProblems();
for (int i = 0; i < problems.length; i++) {
IMessage message = EclipseAdapterUtils.makeMessage(unitResult.compilationUnit, problems[i], getBcelWorld(),
progressListener);
handler.handleMessage(message);
}
}
}
private String writeDirectoryEntry(CompilationResult unitResult, ClassFile classFile, String filename)
throws IOException {
File destinationPath = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
destinationPath = buildConfig.getCompilationResultDestinationManager().getOutputLocationForClass(
new File(new String(unitResult.fileName)));
}
String outFile;
if (destinationPath == null) {
outFile = new File(filename).getName();
outFile = new File(extractDestinationPathFromSourceFile(unitResult), outFile).getPath();
} else {
outFile = new File(destinationPath, filename).getPath();
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
try {
BufferedOutputStream os = FileUtil.makeOutputStream(new File(outFile));
os.write(classFile.getBytes());
os.close();
} catch (FileNotFoundException fnfe) {
IMessage msg = new Message("unable to write out class file: '" + filename + "' - reason: " + fnfe.getMessage(),
IMessage.ERROR, null, new SourceLocation(new File(outFile), 0));
handler.handleMessage(msg);
}
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileWrite(outFile,
CompilationResultDestinationManager.FILETYPE_CLASS);
}
return outFile;
}
private void writeZipEntry(ClassFile classFile, String name) throws IOException {
name = name.replace(File.separatorChar, '/');
ZipEntry newEntry = new ZipEntry(name);
zos.putNextEntry(newEntry);
zos.write(classFile.getBytes());
zos.closeEntry();
}
private void addAspectName(String name, char[] fileContainingAspect) {
BcelWorld world = getBcelWorld();
ResolvedType type = world.resolve(name);
if (type.isAspect()) {
if (state.getAspectNamesToFileNameMap() == null) {
state.initializeAspectNamesToFileNameMap();
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
if (!state.getAspectNamesToFileNameMap().containsKey(name)) {
state.getAspectNamesToFileNameMap().put(name, fileContainingAspect);
}
}
}
};
}
protected boolean proceedOnError() {
return buildConfig.getProceedOnError();
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private void setBuildConfig(AjBuildConfig buildConfig) {
this.buildConfig = buildConfig;
if (!this.environmentSupportsIncrementalCompilation) {
this.environmentSupportsIncrementalCompilation = (buildConfig.isIncrementalMode() || buildConfig
.isIncrementalFileMode());
}
handler.reset();
}
String makeClasspathString(AjBuildConfig buildConfig) {
if (buildConfig == null || buildConfig.getFullClasspath() == null) {
return "";
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
StringBuffer buf = new StringBuffer();
boolean first = true;
for (Iterator it = buildConfig.getFullClasspath().iterator(); it.hasNext();) {
if (first) {
first = false;
} else {
buf.append(File.pathSeparator);
}
buf.append(it.next().toString());
}
return buf.toString();
}
/**
* This will return null if aspectjrt.jar is present and has the correct version. Otherwise it will return a string message
* indicating the problem.
*/
private String checkRtJar(AjBuildConfig buildConfig) {
if (Version.text.equals(Version.DEVELOPMENT)) {
return null;
}
if (buildConfig == null || buildConfig.getFullClasspath() == null) {
return "no classpath specified";
}
String ret = null;
for (Iterator it = buildConfig.getFullClasspath().iterator(); it.hasNext();) {
File p = new File((String) it.next());
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (p.isFile() && p.getName().startsWith("aspectjrt") && p.getName().endsWith(".jar")) {
try {
String version = null;
Manifest manifest = new JarFile(p).getManifest();
if (manifest == null) {
ret = "no manifest found in " + p.getAbsolutePath() + ", expected " + Version.text;
continue;
}
Attributes attr = manifest.getAttributes("org/aspectj/lang/");
if (null != attr) {
version = attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
if (null != version) {
version = version.trim();
}
}
if (Version.DEVELOPMENT.equals(version)) {
return null;
} else if (!Version.text.equals(version)) {
ret = "bad version number found in " + p.getAbsolutePath() + " expected " + Version.text + " found "
+ version;
continue;
}
} catch (IOException ioe) {
ret = "bad jar file found in " + p.getAbsolutePath() + " error: " + ioe;
}
return null;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
} else if (p.isFile() && p.getName().indexOf("org.aspectj.runtime") != -1) {
return null;
} else {
}
}
if (ret != null) {
return ret;
}
return "couldn't find aspectjrt.jar on classpath, checked: " + makeClasspathString(buildConfig);
}
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("AjBuildManager(");
buf.append(")");
return buf.toString();
}
/**
* Returns null if there is no structure model
*/
public AsmManager getStructureModel() {
return (state == null ? null : state.getStructureModel());
}
public IProgressListener getProgressListener() {
return progressListener;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
public void setProgressListener(IProgressListener progressListener) {
this.progressListener = progressListener;
}
/*
* (non-Javadoc)
*
* @see org.aspectj.ajdt.internal.compiler.AjCompiler.IOutputClassFileNameProvider#getOutputClassFileName(char[])
*/
public String getOutputClassFileName(char[] eclipseClassFileName, CompilationResult result) {
String filename = new String(eclipseClassFileName);
filename = filename.replace('/', File.separatorChar) + ".class";
File destinationPath = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
File f = new File(new String(result.getFileName()));
destinationPath = buildConfig.getCompilationResultDestinationManager().getOutputLocationForClass(f);
}
String outFile;
if (destinationPath == null) {
outFile = new File(filename).getName();
outFile = new File(extractDestinationPathFromSourceFile(result), outFile).getPath();
} else {
outFile = new File(destinationPath, filename).getPath();
}
return outFile;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jdt.internal.compiler.ICompilerAdapterFactory#getAdapter(org.eclipse.jdt.internal.compiler.Compiler)
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
*/
public ICompilerAdapter getAdapter(org.aspectj.org.eclipse.jdt.internal.compiler.Compiler forCompiler) {
populateCompilerOptionsFromLintSettings(forCompiler);
AjProblemReporter pr = new AjProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), forCompiler.options,
getProblemFactory());
forCompiler.problemReporter = pr;
AjLookupEnvironment le = new AjLookupEnvironment(forCompiler, forCompiler.options, pr, environment);
EclipseFactory factory = new EclipseFactory(le, this);
le.factory = factory;
pr.factory = factory;
forCompiler.lookupEnvironment = le;
forCompiler.parser = new Parser(pr, forCompiler.options.parseLiteralExpressionsAsConstants);
if (getBcelWorld().shouldPipelineCompilation()) {
IMessage message = MessageUtil.info("Pipelining compilation");
handler.handleMessage(message);
return new AjPipeliningCompilerAdapter(forCompiler, batchCompile, getBcelWorld(), getWeaver(), factory,
getInterimResultRequestor(), progressListener,
this,
this,
state.getBinarySourceMap(), buildConfig.isTerminateAfterCompilation(), buildConfig.getProceedOnError(),
buildConfig.isNoAtAspectJAnnotationProcessing(), buildConfig.isMakeReflectable(), state);
} else {
return new AjCompilerAdapter(forCompiler, batchCompile, getBcelWorld(), getWeaver(), factory,
getInterimResultRequestor(), progressListener,
this,
this,
state.getBinarySourceMap(), buildConfig.isTerminateAfterCompilation(), buildConfig.getProceedOnError(),
buildConfig.isNoAtAspectJAnnotationProcessing(), buildConfig.isMakeReflectable(), state);
}
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
/**
* Some AspectJ lint options need to be known about in the compiler. This is how we pass them over...
*
* @param forCompiler
*/
private void populateCompilerOptionsFromLintSettings(org.aspectj.org.eclipse.jdt.internal.compiler.Compiler forCompiler) {
BcelWorld world = this.state.getBcelWorld();
IMessage.Kind swallowedExceptionKind = world.getLint().swallowedExceptionInCatchBlock.getKind();
Map optionsMap = new HashMap();
optionsMap.put(CompilerOptions.OPTION_ReportSwallowedExceptionInCatchBlock, swallowedExceptionKind == null ? "ignore"
: swallowedExceptionKind.toString());
forCompiler.options.set(optionsMap);
}
/*
* (non-Javadoc)
*
* @see org.aspectj.ajdt.internal.compiler.IBinarySourceProvider#getBinarySourcesForThisWeave()
*/
public Map getBinarySourcesForThisWeave() {
return binarySourcesForTheNextCompile;
}
public static AsmHierarchyBuilder getAsmHierarchyBuilder() {
return asmHierarchyBuilder;
}
/**
* Override the the default hierarchy builder.
*/
public static void setAsmHierarchyBuilder(AsmHierarchyBuilder newBuilder) {
asmHierarchyBuilder = newBuilder;
|
324,190 |
Bug 324190 NullPointerException in AjBuildManager.findOutputDirsForAspects when compiling AspectJ project generated with Maven
|
Build Identifier: 20100617-1415 When I compile my AspectJ project, I get an AspectJ Internal Compiler Error. The stack trace is : java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AjBuildManager.findOutputDirsForAspects(AjBuildManager.java:725) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:652) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.a ... on$1.run(GlobalBuildAction.java:179) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) I digged a bit and looked into the classes. It would seem that AjState.getAspectNamesToFileNameMap() can return null in AjBuildManager.findOutputDirsForAspects. It is taken in account when AjBuildConfig.getCompilationResultDestinationManager() returns null or a list with one element, but not when it returns a list with several elements. Reproducible: Always Steps to Reproduce: Always happen in my configuration, but I didn't try to make it happen again in another workspace. Here are the steps I followed. 1. Generate a AspectJ project with Maven using the pom.xml I'll join 2. Create an aspect with a few pointcuts and a few advices 3. Compile (not with maven, the Eclipse compilation)
|
resolved fixed
|
03c43f5
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-01T15:00:33Z | 2010-09-01T14:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
public AjState getState() {
return state;
}
public void setState(AjState buildState) {
state = buildState;
}
private static class AjBuildContexFormatter implements ContextFormatter {
public String formatEntry(int phaseId, Object data) {
StringBuffer sb = new StringBuffer();
if (phaseId == CompilationAndWeavingContext.BATCH_BUILD) {
sb.append("batch building ");
} else {
sb.append("incrementally building ");
}
AjBuildConfig config = (AjBuildConfig) data;
List classpath = config.getClasspath();
sb.append("with classpath: ");
for (Iterator iter = classpath.iterator(); iter.hasNext();) {
sb.append(iter.next().toString());
sb.append(File.pathSeparator);
}
return sb.toString();
}
}
public boolean wasFullBuild() {
return wasFullBuild;
}
}
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
/* *******************************************************************
* Copyright (c) 2003 Contributors.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Mik Kersten initial implementation
* Andy Clement Extensions for better IDE representation
* ******************************************************************/
package org.aspectj.asm.internal;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.SourceLocation;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
/**
* @author Mik Kersten
* @author Andy Clement
*/
public class AspectJElementHierarchy implements IHierarchy {
private static final long serialVersionUID = 6462734311117048620L;
private transient AsmManager asm;
protected IProgramElement root = null;
protected String configFile = null;
private Map<String, IProgramElement> fileMap = null;
private Map<String, IProgramElement> handleMap = new HashMap<String, IProgramElement>();
private Map<String, IProgramElement> typeMap = null;
public AspectJElementHierarchy(AsmManager asm) {
this.asm = asm;
}
public IProgramElement getElement(String handle) {
return findElementForHandleOrCreate(handle, false);
}
public void setAsmManager(AsmManager asm) {
this.asm = asm;
}
public IProgramElement getRoot() {
return root;
}
public String toSummaryString() {
StringBuilder s = new StringBuilder();
s.append("FileMap has "+fileMap.size()+" entries\n");
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
s.append("HandleMap has "+handleMap.size()+" entries\n");
s.append("TypeMap has "+handleMap.size()+" entries\n");
s.append("FileMap:\n");
for (Map.Entry<String,IProgramElement> fileMapEntry: fileMap.entrySet()) {
s.append(fileMapEntry).append("\n");
}
s.append("TypeMap:\n");
for (Map.Entry<String,IProgramElement> typeMapEntry: typeMap.entrySet()) {
s.append(typeMapEntry).append("\n");
}
s.append("HandleMap:\n");
for (Map.Entry<String,IProgramElement> handleMapEntry: handleMap.entrySet()) {
s.append(handleMapEntry).append("\n");
}
return s.toString();
}
public void setRoot(IProgramElement root) {
this.root = root;
handleMap = new HashMap<String, IProgramElement>();
typeMap = new HashMap<String, IProgramElement>();
}
public void addToFileMap(String key, IProgramElement value) {
fileMap.put(key, value);
}
public boolean removeFromFileMap(String canonicalFilePath) {
return fileMap.remove(canonicalFilePath) != null;
}
public void setFileMap(HashMap<String, IProgramElement> fileMap) {
this.fileMap = fileMap;
}
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
public Object findInFileMap(Object key) {
return fileMap.get(key);
}
public Set<Map.Entry<String, IProgramElement>> getFileMapEntrySet() {
return fileMap.entrySet();
}
public boolean isValid() {
return root != null && fileMap != null;
}
/**
* Returns the first match
*
* @param parent
* @param kind not null
* @return null if not found
*/
public IProgramElement findElementForSignature(IProgramElement parent, IProgramElement.Kind kind, String signature) {
for (IProgramElement node : parent.getChildren()) {
if (node.getKind() == kind && signature.equals(node.toSignatureString())) {
return node;
} else {
IProgramElement childSearch = findElementForSignature(node, kind, signature);
if (childSearch != null) {
return childSearch;
}
}
}
return null;
}
public IProgramElement findElementForLabel(IProgramElement parent, IProgramElement.Kind kind, String label) {
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
for (IProgramElement node : parent.getChildren()) {
if (node.getKind() == kind && label.equals(node.toLabelString())) {
return node;
} else {
IProgramElement childSearch = findElementForLabel(node, kind, label);
if (childSearch != null) {
return childSearch;
}
}
}
return null;
}
/**
* Find the entry in the model that represents a particular type.
*
* @param packageName the package in which the type is declared or null for the default package
* @param typeName the name of the type
* @return the IProgramElement representing the type, or null if not found
*/
public IProgramElement findElementForType(String packageName, String typeName) {
synchronized (this) {
StringBuffer keyb = (packageName == null) ? new StringBuffer() : new StringBuffer(packageName);
keyb.append(".").append(typeName);
String key = keyb.toString();
IProgramElement cachedValue = typeMap.get(key);
if (cachedValue != null) {
return cachedValue;
}
List<IProgramElement> packageNodes = findMatchingPackages(packageName);
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
for (IProgramElement pkg : packageNodes) {
for (IProgramElement fileNode : pkg.getChildren()) {
IProgramElement cNode = findClassInNodes(fileNode.getChildren(), typeName, typeName);
if (cNode != null) {
typeMap.put(key, cNode);
return cNode;
}
}
}
}
return null;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
}
/**
* Look for any package nodes matching the specified package name. There may be multiple in the case where the types within a
* package are split across source folders.
*
* @param packagename the packagename being searched for
* @return a list of package nodes that match that name
*/
public List<IProgramElement> findMatchingPackages(String packagename) {
List<IProgramElement> children = root.getChildren();
if (children.size() == 0) {
return Collections.emptyList();
}
if ((children.get(0)).getKind() == IProgramElement.Kind.SOURCE_FOLDER) {
String searchPackageName = (packagename == null ? "" : packagename);
List<IProgramElement> matchingPackageNodes = new ArrayList<IProgramElement>();
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
for (IProgramElement sourceFolder : children) {
List<IProgramElement> possiblePackageNodes = sourceFolder.getChildren();
for (IProgramElement possiblePackageNode : possiblePackageNodes) {
if (possiblePackageNode.getKind() == IProgramElement.Kind.PACKAGE) {
if (possiblePackageNode.getName().equals(searchPackageName)) {
matchingPackageNodes.add(possiblePackageNode);
}
}
}
}
return matchingPackageNodes;
} else {
if (packagename == null) {
List<IProgramElement> result = new ArrayList<IProgramElement>();
result.add(root);
return result;
}
List<IProgramElement> result = new ArrayList<IProgramElement>();
for (IProgramElement possiblePackage : children) {
if (possiblePackage.getKind() == IProgramElement.Kind.PACKAGE && possiblePackage.getName().equals(packagename)) {
result.add(possiblePackage);
}
if (possiblePackage.getKind() == IProgramElement.Kind.SOURCE_FOLDER) {
if (possiblePackage.getName().equals("binaries")) {
for (IProgramElement possiblePackage2 : possiblePackage.getChildren()) {
if (possiblePackage2.getKind() == IProgramElement.Kind.PACKAGE
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
&& possiblePackage2.getName().equals(packagename)) {
result.add(possiblePackage2);
break;
}
}
}
}
}
if (result.isEmpty()) {
return Collections.emptyList();
} else {
return result;
}
}
}
private IProgramElement findClassInNodes(Collection<IProgramElement> nodes, String name, String typeName) {
String baseName;
String innerName;
int dollar = name.indexOf('$');
if (dollar == -1) {
baseName = name;
innerName = null;
} else {
baseName = name.substring(0, dollar);
innerName = name.substring(dollar + 1);
}
for (IProgramElement classNode : nodes) {
if (baseName.equals(classNode.getName())) {
if (innerName == null) {
return classNode;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
} else {
return findClassInNodes(classNode.getChildren(), innerName, typeName);
}
} else if (name.equals(classNode.getName())) {
return classNode;
} else if (typeName.equals(classNode.getBytecodeSignature())) {
return classNode;
} else if (classNode.getChildren() != null && !classNode.getChildren().isEmpty()) {
IProgramElement node = findClassInNodes(classNode.getChildren(), name, typeName);
if (node != null) {
return node;
}
}
}
return null;
}
/**
* @param sourceFilePath modified to '/' delimited path for consistency
* @return a new structure node for the file if it was not found in the model
*/
public IProgramElement findElementForSourceFile(String sourceFile) {
try {
if (!isValid() || sourceFile == null) {
return IHierarchy.NO_STRUCTURE;
} else {
String correctedPath = asm.getCanonicalFilePath(new File(sourceFile));
IProgramElement node = (IProgramElement) findInFileMap(correctedPath);
if (node != null) {
return node;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
} else {
return createFileStructureNode(correctedPath);
}
}
} catch (Exception e) {
return IHierarchy.NO_STRUCTURE;
}
}
/**
* TODO: discriminate columns
*/
public IProgramElement findElementForSourceLine(ISourceLocation location) {
try {
return findElementForSourceLine(asm.getCanonicalFilePath(location.getSourceFile()), location.getLine());
} catch (Exception e) {
return null;
}
}
/**
* Never returns null
*
* @param sourceFilePath canonicalized path for consistency
* @param lineNumber if 0 or 1 the corresponding file node will be returned
* @return a new structure node for the file if it was not found in the model
*/
public IProgramElement findElementForSourceLine(String sourceFilePath, int lineNumber) {
String canonicalSFP = asm.getCanonicalFilePath(new File(sourceFilePath));
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
IProgramElement node = findNodeForSourceFile(root, canonicalSFP);
if (node == null) {
return createFileStructureNode(sourceFilePath);
}
IProgramElement closernode = findCloserMatchForLineNumber(node, lineNumber);
if (closernode == null) {
return node;
} else {
return closernode;
}
}
/**
* Discover the node representing a particular source file.
*
* @param node where in the model to start looking (usually the root on the initial call)
* @param sourcefilePath the source file being searched for
* @return the node representing that source file or null if it cannot be found
*/
public IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath) {
if ((node.getKind().isSourceFile() && !node.getName().equals("<root>")) || node.getKind().isFile()) {
ISourceLocation nodeLoc = node.getSourceLocation();
if (nodeLoc != null && asm.getCanonicalFilePath(nodeLoc.getSourceFile()).equals(sourcefilePath)) {
return node;
}
return null;
} else {
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
for (IProgramElement child : node.getChildren()) {
IProgramElement foundit = findNodeForSourceFile(child, sourcefilePath);
if (foundit != null) {
return foundit;
}
}
return null;
}
}
public IProgramElement findElementForOffSet(String sourceFilePath, int lineNumber, int offSet) {
String canonicalSFP = asm.getCanonicalFilePath(new File(sourceFilePath));
IProgramElement node = findNodeForSourceLineHelper(root, canonicalSFP, lineNumber, offSet);
if (node != null) {
return node;
} else {
return createFileStructureNode(sourceFilePath);
}
}
private IProgramElement createFileStructureNode(String sourceFilePath) {
int lastSlash = sourceFilePath.lastIndexOf('\\');
if (lastSlash == -1) {
lastSlash = sourceFilePath.lastIndexOf('/');
}
int i = sourceFilePath.lastIndexOf('!');
int j = sourceFilePath.indexOf(".class");
if (i > lastSlash && i != -1 && j != -1) {
lastSlash = i;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
}
String fileName = sourceFilePath.substring(lastSlash + 1);
IProgramElement fileNode = new ProgramElement(asm, fileName, IProgramElement.Kind.FILE_JAVA, new SourceLocation(new File(
sourceFilePath), 1, 1), 0, null, null);
fileNode.addChild(NO_STRUCTURE);
return fileNode;
}
/**
* For a specified node, check if any of the children more accurately represent the specified line.
*
* @param node where to start looking
* @param lineno the line number
* @return any closer match below 'node' or null if nothing is a more accurate match
*/
public IProgramElement findCloserMatchForLineNumber(IProgramElement node, int lineno) {
if (node == null || node.getChildren() == null) {
return null;
}
for (IProgramElement child : node.getChildren()) {
ISourceLocation childLoc = child.getSourceLocation();
if (childLoc != null) {
if (childLoc.getLine() <= lineno && childLoc.getEndLine() >= lineno) {
IProgramElement evenCloserMatch = findCloserMatchForLineNumber(child, lineno);
if (evenCloserMatch == null) {
return child;
} else {
return evenCloserMatch;
}
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
} else if (child.getKind().isType()) {
IProgramElement evenCloserMatch = findCloserMatchForLineNumber(child, lineno);
if (evenCloserMatch != null) {
return evenCloserMatch;
}
}
}
}
return null;
}
private IProgramElement findNodeForSourceLineHelper(IProgramElement node, String sourceFilePath, int lineno, int offset) {
if (matches(node, sourceFilePath, lineno, offset) && !hasMoreSpecificChild(node, sourceFilePath, lineno, offset)) {
return node;
}
if (node != null) {
for (IProgramElement child : node.getChildren()) {
IProgramElement foundNode = findNodeForSourceLineHelper(child, sourceFilePath, lineno, offset);
if (foundNode != null) {
return foundNode;
}
}
}
return null;
}
private boolean matches(IProgramElement node, String sourceFilePath, int lineNumber, int offSet) {
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
ISourceLocation nodeSourceLocation = (node != null ? node.getSourceLocation() : null);
return node != null
&& nodeSourceLocation != null
&& nodeSourceLocation.getSourceFile().getAbsolutePath().equals(sourceFilePath)
&& ((offSet != -1 && nodeSourceLocation.getOffset() == offSet) || offSet == -1)
&& ((nodeSourceLocation.getLine() <= lineNumber && nodeSourceLocation.getEndLine() >= lineNumber) || (lineNumber <= 1 && node
.getKind().isSourceFile()));
}
private boolean hasMoreSpecificChild(IProgramElement node, String sourceFilePath, int lineNumber, int offSet) {
for (IProgramElement child : node.getChildren()) {
if (matches(child, sourceFilePath, lineNumber, offSet)) {
return true;
}
}
return false;
}
public String getConfigFile() {
return configFile;
}
public void setConfigFile(String configFile) {
this.configFile = configFile;
}
public IProgramElement findElementForHandle(String handle) {
return findElementForHandleOrCreate(handle, true);
}
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
public IProgramElement findElementForHandleOrCreate(String handle, boolean create) {
IProgramElement ipe = null;
synchronized (this) {
ipe = handleMap.get(handle);
if (ipe != null) {
return ipe;
}
ipe = findElementForHandle(root, handle);
if (ipe == null && create) {
ipe = createFileStructureNode(getFilename(handle));
}
if (ipe != null) {
cache(handle, ipe);
}
}
return ipe;
}
private IProgramElement findElementForHandle(IProgramElement parent, String handle) {
for (IProgramElement node : parent.getChildren()) {
String nodeHid = node.getHandleIdentifier();
if (handle.equals(nodeHid)) {
return node;
} else {
if (handle.startsWith(nodeHid)) {
IProgramElement childSearch = findElementForHandle(node, handle);
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
if (childSearch != null) {
return childSearch;
}
}
}
}
return null;
}
protected void cache(String handle, IProgramElement pe) {
if (!AsmManager.isCompletingTypeBindings()) {
handleMap.put(handle, pe);
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
}
}
public void flushTypeMap() {
typeMap.clear();
}
public void flushHandleMap() {
handleMap.clear();
}
public void flushFileMap() {
fileMap.clear();
}
public void forget(IProgramElement compilationUnitNode,IProgramElement typeNode) {
String k = null;
synchronized (this) {
for (Map.Entry<String,IProgramElement> typeMapEntry: typeMap.entrySet()) {
if (typeMapEntry.getValue()==typeNode) {
k = typeMapEntry.getKey();
break;
}
}
if (k!=null) {
typeMap.remove(k);
}
}
if (compilationUnitNode!=null) {
k = null;
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
for (Map.Entry<String,IProgramElement> entry: fileMap.entrySet()) {
if (entry.getValue()==compilationUnitNode) {
k = entry.getKey();break;
}
}
if (k!=null) {
fileMap.remove(k);
}
}
}
public void updateHandleMap(Set<String> deletedFiles) {
List<String> forRemoval = new ArrayList<String>();
Set<String> k = null;
synchronized (this) {
k = handleMap.keySet();
for (String handle : k) {
IProgramElement ipe = handleMap.get(handle);
if (deletedFiles.contains(getCanonicalFilePath(ipe))) {
forRemoval.add(handle);
}
}
for (String handle : forRemoval) {
handleMap.remove(handle);
}
forRemoval.clear();
k = typeMap.keySet();
for (String typeName : k) {
IProgramElement ipe = typeMap.get(typeName);
|
324,804 |
Bug 324804 NullPointerException at AspectJElementHierarchy.java:677
|
Build Identifier: 20100617-1415 After removing a "throws" clause from the constructor of a class and then saving I got the following error: java.lang.NullPointerException at org.aspectj.asm.internal.AspectJElementHierarchy.getCanonicalFilePath(AspectJElementHierarchy.java:677) at org.aspectj.asm.internal.AspectJElementHierarchy.updateHandleMap(AspectJElementHierarchy.java:641) at org.aspectj.asm.AsmManager.removeStructureModelForFiles(AsmManager.java:572) at org.aspectj.asm.AsmManager.processDelta(AsmManager.java:604) at org.aspectj.ajdt.internal.core.builder.AjBuildManager ... oBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NullPointerException thrown: null Reproducible: Didn't try
|
resolved fixed
|
6249672
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-09-09T16:24:43Z | 2010-09-08T23:53:20Z |
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
|
if (deletedFiles.contains(getCanonicalFilePath(ipe))) {
forRemoval.add(typeName);
}
}
for (String typeName : forRemoval) {
typeMap.remove(typeName);
}
forRemoval.clear();
}
for (Map.Entry<String, IProgramElement> entry : fileMap.entrySet()) {
String filePath = entry.getKey();
if (deletedFiles.contains(getCanonicalFilePath(entry.getValue()))) {
forRemoval.add(filePath);
}
}
for (String filePath : forRemoval) {
fileMap.remove(filePath);
}
}
private String getFilename(String hid) {
return asm.getHandleProvider().getFileForHandle(hid);
}
private String getCanonicalFilePath(IProgramElement ipe) {
if (ipe.getSourceLocation() != null) {
return asm.getCanonicalFilePath(ipe.getSourceLocation().getSourceFile());
}
return "";
}
}
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
/* *******************************************************************
* Copyright (c) 1999-2001 Xerox Corporation,
* 2002 Palo Alto Research Center, Incorporated (PARC).
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Xerox/PARC initial implementation
* ******************************************************************/
package org.aspectj.util;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
*
*/
public class FileUtil {
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
public static final File DEFAULT_PARENT = new File(".");
public static final List<String> SOURCE_SUFFIXES = Collections.unmodifiableList(Arrays.asList(new String[] { ".java", ".aj" }));
public static final FileFilter ZIP_FILTER = new FileFilter() {
public boolean accept(File file) {
return isZipFile(file);
}
public String toString() {
return "ZIP_FILTER";
}
};
final static int[] INT_RA = new int[0];
public static final FileFilter ALL = new FileFilter() {
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
public boolean accept(File f) {
return true;
}
};
public static final FileFilter DIRS_AND_WRITABLE_CLASSES = new FileFilter() {
public boolean accept(File file) {
return ((null != file) && (file.isDirectory() || (file.canWrite() && file.getName().toLowerCase().endsWith(".class"))));
}
};
private static final boolean PERMIT_CVS;
static {
String name = FileUtil.class.getName() + ".PERMIT_CVS";
PERMIT_CVS = LangUtil.getBoolean(name, false);
}
public static boolean isZipFile(File file) {
try {
return (null != file) && new ZipFile(file) != null;
} catch (IOException e) {
return false;
}
}
public static int zipSuffixLength(File file) {
return (null == file ? 0 : zipSuffixLength(file.getPath()));
}
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
public static int zipSuffixLength(String path) {
if ((null != path) && (4 < path.length())) {
String test = path.substring(path.length() - 4).toLowerCase();
if (".zip".equals(test) || ".jar".equals(test)) {
return 4;
}
}
return 0;
}
public static boolean hasSourceSuffix(File file) {
return ((null != file) && hasSourceSuffix(file.getPath()));
}
public static boolean hasSourceSuffix(String path) {
return ((null != path) && (0 != sourceSuffixLength(path)));
}
/**
* @return 0 if file has no source suffix or the length of the suffix otherwise
*/
public static int sourceSuffixLength(File file) {
return (null == file ? 0 : sourceSuffixLength(file.getPath()));
}
public static int sourceSuffixLength(String path) {
if (LangUtil.isEmpty(path)) {
return 0;
}
for (Iterator<String> iter = SOURCE_SUFFIXES.iterator(); iter.hasNext();) {
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
String suffix = iter.next();
if (path.endsWith(suffix) || path.toLowerCase().endsWith(suffix)) {
return suffix.length();
}
}
return 0;
}
public static boolean canReadDir(File dir) {
return ((null != dir) && dir.canRead() && dir.isDirectory());
}
public static boolean canReadFile(File file) {
return ((null != file) && file.canRead() && file.isFile());
}
public static boolean canWriteDir(File dir) {
return ((null != dir) && dir.canWrite() && dir.isDirectory());
}
public static boolean canWriteFile(File file) {
return ((null != file) && file.canWrite() && file.isFile());
}
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
/**
* @throws IllegalArgumentException unless dir is a readable directory
*/
public static void throwIaxUnlessCanReadDir(File dir, String label) {
if (!canReadDir(dir)) {
throw new IllegalArgumentException(label + " not readable dir: " + dir);
}
}
/**
* @throws IllegalArgumentException unless file is readable and not a directory
*/
public static void throwIaxUnlessCanWriteFile(File file, String label) {
if (!canWriteFile(file)) {
throw new IllegalArgumentException(label + " not writable file: " + file);
}
}
public static void throwIaxUnlessCanWriteDir(File dir, String label) {
if (!canWriteDir(dir)) {
throw new IllegalArgumentException(label + " not writable dir: " + dir);
}
}
public static String[] getPaths(File[] files) {
if ((null == files) || (0 == files.length)) {
return new String[0];
}
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
String[] result = new String[files.length];
for (int i = 0; i < result.length; i++) {
if (null != files[i]) {
result[i] = files[i].getPath();
}
}
return result;
}
public static String[] getPaths(List<File> files) {
final int size = (null == files ? 0 : files.size());
if (0 == size) {
return new String[0];
}
String[] result = new String[size];
for (int i = 0; i < size; i++) {
File file = files.get(i);
if (null != file) {
result[i] = file.getPath();
}
}
return result;
}
/**
* Extract the name of a class from the path to its file. If the basedir is null, then the class is assumed to be in the default
* package unless the classFile has one of the top-level suffixes { com, org, java, javax } as a parent directory.
*
* @param basedir the File of the base directory (prefix of classFile)
* @param classFile the File of the class to extract the name for
* @throws IllegalArgumentException if classFile is null or does not end with ".class" or a non-null basedir is not a prefix of
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
* classFile
*/
public static String fileToClassName(File basedir, File classFile) {
LangUtil.throwIaxIfNull(classFile, "classFile");
String classFilePath = normalizedPath(classFile);
if (!classFilePath.endsWith(".class")) {
String m = classFile + " does not end with .class";
throw new IllegalArgumentException(m);
}
classFilePath = classFilePath.substring(0, classFilePath.length() - 6);
if (null != basedir) {
String basePath = normalizedPath(basedir);
if (!classFilePath.startsWith(basePath)) {
String m = classFile + " does not start with " + basedir;
throw new IllegalArgumentException(m);
}
classFilePath = classFilePath.substring(basePath.length() + 1);
} else {
final String[] suffixes = new String[] { "com", "org", "java", "javax" };
boolean found = false;
for (int i = 0; !found && (i < suffixes.length); i++) {
int loc = classFilePath.indexOf(suffixes[i] + "/");
if ((0 == loc) || ((-1 != loc) && ('/' == classFilePath.charAt(loc - 1)))) {
classFilePath = classFilePath.substring(loc);
found = true;
}
}
if (!found) {
int loc = classFilePath.lastIndexOf("/");
if (-1 != loc) {
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
classFilePath = classFilePath.substring(loc + 1);
}
}
}
return classFilePath.replace('/', '.');
}
/**
* Normalize path for comparisons by rendering absolute, clipping basedir prefix, trimming and changing '\\' to '/'
*
* @param file the File with the path to normalize
* @param basedir the File for the prefix of the file to normalize - ignored if null
* @return "" if null or normalized path otherwise
* @throws IllegalArgumentException if basedir is not a prefix of file
*/
public static String normalizedPath(File file, File basedir) {
String filePath = normalizedPath(file);
if (null != basedir) {
String basePath = normalizedPath(basedir);
if (filePath.startsWith(basePath)) {
filePath = filePath.substring(basePath.length());
if (filePath.startsWith("/")) {
filePath = filePath.substring(1);
}
}
}
return filePath;
}
/**
* Render a set of files to String as a path by getting absolute paths of each and delimiting with infix.
*
|
282,379 |
Bug 282379 [plan] spaces in file names causes AspectJ weaver to fail
|
The WeavingAdaptor requires the aspect path to be composed by URLs. The URL of a file is encoded, for example if it contains spaces they will be represented with %20. It then converts these file:// urls to simple string paths, and then tries to access files pointed by those paths. This is done inside the FileUtil.makeClasspath(URL[]) . This method uses URL.getPath() to obtain the path. But this method does not decode the string, it returns it as it is in the URL. When later this string is used to create a new File instance, that file contains an invalid path, and the weaver fails as follows : Caused by: org.aspectj.bridge.AbortException: bad aspect library: '/home/sym/path%20with%20space/aspect-library.jar' at org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHolder.handleMessage(WeavingAdaptor.java:624) at org.aspectj.bridge.MessageUtil.error(MessageUtil.java:80) at org.aspectj.weaver.tools.WeavingAdaptor.error(WeavingAdaptor.java:504) at org.aspectj.weaver.tools.WeavingAdaptor.addAspectLibrary(WeavingAdaptor.java:472) at org.aspectj.weaver.tools.WeavingAdaptor.registerAspectLibraries(WeavingAdaptor.java:447) at org.aspectj.weaver.tools.WeavingAdaptor.init(WeavingAdaptor.java:177) at org.aspectj.weaver.tools.WeavingAdaptor.<init>(WeavingAdaptor.java:112) This issue is quite important, because on older windows "Documents and Settings" is an unfortunately common path, for example Maven stores there its repository. Multiple solutions are possible for this simple bug, in order of impact : - Decode the string obtained by URL.getPath() using URLEncoder.decode() - Use Files instead of Strings and let Java handle the URL, using the File(URI) constructor - Don't assume that aspect libraries are files, and hence that urls are file url, and use URLConnection to fetch aspect library contents.
|
resolved fixed
|
5648105
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2011-02-05T21:29:00Z | 2009-07-03T14:06:40Z |
util/src/org/aspectj/util/FileUtil.java
|
* @param files the File[] to flatten - may be null or empty
* @param infix the String delimiter internally between entries (if null, then use File.pathSeparator). (alias to
* <code>flatten(getAbsolutePaths(files), infix)</code>
* @return String with absolute paths to entries in order, delimited with infix
*/
public static String flatten(File[] files, String infix) {
if (LangUtil.isEmpty(files)) {
return "";
}
return flatten(getPaths(files), infix);
}
/**
* Flatten File[] to String.
*
* @param files the File[] of paths to flatten - null ignored
* @param infix the String infix to use - null treated as File.pathSeparator
*/
public static String flatten(String[] paths, String infix) {
if (null == infix) {
infix = File.pathSeparator;
}
StringBuffer result = new StringBuffer();
boolean first = true;
for (int i = 0; i < paths.length; i++) {
String path = paths[i];
if (null == path) {
continue;
}
if (first) {
first = false;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.