[weld-commits] Weld SVN: r5454 - in core/trunk/impl/src/main/java/org/jboss/weld: util and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jan 13 12:38:33 EST 2010


Author: pete.muir at jboss.org
Date: 2010-01-13 12:38:32 -0500 (Wed, 13 Jan 2010)
New Revision: 5454

Removed:
   core/trunk/impl/src/main/java/org/jboss/weld/util/Strings.java
Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
   core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
   core/trunk/impl/src/main/java/org/jboss/weld/util/Types.java
Log:
Cleanup

Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java	2010-01-13 17:28:36 UTC (rev 5453)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java	2010-01-13 17:38:32 UTC (rev 5454)
@@ -29,6 +29,7 @@
 import static org.jboss.weld.logging.messages.BeanMessage.USING_DEFAULT_SCOPE;
 import static org.jboss.weld.logging.messages.BeanMessage.USING_SCOPE;
 
+import java.beans.Introspector;
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -74,7 +75,6 @@
 import org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance;
 import org.jboss.weld.util.Beans;
 import org.jboss.weld.util.Proxies;
-import org.jboss.weld.util.Strings;
 import org.jboss.weld.util.Proxies.TypeInfo;
 import org.jboss.weld.util.reflection.SecureReflections;
 import org.slf4j.cal10n.LocLogger;
@@ -392,7 +392,7 @@
    @Override
    protected String getDefaultName()
    {
-      String name = Strings.decapitalize(getWeldAnnotated().getSimpleName());
+      String name = Introspector.decapitalize(getWeldAnnotated().getSimpleName());
       return name;
    }
 

Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java	2010-01-13 17:28:36 UTC (rev 5453)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java	2010-01-13 17:38:32 UTC (rev 5454)
@@ -33,7 +33,6 @@
 import javassist.util.proxy.ProxyObject;
 
 import org.jboss.weld.exceptions.ForbiddenArgumentException;
-import org.jboss.weld.exceptions.WeldException;
 import org.jboss.weld.util.reflection.Reflections;
 import org.jboss.weld.util.reflection.SecureReflections;
 
@@ -278,17 +277,6 @@
          }
       }
    }
-
-   /**
-    * Indicates if an instance is a Javassist proxy
-    * 
-    * @param instance The instance to examine
-    * @return True if proxy, false otherwise
-    */
-   public static boolean isProxy(Object instance)
-   {
-      return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
-   }
    
    public static ProxyFactory attachMethodHandler(ProxyFactory proxyFactory, MethodHandler methodHandler)
    {
@@ -315,30 +303,6 @@
       }
       
    }
-   
-   public static void clean(Class<?> clazz)
-   {
-      if (!ProxyObject.class.isAssignableFrom(clazz))
-      {
-         throw new ForbiddenArgumentException(INSTANCE_NOT_A_PROXY, clazz);
-      }
-      else
-      {
-         // Clear the default handler
-         try
-         {
-            SecureReflections.getDeclaredField(clazz, DEFAULT_INTERCEPTOR).set(null, null);
-         }
-         catch (IllegalAccessException e)
-         {
-            throw new WeldException(e);
-         }
-         catch (NoSuchFieldException e)
-         {
-            throw new WeldException(e);
-         }
-      }
-   }
 
 
 }

Deleted: core/trunk/impl/src/main/java/org/jboss/weld/util/Strings.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Strings.java	2010-01-13 17:28:36 UTC (rev 5453)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Strings.java	2010-01-13 17:38:32 UTC (rev 5454)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.util;
-
-import java.beans.Introspector;
-import java.util.Collection;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-
-/**
- * String utilities
- * 
- * @author Pete Muir
- * 
- */
-public class Strings
-{
-
-   /**
-    * Decapitalizes a String
-    * 
-    * @param camelCase The String
-    * @return The decapitalized result
-    */
-   public static String decapitalize(String camelCase)
-   {
-      return Introspector.decapitalize(camelCase);
-   }
-
-   /**
-    * Split a string into parts
-    * 
-    * @param strings The sources
-    * @param delims The delimeter
-    * @return The parts
-    */
-   public static String[] split(String strings, String delims)
-   {
-      if (strings == null)
-      {
-         return new String[0];
-      }
-      else
-      {
-         StringTokenizer tokens = new StringTokenizer(strings, delims);
-         String[] result = new String[tokens.countTokens()];
-         int i = 0;
-         while (tokens.hasMoreTokens())
-         {
-            result[i++] = tokens.nextToken();
-         }
-         return result;
-      }
-   }
-
-   /**
-    * Returns a textual representation of a map for debug purposes
-    * 
-    * @param header The description of the map
-    * @param map The map
-    * @return A textual representation
-    */
-   public static String mapToString(String header, Map<?, ?> map)
-   {
-      StringBuilder buffer = new StringBuilder();
-      if (map == null)
-      {
-         buffer.append(header).append("null\n");
-         return buffer.toString();
-      }
-      buffer.append(header).append("[").append(map.size()).append(" entries]\n");
-      int i = 0;
-      for (Entry<?, ?> entry: map.entrySet())
-      {
-         Object value = entry.getValue();
-         buffer.append("  #").append(++i).append(": ").append(entry.getKey()).append(" -> ");
-         if (value instanceof Iterable<?>)
-         {
-            buffer.append("\n");
-            for (Object subValue : (Iterable<?>) value)
-            {
-               buffer.append("    ").append(subValue.toString()).append("\n");
-            }
-         }
-         else
-         {
-            buffer.append(value.toString()).append("\n");
-         }
-      }
-      return buffer.toString();
-   }
-
-   /**
-    * Returns a textual representation of a collection for debug purposes
-    * 
-    * @param header The description of the collection
-    * @param collection The collection
-    * @return A textual representation
-    */
-   public static String collectionToString(String header, Collection<?> collection)
-   {
-      StringBuilder buffer = new StringBuilder();
-      if (collection == null)
-      {
-         buffer.append(header + "null\n");
-         return buffer.toString();
-      }
-      buffer.append(header + "[" + collection.size() + " entries]\n");
-      int i = 0;
-      for (Object item : collection)
-      {
-         buffer.append("  #" + ++i + ": " + item.toString() + "\n");
-      }
-      return buffer.toString();
-   }
-
-}

Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Types.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Types.java	2010-01-13 17:28:36 UTC (rev 5453)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Types.java	2010-01-13 17:38:32 UTC (rev 5454)
@@ -34,7 +34,7 @@
     */
    public static Type boxedType(Type type)
    {
-      if (type instanceof Class)
+      if (type instanceof Class<?>)
       {
          return boxedClass((Class<?>) type);
       }



More information about the weld-commits mailing list