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 40964 Details for
Bug 140643
[compiler] $foo() not found in anonymous type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
alternative methods
sorted-insert.txt (text/plain), 2.03 KB, created by
Stephan Herrmann
on 2006-05-10 12:44:43 EDT
(
hide
)
Description:
alternative methods
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2006-05-10 12:44:43 EDT
Size:
2.03 KB
patch
obsolete
>// in class ReferenceBinding: >/** Insert a method into a sorted array. */ >public static MethodBinding[] sortedInsert(MethodBinding[] sortedMethods, MethodBinding newMethod) { > if (sortedMethods != null) { > int max = sortedMethods.length; > if (max > 0) { > int insertBefore = 0; > int left = 0, right = max - 1; > int mid = 0; > while (left <= right) { > mid = (left + right) /2; > MethodBinding midM = sortedMethods[mid]; > int compare = METHOD_COMPARATOR.compare(newMethod, midM); > if (compare < 0) { > right = mid-1; > insertBefore = mid; > } else if (compare > 0) { > left = mid+1; > insertBefore = mid+1; > } else { > insertBefore = mid; > break; // mid's name is equal to `name' > } > } > MethodBinding[] result = new MethodBinding[max+1]; > System.arraycopy(sortedMethods, 0, result, 0, insertBefore); > System.arraycopy(sortedMethods, insertBefore, result, insertBefore+1, max-insertBefore); > result[insertBefore] = newMethod; > return result; > } > } > return new MethodBinding[] {newMethod}; >} > >// in class SourceTypeBinding: >/** Add a method respecting the current state wrt sorting and resolving. */ >public void addMethod(MethodBinding methodBinding) { > int size = this.methods.length; > if ((this.tagBits & TagBits.AreMethodsComplete) != 0) > if (this.resolveTypesFor(methodBinding) == null) > return; // don't add erroenous method > // differentiate between sorted and unsorted state: > if ((this.tagBits & TagBits.AreMethodsSorted) != 0) { > this.methods= ReferenceBinding.sortedInsert(this.methods, methodBinding); > } else { > //grow array > System.arraycopy(this.methods, 0, this.methods= new MethodBinding[size + 1], 0, size); > this.methods[size] = methodBinding; > } >}
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 Raw
Actions:
View
Attachments on
bug 140643
:
40693
|
40932
| 40964