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 more general Map interface for setOptions() #3610

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Jan 24, 2025

and log any error

@jukzi
Copy link
Contributor Author

jukzi commented Jan 27, 2025

00:05:24.187  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.11-SNAPSHOT:verify (verify) on project org.eclipse.jdt.core: There are API errors:
00:05:24.187  model/org/eclipse/jdt/core/JavaCore.java:172 The method org.eclipse.jdt.core.JavaCore.setOptions(Hashtable<String,String>) has been removed
00:05:24.187  model/org/eclipse/jdt/core/JavaCore.java:6419 Missing @since tag on setOptions(Map<String,String>)
00:05:24.187  META-INF/MANIFEST.MF:5 The major version should be incremented in version 3.41.0, since API breakage occurred since version 3.40.0

and log any error

getUnmodifiableOptions() avoids to copy the cached options on each call
@jukzi
Copy link
Contributor Author

jukzi commented Jan 28, 2025

@carstenartur is this what you want?

@carstenartur
Copy link
Contributor

@carstenartur is this what you want?

Basically, yes - something like this.

The code itself still is creating copies of maps in some situations that popped up as performance hotspot back when I investigated using the sap hana tools on Eclipse years ago.

I barely remember any details and don't have the time to investigate again right now. And imho you are a better java and Eclipse developer than me anyway ;)

What might be helpful is to put the recipe to reproduce an issue with multithreading and options into a junit test:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=360711#c37

@jukzi
Copy link
Contributor Author

jukzi commented Jan 29, 2025

There are callers like org.eclipse.jdt.core.ICompilationUnit.getOptions(boolean) which would try to modify the returned map, so one has to be careful in refactoring to use a unmodifiable map.

@jukzi
Copy link
Contributor Author

jukzi commented Jan 29, 2025

For example the BasApiAnalyzer during full build of platform workspace spends ~3s in getOptions()
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants