Author: alessio.soldano(a)jboss.com
Date: 2009-09-29 03:41:34 -0400 (Tue, 29 Sep 2009)
New Revision: 10784
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ToolsUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
Log:
A bunch of fixes for FindBugs reported issues (run on AS)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -94,7 +94,7 @@
componentDeserializer =
(DeserializerSupport)compDeserializerFactory.getDeserializer();
if (arrDims.length < 1 || 2 < arrDims.length)
- throw new WSException("Unsupported array dimensions: " +
Arrays.asList(arrDims));
+ throw new WSException("Unsupported array dimensions: " + arrDims);
Iterator it = DOMUtils.getChildElements(soapElement);
if (arrDims.length == 1)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/DynamicWrapperGenerator.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -309,7 +309,7 @@
// Add @XmlType;
annotation = JavassistUtils.createAnnotation(XmlType.class, constPool);
- if (xmlType.getNamespaceURI() != null & xmlType.getNamespaceURI().length() >
0)
+ if (xmlType.getNamespaceURI() != null && xmlType.getNamespaceURI().length()
> 0)
annotation.addParameter("namespace", xmlType.getNamespaceURI());
annotation.addParameter("name", xmlType.getLocalPart());
if (propertyOrder != null)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -160,14 +160,18 @@
WSDLBindingOperation wsdlBindingOperation =
wsdlOperation.getBindingOperation();
if (wsdlBindingOperation == null)
+ {
log.warn("Could not locate binding operation for:" + opQName);
+ }
+ else
+ {
+ // Change operation according namespace defined on binding
+ // <soap:body use="encoded"
namespace="http://MarshallTestW2J.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ String namespaceURI = wsdlBindingOperation.getNamespaceURI();
+ if (namespaceURI != null)
+ opQName = new QName(namespaceURI, opName);
+ }
- // Change operation according namespace defined on binding
- // <soap:body use="encoded"
namespace="http://MarshallTestW2J.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- String namespaceURI = wsdlBindingOperation.getNamespaceURI();
- if (namespaceURI != null)
- opQName = new QName(namespaceURI, opName);
-
// Set java method name
String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1);
ServiceEndpointMethodMapping seiMethodMapping = null;
@@ -513,7 +517,7 @@
String ns = xmlType.getNamespaceURI() != null ? xmlType.getNamespaceURI() :
"";
XSTypeDefinition xsType = schemaModel.getTypeDefinition(localPart, ns);
XOPScanner scanner = new XOPScanner();
- if (scanner.findXOPTypeDef(xsType) != null |
(localPart.equals("base64Binary") &&
ns.equals(Constants.NS_SCHEMA_XSD)))
+ if (scanner.findXOPTypeDef(xsType) != null ||
(localPart.equals("base64Binary") &&
ns.equals(Constants.NS_SCHEMA_XSD)))
{
// FIXME: read the xmime:contentType from the element declaration
// See SchemaUtils#findXOPTypeDef(XSTypeDefinition typeDef) for details
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -70,7 +70,7 @@
{
private static SchemaUtils ourInstance = new SchemaUtils();
- protected static String xsNS = Constants.NS_SCHEMA_XSD;
+ protected static final String xsNS = Constants.NS_SCHEMA_XSD;
private static Map<Class, QName> toolsTypeMappingOverride = new
HashMap<Class, QName>();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ToolsUtils.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -88,7 +88,7 @@
*/
public static String firstLetterUpperCase(String fname)
{
- if (fname == "" || fname == null)
+ if (fname == null || fname.length() == 0)
throw new WSException("String passed is null");
//Ensure that the first character is uppercase
if (Character.isLowerCase(fname.charAt(0)))
@@ -108,7 +108,7 @@
*/
public static String firstLetterLowerCase(String fname)
{
- if (fname == "" || fname == null)
+ if (fname == null || fname.length() == 0)
throw new WSException("String passed is null");
//Ensure that the first character is lowercase
if (Character.isUpperCase(fname.charAt(0)))
@@ -130,7 +130,7 @@
*/
public static String getJavaIdentifier(String xmlName)
{
- if(xmlName == null || xmlName == "")
+ if(xmlName == null || xmlName.length() == 0)
throw new IllegalArgumentException("xmlName is null");
xmlName = xmlName.trim(); //Get rid of whitespaces
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-09-28
03:08:53 UTC (rev 10783)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-09-29
07:41:34 UTC (rev 10784)
@@ -46,6 +46,7 @@
protected static final Logger log = Logger.getLogger(EndpointServlet.class);
private List<PreDestroyHolder> preDestroyRegistry = new
LinkedList<PreDestroyHolder>();
+ private final Object lock = new Object();
/**
* Provides Native specific endpoint resolver
@@ -78,7 +79,7 @@
@Override
public final void destroy()
{
- synchronized(this.preDestroyRegistry)
+ synchronized(this.lock)
{
for (final PreDestroyHolder holder : this.preDestroyRegistry)
{
@@ -103,7 +104,7 @@
PreDestroyHolder holder =
(PreDestroyHolder)ep.getAttachment(PreDestroyHolder.class);
if (holder != null)
{
- synchronized(this.preDestroyRegistry)
+ synchronized(this.lock)
{
if (!this.preDestroyRegistry.contains(holder))
{