Author: pete.muir(a)jboss.org
Date: 2008-12-05 04:50:51 -0500 (Fri, 05 Dec 2008)
New Revision: 408
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
Log:
Better toString
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -664,7 +664,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append(Strings.collectionToString("Enabled deployment types: ",
getEnabledDeploymentTypes()));
buffer.append(eventManager.toString() + "\n");
buffer.append(metaDataCache.toString() + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/MetaDataCache.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -92,7 +92,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("====================\n");
buffer.append("Metadata cache\n");
buffer.append("====================\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Resolvable annotation item\n");
buffer.append(delegate().toString() + "\n");
return buffer.toString();
@@ -308,7 +308,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Resolver\n");
buffer.append(resolvedInjectionPoints.toString() + "\n");
buffer.append(Strings.collectionToString("Injection points: ",
injectionPoints));
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -642,7 +642,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractBean:\n");
buffer.append("Name: " + name + "\n");
buffer.append("Type: " + type + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -274,7 +274,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractClassBean:\n");
buffer.append(super.toString() + "\n");
buffer.append("Annotated item: " + annotatedItem.toString() +
"\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -36,6 +36,7 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.util.Names;
/**
* An enterprise bean representation
@@ -339,7 +340,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
String ejbType = "";
if (getEjbMetaData().isMessageDriven())
{
@@ -361,7 +362,16 @@
{
ejbType = "unknown";
}
- buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase()
+ " " + ejbType + " enterprise bean '" + getName() + "'
" + "[" + getType().getName() + "]\n");
+ buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()) +
ejbType);
+ if (getName() == null)
+ {
+ buffer.append(" unnamed enterprise bean");
+ }
+ else
+ {
+ buffer.append(" enterprise bean '" + getName() +
"'");
+ }
+ buffer.append(" [" + getType().getName() + "]\n");
buffer.append(" EJB name: " + getEjbMetaData().getEjbName() + ",
default JNDI name: " + getEjbMetaData().getDefaultJndiName() + ", EJB link JNDI
name: " + getEjbMetaData().getEjbLinkJndiName() + "\n");
buffer.append(" API types " + getTypes() + ", binding types "
+ getBindingTypes() + "\n");
return buffer.toString();
@@ -369,7 +379,7 @@
public String toDetailedString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("EnterpriseBean:\n");
buffer.append(super.toString() + "\n");
buffer.append(ejbMetaData.toString() + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -161,7 +161,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Merged stereotypes:\n");
buffer.append("Bean name defaulted: " + beanNameDefaulted +
"\n");
buffer.append("Possible deployment types: " +
getPossibleDeploymentTypes().toString());
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -291,7 +291,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("ProducerMethodBean:\n");
buffer.append(super.toString() + "\n");
buffer.append("Location: " + location + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -33,6 +33,7 @@
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
/**
@@ -360,15 +361,24 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
- buffer.append("Annotated " + getScopeType().getSimpleName().toLowerCase()
+ " " + " simple bean '" + getName() + "' " +
"[" + getType().getName() + "]\n");
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()));
+ if (getName() == null)
+ {
+ buffer.append("unnamed simple bean");
+ }
+ else
+ {
+ buffer.append("simple bean '" + getName() + "'");
+ }
+ buffer.append(" [" + getType().getName() + "]\n");
buffer.append(" API types " + getTypes() + ", binding types "
+ getBindingTypes() + "\n");
return buffer.toString();
}
public String toDetailedString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("SimpleBean\n");
buffer.append(super.toString() + "\n");
buffer.append("Location: " + location + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -51,7 +51,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("XmlEnterpriseBean\n");
buffer.append(super.toString() + "\n");
return buffer.toString();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -51,7 +51,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("XmlLSimpleBean\n");
buffer.append(super.toString() + "\n");
return buffer.toString();
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -85,7 +85,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Proxy method handler\n");
buffer.append("Bean " + (bean == null ? "null" :
bean.toString()) + "\n");
buffer.append("Bean index: " + beanIndex + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -167,7 +167,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Proxy pool\n");
buffer.append(pool.toString() + "\n");
return buffer.toString();
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -151,7 +151,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractContext:\n");
buffer.append("Scope type: " + getScopeType().toString() +
"\n");
buffer.append("Active: " + getActive().toString() + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -220,7 +220,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
List<Contextual<?>> beans = (List) keySet();
buffer.append("Bean -> bean instance mappings in HTTP session: " +
beans.size() + "\n");
int i = 0;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -260,7 +260,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("EJB metadata model\n");
buffer.append("EJB name: " + ejbName + "\n");
buffer.append("EJB type: " + ejbType + "\n");
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -261,7 +261,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("Event manager\n");
buffer.append(registeredObservers.toString());
return buffer.toString();
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -424,7 +424,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedItem:\n");
buffer.append(Strings.collectionToString("Annotations: ",
getAnnotations()));
buffer.append(annotationMap == null ? "" : (annotationMap.toString() +
"\n"));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -163,7 +163,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedMember:\n");
buffer.append(super.toString() + "\n");
buffer.append("Final: " + isFinal() + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -116,7 +116,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AbstractAnnotatedType:\n");
buffer.append(super.toString() + "\n");
buffer.append("Superclass: " + (superclass == null ? "" :
superclass.toString()) + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -184,7 +184,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append("Class: " + clazz.toString() + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -497,7 +497,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ",
Arrays.asList(getActualTypeArguments())));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -276,7 +276,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedConstructorImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ",
Arrays.asList(getActualTypeArguments())));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -161,7 +161,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedFieldImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ",
Arrays.asList(getActualTypeArguments())));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedItemImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -153,7 +153,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedItemImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ",
Arrays.asList(getActualTypeArguments())));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -291,7 +291,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedMethodImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append(Strings.collectionToString("Actual type arguments: ",
Arrays.asList(getActualTypeArguments())));
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -158,7 +158,7 @@
{
return toString;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotatedParameterImpl:\n");
buffer.append(super.toString() + "\n");
buffer.append("Type: " + type.toString() + "\n");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AnnotationModel.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -120,7 +120,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("AnnotationModel:\n");
buffer.append("Annotated annotation: " +
getAnnotatedAnnotation().toString());
buffer.append("Valid: " + isValid());
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/BindingTypeModel.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -154,7 +154,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("BindingTypeModel:\n");
buffer.append(super.toString());
buffer.append("Hash code: " + hashCode);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ScopeModel.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("ScopeModel:\n");
buffer.append(super.toString());
buffer.append("Normal: " + isNormal());
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java 2008-12-05
09:10:12 UTC (rev 407)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/StereotypeModel.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -243,7 +243,7 @@
@Override
public String toString()
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append("StereotypeModel:\n");
buffer.append(super.toString());
buffer.append("Bean name defaulted: " + isBeanNameDefaulted());
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.util;
+
+import java.lang.annotation.Annotation;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Utility class to produce friendly names e.g. for debugging
+ *
+ * @author Pete Muir
+ *
+ */
+public class Names
+{
+
+ private static Pattern CAPITAL_LETTERS =
Pattern.compile("\\p{Upper}{1}\\p{Lower}*");
+
+ public static String scopeTypeToString(Class<? extends Annotation> scopeType)
+ {
+ String scopeName = scopeType.getSimpleName();
+ Matcher matcher = CAPITAL_LETTERS.matcher(scopeName);
+ StringBuilder result = new StringBuilder();
+ while (matcher.find())
+ {
+ result.append(matcher.group().toLowerCase() + " ");
+ }
+ return result.toString();
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Names.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05
09:10:12 UTC (rev 407)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05
09:50:51 UTC (rev 408)
@@ -79,7 +79,7 @@
*/
public static String mapToString(String header, Map<?, ?> map)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (map == null)
{
buffer.append(header + "null\n");
@@ -109,7 +109,7 @@
public static String collectionToString(String header, Collection<?>
collection)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (collection == null)
{
buffer.append(header + "null\n");