chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1497981 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ chemistry-opencmis-client/chemistry-opencmis-client-bindi...
Date Sat, 29 Jun 2013 04:38:02 GMT
Author: fmui
Date: Sat Jun 29 04:38:00 2013
New Revision: 1497981

URL: http://svn.apache.org/r1497981
Log:
code clean up

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/HtmlDoc.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/RenditionDataImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectServicePort10.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryServicePort10.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AclEditorFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/AddObjectToFolderPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/RemoveObjectFromFolderPanel.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/HtmlDoc.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/HtmlDoc.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/HtmlDoc.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/HtmlDoc.java Sat Jun 29 04:38:00 2013
@@ -20,11 +20,11 @@ package org.apache.chemistry.opencmis.cl
 
 public class HtmlDoc extends AtomBase {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	@Override
-	public String getType() {
-		return "HTML document";
-	}
+    @Override
+    public String getType() {
+        return "HTML document";
+    }
 
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java Sat Jun 29 04:38:00 2013
@@ -444,8 +444,7 @@ public final class CmisHttpCookie implem
     @Override
     public Object clone() {
         try {
-            CmisHttpCookie obj = (CmisHttpCookie) super.clone();
-            return obj;
+            return (CmisHttpCookie) super.clone();
         } catch (CloneNotSupportedException e) {
             return null;
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java Sat Jun 29 04:38:00 2013
@@ -51,15 +51,15 @@ public class RenditionImpl extends Rendi
     }
 
     public long getLength() {
-        return length == null ? -1 : length.longValue();
+        return getBigLength() == null ? -1 : getBigLength().longValue();
     }
 
     public long getHeight() {
-        return height == null ? -1 : height.longValue();
+        return getBigHeight() == null ? -1 : getBigHeight().longValue();
     }
 
     public long getWidth() {
-        return width == null ? -1 : width.longValue();
+        return getBigWidth() == null ? -1 : getBigWidth().longValue();
     }
 
     public Document getRenditionDocument() {
@@ -67,10 +67,10 @@ public class RenditionImpl extends Rendi
     }
 
     public Document getRenditionDocument(OperationContext context) {
-        if (renditionDocumentId == null) {
+        if (getRenditionDocumentId() == null) {
             return null;
         }
-        CmisObject rendDoc = session.getObject(renditionDocumentId, context);
+        CmisObject rendDoc = session.getObject(getRenditionDocumentId(), context);
         if (!(rendDoc instanceof Document)) {
             return null;
         }
@@ -79,14 +79,14 @@ public class RenditionImpl extends Rendi
     }
 
     public ContentStream getContentStream() {
-        if ((objectId == null) || (streamId == null)) {
+        if ((objectId == null) || (getStreamId() == null)) {
             return null;
         }
 
         ContentStream contentStream;
         try {
             contentStream = session.getBinding().getObjectService()
-                    .getContentStream(session.getRepositoryInfo().getId(), objectId, streamId, null, null, null);
+                    .getContentStream(session.getRepositoryInfo().getId(), objectId, getStreamId(), null, null, null);
         } catch (CmisConstraintException e) {
             // no content stream
             return null;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java Sat Jun 29 04:38:00 2013
@@ -348,8 +348,7 @@ public class ObjectFactoryImpl implement
                 ObjectType secondaryType = session.getTypeDefinition(secondaryTypeId.toString());
                 if (!(secondaryType instanceof SecondaryType)) {
                     throw new IllegalArgumentException(
-                            "Secondary types property contains a type that is not a secondary type: "
-                                    + secondaryTypeId);
+                            "Secondary types property contains a type that is not a secondary type: " + secondaryTypeId);
                 }
 
                 allSecondaryTypes.add((SecondaryType) secondaryType);
@@ -655,14 +654,15 @@ public class ObjectFactoryImpl implement
 
     private void throwWrongTypeError(Object obj, String type, Class<?> clazz, String id) {
         String expectedTypes;
-        if (clazz.equals(BigInteger.class))
+        if (clazz.equals(BigInteger.class)) {
             expectedTypes = "<BigInteger, Byte, Short, Integer, Long>";
-        else if (clazz.equals(BigDecimal.class))
+        } else if (clazz.equals(BigDecimal.class)) {
             expectedTypes = "<BigDecimal, Double, Float, Byte, Short, Integer, Long>";
-        else if (clazz.equals(GregorianCalendar.class))
+        } else if (clazz.equals(GregorianCalendar.class)) {
             expectedTypes = "<java.util.GregorianCalendar, java.util.Date>";
-        else
+        } else {
             expectedTypes = clazz.getName();
+        }
 
         String message = "Property '" + id + "' is a " + type + " property. Expected type '" + expectedTypes
                 + "' but received a '" + obj.getClass().getName() + "' property.";

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLWalker.java Sat Jun 29 04:38:00 2013
@@ -50,12 +50,13 @@ public abstract class XMLWalker<T> {
             int event = parser.getEventType();
             if (event == XMLStreamReader.START_ELEMENT) {
                 QName name = parser.getName();
-                if (!read(parser, name, result))
+                if (!read(parser, name, result)) {
                     if (result instanceof ExtensionsData) {
                         handleExtension(parser, (ExtensionsData) result);
                     } else {
                         skip(parser);
                     }
+                }
             } else if (event == XMLStreamReader.END_ELEMENT) {
                 break;
             } else {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java Sat Jun 29 04:38:00 2013
@@ -36,8 +36,8 @@ public class PropertiesImpl extends Abst
 
     private static final long serialVersionUID = 1L;
 
-    List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
-    Map<String, PropertyData<?>> properties = new LinkedHashMap<String, PropertyData<?>>();
+    private final List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
+    private final Map<String, PropertyData<?>> properties = new LinkedHashMap<String, PropertyData<?>>();
 
     /**
      * Constructor.

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/RenditionDataImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/RenditionDataImpl.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/RenditionDataImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/RenditionDataImpl.java Sat Jun 29 04:38:00 2013
@@ -29,14 +29,14 @@ public class RenditionDataImpl extends A
 
     private static final long serialVersionUID = 1L;
 
-    protected String streamId;
+    private String streamId;
     private String mimeType;
-    protected BigInteger length;
+    private BigInteger length;
     private String kind;
     private String title;
-    protected BigInteger width;
-    protected BigInteger height;
-    protected String renditionDocumentId;
+    private BigInteger width;
+    private BigInteger height;
+    private String renditionDocumentId;
 
     public RenditionDataImpl() {
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParser.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParser.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/parser/JSONParser.java Sat Jun 29 04:38:00 2013
@@ -138,17 +138,17 @@ public class JSONParser {
                     switch (token.type) {
                     case Yytoken.TYPE_VALUE:
                         status = S_IN_FINISHED_VALUE;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(token.value);
                         break;
                     case Yytoken.TYPE_LEFT_BRACE:
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(createObjectContainer(containerFactory));
                         break;
                     case Yytoken.TYPE_LEFT_SQUARE:
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(createArrayContainer(containerFactory));
                         break;
                     default:
@@ -157,10 +157,11 @@ public class JSONParser {
                     break;
 
                 case S_IN_FINISHED_VALUE:
-                    if (token.type == Yytoken.TYPE_EOF)
+                    if (token.type == Yytoken.TYPE_EOF) {
                         return valueStack.removeFirst();
-                    else
+                    } else {
                         throw new JSONParseException(getPosition(), JSONParseException.ERROR_UNEXPECTED_TOKEN, token);
+                    }
 
                 case S_IN_OBJECT:
                     switch (token.type) {
@@ -171,7 +172,7 @@ public class JSONParser {
                             String key = (String) token.value;
                             valueStack.addFirst(key);
                             status = S_PASSED_PAIR_KEY;
-                            statusStack.addFirst(new Integer(status));
+                            statusStack.addFirst(Integer.valueOf(status));
                         } else {
                             status = S_IN_ERROR;
                         }
@@ -209,7 +210,7 @@ public class JSONParser {
                         List<Object> newArray = createArrayContainer(containerFactory);
                         parent.put(key, newArray);
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(newArray);
                         break;
                     case Yytoken.TYPE_LEFT_BRACE:
@@ -219,7 +220,7 @@ public class JSONParser {
                         Map<String, Object> newObject = createObjectContainer(containerFactory);
                         parent.put(key, newObject);
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(newObject);
                         break;
                     default:
@@ -249,7 +250,7 @@ public class JSONParser {
                         Map<String, Object> newObject = createObjectContainer(containerFactory);
                         val.add(newObject);
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(newObject);
                         break;
                     case Yytoken.TYPE_LEFT_SQUARE:
@@ -257,7 +258,7 @@ public class JSONParser {
                         List<Object> newArray = createArrayContainer(containerFactory);
                         val.add(newArray);
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
+                        statusStack.addFirst(Integer.valueOf(status));
                         valueStack.addFirst(newArray);
                         break;
                     default:
@@ -280,8 +281,9 @@ public class JSONParser {
 
     private void nextToken() throws JSONParseException, IOException {
         token = lexer.yylex();
-        if (token == null)
+        if (token == null) {
             token = new Yytoken(Yytoken.TYPE_EOF, null);
+        }
     }
 
     private Map<String, Object> createObjectContainer(ContainerFactory containerFactory) {
@@ -348,7 +350,8 @@ public class JSONParser {
      * @throws IOException
      * @throws JSONParseException
      */
-    public void parse(Reader in, ContentHandler contentHandler, boolean isResume) throws IOException, JSONParseException {
+    public void parse(Reader in, ContentHandler contentHandler, boolean isResume) throws IOException,
+            JSONParseException {
         if (!isResume) {
             reset(in);
             handlerStatusStack = new LinkedList<Integer>();
@@ -371,21 +374,24 @@ public class JSONParser {
                     switch (token.type) {
                     case Yytoken.TYPE_VALUE:
                         status = S_IN_FINISHED_VALUE;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.primitive(token.value))
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.primitive(token.value)) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_BRACE:
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startObject())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startObject()) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_SQUARE:
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startArray())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startArray()) {
                             return;
+                        }
                         break;
                     default:
                         status = S_IN_ERROR;
@@ -412,9 +418,10 @@ public class JSONParser {
                         if (token.value instanceof String) {
                             String key = (String) token.value;
                             status = S_PASSED_PAIR_KEY;
-                            statusStack.addFirst(new Integer(status));
-                            if (!contentHandler.startObjectEntry(key))
+                            statusStack.addFirst(Integer.valueOf(status));
+                            if (!contentHandler.startObjectEntry(key)) {
                                 return;
+                            }
                         } else {
                             status = S_IN_ERROR;
                         }
@@ -426,8 +433,9 @@ public class JSONParser {
                         } else {
                             status = S_IN_FINISHED_VALUE;
                         }
-                        if (!contentHandler.endObject())
+                        if (!contentHandler.endObject()) {
                             return;
+                        }
                         break;
                     default:
                         status = S_IN_ERROR;
@@ -443,26 +451,30 @@ public class JSONParser {
                     case Yytoken.TYPE_VALUE:
                         statusStack.removeFirst();
                         status = peekStatus(statusStack);
-                        if (!contentHandler.primitive(token.value))
+                        if (!contentHandler.primitive(token.value)) {
                             return;
-                        if (!contentHandler.endObjectEntry())
+                        }
+                        if (!contentHandler.endObjectEntry()) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_SQUARE:
                         statusStack.removeFirst();
-                        statusStack.addFirst(new Integer(S_IN_PAIR_VALUE));
+                        statusStack.addFirst(Integer.valueOf(S_IN_PAIR_VALUE));
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startArray())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startArray()) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_BRACE:
                         statusStack.removeFirst();
-                        statusStack.addFirst(new Integer(S_IN_PAIR_VALUE));
+                        statusStack.addFirst(Integer.valueOf(S_IN_PAIR_VALUE));
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startObject())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startObject()) {
                             return;
+                        }
                         break;
                     default:
                         status = S_IN_ERROR;
@@ -477,8 +489,9 @@ public class JSONParser {
                      */
                     statusStack.removeFirst();
                     status = peekStatus(statusStack);
-                    if (!contentHandler.endObjectEntry())
+                    if (!contentHandler.endObjectEntry()) {
                         return;
+                    }
                     break;
 
                 case S_IN_ARRAY:
@@ -487,8 +500,9 @@ public class JSONParser {
                     case Yytoken.TYPE_COMMA:
                         break;
                     case Yytoken.TYPE_VALUE:
-                        if (!contentHandler.primitive(token.value))
+                        if (!contentHandler.primitive(token.value)) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_RIGHT_SQUARE:
                         if (statusStack.size() > 1) {
@@ -497,20 +511,23 @@ public class JSONParser {
                         } else {
                             status = S_IN_FINISHED_VALUE;
                         }
-                        if (!contentHandler.endArray())
+                        if (!contentHandler.endArray()) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_BRACE:
                         status = S_IN_OBJECT;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startObject())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startObject()) {
                             return;
+                        }
                         break;
                     case Yytoken.TYPE_LEFT_SQUARE:
                         status = S_IN_ARRAY;
-                        statusStack.addFirst(new Integer(status));
-                        if (!contentHandler.startArray())
+                        statusStack.addFirst(Integer.valueOf(status));
+                        if (!contentHandler.startArray()) {
                             return;
+                        }
                         break;
                     default:
                         status = S_IN_ERROR;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectServicePort10.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectServicePort10.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectServicePort10.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectServicePort10.java Sat Jun 29 04:38:00 2013
@@ -38,17 +38,17 @@ import org.apache.chemistry.opencmis.com
 public interface ObjectServicePort10 extends ObjectServicePort {
 
     @WebMethod(action = "createItem", exclude = true)
-    public void createItem(String repositoryId, CmisPropertiesType properties, String folderId,
+    void createItem(String repositoryId, CmisPropertiesType properties, String folderId,
             CmisAccessControlListType addACEs, CmisAccessControlListType removeACEs,
             Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException;
 
     @WebMethod(action = "bulkUpdateProperties", exclude = true)
-    public void bulkUpdateProperties(String repositoryId, CmisBulkUpdateType bulkUpdateData,
+    void bulkUpdateProperties(String repositoryId, CmisBulkUpdateType bulkUpdateData,
             Holder<CmisExtensionType> extension, Holder<CmisObjectIdAndChangeTokenType> objectIdAndChangeToken)
             throws CmisException;
 
     @WebMethod(action = "appendContentStream", exclude = true)
-    public void appendContentStream(String repositoryId, Holder<String> objectId, Boolean isLastChunk,
+    void appendContentStream(String repositoryId, Holder<String> objectId, Boolean isLastChunk,
             Holder<String> changeToken, CmisContentStreamType contentStream, Holder<CmisExtensionType> extension)
             throws CmisException;
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryServicePort10.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryServicePort10.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryServicePort10.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryServicePort10.java Sat Jun 29 04:38:00 2013
@@ -34,14 +34,13 @@ import org.apache.chemistry.opencmis.com
 public interface RepositoryServicePort10 extends RepositoryServicePort {
 
     @WebMethod(action = "createType", exclude = true)
-    public void createType(String repositoryId, Holder<CmisTypeDefinitionType> type, CmisExtensionType extension)
+    void createType(String repositoryId, Holder<CmisTypeDefinitionType> type, CmisExtensionType extension)
             throws CmisException;
 
     @WebMethod(action = "updateType", exclude = true)
-    public void updateType(String repositoryId, Holder<CmisTypeDefinitionType> type, CmisExtensionType extension)
+    void updateType(String repositoryId, Holder<CmisTypeDefinitionType> type, CmisExtensionType extension)
             throws CmisException;
 
     @WebMethod(action = "deleteType", exclude = true)
-    public void deleteType(String repositoryId, String typeId, Holder<CmisExtensionType> extension)
-            throws CmisException;
+    void deleteType(String repositoryId, String typeId, Holder<CmisExtensionType> extension) throws CmisException;
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java Sat Jun 29 04:38:00 2013
@@ -20,6 +20,7 @@ package org.apache.chemistry.opencmis.se
 
 import java.io.Serializable;
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -48,7 +49,7 @@ public class Dispatcher implements Seria
     private static final Logger LOG = LoggerFactory.getLogger(Dispatcher.class.getName());
 
     private final boolean caseSensitive;
-    private final HashMap<String, ServiceCall> serviceCallMap;
+    private final Map<String, ServiceCall> serviceCallMap;
 
     public Dispatcher() {
         this(true);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java Sat Jun 29 04:38:00 2013
@@ -93,9 +93,9 @@ public class TypeValidator {
 
             // check general constraints for all property types
             if (propDef.getCardinality() == Cardinality.SINGLE) {
-                if(prop.getValues() != null && prop.getValues().size() > 1) {
+                if (prop.getValues() != null && prop.getValues().size() > 1) {
                     throw new CmisConstraintException("The property with id " + propDef.getId()
-                        + " is single valued, but multiple values are passed " + prop.getValues());
+                            + " is single valued, but multiple values are passed " + prop.getValues());
                 }
             }
 
@@ -250,7 +250,8 @@ public class TypeValidator {
         validateProperties(typeDef, properties, checkMandatory, false);
     }
 
-    public static <T> void validateProperties(TypeDefinition typeDef, Properties properties, boolean checkMandatory, boolean cmis11) {
+    public static <T> void validateProperties(TypeDefinition typeDef, Properties properties, boolean checkMandatory,
+            boolean cmis11) {
         List<String> propDefsRequired = getMandatoryPropDefs(typeDef.getPropertyDefinitions());
 
         if (properties != null) {
@@ -286,8 +287,9 @@ public class TypeValidator {
 
     public static <T> void validateProperties(List<TypeDefinition> typeDefs, Properties properties,
             boolean checkMandatory) {
-        if (properties == null)
+        if (properties == null) {
             return;
+        }
 
         Map<String, Boolean> checkedProperties = new HashMap<String, Boolean>();
         for (String propId : properties.getProperties().keySet()) {
@@ -308,7 +310,9 @@ public class TypeValidator {
                 }
 
                 if (isSystemProperty(baseTypeId, propertyId, true)) {
-                    checkedProperties.put(prop.getId(), true); // ignore system properties for validation
+                    checkedProperties.put(prop.getId(), true); // ignore system
+                                                               // properties for
+                                                               // validation
                 } else if (typeContainsProperty(typeDef, propertyId)) {
                     // Check if all properties are known in the type
                     // marked the property as found in a type of primary or
@@ -330,8 +334,9 @@ public class TypeValidator {
         // check if all properties are known in a type definition
         List<String> unknownProperties = new ArrayList<String>();
         for (String propId : properties.getProperties().keySet()) {
-            if (!checkedProperties.get(propId))
+            if (!checkedProperties.get(propId)) {
                 unknownProperties.add(propId);
+            }
         }
         if (!unknownProperties.isEmpty()) {
             throw new CmisConstraintException(
@@ -364,12 +369,14 @@ public class TypeValidator {
     }
 
     protected static void validateAllowedTypes(TypeDefinition typeDef, List<String> allowedTypes, String description) {
-        if (null == allowedTypes || allowedTypes.size() == 0)
+        if (null == allowedTypes || allowedTypes.size() == 0) {
             return; // all types are allowed
+        }
 
         for (String allowedType : allowedTypes) {
-            if (allowedType.equals(typeDef.getId()))
+            if (allowedType.equals(typeDef.getId())) {
                 return;
+            }
         }
         throw new CmisConstraintException("The requested type " + typeDef.getId() + " is not allowed " + description);
     }
@@ -413,11 +420,7 @@ public class TypeValidator {
 
         PropertyDefinition<?> propDef = propDefs.get(propertyId);
 
-        if (null == propDef) {
-            return false; // unknown property id in this type
-        } else {
-            return true;
-        }
+        return propDef != null;
     }
 
     public static boolean typeContainsPropertyWithQueryName(TypeDefinition typeDef, String propertyQueryName) {
@@ -428,7 +431,7 @@ public class TypeValidator {
         }
 
         for (PropertyDefinition<?> propDef : propDefs.values()) {
-            if (propDef.getQueryName().toLowerCase().equals(propertyQueryName.toLowerCase())) {
+            if (propDef.getQueryName().equalsIgnoreCase(propertyQueryName)) {
                 return true;
             }
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java Sat Jun 29 04:38:00 2013
@@ -18,51 +18,51 @@
  */
 package org.apache.chemistry.opencmis.server.support.filter;
 
-
 /* 
  * A super simple JSON pretty printer
  */
 
-public class JsonPrettyPrinter  {
+public class JsonPrettyPrinter {
 
     private int indent = 0;
     private String indentStr;
     private StringBuffer sb = new StringBuffer();
-    
-    public JsonPrettyPrinter () {
+
+    public JsonPrettyPrinter() {
         init(3);
     }
 
-    public JsonPrettyPrinter (int indent) {
+    public JsonPrettyPrinter(int indent) {
         init(indent);
     }
-    
+
     private void init(int indent) {
         StringBuffer sb = new StringBuffer();
-        for (int i=0; i<indent; i++)
-            sb.append(" ");
+        for (int i = 0; i < indent; i++) {
+            sb.append(' ');
+        }
         indentStr = sb.toString();
     }
-        
+
     public String prettyPrint(String jsonStr) {
-        for (int i=0; i<jsonStr.length(); i++)  {
+        for (int i = 0; i < jsonStr.length(); i++) {
             char c = jsonStr.charAt(i);
             writeChar(c);
         }
         return sb.toString();
     }
-    
+
     private void writeChar(char c) {
-        if (((char) c) == '[' || ((char) c) == '{') {
+        if (c == '[' || c == '{') {
             sb.append(c);
             sb.append('\n');
             indent++;
             addIndent();
-        } else if (((char) c) == ',') {
+        } else if (c == ',') {
             sb.append(c);
             sb.append('\n');
             addIndent();
-        } else if (((char) c) == ']' || ((char) c) == '}') {
+        } else if (c == ']' || c == '}') {
             sb.append('\n');
             indent--;
             addIndent();
@@ -78,7 +78,7 @@ public class JsonPrettyPrinter  {
             sb.append(indentStr);
         }
     }
-    
+
     public static void main(String[] args) {
         args = new String[2];
         args[0] = "[0,{\"1\":{\"2\":{\"3\":{\"4\":[5,{\"6\":7}]}}}}]";

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java Sat Jun 29 04:38:00 2013
@@ -68,30 +68,37 @@ public class LoggingFilter implements Fi
     private int indent = -1;
 
     public void init(FilterConfig cfg) throws ServletException {
-        
-        String val; 
+
+        String val;
         logDir = cfg.getInitParameter("LogDir");
-        if (null == logDir || logDir.length() == 0)
+        if (null == logDir || logDir.length() == 0) {
             logDir = System.getProperty("java.io.tmpdir");
-        if (null == logDir|| logDir.length() == 0)
+        }
+        if (null == logDir || logDir.length() == 0) {
             logDir = "." + File.separator;
+        }
 
-        if (!logDir.endsWith(File.separator))
+        if (!logDir.endsWith(File.separator)) {
             logDir += File.separator;
+        }
 
         val = cfg.getInitParameter("Indent");
-        if (null != val)
+        if (null != val) {
             indent = Integer.parseInt(val);
-        if (indent < 0)
+        }
+        if (indent < 0) {
             indent = 4;
+        }
 
         val = cfg.getInitParameter("PrettyPrint");
-        if (null != val)
+        if (null != val) {
             prettyPrint = Boolean.parseBoolean(val);
+        }
 
         val = cfg.getInitParameter("LogHeaders");
-        if (null != val)
+        if (null != val) {
             logHeaders = Boolean.parseBoolean(val);
+        }
     }
 
     public void destroy() {
@@ -102,9 +109,9 @@ public class LoggingFilter implements Fi
         LOG.debug("Logging filter doFilter");
 
         if (resp instanceof HttpServletResponse && req instanceof HttpServletRequest) {
-            LoggingRequestWrapper logReq = new LoggingRequestWrapper((HttpServletRequest)req);
-            LoggingResponseWrapper logResponse = new LoggingResponseWrapper((HttpServletResponse)resp);
-            
+            LoggingRequestWrapper logReq = new LoggingRequestWrapper((HttpServletRequest) req);
+            LoggingResponseWrapper logResponse = new LoggingResponseWrapper((HttpServletResponse) resp);
+
             chain.doFilter(logReq, logResponse);
 
             int reqNo = getNextRequestNumber();
@@ -112,56 +119,58 @@ public class LoggingFilter implements Fi
             String cType = logReq.getContentType();
             String xmlRequest = logReq.getPayload();
             StringBuffer sb = new StringBuffer();
-            
-            if (logHeaders)
+
+            if (logHeaders) {
                 logHeaders(logReq, sb);
+            }
 
-            if (xmlRequest == null || xmlRequest.length() == 0)
+            if (xmlRequest == null || xmlRequest.length() == 0) {
                 xmlRequest = "";
+            }
 
             if (prettyPrint && cType != null) {
                 if (cType.startsWith("multipart")) {
                     xmlRequest = processMultipart(cType, xmlRequest);
-                } else if (cType.contains("xml")) { 
+                } else if (cType.contains("xml")) {
                     xmlRequest = prettyPrintXml(xmlRequest, indent);
                 }
             }
-            
+
             xmlRequest = sb.toString() + xmlRequest;
             LOG.debug("Found request: " + requestFileName + ": " + xmlRequest);
             writeTextToFile(requestFileName, xmlRequest);
-            
 
             sb = new StringBuffer();
             cType = logResponse.getContentType();
             String xmlResponse = logResponse.getPayload();
             String responseFileName = getResponseFileName(reqNo);
-            
+
             if (logHeaders) {
                 logHeaders(logResponse, req.getProtocol(), sb);
             }
-            
-            if (xmlResponse == null || xmlResponse.length() == 0) 
+
+            if (xmlResponse == null || xmlResponse.length() == 0) {
                 xmlResponse = "";
+            }
 
             if (prettyPrint && cType != null) {
                 if (cType.startsWith("multipart")) {
                     xmlResponse = processMultipart(cType, xmlResponse);
-                } else if (cType.contains("xml")) { 
+                } else if (cType.contains("xml")) {
                     xmlResponse = prettyPrintXml(xmlResponse, indent);
-                } else if (cType.contains("json")) { 
+                } else if (cType.contains("json")) {
                     xmlResponse = prettyPrintJson(xmlResponse, indent);
                 }
             }
-                
+
             xmlResponse = sb.toString() + xmlResponse;
-            LOG.debug("Found response: " + responseFileName  + ": " + xmlResponse);
+            LOG.debug("Found response: " + responseFileName + ": " + xmlResponse);
             writeTextToFile(responseFileName, xmlResponse);
-        } else {            
+        } else {
             chain.doFilter(req, resp);
         }
     }
-    
+
     private void writeTextToFile(String filename, String content) {
         PrintWriter pw = null;
         FileWriter fw = null;
@@ -189,7 +198,7 @@ public class LoggingFilter implements Fi
                 }
         }
     }
-    
+
     private static String prettyPrintXml(String input, int indent) {
         try {
             Source xmlInput = new StreamSource(new StringReader(input));
@@ -197,25 +206,27 @@ public class LoggingFilter implements Fi
             StreamResult xmlOutput = new StreamResult(stringWriter);
             TransformerFactory transformerFactory = TransformerFactory.newInstance();
             transformerFactory.setAttribute("indent-number", indent);
-            Transformer transformer = transformerFactory.newTransformer(); 
+            Transformer transformer = transformerFactory.newTransformer();
             transformer.setOutputProperty(OutputKeys.INDENT, "yes");
             transformer.transform(xmlInput, xmlOutput);
             return xmlOutput.getWriter().toString();
         } catch (Exception e) {
-            throw new RuntimeException(e); // simple exception handling, please review it
+            throw new RuntimeException(e); // simple exception handling, please
+                                           // review it
         }
     }
-    
+
     private static String prettyPrintJson(String input, int indent) {
         JsonPrettyPrinter pp = new JsonPrettyPrinter(indent);
         return pp.prettyPrint(input);
     }
-    
+
     private String processMultipart(String cType, String messageBody) throws IOException {
         int beginIndex = cType.indexOf("boundary=\"") + 10;
-        int endIndex = cType.indexOf("\"", beginIndex);
-        if (endIndex < 0)
+        int endIndex = cType.indexOf('\"', beginIndex);
+        if (endIndex < 0) {
             endIndex = cType.length();
+        }
         String boundary = "--" + cType.substring(beginIndex, endIndex);
         LOG.debug("Boundary = " + boundary);
         BufferedReader in = new BufferedReader(new StringReader(messageBody));
@@ -223,7 +234,7 @@ public class LoggingFilter implements Fi
         String line;
         ByteArrayOutputStream xmlBodyBuffer = new ByteArrayOutputStream();
         boolean boundaryFound;
-        
+
         boolean inXmlOrJsonBody = false;
         boolean inXmlOrJsonPart = false;
         boolean isXml;
@@ -232,10 +243,10 @@ public class LoggingFilter implements Fi
                 if (line.startsWith("<?xml") || line.startsWith("{")) {
                     inXmlOrJsonBody = true;
                     isXml = line.startsWith("<?xml");
-                    xmlBodyBuffer.write(line.getBytes(), 0, line.length());                   
-                    while (inXmlOrJsonBody)  {
+                    xmlBodyBuffer.write(line.getBytes(), 0, line.length());
+                    while (inXmlOrJsonBody) {
                         line = in.readLine();
-                        if(line == null) {
+                        if (line == null) {
                             break;
                         }
                         boundaryFound = line.startsWith(boundary);
@@ -243,15 +254,17 @@ public class LoggingFilter implements Fi
                             LOG.debug("Leaving XML body: " + line);
                             inXmlOrJsonBody = false;
                             inXmlOrJsonPart = false;
-                            if (isXml)
+                            if (isXml) {
                                 out.append(prettyPrintXml(xmlBodyBuffer.toString(), indent));
-                            else
+                            } else {
                                 out.append(prettyPrintJson(xmlBodyBuffer.toString(), indent));
+                            }
                             out.append(line).append("\n");
-                        } else
+                        } else {
                             xmlBodyBuffer.write(line.getBytes(), 0, line.length());
-                    }               
-                } else { 
+                        }
+                    }
+                } else {
                     LOG.debug("in XML part is: " + line);
                     out.append(line).append("\n");
                 }
@@ -266,9 +279,9 @@ public class LoggingFilter implements Fi
                 }
             }
         }
-        in.close();        
+        in.close();
         LOG.debug("End parsing multipart.");
-        
+
         return out.toString();
     }
 
@@ -289,7 +302,8 @@ public class LoggingFilter implements Fi
         while (headerNames.hasMoreElements()) {
             String headerName = headerNames.nextElement().toString();
             headerName = headerName.substring(0, 1).toUpperCase() + headerName.substring(1);
-            sb.append(headerName + ": ");
+            sb.append(headerName);
+            sb.append(": ");
             sb.append(req.getHeader(headerName));
             sb.append("\n");
         }
@@ -302,11 +316,11 @@ public class LoggingFilter implements Fi
         sb.append(String.valueOf(resp.getStatus()));
         sb.append("\n");
         Map<String, String> headers = resp.getHeaders();
-        for ( Map.Entry<String, String> header: headers.entrySet()) {
+        for (Map.Entry<String, String> header : headers.entrySet()) {
             sb.append(header.getKey());
             sb.append(": ");
             sb.append(header.getValue());
-            sb.append("\n");            
+            sb.append("\n");
         }
         sb.append("\n");
     }
@@ -314,264 +328,269 @@ public class LoggingFilter implements Fi
     private String getRequestFileName(int no) {
         return logDir + String.format("%05d-request.log", no);
     }
-    
+
     private String getResponseFileName(int no) {
         return logDir + String.format("%05d-response.log", no);
     }
-    
+
     private static synchronized int getNextRequestNumber() {
         return REQUEST_NO++;
     }
-    
+
     private class LoggingRequestWrapper extends HttpServletRequestWrapper {
-        
+
         private LoggingInputStream is;
-   
+
         public LoggingRequestWrapper(HttpServletRequest request) throws IOException {
-           super(request);
+            super(request);
         }
-   
+
         @Override
         public ServletInputStream getInputStream() throws IOException {
             this.is = new LoggingInputStream(super.getInputStream());
             return is;
         }
-   
+
         public String getPayload() {
-           return null == is ? "" : is.getPayload();
+            return null == is ? "" : is.getPayload();
         }
-     }
-   
-     private class LoggingInputStream extends ServletInputStream {
-   
+    }
+
+    private class LoggingInputStream extends ServletInputStream {
+
         private ByteArrayOutputStream baous = new ByteArrayOutputStream();
         private ServletInputStream is;
-   
+
         public LoggingInputStream(ServletInputStream is) {
-           super();
-           this.is = is;
+            super();
+            this.is = is;
         }
-   
-        // Since we are not sure which method is used just overwrite all 4 of them:
+
+        // Since we are not sure which method is used just overwrite all 4 of
+        // them:
         @Override
         public int read() throws IOException {
-           int ch = is.read();
-           if (ch != -1) {
-              baous.write(ch);
-           }
-           return ch;
+            int ch = is.read();
+            if (ch != -1) {
+                baous.write(ch);
+            }
+            return ch;
         }
-   
+
         @Override
         public int read(byte[] b) throws IOException {
-           int ch = is.read(b);
-           if (ch != -1) {
-              baous.write(b, 0, ch);
-           }
-           return ch;
+            int ch = is.read(b);
+            if (ch != -1) {
+                baous.write(b, 0, ch);
+            }
+            return ch;
         }
-   
+
         @Override
         public int read(byte[] b, int o, int l) throws IOException {
-           int ch = is.read(b, o, l);
-           if (ch != -1) {
-              baous.write(b, o, ch);
-           }
-           return ch;
+            int ch = is.read(b, o, l);
+            if (ch != -1) {
+                baous.write(b, o, ch);
+            }
+            return ch;
         }
-        
+
         @Override
         public int readLine(byte[] b, int o, int l) throws IOException {
-           int ch = is.readLine(b, o, l);
-           if (ch != -1) {
-               baous.write(b, o, ch);
-           }
-           return ch;
+            int ch = is.readLine(b, o, l);
+            if (ch != -1) {
+                baous.write(b, o, ch);
+            }
+            return ch;
         }
-   
+
         public String getPayload() {
-           return baous.toString();
+            return baous.toString();
         }
-     }
-     
-     private class LoggingResponseWrapper extends HttpServletResponseWrapper {
-         
-         private LoggingOutputStream os;
-         private PrintWriter writer;
-         private int statusCode;
-         private Map<String, String> headers = new HashMap<String, String>();
-         String encoding;
-         
-         public LoggingResponseWrapper(HttpServletResponse response) throws IOException {
+    }
+
+    private class LoggingResponseWrapper extends HttpServletResponseWrapper {
+
+        private LoggingOutputStream os;
+        private PrintWriter writer;
+        private int statusCode;
+        private Map<String, String> headers = new HashMap<String, String>();
+        private String encoding;
+
+        public LoggingResponseWrapper(HttpServletResponse response) throws IOException {
             super(response);
             this.os = new LoggingOutputStream(response.getOutputStream());
-         }
-    
-         @Override
-         public PrintWriter getWriter() {
+        }
+
+        @Override
+        public PrintWriter getWriter() {
             try {
-                if (null == writer)
+                if (null == writer) {
                     writer = new PrintWriter(this.getOutputStream());
+                }
                 return writer;
             } catch (IOException e) {
-                LOG.error("Failed to get PrintWriter in LoggingFilter: "+ e);
+                LOG.error("Failed to get PrintWriter in LoggingFilter: " + e);
                 e.printStackTrace();
-                return null;             
+                return null;
             }
-         }
-         
-         @Override
-         public ServletOutputStream getOutputStream() throws IOException {
+        }
+
+        @Override
+        public ServletOutputStream getOutputStream() throws IOException {
             return os;
-         }
-    
-         public String getPayload() {
+        }
+
+        public String getPayload() {
             return os.getPayload();
-         }
-         
-         @Override
-         public void addCookie(Cookie cookie) {
-             super.addCookie(cookie);
-             String value;
-             if (headers.containsKey("Cookie")) {
-                 value = headers.get("Cookie") + "; " + cookie.toString();
-             } else
-                 value = cookie.toString();
-             headers.put("Cookie", value);
-         }
-         
-         @Override
-         public void setContentType(String type) {
-             super.setContentType(type);
-             if (headers.containsKey("Content-Type")) {
-                 String cType = headers.get("Content-Type");
-                 int pos = cType.indexOf(";charset=");
-                 if (pos < 0 && encoding != null)
-                     type = cType + ";charset=" + encoding;
-                 else if (pos >= 0)
-                     encoding = null;                 
-             }
-             headers.put("Content-Type", type);             
-         }
-         
-         @Override         
-         public void setCharacterEncoding(java.lang.String charset) {
-             super.setCharacterEncoding(charset);
-             encoding = charset;
-             if (headers.containsKey("Content-Type")) {
-                 String cType = headers.get("Content-Type");
-                 int pos = cType.indexOf(";charset=");
-                 if (pos >=0)
-                     cType = cType.substring(0, pos) + ";charset=" + encoding;
-                 else
-                     cType = cType + ";charset=" + encoding;
-                 headers.put("Content-Type", cType);
-             }
-         }
-         
-         @Override
-         public void setContentLength(int len) {
-             super.setContentLength(len);
-             headers.put("Content-Length", String.valueOf(len));                          
-         }
-         
-         private String getDateString(long date) {
-             return FORMAT.format(new Date(date));             
-         }
-         
-         @Override
-         public void setDateHeader(String name, long date) {
-             super.setDateHeader(name, date);
-             headers.put(name, String.valueOf(getDateString(date)));
-         }
-         
-         @Override
-         public void addDateHeader(String name, long date) {
-             super.addDateHeader(name, date);
-             if (headers.containsKey(name)) {
-                 headers.put(name, headers.get(name) + "; " + getDateString(date));
-             } else {
-                 headers.put(name, String.valueOf(getDateString(date)));
-             }
-         }
-         
-         @Override
-         public void setHeader(String name, String value) {
-             super.setHeader(name, value);
-             headers.put(name, String.valueOf(value));
-         }
-
-         @Override
-         public void addHeader(String name, String value) {
-             super.addHeader(name, value);
-             if (headers.containsKey(name)) {
-                 headers.put(name, headers.get(name) + "; " + value);
-             } else {
-                 headers.put(name, String.valueOf(value));
-             }
-         }
-         
-         @Override
-         public void setIntHeader(String name, int value) {
-             super.setIntHeader(name, value);
-             headers.put(name, String.valueOf(value));
-         }
-         
-         @Override
-         public void addIntHeader(String name, int value) {
-             super.addIntHeader(name, value);
-             if (headers.containsKey(name)) {
-                 headers.put(name, headers.get(name) + "; " + String.valueOf(value));
-             } else {
-                 headers.put(name, String.valueOf(value));
-             }
-         }
-         
-         @Override
-         public void sendError(int sc) throws IOException {
-             statusCode = sc;
-             super.sendError(sc);
-         }
-
-         @Override
-         public void sendError(int sc, String msg) throws IOException {
-             statusCode = sc;
-             super.sendError(sc, msg);
-         }
-
-         @Override
-         public void sendRedirect(String location) throws IOException {
-             statusCode = 302;
-             super.sendRedirect(location);
-         }
-
-         @Override
-         public void setStatus(int sc) {
-             statusCode = sc;
-             super.setStatus(sc);
-         }
-
-         public int getStatus() {
-             return statusCode;
-         }
-
-         public Map<String, String> getHeaders() {
-             return headers;
-         }
-      }
-    
-      private class LoggingOutputStream extends ServletOutputStream {
-          private ByteArrayOutputStream baous = new ByteArrayOutputStream();
-          private ServletOutputStream os;
-     
-          public LoggingOutputStream(ServletOutputStream os) {
-             super();
-             this.os = os;
-          }
-          
-          public String getPayload() {
-              return new String(baous.toString());
-           }
+        }
+
+        @Override
+        public void addCookie(Cookie cookie) {
+            super.addCookie(cookie);
+            String value;
+            if (headers.containsKey("Cookie")) {
+                value = headers.get("Cookie") + "; " + cookie.toString();
+            } else {
+                value = cookie.toString();
+            }
+            headers.put("Cookie", value);
+        }
+
+        @Override
+        public void setContentType(String type) {
+            super.setContentType(type);
+            if (headers.containsKey("Content-Type")) {
+                String cType = headers.get("Content-Type");
+                int pos = cType.indexOf(";charset=");
+                if (pos < 0 && encoding != null) {
+                    type = cType + ";charset=" + encoding;
+                } else if (pos >= 0) {
+                    encoding = null;
+                }
+            }
+            headers.put("Content-Type", type);
+        }
+
+        @Override
+        public void setCharacterEncoding(java.lang.String charset) {
+            super.setCharacterEncoding(charset);
+            encoding = charset;
+            if (headers.containsKey("Content-Type")) {
+                String cType = headers.get("Content-Type");
+                int pos = cType.indexOf(";charset=");
+                if (pos >= 0) {
+                    cType = cType.substring(0, pos) + ";charset=" + encoding;
+                } else {
+                    cType = cType + ";charset=" + encoding;
+                }
+                headers.put("Content-Type", cType);
+            }
+        }
+
+        @Override
+        public void setContentLength(int len) {
+            super.setContentLength(len);
+            headers.put("Content-Length", String.valueOf(len));
+        }
+
+        private String getDateString(long date) {
+            return FORMAT.format(new Date(date));
+        }
+
+        @Override
+        public void setDateHeader(String name, long date) {
+            super.setDateHeader(name, date);
+            headers.put(name, String.valueOf(getDateString(date)));
+        }
+
+        @Override
+        public void addDateHeader(String name, long date) {
+            super.addDateHeader(name, date);
+            if (headers.containsKey(name)) {
+                headers.put(name, headers.get(name) + "; " + getDateString(date));
+            } else {
+                headers.put(name, String.valueOf(getDateString(date)));
+            }
+        }
+
+        @Override
+        public void setHeader(String name, String value) {
+            super.setHeader(name, value);
+            headers.put(name, value);
+        }
+
+        @Override
+        public void addHeader(String name, String value) {
+            super.addHeader(name, value);
+            if (headers.containsKey(name)) {
+                headers.put(name, headers.get(name) + "; " + value);
+            } else {
+                headers.put(name, value);
+            }
+        }
+
+        @Override
+        public void setIntHeader(String name, int value) {
+            super.setIntHeader(name, value);
+            headers.put(name, String.valueOf(value));
+        }
+
+        @Override
+        public void addIntHeader(String name, int value) {
+            super.addIntHeader(name, value);
+            if (headers.containsKey(name)) {
+                headers.put(name, headers.get(name) + "; " + value);
+            } else {
+                headers.put(name, String.valueOf(value));
+            }
+        }
+
+        @Override
+        public void sendError(int sc) throws IOException {
+            statusCode = sc;
+            super.sendError(sc);
+        }
+
+        @Override
+        public void sendError(int sc, String msg) throws IOException {
+            statusCode = sc;
+            super.sendError(sc, msg);
+        }
+
+        @Override
+        public void sendRedirect(String location) throws IOException {
+            statusCode = 302;
+            super.sendRedirect(location);
+        }
+
+        @Override
+        public void setStatus(int sc) {
+            statusCode = sc;
+            super.setStatus(sc);
+        }
+
+        public int getStatus() {
+            return statusCode;
+        }
+
+        public Map<String, String> getHeaders() {
+            return headers;
+        }
+    }
+
+    private class LoggingOutputStream extends ServletOutputStream {
+        private ByteArrayOutputStream baous = new ByteArrayOutputStream();
+        private ServletOutputStream os;
+
+        public LoggingOutputStream(ServletOutputStream os) {
+            super();
+            this.os = os;
+        }
+
+        public String getPayload() {
+            return new String(baous.toString());
+        }
 
         @Override
         public void write(byte[] b, int off, int len) {
@@ -582,10 +601,9 @@ public class LoggingFilter implements Fi
                 throw new RuntimeException(e);
             }
         }
-        
+
         @Override
-        public
-        void write(byte[] b) {
+        public void write(byte[] b) {
             try {
                 baous.write(b);
                 os.write(b);
@@ -593,11 +611,11 @@ public class LoggingFilter implements Fi
                 throw new RuntimeException(e);
             }
         }
-         
+
         @Override
         public void write(int ch) throws IOException {
             baous.write(ch);
             os.write(ch);
         }
-      }
+    }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AclEditorFrame.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AclEditorFrame.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AclEditorFrame.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AclEditorFrame.java Sat Jun 29 04:38:00 2013
@@ -86,11 +86,9 @@ public class AclEditorFrame extends JFra
         this.model = model;
         this.object = object;
 
-        Object[] principals;
+        // get users
+        List<String> princiaplList = new ArrayList<String>();
         try {
-            // get users
-            List<String> princiaplList = new ArrayList<String>();
-
             princiaplList.add("");
             princiaplList.add("cmis:user");
 
@@ -123,29 +121,29 @@ public class AclEditorFrame extends JFra
 
                 princiaplList.addAll(aclPrinciaplList);
             }
-
-            principals = princiaplList.toArray();
         } catch (Exception ex) {
-            principals = new Object[] { "", "cmis:user" };
+            princiaplList = new ArrayList<String>();
+            princiaplList.add("");
+            princiaplList.add("cmis:user");
         }
 
-        Object[] permissions;
+        // get permissions
+        List<String> permissionsList = new ArrayList<String>();
         try {
-            // get permissions
-            List<String> permissionsList = new ArrayList<String>();
             permissionsList.add("");
-
             for (PermissionDefinition pd : model.getRepositoryInfo().getAclCapabilities().getPermissions()) {
                 permissionsList.add(pd.getId());
             }
-
-            permissions = permissionsList.toArray();
         } catch (Exception ex) {
-            permissions = new Object[] { "", "cmis:read", "cmis:write", "cmis:all" };
+            permissionsList = new ArrayList<String>();
+            permissionsList.add("");
+            permissionsList.add("cmis:read");
+            permissionsList.add("cmis:write");
+            permissionsList.add("cmis:all");
         }
 
-        addAceList = new AceList(principals, permissions);
-        removeAceList = new AceList(principals, permissions);
+        addAceList = new AceList(princiaplList, permissionsList);
+        removeAceList = new AceList(princiaplList, permissionsList);
 
         createGUI();
     }
@@ -307,10 +305,10 @@ public class AclEditorFrame extends JFra
         private static final long serialVersionUID = 1L;
 
         private final List<AceInputPanel> panels;
-        private final Object[] principals;
-        private final Object[] permissions;
+        private final List<String> principals;
+        private final List<String> permissions;
 
-        public AceList(final Object[] principals, final Object[] permissions) {
+        public AceList(final List<String> principals, final List<String> permissions) {
             super();
 
             panels = new ArrayList<AceInputPanel>();
@@ -365,14 +363,15 @@ public class AclEditorFrame extends JFra
 
         private static final ImageIcon ICON_REMOVE = ClientHelper.getIcon("remove.png");
 
-        private final Object[] permissions;
+        private final List<String> permissions;
 
         private int position;
-        private final JComboBox principalBox;
+        private final JComboBox<String> principalBox;
         private final JPanel permissionsPanel;
-        private final List<JComboBox> permissionBoxes;
+        private final List<JComboBox<String>> permissionBoxes;
 
-        public AceInputPanel(final AceList list, final Object[] principals, final Object[] permissions, int position) {
+        public AceInputPanel(final AceList list, final List<String> principals, final List<String> permissions,
+                int position) {
             super();
 
             this.permissions = permissions;
@@ -408,7 +407,7 @@ public class AclEditorFrame extends JFra
             c.fill = GridBagConstraints.HORIZONTAL;
             c.anchor = GridBagConstraints.LINE_START;
 
-            principalBox = new JComboBox(principals);
+            principalBox = new JComboBox<String>(principals.toArray(new String[0]));
             principalBox.setEditable(true);
             principalBox.setPrototypeDisplayValue("1234567890123456789012345");
 
@@ -422,7 +421,7 @@ public class AclEditorFrame extends JFra
             permissionsPanel.setLayout(new BoxLayout(permissionsPanel, BoxLayout.Y_AXIS));
             permissionsPanel.setOpaque(false);
 
-            permissionBoxes = new ArrayList<JComboBox>();
+            permissionBoxes = new ArrayList<JComboBox<String>>();
 
             updatePermissionsPanel(false);
 
@@ -446,8 +445,8 @@ public class AclEditorFrame extends JFra
             add(removeButton, c);
         }
 
-        private JComboBox createPermissionBox() {
-            JComboBox result = new JComboBox(permissions);
+        private JComboBox<String> createPermissionBox() {
+            JComboBox<String> result = new JComboBox<String>(permissions.toArray(new String[0]));
             result.setEditable(true);
             result.setPrototypeDisplayValue("1234567890123456789012345");
 
@@ -496,7 +495,7 @@ public class AclEditorFrame extends JFra
             if (changed) {
                 permissionsPanel.removeAll();
 
-                for (JComboBox box : permissionBoxes) {
+                for (JComboBox<String> box : permissionBoxes) {
                     permissionsPanel.add(box);
                 }
 
@@ -525,7 +524,7 @@ public class AclEditorFrame extends JFra
         public Ace getAce() {
             List<String> permissions = new ArrayList<String>();
 
-            for (JComboBox box : permissionBoxes) {
+            for (JComboBox<String> box : permissionBoxes) {
                 String permission = box.getSelectedItem().toString().trim();
                 if (permission.length() > 0) {
                     permissions.add(permission);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/AddObjectToFolderPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/AddObjectToFolderPanel.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/AddObjectToFolderPanel.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/AddObjectToFolderPanel.java Sat Jun 29 04:38:00 2013
@@ -61,7 +61,7 @@ public class AddObjectToFolderPanel exte
 
     @Override
     public boolean isAllowed() {
-        if (getObject() == null || !(getObject() instanceof FileableCmisObject)) {
+        if (!(getObject() instanceof FileableCmisObject)) {
             return false;
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/RemoveObjectFromFolderPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/RemoveObjectFromFolderPanel.java?rev=1497981&r1=1497980&r2=1497981&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/RemoveObjectFromFolderPanel.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/RemoveObjectFromFolderPanel.java Sat Jun 29 04:38:00 2013
@@ -69,7 +69,7 @@ public class RemoveObjectFromFolderPanel
 
     @Override
     public boolean isAllowed() {
-        if (getObject() == null || !(getObject() instanceof FileableCmisObject)) {
+        if (!(getObject() instanceof FileableCmisObject)) {
             return false;
         }
 



Mime
View raw message