db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1626590 - in /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque: Torque.java criteria/Criteria.java manager/NoOpMethodResultCache.java om/mapper/DateMapper.java sql/Query.java util/ExceptionMapperImpl.java
Date Sun, 21 Sep 2014 15:15:08 GMT
Author: tfischer
Date: Sun Sep 21 15:15:07 2014
New Revision: 1626590

URL: http://svn.apache.org/r1626590
Log:
Fix checkstyle errors

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/manager/NoOpMethodResultCache.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/DateMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java Sun
Sep 21 15:15:07 2014
@@ -193,14 +193,14 @@ public final class Torque
      * @return The requested Manager.
      */
     @SuppressWarnings("unchecked")
-	public static <T extends AbstractBaseManager<? extends Persistent>> T getManager(final
String name)
+    public static <T extends AbstractBaseManager<? extends Persistent>> T getManager(final
String name)
     {
         /*
          *  The cast is necessary to work around bug
          *  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
          *  in JDK 5.0
          */
-        return (T)getInstance().getManager(name);
+        return (T) getInstance().getManager(name);
     }
 
     /**
@@ -222,7 +222,7 @@ public final class Torque
          *  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
          *  in JDK 5.0
          */
-        return (T)getInstance().getManager(name, defaultClassName);
+        return (T) getInstance().getManager(name, defaultClassName);
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
Sun Sep 21 15:15:07 2014
@@ -194,8 +194,13 @@ public class Criteria implements Seriali
     /** The JDBC statement fetch size, if any. */
     private Integer fetchSize;
 
+    /** The operator used to connect the crizeria parts for set operations. */
     private SqlEnum setOperator;
 
+    /** The parts of a Criteria which consists of several criteria
+     * connected by a set operation.
+     * Set operations are e.g. UNION, INTERSECT, EXCEPT...
+     */
     private final List<Criteria> setCriteriaParts;
 
     /**
@@ -2379,7 +2384,7 @@ public class Criteria implements Seriali
      *
      * @throws TorqueRuntimeException if this Criteria is a composite Criteria.
      */
