cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rica...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library XSPGlobalLibrary.java
Date Sun, 09 Jan 2000 02:47:05 GMT
ricardo     00/01/08 18:47:05

  Modified:    src/org/apache/cocoon/processor/xsp/library
                        XSPGlobalLibrary.java
  Log:
  Removed redundant methods. Removed Java2 dependency
  
  Revision  Changes    Path
  1.3       +9 -22     xml-cocoon/src/org/apache/cocoon/processor/xsp/library/XSPGlobalLibrary.java
  
  Index: XSPGlobalLibrary.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/XSPGlobalLibrary.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XSPGlobalLibrary.java	2000/01/05 19:38:00	1.2
  +++ XSPGlobalLibrary.java	2000/01/09 02:47:05	1.3
  @@ -67,31 +67,19 @@
   
   public class XSPGlobalLibrary {
     // XSPGlobal
  -  public static Object getAttribute(XSPGlobal global, String name) {
  -    if (name == null || name.length() == 0) {
  -      return null;
  -    }
  -
  -    return global.getAttribute(name);
  -  }
  -
     public static Element getAttribute(XSPGlobal global, String name, Document document)
{
  -    Object value = getAttribute(global, name);
  -
  -    if (value == null) {
  -      return null;
  -    }
  -
  +    Object value = global.getAttribute(name);
       Element element = document.createElement("global:attribute");
  -
       element.setAttribute("name", name);
   
  -    if (value instanceof XObject) {
  -      DocumentFragment fragment = document.createDocumentFragment();
  -      ((XObject) value).toDOM(fragment);
  -      element.appendChild(fragment);
  -    } else {
  -      element.appendChild(document.createTextNode(value.toString()));
  +    if (value != null) {
  +      if (value instanceof XObject) {
  +        DocumentFragment fragment = document.createDocumentFragment();
  +        ((XObject) value).toDOM(fragment);
  +        element.appendChild(fragment);
  +      } else {
  +        element.appendChild(document.createTextNode(value.toString()));
  +      }
       }
   
       return element;
  @@ -107,7 +95,6 @@
   
       String[] attributeNames = new String[v.size()];
       v.copyInto(attributeNames);
  -    Arrays.sort(attributeNames); // Since Java2
   
       return attributeNames;
     }
  
  
  

Mime
View raw message