Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 178362 Details for
Bug 316332
[hotbug] False validation on server runtime when creating new web project
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch v2
patch316332v2.txt (text/plain), 3.77 KB, created by
Konstantin Komissarchik
on 2010-09-07 17:29:28 EDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
Konstantin Komissarchik
Created:
2010-09-07 17:29:28 EDT
Size:
3.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.server.core >Index: servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java >=================================================================== >RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java,v >retrieving revision 1.7 >diff -u -r1.7 RuntimeBridge.java >--- servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java 6 Feb 2008 18:11:37 -0000 1.7 >+++ servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java 7 Sep 2010 21:28:50 -0000 >@@ -11,20 +11,10 @@ > *******************************************************************************/ > package org.eclipse.wst.server.core.internal.facets; > >-import java.util.ArrayList; >-import java.util.HashMap; >-import java.util.HashSet; >-import java.util.List; >-import java.util.Map; >-import java.util.Set; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeBridge; >-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; >-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentVersion; >-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager; >+import java.util.*; >+ >+import org.eclipse.core.runtime.*; >+import org.eclipse.wst.common.project.facet.core.runtime.*; > import org.eclipse.wst.server.core.IRuntime; > import org.eclipse.wst.server.core.IRuntimeType; > import org.eclipse.wst.server.core.ServerCore; >@@ -105,27 +95,20 @@ > public IStub bridge(String name) throws CoreException { > if (name == null) > throw new IllegalArgumentException(); >- >- IRuntime[] runtimes = ServerCore.getRuntimes(); >- int size = runtimes.length; >- for (int i = 0; i < size; i++) { >- if (runtimes[i].getId().equals(name)) >- return new Stub(runtimes[i]); >- if (runtimes[i].getName().equals(name)) >- return new Stub(runtimes[i]); >- } >- return null; >+ return new Stub(name); > } > > private static class Stub extends IRuntimeBridge.Stub { >- private IRuntime runtime; >+ private String id; > >- public Stub(IRuntime runtime) { >- this.runtime = runtime; >+ public Stub(String id) { >+ this.id = id; > } > > public List<IRuntimeComponent> getRuntimeComponents() { > List<IRuntimeComponent> components = new ArrayList<IRuntimeComponent>(2); >+ final IRuntime runtime = findRuntime( this.id ); >+ > if (runtime == null) > return components; > >@@ -159,6 +142,7 @@ > > public Map<String, String> getProperties() { > final Map<String, String> props = new HashMap<String, String>(); >+ final IRuntime runtime = findRuntime( this.id ); > if (runtime != null) { > props.put("id", runtime.getId()); > props.put("localized-name", runtime.getName()); >@@ -170,7 +154,27 @@ > } > > public IStatus validate(final IProgressMonitor monitor) { >- return runtime.validate( monitor ); >- } >+ final IRuntime runtime = findRuntime( this.id ); >+ if( runtime != null ) { >+ return runtime.validate( monitor ); >+ } >+ return Status.OK_STATUS; >+ } >+ >+ private static final IRuntime findRuntime( final String id ) >+ { >+ IRuntime[] runtimes = ServerCore.getRuntimes(); >+ int size = runtimes.length; >+ >+ for (int i = 0; i < size; i++) { >+ if (runtimes[i].getId().equals(id)) >+ return runtimes[i]; >+ if (runtimes[i].getName().equals(id)) >+ return runtimes[i]; >+ >+ } >+ >+ return null; >+ } > } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 316332
:
171658
| 178362