-    protected void assertNoComposite() throws TorqueRuntimeException
+    protected void assertNoComposite()
     {
         if (isComposite())
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/manager/NoOpMethodResultCache.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/manager/NoOpMethodResultCache.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/manager/NoOpMethodResultCache.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/manager/NoOpMethodResultCache.java
Sun Sep 21 15:15:07 2014
@@ -33,7 +33,7 @@ import org.apache.torque.TorqueException
 public class NoOpMethodResultCache
     extends MethodResultCache
 {
-    public NoOpMethodResultCache(GroupCacheAccess cache)
+    public NoOpMethodResultCache(final GroupCacheAccess cache)
     {
         super();
     }
@@ -41,6 +41,7 @@ public class NoOpMethodResultCache
     /**
      * Clear the cache
      */
+    @Override
     public void clear()
     {
        //empty
@@ -50,7 +51,7 @@ public class NoOpMethodResultCache
      * @see org.apache.torque.manager.MethodResultCache#getImpl(org.apache.torque.manager.MethodCacheKey)
      */
     @Override
-    protected Object getImpl(MethodCacheKey key)
+    protected Object getImpl(final MethodCacheKey key)
     {
         return null;
     }
@@ -59,7 +60,7 @@ public class NoOpMethodResultCache
      * @see org.apache.torque.manager.MethodResultCache#putImpl(org.apache.torque.manager.MethodCacheKey,
java.lang.Object)
      */
     @Override
-    protected Object putImpl(MethodCacheKey key, Object value) throws TorqueException
+    protected Object putImpl(final MethodCacheKey key, final Object value) throws TorqueException
     {
         return null;
     }
@@ -68,25 +69,29 @@ public class NoOpMethodResultCache
      * @see org.apache.torque.manager.MethodResultCache#removeImpl(org.apache.torque.manager.MethodCacheKey)
      */
     @Override
-    protected Object removeImpl(MethodCacheKey key)
+    protected Object removeImpl(final MethodCacheKey key)
     {
         return null;
     }
 
     /**
-     * @see org.apache.torque.manager.MethodResultCache#get(java.io.Serializable, java.lang.String,
java.io.Serializable[])
+     * @see org.apache.torque.manager.MethodResultCache#get(
+     *     java.io.Serializable,
+     *     java.lang.String, java.io.Serializable[])
      */
     @Override
-    public <T> T get(Serializable instanceOrClass, String method, Serializable... arg)
+    public <T> T get(final Serializable instanceOrClass, final String method, final
Serializable... arg)
     {
         return null;
     }
 
     /**
-     * @see org.apache.torque.manager.MethodResultCache#put(java.lang.Object, java.io.Serializable,
java.lang.String, java.io.Serializable[])
+     * @see org.apache.torque.manager.MethodResultCache#put(
+     *     java.lang.Object, java.io.Serializable,
+     *     java.lang.String, java.io.Serializable[])
      */
     @Override
-    public <T> void put(T value, Serializable instanceOrClass, String method, Serializable...
arg)
+    public <T> void put(final T value, final Serializable instanceOrClass, final String
method, final Serializable... arg)
     {
         //empty
     }
@@ -95,7 +100,7 @@ public class NoOpMethodResultCache
      * @see org.apache.torque.manager.MethodResultCache#removeAll(java.io.Serializable, java.lang.String)
      */
     @Override
-    public void removeAll(Serializable instanceOrClass, String method)
+    public void removeAll(final Serializable instanceOrClass, final String method)
     {
         //empty
     }
@@ -104,7 +109,7 @@ public class NoOpMethodResultCache
      * @see org.apache.torque.manager.MethodResultCache#remove(java.io.Serializable, java.lang.String,
java.io.Serializable[])
      */
     @Override
-    public <T> T remove(Serializable instanceOrClass, String method, Serializable...
arg)
+    public <T> T remove(final Serializable instanceOrClass, final String method, final
Serializable... arg)
     {
         return null;
     }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/DateMapper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/DateMapper.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/DateMapper.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/DateMapper.java
Sun Sep 21 15:15:07 2014
@@ -81,7 +81,8 @@ public class DateMapper implements Recor
             java.util.Date value = resultSet.getTimestamp(
                     rowOffset + internalOffset + 1);
             return value;
-        } catch (SQLException e)
+        }
+        catch (SQLException e)
         {
             throw new TorqueException("Result could not be mapped to a Date", e);
         }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/Query.java
Sun Sep 21 15:15:07 2014
@@ -178,7 +178,7 @@ public class Query
     /**
      * The Operator connecting the parts of the query.
      */
-    public String partOperator;
+    private String partOperator;
 
     /**
      * Retrieve the modifier buffer in order to add modifiers to this
@@ -607,7 +607,7 @@ public class Query
 
             if (Type.UPDATE == type)
             {
-            	stringBuilder.append(SET);
+                stringBuilder.append(SET);
                 first = true;
                 for (Map.Entry<Column, JdbcTypedValue> entry
                         : updateValues.entrySet())

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java?rev=1626590&r1=1626589&r2=1626590&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
Sun Sep 21 15:15:07 2014
@@ -32,9 +32,11 @@ import org.apache.torque.TorqueException
  */
 public class ExceptionMapperImpl extends ExceptionMapper
 {
+    /** ORA-00060: Deadlock detected while waiting for resource. */
+    private static final int ORACLE_DEADLOCK_ERROR_CODE = 60;
 
     @Override
-    public TorqueException toTorqueException(SQLException sqlException)
+    public TorqueException toTorqueException(final SQLException sqlException)
     {
         if (StringUtils.startsWith(sqlException.getSQLState(), "23"))
         {
@@ -51,7 +53,7 @@ public class ExceptionMapperImpl extends
             return new DeadlockException(sqlException);
         }
         if (StringUtils.equals(sqlException.getSQLState(), "61000")
-                && sqlException.getErrorCode() == 60)
+                && sqlException.getErrorCode() == ORACLE_DEADLOCK_ERROR_CODE)
         {
             // oracle
             return new DeadlockException(sqlException);



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


Mime
View raw message