Skip to content

Commit 67e27aa

Browse files
committed
Fix Oxygen 1.a classpath exception.
1 parent 80e8600 commit 67e27aa

File tree

4 files changed

+49
-30
lines changed

4 files changed

+49
-30
lines changed

eclipse/mars/gwt-eclipse-mars.target

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde?>
33
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
4-
<target name="GWT Eclipse Plugin Mars" sequenceNumber="1499963709">
4+
<target name="GWT Eclipse Plugin Mars" sequenceNumber="1507910989">
55
<locations>
66
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
77
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
@@ -43,7 +43,7 @@
4343
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20160221192158/repository/"/>
4444
</location>
4545
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
46-
<unit id="com.google.cloud.tools.eclipse.suite.e45.feature.feature.group" version="1.2.0.201706082053"/>
46+
<unit id="com.google.cloud.tools.eclipse.suite.e45.feature.feature.group" version="1.3.1.201709121426"/>
4747
<repository location="https://dl.google.com/eclipse/google-cloud-eclipse/stable/"/>
4848
</location>
4949
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">

eclipse/neon/gwt-eclipse-neon.target

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde?>
33
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
4-
<target name="GWT Eclipse Plugin Neon" sequenceNumber="1488306278">
4+
<target name="GWT Eclipse Plugin Neon" sequenceNumber="1507911751">
55
<locations>
66
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
77
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
88
<repository location="http://download.eclipse.org/cbi/updates/license"/>
99
</location>
1010
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
11-
<unit id="org.eclipse.sdk.feature.group" version="4.6.2.v20161124-1529"/>
12-
<unit id="org.eclipse.jdt.feature.group" version="3.12.2.v20161124-1400"/>
11+
<unit id="org.eclipse.sdk.feature.group" version="4.6.3.v20170301-0400"/>
12+
<unit id="org.eclipse.jdt.feature.group" version="3.12.3.v20170301-0400"/>
1313
<unit id="org.eclipse.m2e.feature.feature.group" version="1.7.0.20160603-1933"/>
1414
<unit id="org.eclipse.m2e.wtp.feature.feature.group" version="1.3.1.20160831-1005"/>
1515
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.21.0.v20160707-1856"/>
16-
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.5.0.v201603181811"/>
16+
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.5.0.v201607131827"/>
1717
<unit id="org.eclipse.datatools.sdk.feature.feature.group" version="1.13.0.201603142002"/>
1818
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/>
1919
<unit id="org.eclipse.jetty.http" version="9.3.9.v20160517"/>
@@ -45,8 +45,8 @@
4545
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/"/>
4646
</location>
4747
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
48-
<unit id="com.google.cloud.tools.eclipse.suite.e45.feature.feature.group" version="1.0.0.201702221633"/>
49-
<repository location="https://storage.googleapis.com/gcloud-for-eclipse-testing/"/>
48+
<unit id="com.google.cloud.tools.eclipse.suite.e45.feature.feature.group" version="1.3.1.201709121426"/>
49+
<repository location="https://dl.google.com/eclipse/google-cloud-eclipse/stable/"/>
5050
</location>
5151
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
5252
<unit id="com.github.sdbg.feature.feature.group" version="1.0.10.201610081555"/>

plugins/com.gwtplugins.gdt.eclipse.core/src/com/google/gdt/eclipse/core/ClasspathUtilities.java

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import java.util.Map;
4343

