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 42301 Details for
Bug 143259
[1.5][compiler] NullPointerException in ReferenceBinding.binarySearch , Eclipse 3.2RC4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to clean up field array
fieldPatch.txt (text/plain), 2.31 KB, created by
Kent Johnson
on 2006-05-23 14:55:13 EDT
(
hide
)
Description:
Patch to clean up field array
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2006-05-23 14:55:13 EDT
Size:
2.31 KB
patch
obsolete
>Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v >retrieving revision 1.136 >diff -u -r1.136 SourceTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 28 Apr 2006 14:53:28 -0000 1.136 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 23 May 2006 18:54:08 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.util.Util; > import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable; >+import org.eclipse.jdt.internal.compiler.util.SimpleSet; > > public class SourceTypeBinding extends ReferenceBinding { > public ReferenceBinding superclass; >@@ -590,7 +591,7 @@ > if ((this.tagBits & TagBits.AreFieldsComplete) != 0) > return this.fields; > >- int failed = 0; >+ SimpleSet failedFields = null; > try { > // lazily sort fields > if ((this.tagBits & TagBits.AreFieldsSorted) == 0) { >@@ -598,23 +599,29 @@ > if (length > 1) > ReferenceBinding.sortFields(this.fields, 0, length); > this.tagBits |= TagBits.AreFieldsSorted; >- } >+ } > for (int i = 0, length = this.fields.length; i < length; i++) { > if (resolveTypeFor(this.fields[i]) == null) { >- this.fields[i] = null; >- failed++; >+ if (failedFields == null) >+ failedFields = new SimpleSet(3); >+ failedFields.add(this.fields[i]); > } > } > } finally { >- if (failed > 0) { >+ if (failedFields != null) { > // ensure fields are consistent reqardless of the error >- int newSize = this.fields.length - failed; >+ // count how many fields should remain >+ int newSize = 0; >+ for (int i = 0, l = this.fields.length; i < l; i++) { >+ if (!failedFields.includes(this.fields[i])) >+ newSize++; >+ } > if (newSize == 0) > return this.fields = Binding.NO_FIELDS; > > FieldBinding[] newFields = new FieldBinding[newSize]; > for (int i = 0, j = 0, length = this.fields.length; i < length; i++) { >- if (this.fields[i] != null) >+ if (!failedFields.includes(this.fields[i])) > newFields[j++] = this.fields[i]; > } > this.fields = newFields;
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 143259
:
42281
|
42299
|
42301
|
42942
|
42948