aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/properties/PropertyCache.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
committerJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
commit29e8badcec8bd40eca2ef4940133f08eeefdda11 (patch)
tree7b44a2d058ae8a60ff278f5d26f243eb674e54c6 /src/java/org/apache/fop/fo/properties/PropertyCache.java
parentc81729764a0692e9f5e31ec28722403b603ee5aa (diff)
downloadxmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.tar.gz
xmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.zip
Bugzilla #49733:
Resolved compilation (safe one), Checkstyle and many Javadoc warnings. Submitted by: Glenn Adams <glenn.at.skynav.com> Changes to patch: - Restored the deprecated Graphics2DAdapter method (to be removed after Barcode4J 2.1 is released). - Restored Renderer.startPageSequence(LineArea) pending discussion about removal. - build.xml: set max VM to 1024MB instead of 2048MB to allow for 32-bit JVMs. - build.xml: restored longer taskdef names. - Restored Checkstyle 4 file for people running older IDEs. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/properties/PropertyCache.java')
-rw-r--r--src/java/org/apache/fop/fo/properties/PropertyCache.java30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/fo/properties/PropertyCache.java b/src/java/org/apache/fop/fo/properties/PropertyCache.java
index dc9abb023..920125796 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyCache.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyCache.java
@@ -98,8 +98,13 @@ public final class PropertyCache {
}
/* Wrapper objects to synchronize on */
- private static class CacheSegment {
+ private static final class CacheSegment {
+ CacheSegment() {
+ }
private int count = 0;
+ int getCount() {
+ return count;
+ }
}
private void cleanSegment(int segmentIndex) {
@@ -209,10 +214,11 @@ public final class PropertyCache {
/* try non-synched first */
for (CacheEntry e = entry; e != null; e = e.nextEntry) {
- if (e.hash == hash
- && (q = e.get()) != null
- && eq(q, o)) {
- return q;
+ if ( e.hash == hash ) {
+ q = e.get();
+ if ( ( q != null ) && eq ( q, o ) ) {
+ return q;
+ }
}
}
@@ -223,10 +229,11 @@ public final class PropertyCache {
synchronized (segment) {
entry = table[index];
for (CacheEntry e = entry; e != null; e = e.nextEntry) {
- if (e.hash == hash
- && (q = e.get()) != null
- && eq(q, o)) {
- return q;
+ if ( e.hash == hash ) {
+ q = e.get();
+ if ( ( q != null ) && eq ( q, o ) ) {
+ return q;
+ }
}
}
}
@@ -261,7 +268,8 @@ public final class PropertyCache {
newLength--;
for (int i = table.length; --i >= 0;) {
for (CacheEntry c = table[i]; c != null; c = c.nextEntry) {
- if ((o = c.get()) != null) {
+ o = c.get();
+ if (o != null) {
hash = c.hash;
idx = hash & newLength;
newTable[idx] = new CacheEntry(o, newTable[idx]);
@@ -384,7 +392,7 @@ public final class PropertyCache {
}
/**
- * Checks if the given {@link Marker.MarkerAttribute} is present
+ * Checks if the given {@link org.apache.fop.fo.flow.Marker.MarkerAttribute} is present
* in the cache - if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
*