4444
/**
45-
*
45+
*
4646
*/
4747
@SuppressWarnings("restriction")
4848
public final class ClasspathUtilities {
@@ -77,7 +77,7 @@ public Class<?> find(ClassLoader classLoader, String className) {
7777
/**
7878
* Finds all the classpath containers in the specified project that match the
7979
* provided container ID.
80-
*
80+
*
8181
* @param javaProject the project to query
8282
* @param containerId The container ID we are trying to match.
8383
* @return an array of matching classpath containers.
@@ -87,6 +87,7 @@ public static IClasspathEntry[] findClasspathContainersWithContainerId(
8787
throws JavaModelException {
8888

8989
Predicate<IClasspathEntry> matchPredicate = new Predicate<IClasspathEntry>() {
90+
@Override
9091
public boolean apply(IClasspathEntry entry) {
9192
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
9293
IPath containerPath = entry.getPath();
@@ -123,7 +124,7 @@ public boolean apply(IClasspathEntry entry) {
123124
/**
124125
* Returns the {@link IClasspathEntry#CPE_CONTAINER} entry with the specified
125126
* container ID or <code>null</code> if one could not be found.
126-
*
127+
*
127128
* @param classpathEntries array of classpath entries
128129
* @param containerId container ID
129130
* @return {@link IClasspathEntry#CPE_CONTAINER} entry with the specified
@@ -141,7 +142,7 @@ public static IClasspathEntry findClasspathEntryContainer(
141142
/**
142143
* Return the raw classpath entry on the project's classpath that contributes
143144
* the given type to the project.
144-
*
145+
*
145146
* @param javaProject The java project
146147
* @param fullyQualifiedName The fully-qualified type name
147148
* @return The raw classpath entry that contributes the type to the project,
@@ -160,8 +161,20 @@ public static IClasspathEntry findRawClasspathEntryFor(
160161
IClasspathEntry[] rawClasspath = javaProject.getRawClasspath();
161162
for (IClasspathEntry rawClasspathEntry : rawClasspath) {
162163
IClasspathEntry[] resolvedClasspath = jProject.resolveClasspath(new IClasspathEntry[] {rawClasspathEntry});
163-
IPackageFragmentRoot[] computePackageFragmentRoots = jProject.computePackageFragmentRoots(
164-
resolvedClasspath, true, null);
164+
165+
// was this - which is no longer, internal api refactor
166+
//IPackageFragmentRoot[] computePackageFragmentRoots = jProject.computePackageFragmentRoots(resolvedClasspath, true, null);
167+
168+
// now this - from IPackage
169+
List<IPackageFragmentRoot> fragmentRoots = new ArrayList<IPackageFragmentRoot>();
170+
for (IClasspathEntry classPathEntry : resolvedClasspath) {
171+
IPackageFragmentRoot[] foundRoots = javaProject.findPackageFragmentRoots(classPathEntry);
172+
fragmentRoots.addAll(Arrays.asList(foundRoots));
173+
}
174+
175+
IPackageFragmentRoot[] computePackageFragmentRoots = new IPackageFragmentRoot[fragmentRoots.size()];
176+
fragmentRoots.toArray(computePackageFragmentRoots);
177+
165178
if (Arrays.asList(computePackageFragmentRoots).contains(
166179
packageFragmentRoot)) {
167180
return rawClasspathEntry;
@@ -177,7 +190,7 @@ public static IClasspathEntry findRawClasspathEntryFor(
177190
/**
178191
* Returns a String (in the format of the JVM classpath argument) which
179192
* contains the given classpath entries.
180-
*
193+
*
181194
* @param classpathEntries array of runtime classpath entries
182195
* @return flattened String of the given classpath entries in the format
183196
* suitable for passing as a JVM argument
@@ -217,7 +230,7 @@ public static IClasspathEntry getNullableRawClasspathEntryForPackageFragmentRoot
217230
/**
218231
* Determines whether a ClasspathContainer exists on the provided project that
219232
* matches the provided container ID.
220-
*
233+
*
221234
* @param javaProject the project to query
222235
* @param containerId The container ID we are trying to match.
223236
* @return whether at least one classpath container exists that matches the
@@ -235,7 +248,7 @@ public static boolean includesClasspathContainerWithContainerId(
235248
* Returns the first index of the specified
236249
* {@link IClasspathEntry#CPE_CONTAINER} entry with the specified container ID
237250
* or -1 if one could not be found.
238-
*
251+
*
239252
* @param classpathEntries array of classpath entries
240253
* @param containerId container ID
241254
* @return index of the specified {@link IClasspathEntry#CPE_CONTAINER} entry
@@ -263,11 +276,11 @@ public static int indexOfClasspathEntryContainer(
263276
/**
264277
* Replace an {@link IClasspathEntry#CPE_CONTAINER} entry with the given
265278
* container ID, with its corresponding resolved classpath entries.
266-
*
279+
*
267280
* @param javaProject java project
268281
* @param containerId container ID to replace
269282
* @return true if a container was replaced
270-
*
283+
*
271284
* @throws JavaModelException
272285
*/
273286
public static boolean replaceContainerWithClasspathEntries(
@@ -294,7 +307,7 @@ public static boolean replaceContainerWithClasspathEntries(
294307
/**
295308
* Replaces a project's classpath container entry with a new one or appends it
296309
* to the classpath if none were found.
297-
*
310+
*
298311
* @param javaProject The target project
299312
* @param containerId the identifier of the classpath container type
300313
* @param newContainerPath the path for the new classpath. Note: this path
@@ -333,30 +346,31 @@ public static void replaceOrAppendContainer(IJavaProject javaProject,
333346
* more information: <a
334347
* href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=243692"
335348
* >http://bugs.eclipse.org/bugs/show_bug.cgi?id=243692</a>
336-
*
349+
*
337350
* <p>
338351
* Note that this method is asynchronous, so the caller will regain control
339352
* immediately, and the raw classpath will be set at some future time. Right
340353
* now, there is no way to tell the caller when the operation has completed.
341354
* If this becomes a concern in the future, a callback parameter can be
342355
* introduced.
343356
* </p>
344-
*
357+
*
345358
* <p>
346359
* This method does not accept an IProgressMonitor, unlike the equivalent
347360
* method in IJavaProject, because there is an implicit progress monitor
348361
* provided when running the setRawClasspath operation as a task. In the
349362
* future, this method could be modified to accept a user-specified progress
350363
* monitor.
351364
* </p>
352-
*
365+
*
353366
* NOTE: If you are already running in a job, you probably don't want to call
354367
* this method.
355368
*/
356369
public static void setRawClasspath(final IJavaProject javaProject,
357370
final IClasspathEntry[] newClasspathEntries) {
358371

359372
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
373+
@Override
360374
public void run(IProgressMonitor monitor) throws CoreException,
361375
OperationCanceledException {
362376
javaProject.setRawClasspath(newClasspathEntries, monitor);
@@ -376,15 +390,15 @@ public void run(IProgressMonitor monitor) throws CoreException,
376390
* more information: <a
377391
* href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=243692"
378392
* >http://bugs.eclipse.org/bugs/show_bug.cgi?id=243692</a>
379-
*
393+
*
380394
* <p>
381395
* Note that this method is asynchronous, so the caller will regain control
382396
* immediately, and the raw classpath will be set at some future time. Right
383397
* now, there is no way to tell the caller when the operation has completed.
384398
* If this becomes a concern in the future, a callback parameter can be
385399
* introduced.
386400
* </p>
387-
*
401+
*
388402
* <p>
389403
* This method does not accept an IProgressMonitor, unlike the equivalent
390404
* method in IJavaProject, because there is an implicit progress monitor
@@ -401,7 +415,7 @@ public static void setRawClasspath(final IJavaProject javaProject,
401415
/**
402416
* Waits indefinitely until the given classpath entries are on the given
403417
* project's raw classpath.
404-
*
418+
*
405419
* @throws JavaModelException
406420
* @throws InterruptedException
407421
*/

pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<os-jvm-flags />
2727

2828
<!-- Used In: GwtRuntimeTestUtilities.java TODO remove? -->
29-
<gwt.version>2.7.0</gwt.version>
29+
<gwt.version>2.8.1</gwt.version>
3030

3131
<!-- SwtBot Timeout -->
3232
<org.eclipse.swtbot.search.timeout>50000</org.eclipse.swtbot.search.timeout>
@@ -55,13 +55,18 @@
5555
<module>plugins/com.gwtplugins.gdt.eclipse.suite</module>
5656
<module>plugins/com.gwtplugins.gdt.eclipse.suite.update</module>
5757
<module>plugins/com.gwtplugins.gdt.eclipse.suite.test</module>
58-
<module>plugins/com.gwtplugins.gdt.eclipse.suite.test.swtbot</module>
59-
<module>plugins/com.gwtplugins.gdt.eclipse.swtbot</module>
58+
59+
<!-- TODO not enabled yet -->
60+
<!-- <module>plugins/com.gwtplugins.gdt.eclipse.suite.test.swtbot</module> -->
61+
<!-- <module>plugins/com.gwtplugins.gdt.eclipse.swtbot</module> -->
6062

6163
<!-- GWT -->
6264
<module>plugins/com.gwtplugins.gwt.eclipse.core</module>
6365
<module>plugins/com.gwtplugins.gwt.eclipse.core.test</module>
64-
<module>plugins/com.gwtplugins.gwt.eclipse.core.test.swtbot</module>
66+
67+
<!-- TODO enable swtbot -->
68+
<!-- <module>plugins/com.gwtplugins.gwt.eclipse.core.test.swtbot</module> -->
69+
6570
<module>plugins/com.gwtplugins.gwt.eclipse.oophm</module>
6671
<module>plugins/com.gwtplugins.gwt.eclipse.oophm.test</module>
6772
<module>plugins/com.gwtplugins.gwt.eclipse.testing</module>

0 commit comments

Comments
 (0)