Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82985 Details for
Bug 209961
[compiler][apt] NPE in apt processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_209961.txt (text/plain), 6.92 KB, created by
Olivier Thomann
on 2007-11-15 12:48:32 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-11-15 12:48:32 EST
Size:
6.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.compiler.apt.tests >Index: src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java,v >retrieving revision 1.11 >diff -u -r1.11 BatchTestUtils.java >--- src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java 2 Oct 2007 20:51:16 -0000 1.11 >+++ src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java 15 Nov 2007 17:47:02 -0000 >@@ -193,6 +193,10 @@ > return _tmpSrcFolderName; > } > >+ public static String getResourceFolderName() { >+ return RESOURCES_DIR; >+ } >+ > /** > * Load Eclipse compiler and create temporary directories on disk > */ >Index: src/org/eclipse/jdt/compiler/apt/tests/BatchDispatchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchDispatchTests.java,v >retrieving revision 1.8 >diff -u -r1.8 BatchDispatchTests.java >--- src/org/eclipse/jdt/compiler/apt/tests/BatchDispatchTests.java 21 Apr 2007 01:20:23 -0000 1.8 >+++ src/org/eclipse/jdt/compiler/apt/tests/BatchDispatchTests.java 15 Nov 2007 17:47:02 -0000 >@@ -219,6 +219,28 @@ > assertEquals("succeeded", System.getProperty(processorClass)); > } > >+ /** >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=209961 >+ */ >+ public void test209961() throws IOException { >+ File targetFolder = TestUtils.concatPath(BatchTestUtils.getSrcFolderName(), "targets", "dispatch"); >+ File inputFile = BatchTestUtils.copyResource("targets/dispatch/X.java", targetFolder); >+ assertNotNull("No input file", inputFile); >+ File classpathEntry =TestUtils.concatPath( >+ new File(BatchTestUtils.getPluginDirectoryPath(), BatchTestUtils.getResourceFolderName()).getAbsolutePath(), >+ "targets", >+ "dispatch"); >+ >+ List<String> options = new ArrayList<String>(); >+ // See corresponding list in CheckArgsProc processor. >+ // Processor will throw IllegalStateException if it detects a mismatch. >+ options.add("-classpath"); >+ options.add(classpathEntry.getAbsolutePath()); >+ options.add("-verbose"); >+ >+ BatchTestUtils.compileOneClass(BatchTestUtils.getEclipseCompiler(), options, inputFile); >+ } >+ > @Override > protected void tearDown() throws Exception { > BatchTestUtils.tearDown(); >Index: resources/targets/dispatch/p/Y.java >=================================================================== >RCS file: resources/targets/dispatch/p/Y.java >diff -N resources/targets/dispatch/p/Y.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/targets/dispatch/p/Y.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+package p; >+ >+public class Y extends Z {} >Index: resources/targets/dispatch/p/Z.java >=================================================================== >RCS file: resources/targets/dispatch/p/Z.java >diff -N resources/targets/dispatch/p/Z.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/targets/dispatch/p/Z.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+package p; >+ >+public class Z {} >Index: resources/targets/dispatch/X.java >=================================================================== >RCS file: resources/targets/dispatch/X.java >diff -N resources/targets/dispatch/X.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/targets/dispatch/X.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+import p.Y; >+import p.Z; >+ >+public class X extends Y { >+ public static void main(String[] args) { >+ System.out.println(new Y()); >+ System.out.println(new Z()); >+ } >+} >#P org.eclipse.jdt.compiler.tool >Index: src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java,v >retrieving revision 1.6 >diff -u -r1.6 EclipseFileManager.java >--- src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java 15 Oct 2007 17:39:38 -0000 1.6 >+++ src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java 15 Nov 2007 17:47:08 -0000 >@@ -634,7 +634,13 @@ > if (remaining.hasNext()) { > final Iterable<? extends File> classpaths = getPathsFrom(remaining.next()); > if (classpaths != null) { >- setLocation(StandardLocation.CLASS_PATH, classpaths); >+ Iterable<? extends File> iterable = getLocation(StandardLocation.CLASS_PATH); >+ if (iterable != null) { >+ setLocation(StandardLocation.CLASS_PATH, >+ concatFiles(iterable, classpaths)); >+ } else { >+ setLocation(StandardLocation.CLASS_PATH, classpaths); >+ } > if ((this.flags & HAS_PROCESSORPATH) == 0) { > setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths); > } >#P org.eclipse.jdt.compiler.apt >Index: src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java,v >retrieving revision 1.4 >diff -u -r1.4 EclipseFileManager.java >--- src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java 15 Oct 2007 17:39:52 -0000 1.4 >+++ src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java 15 Nov 2007 17:47:11 -0000 >@@ -634,7 +634,13 @@ > if (remaining.hasNext()) { > final Iterable<? extends File> classpaths = getPathsFrom(remaining.next()); > if (classpaths != null) { >- setLocation(StandardLocation.CLASS_PATH, classpaths); >+ Iterable<? extends File> iterable = getLocation(StandardLocation.CLASS_PATH); >+ if (iterable != null) { >+ setLocation(StandardLocation.CLASS_PATH, >+ concatFiles(iterable, classpaths)); >+ } else { >+ setLocation(StandardLocation.CLASS_PATH, classpaths); >+ } > if ((this.flags & HAS_PROCESSORPATH) == 0) { > setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths); > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/Compiler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java,v >retrieving revision 1.99 >diff -u -r1.99 Compiler.java >--- compiler/org/eclipse/jdt/internal/compiler/Compiler.java 27 Oct 2007 07:33:34 -0000 1.99 >+++ compiler/org/eclipse/jdt/internal/compiler/Compiler.java 15 Nov 2007 17:47:14 -0000 >@@ -645,7 +645,7 @@ > int newUnitSize = 0; > int newClassFilesSize = 0; > int bottom = 0; >- int top = this.unitsToProcess.length; >+ int top = this.totalUnits; > ReferenceBinding[] binaryTypeBindingsTemp = this.referenceBindings; > if (top == 0 && binaryTypeBindingsTemp == null) return; > this.referenceBindings = null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209961
:
82968
|
82983
| 82985