eclipse-jdt / eclipse-jdt/eclipse.jdt.debug

`AbstractVMInstall.evaluateSystemProperties()` never invalidates its cache

Open
#845 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
23
Forks
68
Avg merge
1d 4h
Merged PRs (30d)
13

Description

RCPTT uses
```
AbstractVMInstall.evaluateSystemProperties(new String[]{"os.arch", "sun.arch.data.model"}, null)
```
to detect application architectures supported by a given VM installation.

When another VM is installed into the same location, the returned values are stale (internally cached and the cache is never invalidated). Removal and re-registration of the VM installation does not help.

# Workaround:
- Shutdown Eclipse
- Remove stale lines from `.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs` manually

I've considered submitting a test case, but JDT seems to use this API internally for a very exotic scenario so JDT-relevant test steps would be extremely convoluted.

https://github.com/eclipse-jdt/eclipse.jdt.debug/blob/5c70abcb63dfd2f2d7613fc531c1e8f4828d06e9/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java#L243-L247

Should this API be deprecated?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.