[jsword-svn] jsword/java/jsword/org/crosswire/jsword/passage s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sat Mar 19 11:45:01 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage
In directory www.crosswire.org:/tmp/cvs-serv30421/java/jsword/org/crosswire/jsword/passage

Modified Files:
	RangedPassage.java AccuracyType.java AbstractPassage.java 
	BibleInfo.java PassageKeyFactory.java VerseRange.java 
	PassageTally.java 
Log Message:
Update pmd ruleset.xml, adding new rules, (re)testing all rules, and cleaning up trivial reports.

Index: VerseRange.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/VerseRange.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** VerseRange.java	30 Aug 2004 09:27:07 -0000	1.36
--- VerseRange.java	19 Mar 2005 18:44:58 -0000	1.37
***************
*** 1134,1138 ****
       * All ctors init this so leave default
       */
!     protected transient Verse start;
  
      /**
--- 1134,1138 ----
       * All ctors init this so leave default
       */
!     /* pkg protected */ transient Verse start;
  
      /**
***************
*** 1140,1144 ****
       * All ctors init this so leave default
       */
!     protected transient Verse end;
  
      /**
--- 1140,1144 ----
       * All ctors init this so leave default
       */
!     /* pkg protected */ transient Verse end;
  
      /**
***************
*** 1162,1166 ****
       * The log stream
       */
!     protected static final transient Logger log = Logger.getLogger(VerseRange.class);
  
  }
--- 1162,1166 ----
       * The log stream
       */
!     /* pkg protected */ static final transient Logger log = Logger.getLogger(VerseRange.class);
  
  }

Index: AbstractPassage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/AbstractPassage.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** AbstractPassage.java	21 Sep 2004 17:46:23 -0000	1.36
--- AbstractPassage.java	19 Mar 2005 18:44:58 -0000	1.37
***************
*** 143,151 ****
          // is that the user does not need to know the actual type of the
          // Object he is using.
!         if (!(obj instanceof Passage)) return false;
  
          Passage ref = (Passage) obj;
          // The real test
!         if (!ref.getName().equals(getName())) return false;
  
          return true;
--- 143,157 ----
          // is that the user does not need to know the actual type of the
          // Object he is using.
!         if (!(obj instanceof Passage))
!         {
!             return false;
!         }
  
          Passage ref = (Passage) obj;
          // The real test
!         if (!ref.getName().equals(getName()))
!         {
!             return false;
!         }
  
          return true;
***************
*** 309,313 ****
      public int chaptersInPassage(int book) throws NoSuchVerseException
      {
!         if (book != 0)  BibleInfo.validate(book, 1, 1);
  
          int current_chapter = 0;
--- 315,322 ----
      public int chaptersInPassage(int book) throws NoSuchVerseException
      {
!         if (book != 0)
!         {
!             BibleInfo.validate(book, 1, 1);
!         }
  
          int current_chapter = 0;
***************
*** 423,427 ****
--- 432,438 ----
          {
              if (!contains((VerseBase) that_it.next()))
+             {
                  return false;
+             }
          }
  
***************
*** 947,951 ****
  
          String[] parts = StringUtil.split(refs, AbstractPassage.REF_ALLOWED_DELIMS);
!         if (parts.length == 0) return;
  
          // We treat the first as a special case because there is
--- 958,965 ----
  
          String[] parts = StringUtil.split(refs, AbstractPassage.REF_ALLOWED_DELIMS);
!         if (parts.length == 0)
!         {
!             return;
!         }
  
          // We treat the first as a special case because there is

Index: RangedPassage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/RangedPassage.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** RangedPassage.java	8 Sep 2004 19:55:08 -0000	1.18
--- RangedPassage.java	19 Mar 2005 18:44:58 -0000	1.19
***************
*** 175,179 ****
          {
              VerseRange this_range = (VerseRange) it.next();
!             if (this_range.contains(that_range)) return true;
          }
  
--- 175,182 ----
          {
              VerseRange this_range = (VerseRange) it.next();
!             if (this_range.contains(that_range))
!             {
!                 return true;
!             }
          }
  
***************
*** 297,301 ****
                      // ... remove it and add the remainder
                      VerseRange interstect = VerseRange.intersection(this_range, that_range);
!                     if (interstect != null) new_store.add(interstect);
                  }
              }
