axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Jordahl" <>
Subject RE: Programming Meticulous coDe
Date Mon, 24 Apr 2006 15:11:35 GMT

They sometimes get used depending on what types of things get
registered.  I would be reasonable to change the code emitter to omit
them if we do not reference them later.

Tom Jordahl
Adobe ColdFusion Team

-----Original Message-----
From: Philip Gonia [] 
Sent: Saturday, April 22, 2006 3:22 PM
Subject: Programming Meticulous coDe

Hi all,

I am developing an application that uses Axis (1.3). All my
development is supported through the use of NetBeans 5.0.

I recently installed a NB plugin called PMD (Programming Meticulous
coDe ... informal meaning), which allows a programmer to perform
automated code inspections based on various
coding rules. (see

Yesterday I managed to start to work through a set of reported issues
by the PMD plugin. The following is related to ten issues identified
to a class within my application that was auto-generated by the
Axis msdl2java tool.

First the PMD "Unused Code Rule" rule at issue here is the following:

"UnusedFormalParameter -- Avoid passing parameters to methods or
constructors and then not using those parameters."

(Aside from the fact that the following appears to not correctly
represent the reported code rule it has raised a question in
my mind that would be nice to understand.)

Here is the code at issue, as related to this e-mail. I have entered
my questions within the code.

      // Class SoapBindingStub constructor.
      public SoapBindingStub(javax.xml.rpc.Service service)
      throws org.apache.axis.AxisFault
          if (service == null)
              super.service = new org.apache.axis.client.Service();
              super.service = service;


          java.lang.Class cls;

          javax.xml.namespace.QName qName;

          javax.xml.namespace.QName qName2;

          // Each of the following ten local variables were tagged as
          // breaking the stated rule above. This does not appear to
          // completely represent the rule as outlined on the
          // PMD web site. But I have to admit, what is the reason for
          // these variables? They are local to this constructor and
          // yet are not used.
          java.lang.Class beansf = org.apache.axis.encoding.ser.

          java.lang.Class beandf = org.apache.axis.encoding.ser.

          java.lang.Class enumsf = org.apache.axis.encoding.ser.

          java.lang.Class enumdf = org.apache.axis.encoding.ser.

          java.lang.Class arraysf = org.apache.axis.encoding.ser.

          java.lang.Class arraydf = org.apache.axis.encoding.ser.

          java.lang.Class simplesf = org.apache.axis.encoding.ser.

          java.lang.Class simpledf = org.apache.axis.encoding.ser.

          java.lang.Class simplelistsf = org.apache.axis.encoding.ser.

          java.lang.Class simplelistdf = org.apache.axis.encoding.ser.

          qName = new javax.xml.namespace.QName(_URN,


          cls = java.lang.String[].class;


          qName = new javax.xml.namespace.QName(
                  _NAMESPACE_URI, _LOCALPART);

          qName2 = null;
          cachedSerFactories.add(new org.apache.axis.encoding.ser.
                  ArraySerializerFactory(qName, qName2));

          cachedDeserFactories.add(new org.apache.axis.encoding.ser.



View raw message