Skip to content

Commit

Permalink
VMs is toolchains are not detected
Browse files Browse the repository at this point in the history
A wrong/too early guard was preventing from actually processing the VM
installation.

Also explicit a test transitively requires Java 1.8 to run
  • Loading branch information
mickaelistria committed Jun 13, 2023
1 parent d31ccee commit 6e71772
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
21 changes: 13 additions & 8 deletions org.eclipse.m2e.jdt.tests/projects/basicProjectWithDep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
<groupId>ewq</groupId>
<artifactId>bugM2e2</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,16 @@ private void addToolchain(ToolchainModel toolchain) {
.noneMatch(install -> isSameCanonicalFile(candidate, install))) {
VMStandin workingCopy = new VMStandin(standardType, candidate.getAbsolutePath());
workingCopy.setInstallLocation(candidate);
if (workingCopy.getJavaVersion() != null) {
String name = candidate.getName();
int i = 1;
while (isDuplicateName(name)) {
name = candidate.getName() + '(' + i++ + ')';
}
workingCopy.setName(name);
IVMInstall newVM = workingCopy.convertToRealVM();
// next lines workaround https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/248
if (!(newVM instanceof IVMInstall2 newVM2 && newVM2.getJavaVersion() != null)) {
standardType.disposeVMInstall(newVM.getId());
}
String name = candidate.getName();
int i = 1;
while (isDuplicateName(name)) {
name = candidate.getName() + '(' + i++ + ')';
}
workingCopy.setName(name);
IVMInstall newVM = workingCopy.convertToRealVM();
// next lines workaround https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/248
if (!(newVM instanceof IVMInstall2 newVM2 && newVM2.getJavaVersion() != null)) {
standardType.disposeVMInstall(newVM.getId());
}
}
});
Expand Down

0 comments on commit 6e71772

Please sign in to comment.