Add @SuppressWarnings({"unchecked","unused"}) to Java code template
-------------------------------------------------------------------
Key: AXIS2-1890
URL: http://issues.apache.org/jira/browse/AXIS2-1890
Project: Apache Axis 2.0 (Axis2)
Issue Type: Improvement
Components: codegen
Environment: Linux, Tomcat 5.5.20, Eclipse
Reporter: Nicolas Ternisien
Priority: Minor
To better include Java generated stub code of Axis2 Web services (using
wsdl2java ant task), it will be better is these classes uses the Java 5
annotation to ignore compilation warnings :
@SuppressWarnings({"unchecked","unused"})
It will help people on big project to see where are the real warnings, and
those generated by the codegen API. This could be added only if the user set a
java version from the command line or the Ant task, for compatibility with old
Java versions.
Here is a little patch explaining my improvement :
Index: src/org/apache/axis2/schema/template/PlainBeanTemplate.xsl
===================================================================
--- src/org/apache/axis2/schema/template/PlainBeanTemplate.xsl (révision
488663)
+++ src/org/apache/axis2/schema/template/PlainBeanTemplate.xsl (copie de
travail)
@@ -15,7 +15,8 @@
/**
* <xsl:value-of select="$name"/> wrapped bean classes
- */
+ */
+ @SuppressWarnings({"unchecked","unused"})
public class <xsl:value-of select="$name"/>{
<xsl:apply-templates/>
Index: src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
===================================================================
--- src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (révision
488663)
+++ src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (copie de
travail)
@@ -58,6 +58,7 @@
/**
* <xsl:value-of select="$name"/> bean class
*/
+ @SuppressWarnings({"unchecked","unused"})
</xsl:if>
public <xsl:if test="not(@unwrapped) or (@skip-write)">static</xsl:if>
class <xsl:value-of select="$name"/> <xsl:if test="$extension"> extends
<xsl:value-of select="$extension"/></xsl:if> <xsl:if test="$restriction">
extends <xsl:value-of select="$restriction"/></xsl:if>
implements org.apache.axis2.databinding.ADBBean{
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]