Bug 489833 - [content assist] Incorrect value from CompletionProposal.getReplaceStart() causes SIOOBE
Summary: [content assist] Incorrect value from CompletionProposal.getReplaceStart() ca...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 07:00 EDT by Noopur Gupta CLA
Modified: 2022-10-21 05:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2016-03-17 07:00:46 EDT
package p1;
/**
 * Bla {@link #method(Object[]...)}.
 *
 * Auto-complete here #
 */
public class Test {

	public void method(Object[]... args) {}
	public void method2(int arg) {}
}

- In the above example, press Ctrl+space after # at the specified location.
- CompletionProposal.getReplaceStart() for the received proposals returns the offset before the first #. 

As a result, we get wrong pattern in AbstractJavaCompletionProposal.getPatternMatchRule(String pattern, String string). Here,

string is:
{@link #method(Object[]...)} - Test

and, pattern is:
#method(Object[]...)}.
 *
 * Auto-complete here #

This results in SIOOBE.

- In 4.6 M3 build, before AbstractJavaCompletionProposal#getPatternMatchRule was introduced, we used to get incorrect result and the text from the first # onwards was eaten up by applying the proposal.
Comment 1 Manoj N Palat CLA 2016-05-04 03:46:17 EDT
Initial Analysis: Though the symptoms are similar to the bug 488363, the root cause is different. Here instead of CompletionOnJavadocFieldReference a CompletionOnJavadocMessageSend node is created with reference to "@link #method(Object[]...)}" in 
Eclipse.4.6M7PLUS [Eclipse Application]	
	org.eclipse.equinox.launcher.Main at localhost:59224	
		Thread [main] (Suspended (breakpoint at line 20 in CompletionOnJavadocMessageSend))	
			CompletionOnJavadocMessageSend.<init>(JavadocMessageSend, int) line: 20	
			CompletionJavadocParser.syntaxRecoverArgumentType(Object, List, Object) line: 860	
			CompletionJavadocParser.parseArguments(Object) line: 453	
			CompletionJavadocParser(AbstractCommentParser).parseMember(Object) line: 763	
			CompletionJavadocParser(AbstractCommentParser).parseReference() line: 1204	
			CompletionJavadocParser.parseReference() line: 543	
			CompletionJavadocParser(JavadocParser).parseTag(int) line: 593	
			CompletionJavadocParser.parseTag(int) line: 556	
			CompletionJavadocParser(AbstractCommentParser).commentParse() line: 242	
			CompletionJavadocParser.commentParse() line: 99	
			
moving to 4.7
Comment 2 Eclipse Genie CLA 2020-09-03 09:31:32 EDT
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.
Comment 3 Eclipse Genie CLA 2022-10-21 05:30:45 EDT
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.