diff options
20 files changed, 364 insertions, 292 deletions
diff --git a/.gitignore b/.gitignore index 0751d5c9a..45f18ebe9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # . workspace debug-workspace +m2 # Ignored throughout the whole tree bin/ diff --git a/admin/pom-build.xml b/admin/pom-build.xml index 41196a415..f1e44545b 100644 --- a/admin/pom-build.xml +++ b/admin/pom-build.xml @@ -62,25 +62,24 @@ </profile> <profile> - <id>findbugs</id> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - </plugin> - </plugins> - </build> - </profile> - - <profile> <id>static-checks</id> <build> <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - </plugin> + <plugin> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> + <version>4.5.3.0</version> + <configuration> + <excludeFilterFile>${adminDir}/findbugs-exclude.xml</excludeFilterFile> + <plugins> + <plugin> + <groupId>com.h3xstream.findsecbugs</groupId> + <artifactId>findsecbugs-plugin</artifactId> + <version>1.10.1</version> + </plugin> + </plugins> + </configuration> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> @@ -88,69 +87,5 @@ </plugins> </build> </profile> - - <profile> - <id>tests</id> - <build> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>target-platform-configuration</artifactId> - <configuration> - <dependency-resolution> - <extraRequirements> - <!-- product IU under test --> - <requirement> - <type>p2-installable-unit</type> - <id>org.eclipse.platform.ide</id> - <versionRange>0.0.0</versionRange> - </requirement> - <requirement> - <type>eclipse-feature</type> - <id>org.eclipse.sdk</id> - <versionRange>0.0.0</versionRange> - </requirement> - <requirement> - <type>eclipse-feature</type> - <id>org.eclipse.cdt.platform</id> - <versionRange>0.0.0</versionRange> - </requirement> - <requirement> - <type>eclipse-feature</type> - <id>org.eclipse.remote</id> - <versionRange>0.0.0</versionRange> - </requirement> - <requirement> - <type>eclipse-feature</type> - <id>org.eclipse.swtbot.eclipse</id> - <versionRange>0.0.0</versionRange> - </requirement> - </extraRequirements> - </dependency-resolution> - </configuration> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <includes> - <include>org.eclipse.tcf*</include> - </includes> - <excludes> - <exclude>org.eclipse.tcf.debug.test*</exclude> - <exclude>org.eclipse.tcf.te.tests.*</exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> </profiles> </project> diff --git a/admin/pom-config.xml b/admin/pom-config.xml index 54e885758..86dacae4f 100644 --- a/admin/pom-config.xml +++ b/admin/pom-config.xml @@ -32,7 +32,7 @@ <organization> <name>Eclipse Foundation</name> - <url>http://www.eclipse.org/</url> + <url>https://www.eclipse.org/</url> </organization> <properties> @@ -42,7 +42,6 @@ <maven-resources-version>2.7</maven-resources-version> <maven-antrun-version>1.8</maven-antrun-version> <gmaven-version>1.5</gmaven-version> - <findbugs-version>3.0.4</findbugs-version> <!-- Check available versions at https://repository.sonatype.org/content/repositories/public/org/jacoco/jacoco-maven-plugin --> <jacoco-version>0.7.9</jacoco-version> <eclipse-jarsigner-version>1.3.2</eclipse-jarsigner-version> @@ -61,17 +60,13 @@ <!-- P2 repository URL's --> <!-- Default: Eclipse 3.8.x (Juno), CDT 8.3.0 (Kepler SR2), TM 4.0 + Remote 2.0 (Mars) --> - <platform-site>http://download.eclipse.org/eclipse/updates/3.8</platform-site> - <license-site>http://download.eclipse.org/cbi/updates/license</license-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/kepler</cdt-site> - <tm-site>http://download.eclipse.org/tm/updates/4.0</tm-site> - <terminal-site>http://download.eclipse.org/tm/terminal/updates/4.0</terminal-site> + <platform-site>https://download.eclipse.org/eclipse/updates/3.8</platform-site> + <license-site>https://download.eclipse.org/cbi/updates/license</license-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/kepler</cdt-site> + <tm-site>https://download.eclipse.org/tm/updates/4.0</tm-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.0</terminal-site> <!-- TCF needs gson-2.2.4 which was added to Orbit in Luna SR2 --> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/</orbit-site> - <!-- SWTBot-2.4 and later require an e4-based Eclipse eg Juno or later: --> - <!-- See http://wiki.eclipse.org/SWTBot/Releases --> - <!-- Also, newer SWTBot needs JUnit 4.12 which is only in Orbit Mars and newer --> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.2.1/</swtbot-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/</orbit-site> </properties> <repositories> @@ -105,11 +100,6 @@ <url>${tm-site}</url> <layout>p2</layout> </repository> - <repository> - <id>swtbot</id> - <url>${swtbot-site}</url> - <layout>p2</layout> - </repository> </repositories> <pluginRepositories> @@ -148,7 +138,7 @@ <id>kepler</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.3</platform-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.3</platform-site> </properties> </profile> @@ -157,8 +147,8 @@ <id>luna</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.4</platform-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/8.6</cdt-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.4</platform-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/8.6</cdt-site> </properties> </profile> @@ -167,10 +157,9 @@ <id>mars</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.5</platform-site> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20160221192158/repository</orbit-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/8.8.1</cdt-site> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.5.0</swtbot-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.5</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20160221192158/repository</orbit-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/8.8.1</cdt-site> </properties> </profile> @@ -179,12 +168,11 @@ <id>neon</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.6</platform-site> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository</orbit-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/9.2</cdt-site> - <terminal-site>http://download.eclipse.org/tm/terminal/updates/4.2</terminal-site> - <tm-site>http://download.eclipse.org/tm/updates/4.2</tm-site> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.5.0</swtbot-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.6</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository</orbit-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/9.2</cdt-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.2</terminal-site> + <tm-site>https://download.eclipse.org/tm/updates/4.2</tm-site> </properties> <!-- Workaround for CDT release problem: @@ -194,24 +182,35 @@ <repositories> <repository> <id>cdt-launchbar</id> - <url>http://download.eclipse.org/tools/cdt/launchbar/neon.2</url> + <url>https://download.eclipse.org/tools/cdt/launchbar/neon.2</url> <layout>p2</layout> </repository> </repositories> </profile> <profile> - <!-- Eclipse 4.7.1 (Oxygen), CDT 9.3 --> + <!-- Eclipse 4.7 (Oxygen), CDT 9.3 --> <id>oxygen</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.7</platform-site> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/repository</orbit-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/9.3</cdt-site> - <terminal-site>http://download.eclipse.org/tm/terminal/updates/4.3</terminal-site> - <tm-site>http://download.eclipse.org/tm/updates/4.3milestones</tm-site> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.6.0/</swtbot-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.7</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/repository</orbit-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/9.3/cdt9.3.3</cdt-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.3</terminal-site> + <tm-site>https://download.eclipse.org/tm/updates/4.3milestones</tm-site> </properties> + + <!-- Workaround for CDT release problem: + Missing requirement: org.eclipse.cdt.debug.core 8.2.0.201710130142 requires + 'bundle org.eclipse.launchbar.core 2.0.0' but it could not be found + --> + <repositories> + <repository> + <id>cdt-launchbar</id> + <url>https://download.eclipse.org/tools/cdt/launchbar/neon.2</url> + <layout>p2</layout> + </repository> + </repositories> </profile> <profile> @@ -219,13 +218,24 @@ <id>photon</id> <properties> - <platform-site>http://download.eclipse.org/eclipse/updates/4.8</platform-site> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository</orbit-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/9.4</cdt-site> - <terminal-site>http://download.eclipse.org/tm/terminal/updates/4.4milestones</terminal-site> - <tm-site>http://download.eclipse.org/tm/updates/4.3milestones</tm-site> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.7.0</swtbot-site> + <platform-site>https://download.eclipse.org/eclipse/updates/4.8</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository</orbit-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/9.4/cdt-9.4.3</cdt-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.4milestones</terminal-site> + <tm-site>https://download.eclipse.org/tm/updates/4.3milestones</tm-site> </properties> + + <!-- Workaround for CDT release problem: + Missing requirement: org.eclipse.cdt.debug.core 8.3.0.201802261533 requires + 'bundle org.eclipse.launchbar.core 2.0.0' but it could not be found + --> + <repositories> + <repository> + <id>cdt-launchbar</id> + <url>https://download.eclipse.org/tools/cdt/launchbar/neon.2</url> + <layout>p2</layout> + </repository> + </repositories> </profile> <profile> @@ -233,12 +243,35 @@ <id>2018-09</id> <properties> - <platform-site>http://download.eclipse.org/releases/2018-09</platform-site> - <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository</orbit-site> - <cdt-site>http://download.eclipse.org/tools/cdt/releases/9.5</cdt-site> - <terminal-site>http://download.eclipse.org/tm/terminal/updates/4.4milestones</terminal-site> - <tm-site>http://download.eclipse.org/tm/updates/4.5.0-SNAPSHOT/repository</tm-site> - <swtbot-site>http://download.eclipse.org/technology/swtbot/releases/2.7.0</swtbot-site> + <platform-site>https://download.eclipse.org/releases/2018-09</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository</orbit-site> + <cdt-site>https://archive.eclipse.org/tools/cdt/releases/9.5/cdt-9.5.5</cdt-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.4milestones</terminal-site> + <tm-site>https://download.eclipse.org/tm/updates/4.5.0-SNAPSHOT/repository</tm-site> + </properties> + + <repositories> + <!-- Terminal is merged with TM --> + <repository> + <id>terminal</id> + <snapshots><enabled>false</enabled></snapshots> + <releases><enabled>false</enabled></releases> + <url>${terminal-site}</url> + <layout>p2</layout> + </repository> + </repositories> + </profile> + + <profile> + <!-- Eclipse 2021-12 (4.22.0), CDT 10.5 --> + <id>2021-12</id> + + <properties> + <platform-site>https://download.eclipse.org/releases/2021-12</platform-site> + <orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository</orbit-site> + <cdt-site>https://download.eclipse.org/tools/cdt/releases/10.5</cdt-site> + <terminal-site>https://download.eclipse.org/tm/terminal/updates/4.4milestones</terminal-site> + <tm-site>https://download.eclipse.org/tm/updates/4.5.300-SNAPSHOT/repository</tm-site> </properties> <repositories> @@ -280,21 +313,11 @@ <environment> <os>linux</os> <ws>gtk</ws> - <arch>x86</arch> - </environment> - <environment> - <os>linux</os> - <ws>gtk</ws> <arch>x86_64</arch> </environment> <environment> <os>win32</os> <ws>win32</ws> - <arch>x86</arch> - </environment> - <environment> - <os>win32</os> - <ws>win32</ws> <arch>x86_64</arch> </environment> <environment> @@ -385,24 +408,17 @@ <version>${gmaven-version}</version> </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>${findbugs-version}</version> - <configuration> - <encoding>UTF-8</encoding> - <effort>Max</effort> - <threshold>Low</threshold> - <xmlOutput>true</xmlOutput> - <failOnError>false</failOnError> - <excludeFilterFile>${adminDir}/findbugs-exclude.xml</excludeFilterFile> - </configuration> - <executions> - <execution> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> + <version>4.5.3.0</version> + <dependencies> + <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs --> + <dependency> + <groupId>com.github.spotbugs</groupId> + <artifactId>spotbugs</artifactId> + <version>4.6.0</version> + </dependency> + </dependencies> </plugin> <plugin> <groupId>org.jacoco</groupId> @@ -487,7 +503,7 @@ <configuration> <baselineRepositories> <repository> - <url>http://download.eclipse.org/tools/tcf/builds/${tcf-stream}/nightly</url> + <url>https://download.eclipse.org/tools/tcf/builds/${tcf-stream}/nightly</url> </repository> </baselineRepositories> </configuration> diff --git a/admin/target-defs/eclipse-3.8.2-juno.target b/admin/target-defs/eclipse-3.8.2-juno.target index 0263f7239..31fa30da9 100644 --- a/admin/target-defs/eclipse-3.8.2-juno.target +++ b/admin/target-defs/eclipse-3.8.2-juno.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/juno"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.2.1.201402241301"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.2.1.201402241301"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.2.1.201402241301"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.2.1.201402241301"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201305281000"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/2.2.1"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="4.0.0.201506040610"/> <unit id="org.eclipse.tm.terminal.view.rse.sdk.feature.feature.group" version="4.0.0.201506040610"/> <repository location="http://download.eclipse.org/tm/terminal/updates/4.0"/> @@ -36,7 +26,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.feature.group" version="8.3.0.201402142303"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/kepler"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/kepler"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.2.4.v201311231704"/> diff --git a/admin/target-defs/eclipse-4.3.x-kepler.target b/admin/target-defs/eclipse-4.3.x-kepler.target index 16c525926..83856ef0c 100644 --- a/admin/target-defs/eclipse-4.3.x-kepler.target +++ b/admin/target-defs/eclipse-4.3.x-kepler.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/kepler"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.5.0.201609021837"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/2.5.0"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="4.0.0.201506040610"/> <unit id="org.eclipse.tm.terminal.view.rse.sdk.feature.feature.group" version="4.0.0.201506040610"/> <repository location="http://download.eclipse.org/tm/terminal/updates/4.0"/> @@ -36,7 +26,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.feature.group" version="8.3.0.201402142303"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/kepler"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/kepler"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.2.4.v201311231704"/> diff --git a/admin/target-defs/eclipse-4.4.x-luna.target b/admin/target-defs/eclipse-4.4.x-luna.target index ab3c60221..5a798e822 100644 --- a/admin/target-defs/eclipse-4.4.x-luna.target +++ b/admin/target-defs/eclipse-4.4.x-luna.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/luna"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.5.0.201609021837"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/2.5.0"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="4.0.0.201506040610"/> <unit id="org.eclipse.tm.terminal.view.rse.sdk.feature.feature.group" version="4.0.0.201506040610"/> <repository location="http://download.eclipse.org/tm/terminal/updates/4.0"/> @@ -36,7 +26,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.feature.group" version="8.6.0.201502131403"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/8.6"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/8.6"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.2.4.v201311231704"/> diff --git a/admin/target-defs/eclipse-4.5.x-mars.target b/admin/target-defs/eclipse-4.5.x-mars.target index 515d6fd2f..eea1d8a2d 100644 --- a/admin/target-defs/eclipse-4.5.x-mars.target +++ b/admin/target-defs/eclipse-4.5.x-mars.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/mars"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.5.0.201609021837"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/2.5.0"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="4.0.0.201506040610"/> <unit id="org.eclipse.tm.terminal.view.rse.sdk.feature.feature.group" version="4.0.0.201506040610"/> <repository location="http://download.eclipse.org/tm/terminal/updates/4.0"/> @@ -36,7 +26,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.feature.group" version="8.7.0.201506070905"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/8.8.1"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/8.8.1"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.2.4.v201311231704"/> diff --git a/admin/target-defs/eclipse-4.6.x-neon.target b/admin/target-defs/eclipse-4.6.x-neon.target index 5bf7324d9..721f5108e 100644 --- a/admin/target-defs/eclipse-4.6.x-neon.target +++ b/admin/target-defs/eclipse-4.6.x-neon.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/neon"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.5.0.201609021837"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/2.5.0"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.connector.remote.sdk.feature.feature.group" version="4.3.0.201706140544"/> <unit id="org.eclipse.tm.terminal.sdk.feature.feature.group" version="4.2.0.201611281915"/> <unit id="org.eclipse.tm.terminal.view.rse.sdk.feature.feature.group" version="4.3.0.201706140544"/> @@ -37,7 +27,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.sdk.feature.group" version="9.2.1.201704050430"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/9.2"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/9.2"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.2.4.v201311231704"/> diff --git a/admin/target-defs/eclipse-4.7.x-oxygen.target b/admin/target-defs/eclipse-4.7.x-oxygen.target index fdcceda8a..a707a195e 100644 --- a/admin/target-defs/eclipse-4.7.x-oxygen.target +++ b/admin/target-defs/eclipse-4.7.x-oxygen.target @@ -15,16 +15,6 @@ <repository location="http://download.eclipse.org/releases/oxygen"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.6.0.201706141832"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/latest"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.connector.cdtserial.sdk.feature.feature.group" version="4.3.0.201706140544"/> <unit id="org.eclipse.tm.terminal.connector.remote.sdk.feature.feature.group" version="4.3.0.201706140544"/> <unit id="org.eclipse.tm.terminal.connector.serial.sdk.feature.feature.group" version="4.3.0.201706140544"/> @@ -38,7 +28,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.sdk.feature.group" version="9.4.3.201802261533"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/9.4"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/9.3/cdt9.3.3"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.7.0.v20170129-0911"/> diff --git a/admin/target-defs/eclipse-4.8.x-photon.target b/admin/target-defs/eclipse-4.8.x-photon.target index fbef505ad..4e91f5671 100644 --- a/admin/target-defs/eclipse-4.8.x-photon.target +++ b/admin/target-defs/eclipse-4.8.x-photon.target @@ -14,16 +14,6 @@ <repository location="http://download.eclipse.org/staging/photon"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="org.apache.log4j" version="1.2.15.v201012070815"/> -<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.forms.feature.group" version="2.6.0.201706141832"/> -<unit id="org.eclipse.swtbot.ide.feature.group" version="2.6.0.201706141832"/> -<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/> -<unit id="org.hamcrest.library" version="1.3.0.v201505072020"/> -<repository location="http://download.eclipse.org/technology/swtbot/releases/latest"/> -</location> -<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.tm.terminal.connector.cdtserial.sdk.feature.feature.group" version="4.3.0.201803121138"/> <unit id="org.eclipse.tm.terminal.connector.remote.sdk.feature.feature.group" version="4.3.0.201803121138"/> <unit id="org.eclipse.tm.terminal.connector.serial.sdk.feature.feature.group" version="4.3.0.201803121138"/> @@ -37,7 +27,7 @@ </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="org.eclipse.cdt.sdk.feature.group" version="9.5.0.201806170908"/> -<repository location="http://download.eclipse.org/tools/cdt/releases/9.5"/> +<repository location="https://archive.eclipse.org/tools/cdt/releases/9.4/cdt-9.4.3"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="com.google.gson" version="2.7.0.v20170129-0911"/> diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java index 7f0f91074..8f78bbe34 100644 --- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java +++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010-2021 Wind River Systems, Inc. and others. + * Copyright (c) 2010-2022 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -203,15 +203,13 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend { @Override public void changed(String context_id) { - if (fMemoryContext == null) - return; - if (!fMemoryContext.getID().equals(context_id)) - return; - if (fCallback == null) - return; + if (fMemoryContext == null) return; + if (!fMemoryContext.getID().equals(context_id)) return; + if (fCallback == null) return; try { fCallback.getClass().getMethod("refresh").invoke(fCallback); - } catch (Exception e) { + } + catch (Exception e) { } } } @@ -232,15 +230,13 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend { @Override public void memoryChanged(String context_id, Number[] addr, long[] size) { - if (fMemoryContext == null) - return; - if (!fMemoryContext.getID().equals(context_id)) - return; - if (fCallback == null) - return; + if (fMemoryContext == null) return; + if (!fMemoryContext.getID().equals(context_id)) return; + if (fCallback == null) return; try { fCallback.getClass().getMethod("refresh").invoke(fCallback); - } catch (Exception e) { + } + catch (Exception e) { } } } @@ -654,7 +650,9 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend { if (!done_disassembly) { Map<String, Object> params = new HashMap<String, Object>(); - disass.disassemble(mem.getID(), startAddress, accessSize, params, new DoneDisassemble() { + /* Use thread, not memory context, to allow disassembler to check CPU mode. */ + /* It can improve disassembler accuracy, at least around current PC. */ + disass.disassemble(request.ctx.getID(), startAddress, accessSize, params, new DoneDisassemble() { @Override public void doneDisassemble(IToken token, final Throwable error, IDisassemblyLine[] res) { if (error != null) { diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java index 2f78f2109..31e3bb740 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011-2020 Wind River Systems, Inc. and others. + * Copyright (c) 2011-2022 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -67,9 +67,9 @@ public class PeerListControl implements ISelectionProvider { public static class PeerInfo { public String id; public IPeer peer; + public Map<String,String> attrs; PeerInfo parent; - Map<String,String> attrs; PeerInfo[] children; boolean children_pending; Throwable children_error; diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java index c611584b2..c74b9ff2c 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/launch/TCFLocalAgent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2009-2022 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -60,9 +60,7 @@ public class TCFLocalAgent { String arch = System.getProperty("os.arch"); if (arch.equals("x86")) arch = "i386"; if (arch.equals("i686")) arch = "i386"; - if (os.startsWith("Windows")) { - os = "Windows"; - } + if (os.startsWith("Windows")) os = "Windows"; if (os.equals("Linux")) os = "GNU/Linux"; return os + "/" + arch; } diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java index 1980cab8c..d7cbdd0a7 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others. + * Copyright (c) 2007-2022 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -107,6 +107,7 @@ public class TCFBreakpointsModel { protected final String marker_id; private final String marker_file; private final String marker_type; + private boolean exec_done; IBreakpoints service; IBreakpoints.DoneCommand done; @@ -124,15 +125,25 @@ public class TCFBreakpointsModel { } synchronized void exec() throws InterruptedException { + assert !exec_done; assert !Protocol.isDispatchThread(); if (marker_id != null) { Protocol.invokeLater(this); - wait(); + while (!exec_done) wait(); } } + private synchronized void exec_done() { + exec_done = true; + BreakpointUpdate.this.notify(); + } + + @Override public void run() { - if (disposed) return; + if (disposed) { + exec_done(); + return; + } if (removed) id2bp.remove(marker_id); else id2bp.put(marker_id, breakpoint); if (is_local) { @@ -150,9 +161,7 @@ public class TCFBreakpointsModel { } Protocol.sync(new Runnable() { public void run() { - synchronized (BreakpointUpdate.this) { - BreakpointUpdate.this.notify(); - } + exec_done(); } }); }; @@ -265,7 +274,13 @@ public class TCFBreakpointsModel { if (map.isEmpty()) return; Runnable r = new Runnable() { public void run() { - if (disposed) return; + if (disposed) { + synchronized (map) { + map.clear(); + map.notify(); + return; + } + } for (final IChannel channel : channels.keySet()) { IBreakpoints service = channel.getRemoteService(IBreakpoints.class); Set<String> ids = new HashSet<String>(); @@ -288,6 +303,7 @@ public class TCFBreakpointsModel { Protocol.sync(new Runnable() { public void run() { synchronized (map) { + map.clear(); map.notify(); } } @@ -297,7 +313,7 @@ public class TCFBreakpointsModel { synchronized (map) { assert !Protocol.isDispatchThread(); Protocol.invokeLater(r); - map.wait(); + while (!map.isEmpty()) map.wait(); } } catch (Throwable x) { diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java index 02f8e5397..65a33225f 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java @@ -79,7 +79,7 @@ class RunControl { } public void contextSuspended(final String id, String pc, String reason, Map<String,Object> params) { - if (enable_trace) System.out.println("" + channel_id + " suspended " + id); + if (enable_trace) System.out.println("" + channel_id + " suspended " + id + ": " + pc + " " + reason); suspended_ctx_ids.add(id); Protocol.invokeLater(new Runnable() { public void run() { diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java index e6683ff9a..06d77453e 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java @@ -471,16 +471,36 @@ class TestExpressions implements ITCFTest, RunControl.DiagnosticTestDone, } assert test_done || !canResume(thread_id); if (stack_trace == null) { - srv_stk.getChildren(thread_id, new IStackTrace.DoneGetChildren() { + srv_stk.getChildrenRange(thread_id, 0, 5, new IStackTrace.DoneGetChildren() { public void doneGetChildren(IToken token, Exception error, String[] context_ids) { - if (error != null) { + if (error instanceof IErrorReport && ((IErrorReport)error).getErrorCode() == IErrorReport.TCF_ERROR_INV_COMMAND) { + /* Older agent, the command not available */ + srv_stk.getChildren(thread_id, new IStackTrace.DoneGetChildren() { + public void doneGetChildren(IToken token, Exception error, String[] context_ids) { + if (error != null) { + exit(error); + } + else if (context_ids == null || context_ids.length < 2) { + exit(new Exception("Invalid stack trace")); + } + else { + stack_trace = context_ids; + runTest(); + } + } + }); + } + else if (error != null) { exit(error); } else if (context_ids == null || context_ids.length < 2) { exit(new Exception("Invalid stack trace")); } else { - stack_trace = context_ids; + stack_trace = new String[context_ids.length]; + for (int i = 0; i < context_ids.length; i++) { + stack_trace[context_ids.length - i - 1] = context_ids[i]; + } runTest(); } } @@ -506,18 +526,18 @@ class TestExpressions implements ITCFTest, RunControl.DiagnosticTestDone, int j = stack_trace.length - i - 2; if (i >= context_ids.length) { if (j >= 0) { - exit(new Exception("Invalid result of doneGetChildren command: too short")); + exit(new Exception("Invalid result of getChildrenRange command: too short")); } } else { if (j < 0) { - exit(new Exception("Invalid result of doneGetChildren command: too long")); + exit(new Exception("Invalid result of getChildrenRange command: too long")); } if (context_ids[i]== null) { - exit(new Exception("Invalid result of doneGetChildren command: ID is null")); + exit(new Exception("Invalid result of getChildrenRange command: ID is null")); } if (!context_ids[i].equals(stack_trace[j])) { - exit(new Exception("Invalid result of doneGetChildren command: wrong ID")); + exit(new Exception("Invalid result of getChildrenRange command: wrong ID")); } } } diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java index 292878151..d1f18d090 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java @@ -1475,7 +1475,9 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl. if (isMyBreakpoint(sc)) { rm = rnd.nextInt(6); if (!ctx.canResume(rm)) rm = IRunControl.RM_RESUME; + /* TODO: a better way to test step counter if (rm != IRunControl.RM_RESUME) cnt = rnd.nextInt(5) + 1; + */ } test_rc.resume(id, rm, cnt); } diff --git a/plugins/org.eclipse.tcf/src/org/eclipse/tcf/ssl/TCFSecurityManager.java b/plugins/org.eclipse.tcf/src/org/eclipse/tcf/ssl/TCFSecurityManager.java index 27964c425..a8fc5d6bc 100644 --- a/plugins/org.eclipse.tcf/src/org/eclipse/tcf/ssl/TCFSecurityManager.java +++ b/plugins/org.eclipse.tcf/src/org/eclipse/tcf/ssl/TCFSecurityManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009-2018 Wind River Systems, Inc. and others. + * Copyright (c) 2009-2022 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -215,22 +215,25 @@ public class TCFSecurityManager { public X509Certificate[] getAcceptedIssuers() { ArrayList<X509Certificate> list = new ArrayList<X509Certificate>(); - for (String fnm : usr_certs.list()) { - if (!fnm.endsWith(".cert")) continue; //$NON-NLS-1$ - InputStream inp = null; - try { - inp = new BufferedInputStream(new FileInputStream(new File(usr_certs, fnm))); - X509Certificate cert = (X509Certificate)cf.generateCertificate(inp); - inp.close(); - list.add(cert); - } - catch (Throwable x) { - Protocol.log("Cannot load certificate: " + fnm, x); //$NON-NLS-1$ + String[] usr_list = usr_certs.list(); + if (usr_list != null) { + for (String fnm : usr_list) { + if (!fnm.endsWith(".cert")) continue; //$NON-NLS-1$ + InputStream inp = null; try { - if (inp != null) inp.close(); + inp = new BufferedInputStream(new FileInputStream(new File(usr_certs, fnm))); + X509Certificate cert = (X509Certificate)cf.generateCertificate(inp); + inp.close(); + list.add(cert); } - catch (IOException e) { - Protocol.log("Cannot close certificate file: " + fnm, x); //$NON-NLS-1$ + catch (Throwable x) { + Protocol.log("Cannot load certificate: " + fnm, x); //$NON-NLS-1$ + try { + if (inp != null) inp.close(); + } + catch (IOException e) { + Protocol.log("Cannot close certificate file: " + fnm, x); //$NON-NLS-1$ + } } } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java index 7859b7fc2..875718c57 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved. + * Copyright (c) 2011-2022 Wind River Systems, Inc. and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License 2.0 which accompanies this distribution, and is * available at https://www.eclipse.org/legal/epl-2.0/ @@ -14,7 +14,6 @@ import org.eclipse.core.expressions.EvaluationResult; import org.eclipse.core.expressions.ICountable; import org.eclipse.core.expressions.IEvaluationContext; import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.internal.expressions.CountExpression; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; @@ -38,7 +37,6 @@ import org.eclipse.ui.navigator.INavigatorContentService; /** * Category property tester. */ -@SuppressWarnings("restriction") public class CategoryPropertyTester extends PropertyTester { /* (non-Javadoc) diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CountExpression.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CountExpression.java new file mode 100644 index 000000000..4d75d93db --- /dev/null +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CountExpression.java @@ -0,0 +1,155 @@ +/*******************************************************************************
+ * Copyright (c) 2000, 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation.
+ * Ian Phillips - additional expressions support ( "-N)", "(N-" ).
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.views.internal.categories;
+
+import java.util.Collection;
+
+import org.eclipse.core.expressions.EvaluationResult;
+import org.eclipse.core.expressions.Expression;
+import org.eclipse.core.expressions.ExpressionInfo;
+import org.eclipse.core.expressions.ICountable;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.w3c.dom.Element;
+
+
+public class CountExpression extends Expression {
+
+ private static final int GREATER_THAN = 7; // (N-
+ private static final int LESS_THAN = 6; // -N)
+ private static final int ANY_NUMBER = 5; // *
+ private static final int EXACT = 4; // N
+ private static final int ONE_OR_MORE = 3; // +
+ private static final int NONE_OR_ONE = 2; // ?
+ private static final int NONE = 1; // !
+ private static final int UNKNOWN = 0;
+
+ /**
+ * The seed for the hash code for all count expressions.
+ */
+ private static final int HASH_INITIAL= CountExpression.class.getName().hashCode();
+
+ private int fMode;
+ private int fSize;
+
+ public CountExpression(IConfigurationElement configElement) {
+ String size = configElement.getAttribute(ATT_VALUE);
+ initializeSize(size);
+ }
+
+ public CountExpression(Element element) {
+ String size = element.getAttribute(ATT_VALUE);
+ initializeSize(size.length() > 0 ? size : null);
+ }
+
+ public CountExpression(String size) {
+ initializeSize(size);
+ }
+
+ private void initializeSize(String size) {
+ if (size == null)
+ size= "*"; //$NON-NLS-1$
+ if (size.equals("*")) //$NON-NLS-1$
+ fMode= ANY_NUMBER;
+ else if (size.equals("?")) //$NON-NLS-1$
+ fMode= NONE_OR_ONE;
+ else if (size.equals("!")) //$NON-NLS-1$
+ fMode= NONE;
+ else if (size.equals("+")) //$NON-NLS-1$
+ fMode= ONE_OR_MORE;
+ else if (size.charAt(0) == '-' && size.charAt(size.length() - 1) == ')') {
+ try {
+ fMode = LESS_THAN;
+ fSize = Integer.parseInt(size.substring(1, size.length() - 1));
+ } catch (NumberFormatException e) {
+ fMode= UNKNOWN;
+ }
+ } else if (size.charAt(0) == '(' && size.charAt(size.length() - 1) == '-') {
+ try {
+ fMode = GREATER_THAN;
+ fSize = Integer.parseInt(size.substring(1, size.length() - 1));
+ } catch (NumberFormatException e) {
+ fMode= UNKNOWN;
+ }
+ } else {
+ try {
+ fSize= Integer.parseInt(size);
+ fMode= EXACT;
+ } catch (NumberFormatException e) {
+ fMode= UNKNOWN;
+ }
+ }
+ }
+
+ public static ICountable getAsICountable(Object var, Expression expression) {
+ if (var instanceof ICountable) return (ICountable)var;
+ IAdapterManager manager = Platform.getAdapterManager();
+ ICountable result = (ICountable)manager.getAdapter(var, ICountable.class);
+ return result;
+ }
+
+ @Override
+ public EvaluationResult evaluate(IEvaluationContext context) throws CoreException {
+ Object var = context.getDefaultVariable();
+ int size;
+ if (var instanceof Collection) {
+ size = ((Collection<?>)var).size();
+ } else {
+ ICountable countable = getAsICountable(var, this);
+ if (countable == null)
+ return EvaluationResult.NOT_LOADED;
+ size = countable.count();
+ }
+ switch (fMode) {
+ case UNKNOWN:
+ return EvaluationResult.FALSE;
+ case NONE:
+ return EvaluationResult.valueOf(size == 0);
+ case NONE_OR_ONE:
+ return EvaluationResult.valueOf(size == 0 || size == 1);
+ case ONE_OR_MORE:
+ return EvaluationResult.valueOf(size >= 1);
+ case EXACT:
+ return EvaluationResult.valueOf(fSize == size);
+ case ANY_NUMBER:
+ return EvaluationResult.TRUE;
+ case LESS_THAN:
+ return EvaluationResult.valueOf(size < fSize);
+ case GREATER_THAN:
+ return EvaluationResult.valueOf(size > fSize);
+ }
+ return EvaluationResult.FALSE;
+ }
+
+ @Override
+ public void collectExpressionInfo(ExpressionInfo info) {
+ info.markDefaultVariableAccessed();
+ }
+
+ @Override
+ public boolean equals(final Object object) {
+ if (!(object instanceof CountExpression))
+ return false;
+
+ final CountExpression that = (CountExpression)object;
+ return (this.fMode == that.fMode) && (this.fSize == that.fSize);
+ }
+
+ @Override
+ protected int computeHashCode() {
+ return HASH_INITIAL * HASH_FACTOR + fMode
+ * HASH_FACTOR + fSize;
+ }
+}
|