File tree Expand file tree Collapse file tree 6 files changed +17
-11
lines changed
Expand file tree Collapse file tree 6 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,9 @@ protected Class<?> getType(final E o) {
258258 /** Removes the object from all compatible type lists. */
259259 protected boolean remove (final Object o , final boolean batch ) {
260260 if (!getBaseClass ().isAssignableFrom (o .getClass ())) return false ;
261- return remove (o , getType ((E )o ), batch );
261+ @ SuppressWarnings ("unchecked" )
262+ final E e = (E ) o ;
263+ return remove (o , getType (e ), batch );
262264 }
263265
264266 private Map <Class <?>, List <E >[]> type2Lists = new HashMap <Class <?>, List <E >[]>();
Original file line number Diff line number Diff line change @@ -97,14 +97,13 @@ public boolean addAll(final Collection<? extends E> c) {
9797 return changed ;
9898 }
9999
100- @ SuppressWarnings ("unchecked" )
101100 private void mergeAfterSorting (final Collection <? extends E > c ) {
102101 final List <E > listToMerge = new ArrayList <E >(c );
103102 Collections .sort (listToMerge );
104103 final Map <Class <?>, List <E >> map = new HashMap <Class <?>, List <E >>();
105104 for (final E e : listToMerge ) {
106105 for (final Class <?> clazz : getTypes (getType (e ))) {
107- final List <E > list = ( List < E >) retrieveList (clazz );
106+ final List <E > list = retrieveList (clazz );
108107 List <E > list2 = map .get (clazz );
109108 if (list2 == null ) {
110109 list2 = list .size () == 0 ? (List <E >)list : new ArrayList <E >();
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ public static String stripFilenameVersion(final String filename) {
147147 * @return the {@link Matcher} object
148148 * @deprecated see {@link #stripFilenameVersion(String)}
149149 */
150+ @ Deprecated
150151 public static Matcher matchVersionedFilename (String filename ) {
151152 return versionPattern .matcher (filename );
152153 }
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ private NumberUtils() {
5353 * null if the types are incompatible.
5454 */
5555 public static Number toNumber (final Object value , final Class <?> type ) {
56- final Object num = ClassUtils .convert (value , type );
57- return num == null ? null : ClassUtils .cast (num , Number .class );
56+ final Object num = ConversionUtils .convert (value , type );
57+ return num == null ? null : ConversionUtils .cast (num , Number .class );
5858 }
5959
6060 public static Number getMinimumNumber (final Class <?> type ) {
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ public boolean contains(final Object o) {
187187 @ Override
188188 public boolean remove (final Object o ) {
189189 if (!compatibleClass (o )) return false ;
190- final E value = ClassUtils .cast (o , objectClass );
190+ final E value = ConversionUtils .cast (o , objectClass );
191191 return removeValue (value );
192192 }
193193
@@ -219,7 +219,7 @@ public boolean removeAll(final Collection<?> c) {
219219 boolean changed = false ;
220220 for (final Object o : c ) {
221221 if (!compatibleClass (o )) continue ;
222- final E value = ClassUtils .cast (o , objectClass );
222+ final E value = ConversionUtils .cast (o , objectClass );
223223 final boolean result = removeValue (value );
224224 if (result ) changed = true ;
225225 }
Original file line number Diff line number Diff line change @@ -377,20 +377,24 @@ public static abstract class AbstractBase extends AbstractService implements
377377 BaseService
378378 {
379379 // NB: No implementation needed.
380- };
380+ }
381381
382382 /** Abstract implementation of {@link ExtensionService}. */
383383 public static abstract class AbstractExtension extends AbstractService
384384 implements ExtensionService
385385 {
386386 // NB: No implementation needed.
387- };
387+ }
388388
389389 /** Empty {@link BaseService} implementation. */
390- public static class BaseImpl extends AbstractBase { };
390+ public static class BaseImpl extends AbstractBase {
391+ // NB: No implementation needed.
392+ }
391393
392394 /** Empty {@link ExtensionService} implementation. */
393- public static class ExtensionImpl extends AbstractExtension { };
395+ public static class ExtensionImpl extends AbstractExtension {
396+ // NB: No implementation needed.
397+ }
394398
395399 /** A service that is doomed to fail, for depending on a missing service. */
396400 public static class ServiceRequiringMissingService extends AbstractService {
You can’t perform that action at this time.
0 commit comments