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 155462 Details for
Bug 298905
Change Java Facet id from "jst.java" to "java"
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]
Combined Patch v1
patch-java-facet.txt (text/plain), 9.15 KB, created by
Konstantin Komissarchik
on 2010-01-06 18:36:08 EST
(
hide
)
Description:
Combined Patch v1
Filename:
MIME Type:
Creator:
Konstantin Komissarchik
Created:
2010-01-06 18:36:08 EST
Size:
9.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.common.project.facet.core >Index: src/org/eclipse/wst/common/project/facet/core/util/internal/CollectionsUtil.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/CollectionsUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 CollectionsUtil.java >--- src/org/eclipse/wst/common/project/facet/core/util/internal/CollectionsUtil.java 22 Dec 2009 08:15:09 -0000 1.2 >+++ src/org/eclipse/wst/common/project/facet/core/util/internal/CollectionsUtil.java 6 Jan 2010 23:33:13 -0000 >@@ -26,7 +26,8 @@ > { > private CollectionsUtil() {} > >- @SuppressWarnings( "unchecked" ) >+ @SuppressWarnings( "rawtypes" ) >+ > private static final Comparator<Comparable<? super Comparable>> INVERTING_COMPARATOR > = new Comparator<Comparable<? super Comparable>>() > { >@@ -45,7 +46,8 @@ > * @return an inverting comparator > */ > >- @SuppressWarnings( "unchecked" ) >+ @SuppressWarnings( { "unchecked", "rawtypes" } ) >+ > public static <T extends Comparable> Comparator<T> getInvertingComparator() > { > return (Comparator<T>) INVERTING_COMPARATOR; >Index: src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java,v >retrieving revision 1.4 >diff -u -r1.4 IndexedSet.java >--- src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java 22 Dec 2009 08:15:09 -0000 1.4 >+++ src/org/eclipse/wst/common/project/facet/core/util/internal/IndexedSet.java 6 Jan 2010 23:33:13 -0000 >@@ -14,6 +14,7 @@ > import java.util.Collections; > import java.util.HashMap; > import java.util.HashSet; >+import java.util.Iterator; > import java.util.Map; > import java.util.Set; > >@@ -22,56 +23,101 @@ > */ > > public final class IndexedSet<K,V> >- >- extends HashSet<V> >- > { >- private static final long serialVersionUID = 1L; >+ private final Set<V> set; > private final Set<V> unmodifiable; > private final Map<K,V> index; > > public IndexedSet() > { >- this.unmodifiable = Collections.unmodifiableSet( this ); >+ this.set = new HashSet<V>(); >+ this.unmodifiable = Collections.unmodifiableSet( this.set ); > this.index = new HashMap<K,V>(); > } > >- public void add( final K key, >- final V value ) >+ public Set<V> getItemSet() > { >- remove( this.index.get( key ) ); >- add( value ); >- this.index.put( key, value ); >+ return this.unmodifiable; >+ } >+ >+ public V getItemByKey( final K key ) >+ { >+ return this.index.get( key ); > } > >- public boolean delete( final K key ) >+ public boolean containsKey( final K key ) > { >- final Object value = this.index.get( key ); >- >- if( value == null ) >- { >- return false; >- } >- else >+ return this.index.containsKey( key ); >+ } >+ >+ public boolean containsItem( final V item ) >+ { >+ return this.set.contains( item ); >+ } >+ >+ public void addItem( final V item ) >+ { >+ if( item == null ) > { >- remove( value ); >- this.index.remove( key ); >- return true; >+ throw new IllegalArgumentException(); > } >+ >+ this.set.add( item ); > } > >- public V get( final K key ) >+ public void addItemWithKey( final K key, >+ final V item ) > { >- return this.index.get( key ); >+ addItem( item ); >+ addKey( key, item ); > } > >- public boolean containsKey( final K key ) >+ public void addKey( final K key, >+ final V item ) > { >- return this.index.containsKey( key ); >+ if( key == null || item == null ) >+ { >+ throw new IllegalArgumentException(); >+ } >+ >+ if( ! this.set.contains( item ) ) >+ { >+ throw new IllegalArgumentException(); >+ } >+ >+ this.index.put( key, item ); > } > >- public Set<V> getUnmodifiable() >+ public boolean removeItem( final V item ) > { >- return this.unmodifiable; >+ if( this.set.remove( item ) ) >+ { >+ for( Iterator<Map.Entry<K,V>> itr = this.index.entrySet().iterator(); itr.hasNext(); ) >+ { >+ final Map.Entry<K,V> entry = itr.next(); >+ >+ if( entry.getValue() == item ) >+ { >+ itr.remove(); >+ } >+ } >+ >+ return true; >+ } >+ >+ return false; >+ } >+ >+ public boolean removeItemByKey( final K key ) >+ { >+ final V item = this.index.get( key ); >+ >+ if( item != null ) >+ { >+ return removeItem( item ); >+ } >+ >+ return false; > } >+ > } >\ No newline at end of file >Index: src/org/eclipse/wst/common/project/facet/core/util/internal/PluginUtil.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/PluginUtil.java,v >retrieving revision 1.5 >diff -u -r1.5 PluginUtil.java >--- src/org/eclipse/wst/common/project/facet/core/util/internal/PluginUtil.java 22 Dec 2009 08:15:09 -0000 1.5 >+++ src/org/eclipse/wst/common/project/facet/core/util/internal/PluginUtil.java 6 Jan 2010 23:33:13 -0000 >@@ -184,12 +184,13 @@ > } > > @SuppressWarnings( "unchecked" ) >+ > public static <T> Class<T> loadClass( final String pluginId, > final String clname, > final Class<T> interfc ) > { > final Bundle bundle = Platform.getBundle( pluginId ); >- final Class cl; >+ final Class<?> cl; > > try > { >@@ -216,7 +217,7 @@ > return null; > } > >- return cl; >+ return (Class<T>) cl; > } > > public static <T> T instantiate( final String pluginId, >Index: src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java,v >retrieving revision 1.9 >diff -u -r1.9 Versionable.java >--- src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java 22 Dec 2009 08:15:09 -0000 1.9 >+++ src/org/eclipse/wst/common/project/facet/core/util/internal/Versionable.java 6 Jan 2010 23:33:13 -0000 >@@ -49,7 +49,7 @@ > > public Set<T> getVersions() > { >- return this.versions.getUnmodifiable(); >+ return this.versions.getItemSet(); > } > > public Set<T> getVersions( final String expr ) >@@ -60,7 +60,7 @@ > final VersionExpr<T> prepared = new VersionExpr<T>( this, expr, null ); > final Set<T> result = new HashSet<T>(); > >- for( T ver : this.versions ) >+ for( T ver : this.versions.getItemSet() ) > { > if( prepared.check( ver ) ) > { >@@ -73,7 +73,7 @@ > > public T getVersion( final String version ) > { >- final T ver = this.versions.get( version ); >+ final T ver = this.versions.getItemByKey( version ); > > if( ver == null ) > { >@@ -87,10 +87,9 @@ > > public T getLatestVersion() > { >- if( this.versions.size() > 0 ) >+ if( this.versions.getItemSet().size() > 0 ) > { >- // [263113] Versionable no longer compiles as of I20090125-2000 >- return (T) Collections.max( this.versions ); >+ return (T) Collections.max( this.versions.getItemSet() ); > } > else > { >@@ -124,13 +123,14 @@ > }; > } > >- final List<T> list = new ArrayList<T>( this.versions ); >+ final List<T> list = new ArrayList<T>( this.versions.getItemSet() ); > Collections.sort( list, comp ); > > return list; > } > > @SuppressWarnings( "unchecked" ) >+ > public Comparator<String> getVersionComparator() > > throws CoreException >@@ -150,9 +150,7 @@ > > try > { >- final Class cl >- = bundle.loadClass( this.versionComparatorClass ); >- >+ final Class<?> cl = bundle.loadClass( this.versionComparatorClass ); > this.versionComparator = (Comparator<String>) cl.newInstance(); > } > catch( Exception e )
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 298905
:
155462
|
155463