Community
Participate
Working Groups
When processing a method for content assist, an AIOOBE is thrown from InternalCompletionProposal [1]. This is happening because BinaryMethod.getParameterNames() for the method "io.toro.integrate.CacheMethods#cacheGet" [2] has annotations on its parameters. BinaryMethod circa line 385 is trying to find the begin and end parenthesis of the method doc. It properly skips over method annotations to find the left paren. However "final int indexOfClosingParen = methodDoc.indexOf(')', indexOfOpenParen);" gets the index of the right paren of the first parameter type annotation. Thus it ends up with paramsSource as "@GloopParameter(value="Cache name in the current package",allowNull=false". There are more details described at [1], including a simple .classpath that can be used to recreate. [1] https://github.com/groovy/groovy-eclipse/issues/808 [2] https://javadocs.torocloud.com/integrate/3.2.0/io/toro/integrate/CacheMethods.html#cacheGet-java.lang.String-java.util.Collection-
Created attachment 277547 [details] Parse names from dl html If parameter names are commonly provided as part of <dl>...<dd><code>name</code>...</dd></dl> markup, this could be easier than trying to deal with annotations.
Here is an updated patch section that reads from the method signature text instead of the parameters table. Ex "<pre>public static <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] tokenizeToStringArray(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> str, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> delimiter, boolean trimTokens, boolean ignoreEmptyTokens, boolean retainDelimeter)</pre>" if (methodDoc != null) { // GROOVY add int indexOfPre = methodDoc.indexOf("<pre>"); //$NON-NLS-1$ if (indexOfPre != -1) { List<String> names = new ArrayList<>(); String methodSig = methodDoc.substring(indexOfPre, methodDoc.indexOf("</pre>", indexOfPre) + 6); //$NON-NLS-1$ Matcher matcher = Pattern.compile(" (\\p{javaJavaIdentifierPart}+)[,)]").matcher(methodSig); //$NON-NLS-1$ while (matcher.find()) { names.add(matcher.group(1)); } if (this.parameterTypes.length == names.size()) { return this.parameterNames = names.toArray(new String[names.size()]); } else { System.err.print(""); //$NON-NLS-1$ } } // GROOVY end int indexOfOpenParen = methodDoc.indexOf('(');
Eric, We will consider this for 4.12. I haven't looked at the proposed fix yet, though.
Bulk move to 4.14
Bulk move out of 4.13
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.