Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use StubUtility from o.e.jdt.core.manipulation. #793

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

rgrunber
Copy link
Contributor

  • With http://eclip.se/534221 complete, we can can reduce copies for
    classes like StubUtility, CodeTemplateContext, and CodeTemplateContextType.
  • Update target platform to use 4.10 I-builds.
  • 32 bit architectures have been removed from 4.10

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=536766 for information on the dropping of 32 bit support in 4.10.

@fbricon
Copy link
Contributor

fbricon commented Sep 19, 2018

@snjeza can you check how jdt.ls behaves on a 32bits VM? does it start with/without this PR?

Copy link
Contributor

@snjeza snjeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check how jdt.ls behaves on a 32bits VM? does it start with/without this PR?

@fbricon jdt.ls starts on JDK 1.8.0_181 32bits with and without this PR. I have tested on Linux, Windows and docker 32bit VM (https://github.com/cortinico/docker-java8-32bit)

private static final String CODETEMPLATES_PREFIX = "java.codetemplates."; //$NON-NLS-1$
public static final String COMMENT_SUFFIX = ".comment"; //$NON-NLS-1$
public static final String BODY_SUFFIX = ".body"; //$NON-NLS-1$
private static final String CODETEMPLATES_PREFIX = "org.eclipse.jdt.ui.text.codetemplates."; //$NON-NLS-1$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a jdt.ui namespaced prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in order to access the following code template definitions, https://github.com/eclipse/eclipse.jdt.ui/blob/master/org.eclipse.jdt.ui/templates/default-codetemplates.xml . Currently they're defined in jdt.ui. Perhaps they could be moved in the future and even have their namespace changed but haven't looked into it yet.

I'll definitely take care of the other issues mentioned.

};

TemplatePersistenceData [] templateData = new TemplatePersistenceData [templates.length];
for (int i = 0; i < templates.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enhanced for loop please :-)

TemplateReaderWriter trw = new TemplateReaderWriter();
try (Writer wrt = new StringWriter()) {
trw.save(templateData, wrt);
defEclipsePrefs.put("org.eclipse.jdt.ls.core.custom_code_templates", wrt.toString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract "org.eclipse.jdt.ls.core.custom_code_templates" as constant

- With http://eclip.se/534221 complete, we can can reduce copies for
classes like StubUtility, CodeTemplateContext, and CodeTemplateContextType.
- Update target platform to use 4.10 I-builds.
- 32 bit architectures have been removed from 4.10

Signed-off-by: Roland Grunberg <[email protected]>
@fbricon fbricon merged commit e64573e into eclipse-jdtls:master Sep 26, 2018
@fbricon fbricon added this to the End September 2018 milestone Sep 26, 2018
@rgrunber rgrunber deleted the bug-534221 branch September 28, 2018 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants