Author: adrianc
Date: Fri Jul 30 03:40:16 2010
New Revision: 980645
URL: http://svn.apache.org/viewvc?rev=980645&view=rev
Log:
Added two new annotations, and did some code cleanups. No functional change.
Added:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
(with props)
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java (with
props)
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ComparableRange.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/LockedBy.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/SourceMonitored.java
Added: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java?rev=980645&view=auto
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
(added)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java Fri
Jul 30 03:40:16 2010
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.ofbiz.base.lang;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Identifies the valid state(s) of a field or variable. */
+...@documented
+...@retention(RetentionPolicy.SOURCE)
+...@target({ElementType.FIELD, ElementType.LOCAL_VARIABLE})
+public @interface ClassInvariant {
+ String value();
+}
Propchange:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ClassInvariant.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ComparableRange.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ComparableRange.java?rev=980645&r1=980644&r2=980645&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ComparableRange.java
(original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ComparableRange.java Fri
Jul 30 03:40:16 2010
@@ -20,6 +20,7 @@ package org.ofbiz.base.lang;
/** An immutable range of values. */
@SourceMonitored
+...@threadsafe
public class ComparableRange<T extends Comparable<T>> implements Range<T>,
Comparable<ComparableRange<T>> {
protected final T start;
@@ -71,7 +72,7 @@ public class ComparableRange<T extends C
return true;
}
try {
- ComparableRange that = (ComparableRange) obj;
+ ComparableRange<?> that = (ComparableRange<?>) obj;
return this.start.equals(that.start()) &&
this.end.equals(that.end());
} catch (Exception e) {}
return false;
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/LockedBy.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/LockedBy.java?rev=980645&r1=980644&r2=980645&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/LockedBy.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/LockedBy.java Fri Jul 30
03:40:16 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.ofbiz.base.lang;
import java.lang.annotation.Documented;
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/SourceMonitored.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/SourceMonitored.java?rev=980645&r1=980644&r2=980645&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/SourceMonitored.java
(original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/SourceMonitored.java Fri
Jul 30 03:40:16 2010
@@ -18,7 +18,6 @@
*******************************************************************************/
package org.ofbiz.base.lang;
-import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Added: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java?rev=980645&view=auto
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java (added)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java Fri Jul
30 03:40:16 2010
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.ofbiz.base.lang;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Identifies thread safe classes. */
+...@documented
+...@retention(RetentionPolicy.SOURCE)
+...@target(ElementType.TYPE)
+public @interface ThreadSafe {}
Propchange: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange: ofbiz/trunk/framework/base/src/org/ofbiz/base/lang/ThreadSafe.java
------------------------------------------------------------------------------
svn:mime-type = text/plain