dion        2004/09/05 19:55:04

  Modified:    jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/impl
                        GridBagConstraintBean.java
  Log:
  Introduce constant for error message
  
  Revision  Changes    Path
  1.8       +8 -5      
jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/impl/GridBagConstraintBean.java
  
  Index: GridBagConstraintBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/impl/GridBagConstraintBean.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GridBagConstraintBean.java        6 Sep 2004 02:51:06 -0000       1.7
  +++ GridBagConstraintBean.java        6 Sep 2004 02:55:04 -0000       1.8
  @@ -45,6 +45,9 @@
       
       /** Logging output */
       private static final Log LOG = LogFactory.getLog(GridBagConstraintBean.class);
  +    
  +    /** error message */
  +    private static final String ILLEGAL_ANCHOR_MSG = "Anchor must be one of  the 
GridBagLayout constants for the current Java version.";
   
       public GridBagConstraintBean() {
       }
  @@ -165,7 +168,7 @@
           else if (this.anchor ==  getByReflection("LAST_LINE_END"))
               return "last_line_end";
           
  -        throw new IllegalArgumentException("Anchor must be one of  the 
GridBagLayout constants: CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, 
WEST, or NORTHWEST.");
  +        throw new IllegalArgumentException(ILLEGAL_ANCHOR_MSG);
       }
   
       /** Accepts one of the strings with the same name as the constants 
  @@ -335,16 +338,16 @@
               return rv.intValue();
           } catch (SecurityException e) {
               LOG.debug(e);
  -            throw new IllegalArgumentException("Anchor must be one of  the 
GridBagLayout constants for the current Java version.");
  +            throw new IllegalArgumentException(ILLEGAL_ANCHOR_MSG);
           } catch (NoSuchFieldException e) {
               LOG.debug(e);
  -            throw new IllegalArgumentException("Anchor must be one of  the 
GridBagLayout constants for the current Java version.");
  +            throw new IllegalArgumentException(ILLEGAL_ANCHOR_MSG);
           } catch (IllegalArgumentException e) {
               LOG.debug(e);
  -            throw new IllegalArgumentException("Anchor must be one of  the 
GridBagLayout constants for the current Java version.");
  +            throw new IllegalArgumentException(ILLEGAL_ANCHOR_MSG);
           } catch (IllegalAccessException e) {
               LOG.debug(e);
  -            throw new IllegalArgumentException("Anchor must be one of  the 
GridBagLayout constants for the current Java version.");
  +            throw new IllegalArgumentException(ILLEGAL_ANCHOR_MSG);
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to