commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang Entities.java
Date Sat, 26 Jul 2003 15:34:20 GMT
scolebourne    2003/07/26 08:34:19

  Modified:    lang/src/java/org/apache/commons/lang Entities.java
  Log:
  Declare variables final, and rename to capitals
  
  Revision  Changes    Path
  1.12      +15 -14    jakarta-commons/lang/src/java/org/apache/commons/lang/Entities.java
  
  Index: Entities.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/Entities.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Entities.java	26 Jul 2003 00:32:19 -0000	1.11
  +++ Entities.java	26 Jul 2003 15:34:19 -0000	1.12
  @@ -73,20 +73,19 @@
    */
   class Entities {
   
  -    static private String[][] basic = {
  +    private static final String[][] BASIC_ARRAY = {
           {"quot", "34"}, // " - double-quote
           {"amp", "38"}, // & - ampersand
           {"lt", "60"}, // < - less-than
           {"gt", "62"}, // > - greater-than
       };
   
  -    static String[][] apos = {
  +    private static final String[][] APOS_ARRAY = {
           {"apos", "39"}, // XML apostrophe
       };
   
  -    //todo: load these from a DTD file
  -
  -    static String[][] iso8859_1 = {
  +    // package scoped for testing
  +    static final String[][] ISO8859_1_ARRAY = {
           {"nbsp", "160"}, // non-breaking space
           {"iexcl", "161"}, //inverted exclamation mark
           {"cent", "162"}, //cent sign
  @@ -186,7 +185,8 @@
       };
   
       // http://www.w3.org/TR/REC-html40/sgml/entities.html
  -    static String[][] html40 = {
  +    // package scoped for testing
  +    static final String[][] HTML40_ARRAY = {
   // <!-- Latin Extended-B -->
           {"fnof", "402"}, //latin small f with hook = function= florin, U+0192 ISOtech -->
   // <!-- Greek -->
  @@ -387,14 +387,14 @@
   
       static {
           XML = new Entities();
  -        XML.addEntities(basic);
  -        XML.addEntities(apos);
  +        XML.addEntities(BASIC_ARRAY);
  +        XML.addEntities(APOS_ARRAY);
       }
   
       static {
           HTML32 = new Entities();
  -        HTML32.addEntities(basic);
  -        HTML32.addEntities(iso8859_1);
  +        HTML32.addEntities(BASIC_ARRAY);
  +        HTML32.addEntities(ISO8859_1_ARRAY);
       }
   
       static {
  @@ -403,9 +403,9 @@
       }
   
       static void fillWithHtml40Entities(Entities entities) {
  -        entities.addEntities(basic);
  -        entities.addEntities(iso8859_1);
  -        entities.addEntities(html40);
  +        entities.addEntities(BASIC_ARRAY);
  +        entities.addEntities(ISO8859_1_ARRAY);
  +        entities.addEntities(HTML40_ARRAY);
       }
   
       static interface EntityMap {
  @@ -601,6 +601,7 @@
           }
       }
   
  +    // package scoped for testing
       EntityMap map = new Entities.LookupEntityMap();
   
       public void addEntities(String[][] entityArray) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message