--- 300,307 ----
                      // ... remove it and add the remainder
                      VerseRange interstect = VerseRange.intersection(this_range, that_range);
!                     if (interstect != null)
!                     {
!                         new_store.add(interstect);
!                     }
                  }
              }

Index: BibleInfo.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/BibleInfo.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** BibleInfo.java	18 Mar 2005 15:38:10 -0000	1.28
--- BibleInfo.java	19 Mar 2005 18:44:58 -0000	1.29
***************
*** 877,881 ****
          for (int i = 0; i < text.length(); i++)
          {
!             if (Character.isLetter(text.charAt(i))) return true;
          }
  
--- 877,884 ----
          for (int i = 0; i < text.length(); i++)
          {
!             if (Character.isLetter(text.charAt(i)))
!             {
!                 return true;
!             }
          }
  

Index: PassageTally.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/PassageTally.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** PassageTally.java	24 Jan 2005 23:29:45 -0000	1.31
--- PassageTally.java	19 Mar 2005 18:44:58 -0000	1.32
***************
*** 259,263 ****
              {
                  Verse verse = (Verse) it.next();
!                 retcode.append(verse.getName() + " (" + (100 * it.lastRank() / max) + "%)"); //$NON-NLS-1$ //$NON-NLS-2$
  
                  count++;
--- 259,266 ----
              {
                  Verse verse = (Verse) it.next();
!                 retcode.append(verse.getName());
!                 retcode.append(" ("); //$NON-NLS-1$
!                 retcode.append(100 * it.lastRank() / max);
!                 retcode.append("%)"); //$NON-NLS-1$
  
                  count++;
***************
*** 321,325 ****
--- 324,330 ----
          {
              if (board[verses[i].getOrdinal() - 1] == 0)
+             {
                  return false;
+             }
          }
  
***************
*** 350,354 ****
--- 355,361 ----
          {
              if (verse.equals(it.next()))
+             {
                  return reply;
+             }
  
              reply++;
***************
*** 507,511 ****
--- 514,520 ----
              {
                  if (that_rt.board[i] != 0)
+                 {
                      kill(i + 1);
+                 }
              }
          }
***************
*** 733,737 ****
--- 742,748 ----
  
          if (tally > 0)
+         {
              incrementMax(tally);
+         }
      }
  
***************
*** 850,854 ****
--- 861,867 ----
              {
                  if (next > BibleInfo.versesInBible())
+                 {
                      throw new NoSuchElementException();
+                 }
  
                  Object retcode = new Verse(next);

Index: AccuracyType.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/AccuracyType.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** AccuracyType.java	24 Jan 2005 23:29:45 -0000	1.7
--- AccuracyType.java	19 Mar 2005 18:44:58 -0000	1.8
***************
*** 706,714 ****
                  if (!foundLetters)
                  {
!                     if (Character.isLetter(word.charAt(i))) foundLetters = true;
                  }
                  else
                  {
!                     if (!Character.isLetter(word.charAt(i))) break;
                  }
              }
--- 706,720 ----
                  if (!foundLetters)
                  {
!                     if (Character.isLetter(word.charAt(i)))
!                     {
!                         foundLetters = true;
!                     }
                  }
                  else
                  {
!                     if (!Character.isLetter(word.charAt(i)))
!                     {
!                         break;
!                     }
                  }
              }

Index: PassageKeyFactory.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/PassageKeyFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PassageKeyFactory.java	30 Aug 2004 09:27:07 -0000	1.7
--- PassageKeyFactory.java	19 Mar 2005 18:44:58 -0000	1.8
***************
*** 381,385 ****
--- 381,387 ----
  
                  if ((buffer[idx0] & (1 << bit)) != 0)
+                 {
                      ref.add(new Verse(ord));
+                 }
              }
              // index gets left behind here, but we dont care



More information about the jsword-svn mailing list