Community
Participate
Working Groups
Description Resource Path Location Type The method StringBuffer.insert(int, CharSequence) referenced in org.eclipse.jdt.internal.core.util.KeyToSignature.consumeType() is not defined in bundle's required execution environment: J2SE-1.4 KeyToSignature.java /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util line 261 API Usage Problem
Created attachment 134689 [details] fix
This problem only occurs if JDT/Core is compiled using a 1.5 library. This is not supposed to be the case. JDT/Core should always be built using 1.4 libraries.
For safety (people that are building JDT/Core on a 1.5 libraries), we could release that patch. David, please review.
+1. patch looks good and would avoid problems with this uncommon configuration.
Released for 3.5RC1. Code review is required for verification.
Olivier, I'm afraid I'm missing a point here: when I enabled API Tooling on o.e.jdt.core, I had the error in comment 0 because J2SE1.4 (the EE of this bundle), does *NOT* contain an insert(int, xxx) method taking a CharSequence parameter as its second argument. So in fact I am wondering how this code was supposed to compile against a JRE 1.4 before! But as already said, I must be missing something, and I don't really understand why we are talking about JRE 1.5 here
Check the JRE used on the JDT/Core project classpath. I am sure this is a JRE 1.5. You don't resolve to the insert(int, CharSequence) if the libraries on the classpath are 1.4 libraries. If you have 1.4 libraries, this call is resolved to insert(int, Object).
Can you confirm that you have a 1.5 JRE or above on the project's classpath ?
Olivier you're right: now that I added the configuration for a JRE 1.4 in my workspace, it looks good! Is it because of a bug in API tools that I had sort of a false report for this "missing" insert(int, CharSequence) method in J2SE1.4? Changing the code to this.signature.insert(this.typeSigStart, (Object)typeParametersSig); makes API tools happy again (when I have a JRE>1.4, of course :))
(In reply to comment #9) > Is it because of a bug in API tools that I had sort of a false report for this > "missing" insert(int, CharSequence) method in J2SE1.4? This is not a bug, it is a feature :-). When you are building with a 1.5 JRE on the classpath, the call is resolved to a different signature than when you are using a 1.4 JRE on the classpath. API Tooling is using resolved signatures and finds that the resolved signature for this call would not be available with a 1.4 JRE. So we "fix" the code to avoid this method invocation to resolve to a different signature according to the libraries used on the classpath.
(In reply to comment #10) > This is not a bug, it is a feature :-). > [...] Thank you very much for this explanation Olivier, everything is much clearer now! :)
Verified for 3.5RC1 using I20090513-2000
Moving iplog+ flag from bug itself to the contributed patch.