<?xml version="1.0"?>

<ruleset name="scratchpad" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../etc/ruleset_xml_schema.xml">
  <description>
These are new rules that are still in progress
  </description>


    <rule name="UnnecessaryLocalBeforeReturn"
          message="Consider simply returning the value vs storing it in local variable ''{0}''"
          class="net.sourceforge.pmd.rules.design.UnnecessaryLocalBeforeReturn"
          externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#UnnecessaryLocalBeforeReturn">
      <description>
Avoid unnecessarily creating local variables
      </description>
        <priority>3</priority>
      <example>
  <![CDATA[
  public class Foo {
    public int foo() {
      int x = doSomething();
      return x;  // instead, just 'return doSomething();'
    }
  }
  ]]>
      </example>
    </rule>


    <!--
    <rule name="UselessAssignment"
           message="This assignment to ''{0}'' is useless"
           class="net.sourceforge.pmd.rules.UselessAssignment"
           dfa="true">
       <description>
This assignment is useless
       </description>
         <priority>3</priority>
       <example>
   <![CDATA[
public class Foo {
 public void foo() {
  int x = 2; // useless assignment!
  x = 5;
  bar(x);
 }
}
   ]]>
       </example>
     </rule>
-->

    <!--

     <rule name="PositionalIterator"
           message="Avoid positional iterators"
           class="net.sourceforge.pmd.rules.design.PositionalIteratorRule">
       <description>
       Avoid positional iterators.   This doesn't work yet,
       it breaks on stuff like this:
       public class Foo {
        private int baz = true;
        public void bar(Iterator i) {
         Object x = null;
         while (i.hasNext()) {
          if (baz) {
           x = i.next();
          } else {
           x = new Runnable() {public void run() {Object bif = i.next();}}
          }
         }
        }
       }
       See javax.security.auth.Subject.java, inner class SecureSet, method removeAll(), around line 1092 for a good example.
       </description>
       <example>
   <![CDATA[
   public class PositionalIterators {
    public void foo(Iterator i) {
     while(i.hasNext()) {
      Object one = i.next();
      // 2 calls to next() inside the loop == bad!
      Object two = i.next();
     }
    }
   }
   ]]>
       </example>
       </rule>

       -->

</ruleset>
