no effective change - format

This commit is contained in:
Rob Bygrave
2016-11-17 20:00:01 +13:00
parent 697e4dd0da
commit c410700433
11 changed files with 59 additions and 55 deletions
@@ -1,11 +1,11 @@
package com.avaje.ebean.bean;
import com.avaje.ebean.ExpressionList;
import java.io.Serializable;
import java.util.Collection;
import java.util.Set;
import com.avaje.ebean.ExpressionList;
/**
* Lazy loading capable Maps, Lists and Sets.
* <p>
@@ -23,11 +23,17 @@ import com.avaje.ebean.ExpressionList;
public interface BeanCollection<E> extends Serializable {
enum ModifyListenMode {
/** The common mode */
/**
* The common mode
*/
NONE,
/** Mode used for PrivateOwned */
/**
* Mode used for PrivateOwned
*/
REMOVALS,
/** Mode used for ManyToMany relationships */
/**
* Mode used for ManyToMany relationships
*/
ALL
}
@@ -95,7 +95,7 @@ public final class CallStack implements Serializable {
}
public String getOriginKey(int queryHash) {
return enc(queryHash)+ "." + zeroHash + "." + pathHash;
return enc(queryHash) + "." + zeroHash + "." + pathHash;
}
private static final int radix = 1 << 6;
@@ -116,10 +116,10 @@ public final class CallStack implements Serializable {
}
private static final char intToBase64[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
};
}
@@ -15,9 +15,9 @@ import java.io.Serializable;
public interface EntityBean extends Serializable {
String[] _ebean_getPropertyNames();
String _ebean_getPropertyName(int pos);
/**
* Return the enhancement marker value.
* <p>
@@ -311,7 +311,7 @@ public final class EntityBeanIntercept implements Serializable {
if (idPos > -1) {
// For cases where properties are set on constructor
// set every non Id property to unloaded (for lazy loading)
for (int i=0; i< loadedProps.length; i++) {
for (int i = 0; i < loadedProps.length; i++) {
if (i != idPos) {
loadedProps[i] = false;
}
@@ -486,7 +486,7 @@ public final class EntityBeanIntercept implements Serializable {
public void setPropertyLoaded(String propertyName, boolean loaded) {
int position = findProperty(propertyName);
if (position == -1) {
throw new IllegalArgumentException("Property "+propertyName+" not found");
throw new IllegalArgumentException("Property " + propertyName + " not found");
}
loadedProps[position] = loaded;
}
@@ -526,7 +526,7 @@ public final class EntityBeanIntercept implements Serializable {
*/
public boolean isDirtyProperty(int propertyIndex) {
return (changedProps != null && changedProps[propertyIndex]
|| embeddedDirty != null && embeddedDirty[propertyIndex]);
|| embeddedDirty != null && embeddedDirty[propertyIndex]);
}
/**
@@ -572,7 +572,7 @@ public final class EntityBeanIntercept implements Serializable {
changedProps = new boolean[owner._ebean_getPropertyNames().length];
}
for (int i=0; i< loadedProps.length; i++) {
for (int i = 0; i < loadedProps.length; i++) {
if (loadedProps[i]) {
changedProps[i] = true;
}
@@ -588,7 +588,7 @@ public final class EntityBeanIntercept implements Serializable {
return null;
}
Set<String> props = new LinkedHashSet<>();
for (int i=0; i<loadedProps.length; i++) {
for (int i = 0; i < loadedProps.length; i++) {
if (loadedProps[i]) {
props.add(getProperty(i));
}
@@ -634,8 +634,8 @@ public final class EntityBeanIntercept implements Serializable {
props.add(propName);
} else if (embeddedDirty != null && embeddedDirty[i]) {
// an embedded property has been changed - recurse
EntityBean embeddedBean = (EntityBean)owner._ebean_getField(i);
embeddedBean._ebean_getIntercept().addDirtyPropertyNames(props, getProperty(i)+".");
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
embeddedBean._ebean_getIntercept().addDirtyPropertyNames(props, getProperty(i) + ".");
}
}
}
@@ -665,8 +665,8 @@ public final class EntityBeanIntercept implements Serializable {
/**
* Return a map of dirty properties with their new and old values.
*/
public Map<String,ValuePair> getDirtyValues() {
Map<String,ValuePair> dirtyValues = new LinkedHashMap<>();
public Map<String, ValuePair> getDirtyValues() {
Map<String, ValuePair> dirtyValues = new LinkedHashMap<>();
addDirtyPropertyValues(dirtyValues, null);
return dirtyValues;
}
@@ -674,7 +674,7 @@ public final class EntityBeanIntercept implements Serializable {
/**
* Recursively add dirty properties.
*/
public void addDirtyPropertyValues(Map<String,ValuePair> dirtyValues, String prefix) {
public void addDirtyPropertyValues(Map<String, ValuePair> dirtyValues, String prefix) {
int len = getPropertyLength();
for (int i = 0; i < len; i++) {
if (changedProps != null && changedProps[i]) {
@@ -687,7 +687,7 @@ public final class EntityBeanIntercept implements Serializable {
} else if (embeddedDirty != null && embeddedDirty[i]) {
// an embedded property has been changed - recurse
EntityBean embeddedBean = (EntityBean)owner._ebean_getField(i);
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
embeddedBean._ebean_getIntercept().addDirtyPropertyValues(dirtyValues, getProperty(i) + ".");
}
}
@@ -708,10 +708,10 @@ public final class EntityBeanIntercept implements Serializable {
for (int i = 0; i < len; i++) {
if (changedProps != null && changedProps[i]) {
// the property has been changed on this bean
hash = hash * 31 + (i+1);
hash = hash * 31 + (i + 1);
} else if (embeddedDirty != null && embeddedDirty[i]) {
// an embedded property has been changed - recurse
EntityBean embeddedBean = (EntityBean)owner._ebean_getField(i);
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
hash = hash * 31 + embeddedBean._ebean_getIntercept().addDirtyPropertyHash(hash);
}
}
@@ -726,7 +726,7 @@ public final class EntityBeanIntercept implements Serializable {
int len = getPropertyLength();
for (int i = 0; i < len; i++) {
if (isLoadedProperty(i)) {
hash = hash * 31 + (i+1);
hash = hash * 31 + (i + 1);
}
}
return hash;
@@ -821,7 +821,7 @@ public final class EntityBeanIntercept implements Serializable {
/**
* Helper method to check if two objects are equal.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({"unchecked", "rawtypes"})
protected boolean areEqual(Object obj1, Object obj2) {
if (obj1 == null) {
return (obj2 == null);
@@ -1044,7 +1044,7 @@ public final class EntityBeanIntercept implements Serializable {
} else {
return null;
}
return (pcs == null) ? null : new PropertyChangeEvent(owner, getProperty(propertyIndex), oldValue, newValue);
return (pcs == null) ? null : new PropertyChangeEvent(owner, getProperty(propertyIndex), oldValue, newValue);
}
/**
@@ -1104,7 +1104,7 @@ public final class EntityBeanIntercept implements Serializable {
} else {
return null;
}
return (pcs == null) ? null: new PropertyChangeEvent(owner, getProperty(propertyIndex), oldValue, newValue);
return (pcs == null) ? null : new PropertyChangeEvent(owner, getProperty(propertyIndex), oldValue, newValue);
}
/**
@@ -64,15 +64,15 @@ public final class ObjectGraphNode implements Serializable {
}
public String toString() {
return "origin:" + originQueryPoint + " path[" + path+"]";
return "origin:" + originQueryPoint + " path[" + path + "]";
}
public int hashCode() {
int hc = 31 * originQueryPoint.hashCode();
hc = 31 * hc + (path == null ? 0 : path.hashCode());
return hc;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
@@ -80,10 +80,10 @@ public final class ObjectGraphNode implements Serializable {
if (!(obj instanceof ObjectGraphNode)) {
return false;
}
ObjectGraphNode e = (ObjectGraphNode) obj;
//noinspection StringEquality
return ((e.path == path) || (e.path != null && e.path.equals(path)))
&& e.originQueryPoint.equals(originQueryPoint);
return ((e.path == path) || (e.path != null && e.path.equals(path)))
&& e.originQueryPoint.equals(originQueryPoint);
}
}
@@ -58,7 +58,7 @@ public final class ObjectGraphOrigin implements Serializable {
}
public String toString() {
return "key["+ key + "] type[" + beanType + "] " + callStack.getFirstStackTraceElement()+" ";
return "key[" + key + "] type[" + beanType + "] " + callStack.getFirstStackTraceElement() + " ";
}
public int hashCode() {
@@ -67,7 +67,7 @@ public final class ObjectGraphOrigin implements Serializable {
hc = 31 * hc + queryHash;
return hc;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
@@ -75,10 +75,10 @@ public final class ObjectGraphOrigin implements Serializable {
if (!(obj instanceof ObjectGraphOrigin)) {
return false;
}
ObjectGraphOrigin e = (ObjectGraphOrigin) obj;
return e.queryHash == queryHash
&& e.beanType.equals(beanType)
&& e.callStack.equals(callStack);
return e.queryHash == queryHash
&& e.beanType.equals(beanType)
&& e.callStack.equals(callStack);
}
}
@@ -1,12 +1,11 @@
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Enhanced beans API and Support objects</TITLE>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Enhanced beans API and Support objects</TITLE>
</HEAD>
<Body BGCOLOR="#ffffff">
Enhanced beans API and Support objects
</Body>
</HTML>
</HTML>
+3 -4
View File
@@ -10,7 +10,7 @@ package com.avaje.ebean.cache;
* which holds beans of a given type. The other is the 'query cache' holding
* query results for a given type.
* </p>
*
*
* @author rbygrave
*/
public interface ServerCache {
@@ -52,9 +52,8 @@ public interface ServerCache {
/**
* Return statistics for the cache.
*
* @param reset
* if true the statistics are reset.
*
* @param reset if true the statistics are reset.
*/
ServerCacheStatistics getStatistics(boolean reset);
}
@@ -1,7 +1,7 @@
package com.avaje.ebean.cache;
import com.avaje.ebean.annotation.CacheQueryTuning;
import com.avaje.ebean.annotation.CacheBeanTuning;
import com.avaje.ebean.annotation.CacheQueryTuning;
/**
* Options for controlling a cache.
@@ -71,7 +71,7 @@ public class ServerCacheStatistics {
if (totalCount == 0) {
return 0;
} else {
return (int)(hitCount * 100 / totalCount);
return (int) (hitCount * 100 / totalCount);
}
}
+3 -3
View File
@@ -1,10 +1,10 @@
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Server Cache Service</TITLE>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Server Cache Service</TITLE>
</HEAD>
<Body BGCOLOR="#ffffff">
Server Cache Service
</Body>
</HTML>
</HTML>