Bug 396270 - [quick assist] 'Combine to single String' option does not appear if the selected String contains additional space.
Summary: [quick assist] 'Combine to single String' option does not appear if the selec...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Midhun Vishnukripa CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2012-12-11 08:39 EST by Martin Mathew CLA
Modified: 2019-10-06 16:27 EDT (History)
3 users (show)

See Also:
noopur_gupta: review-
noopur_gupta: review-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mathew CLA 2012-12-11 08:39:45 EST
public class StringConcat {

	protected void concat(){
		String s = "a"+"B"+"1" ;
		System.out.println(s);
	}
}
1. Select the String <"a"+"B"+"1" > in the above code with the additional space
2. Invoke Quick Assist(Ctrl+1)

Issue : 'Combine to single String' option is not available. The option reappears when the additional space is removed from the selection.
Comment 1 Dani Megert CLA 2012-12-12 03:58:57 EST
Billy, would you want to work on this?
Comment 2 Billy Huang CLA 2012-12-12 10:15:23 EST
Sure, I'll take this.
Comment 3 Eclipse Genie CLA 2016-06-14 21:48:07 EDT
New Gerrit change created: https://git.eclipse.org/r/75288
Comment 4 Noopur Gupta CLA 2016-06-15 02:27:17 EDT
Midhun, this results in test failures in AssistQuickFixTest.java.

See the Gerrit build failure details here:
https://hudson.eclipse.org/platform/job/eclipse.jdt.ui-Gerrit/841/
Comment 5 Eclipse Genie CLA 2016-06-15 10:21:58 EDT
New Gerrit change created: https://git.eclipse.org/r/75312
Comment 6 Noopur Gupta CLA 2016-06-20 09:14:22 EDT
Midhun, you should amend the existing Gerrit request to upload the new patch set instead of creating a new Gerrit request. I have abandoned the first one now. See: https://wiki.eclipse.org/EGit/User_Guide#Amending_Commits

Review comments:
- The new test case is not correct. It should check that the proposal exists now after your fix (#assertExpectedExistInProposals).
- Do not add any additional whitespace in the patch. 
- Follow proper coding conventions. See: https://wiki.eclipse.org/JDT_UI/How_to_Contribute#Coding_Conventions
Example: if statements always use braces {}.
- In the fix, you are always using "fragmentList.get(0)". Even if I select the second fragment <"a" + "b" + "2" > in the following example, your fix will still convert the first fragment to single string:
String s1 = "x" + "y" + "1" , s2 = "a" + "b" + "2" ;
Try to look for a generic solution.
Comment 7 Eclipse Genie CLA 2019-10-06 16:27: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.