This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There is a wrong leftShift return type shown by code completion. It should be StringBuffer, but at the moment cc shows StringBuilder. Uncomment MethodCompletionTest.testCompletionNoPrefixString1 and MethodCompletionTest.testCompletionNoPrefixString2 tests to see wrong output.
Uncomment also those two tests together with fix: OperatorsCompletionTest.testSafeNavigation4 OperatorsCompletionTest.testMethodClosure4
Seems like the problem occurs only in tests where the IDE shows unexpected token error. For example test containing: "".&^ seems to be invalid for parser, but similar: "".&a^ seems to be valid. (the parser behavior looks fine to me - dynamic method are valid if there is some method name, otherwise the file cannot be compiled)
*** This bug has been marked as a duplicate of bug 206610 ***
Reopening, setting TM = Dev. At the end this and the issue 206610 are probably separate problems caused by insufficient sanitization. It's still hard to say why it results in randomly shown code completion, but at least it could be possibly fixed.
MetaElementHandler.getMethods() is the problem! Obviously GroovySystem.getMetaClassRegistry().getMetaClass(clz) does not guarantees the order of loaded meta methods and thus sometimes String's methods commes before CharSequence ones and sometimes not. After so MetaElementHandler.addOrReplaceItem() checks for superClass (meaning java.lang.Object) distance which is lower for String methods and as a result they are replaced by CharSequence ones (e.g. returning StringBuilder instead of StringBuffer in leftShift method).. Altough not sure yet how to fix it correcly..
Fixed in: web-main #2c06023f31ec
Integrated into 'main-golden', will be available in build *201303222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2c06023f31ec User: Martin Janicek <mjanicek@netbeans.org> Log: #205951 - CC shows wrong leftShift return type in tests