No effective change - code cleanup - change return to void

This commit is contained in:
Robin Bygrave
2015-07-31 20:28:41 +12:00
parent ea504a93cf
commit f06c1b83a9
21 changed files with 45 additions and 72 deletions
@@ -80,17 +80,16 @@ final class DRawSqlColumnsParser {
return new ColumnMapping.Column(indexPos++, sb.toString(), split[split.length - 1]);
}
private int nextComma() {
private void nextComma() {
boolean inQuote = false;
while (pos < end) {
char c = sqlSelect.charAt(pos);
if (c == '\'') {
inQuote = !inQuote;
} else if (!inQuote && c == ',') {
return pos;
return;
}
pos++;
}
return pos;
}
}
@@ -54,17 +54,15 @@ public class HashQueryPlanBuilder {
/**
* Add a number to the bind count for the hash.
*/
public HashQueryPlanBuilder bind(int extraBindCount) {
public void bind(int extraBindCount) {
bindCount += extraBindCount;
return this;
}
/**
* Add raw sql to the hash.
*/
public HashQueryPlanBuilder addRawSql(String rawSql) {
public void addRawSql(String rawSql) {
this.rawSql = rawSql;
return this;
}
/**
@@ -243,8 +243,8 @@ public class ScopedTransaction implements SpiTransaction {
}
@Override
public int depth(int diff) {
return transaction.depth();
public void depth(int diff) {
transaction.depth();
}
@Override
@@ -586,7 +586,7 @@ public interface SpiQuery<T> extends Query<T> {
* <p>
* This does not exclude/remove the use of the id property.
*/
Query<T> setSqlDistinct(boolean sqlDistinct);
void setSqlDistinct(boolean sqlDistinct);
/**
* Return true if this query has been specified by a user or internally by Ebean to use DISTINCT.
@@ -125,7 +125,7 @@ public interface SpiTransaction extends Transaction {
* executed first during save.
* </p>
*/
int depth(int diff);
void depth(int diff);
/**
* Return the current depth.
@@ -114,16 +114,11 @@ class SocketClient {
}
}
public boolean send(SocketClusterMessage msg) throws IOException {
public void send(SocketClusterMessage msg) throws IOException {
if (online){
writeObject(msg);
return true;
} else {
return false;
}
}
private void writeObject(Object object) throws IOException {
@@ -196,10 +196,10 @@ public final class DefaultSqlUpdate implements Serializable, SpiSqlUpdate {
this.timeout = secs;
return this;
}
public SqlUpdate addParameter(Object value) {
return setParameter(++addPos, value);
}
public void addParameter(Object value) {
setParameter(++addPos, value);
}
public SqlUpdate setParameter(int position, Object value) {
bindParams.setParameter(position, value);
@@ -258,23 +258,22 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
beanPersistMap.add(beanDescriptor, type, idValue);
}
public boolean notifyLocalPersistListener() {
if (beanPersistListener == null) {
return false;
} else {
public void notifyLocalPersistListener() {
if (beanPersistListener != null) {
switch (type) {
case INSERT:
return beanPersistListener.inserted(bean);
case INSERT:
beanPersistListener.inserted(bean);
break;
case UPDATE:
return beanPersistListener.updated(bean, updatedProperties);
case UPDATE:
beanPersistListener.updated(bean, updatedProperties);
break;
case DELETE:
return beanPersistListener.deleted(bean);
case DELETE:
beanPersistListener.deleted(bean);
break;
default:
return false;
default:
}
}
}
@@ -215,17 +215,16 @@ public final class DRawSqlSelectColumnsParser {
return columnLabel.equalsIgnoreCase(prop.getDbColumn()) || columnLabel.equalsIgnoreCase(prop.getName());
}
private int nextComma() {
private void nextComma() {
boolean inQuote = false;
while (pos < end) {
char c = sqlSelect.charAt(pos);
if (c == '\'') {
inQuote = !inQuote;
} else if (!inQuote && c == ',') {
return pos;
return;
}
pos++;
}
return pos;
}
}
@@ -103,7 +103,7 @@ public class DeployOrmXml {
return ormXmlList;
}
private boolean readOrmXml(String ormXmlName, ArrayList<Dnode> ormXmlList) {
private void readOrmXml(String ormXmlName, ArrayList<Dnode> ormXmlList) {
try {
Dnode ormXml = null;
@@ -120,14 +120,10 @@ public class DeployOrmXml {
if (ormXml != null) {
ormXml.setAttribute("ebean.filename", ormXmlName);
ormXmlList.add(ormXml);
return true;
} else {
return false;
}
} catch (IOException e) {
logger.error("error reading orm xml deployment " + ormXmlName, e);
return false;
}
}
@@ -183,12 +183,12 @@ public class DeployTableJoin {
return copyInternal(inverse, true, tableName, true);
}
public DeployTableJoin copyTo(DeployTableJoin destJoin, boolean reverse, String tableName) {
return copyInternal(destJoin, reverse, tableName, true);
public void copyTo(DeployTableJoin destJoin, boolean reverse, String tableName) {
copyInternal(destJoin, reverse, tableName, true);
}
public DeployTableJoin copyWithoutType(DeployTableJoin destJoin, boolean reverse, String tableName) {
return copyInternal(destJoin, reverse, tableName, false);
public void copyWithoutType(DeployTableJoin destJoin, boolean reverse, String tableName) {
copyInternal(destJoin, reverse, tableName, false);
}
private DeployTableJoin copyInternal(DeployTableJoin destJoin, boolean reverse, String tableName, boolean withType) {
@@ -78,7 +78,7 @@ public class DeployInherit {
}
}
private InheritInfo createFinalInfo(InheritInfo root, InheritInfo parent, DeployInheritInfo deploy) {
private void createFinalInfo(InheritInfo root, InheritInfo parent, DeployInheritInfo deploy) {
InheritInfo node = new InheritInfo(root, parent, deploy);
if (parent != null) {
@@ -94,8 +94,6 @@ public class DeployInherit {
for (DeployInheritInfo childDeploy : deploy.children()) {
createFinalInfo(root, node, childDeploy);
}
return node;
}
/**
@@ -103,7 +103,7 @@ public class DeployUtil {
return new DataEncryptSupport(encryptKeyManager, bytesEncryptor, table, column);
}
public ScalarType<?> setEnumScalarType(Enumerated enumerated, DeployBeanProperty prop) {
public void setEnumScalarType(Enumerated enumerated, DeployBeanProperty prop) {
Class<?> enumType = prop.getPropertyType();
if (!enumType.isEnum()) {
@@ -123,7 +123,6 @@ public class DeployUtil {
}
prop.setScalarType(scalarType);
prop.setDbType(scalarType.getJdbcType());
return scalarType;
}
private ScalarType<?> createEnumScalarTypePerSpec(Class<?> enumType, EnumType type, int dbType) {
@@ -17,7 +17,7 @@ public class FactoryAssocOnes {
/**
* Add foreign key columns from associated one beans.
*/
public List<Bindable> create(List<Bindable> list, BeanDescriptor<?> desc, DmlMode mode) {
public void create(List<Bindable> list, BeanDescriptor<?> desc, DmlMode mode) {
BeanPropertyAssocOne<?>[] ones = desc.propertiesOneImported();
@@ -41,7 +41,5 @@ public class FactoryAssocOnes {
list.add(new BindableAssocOne(ones[i]));
}
}
return list;
}
}
@@ -114,11 +114,10 @@ public class SqlTreeAlias {
return alias;
}
private String calcAliasManyWhere(String prefix) {
private void calcAliasManyWhere(String prefix) {
String alias = nextManyWhereTableAlias();
manyWhereAliasMap.put(prefix, alias);
return alias;
}
/**
@@ -888,15 +888,13 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
return this;
}
public DefaultOrmQuery<T> setQuery(String queryString) throws PersistenceException {
public void setQuery(String queryString) throws PersistenceException {
this.query = queryString;
OrmQueryDetailParser parser = new OrmQueryDetailParser(queryString);
parser.parse();
parser.assign(this);
return this;
}
protected void setOrmQueryDetail(OrmQueryDetail detail) {
@@ -1111,9 +1109,8 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
/**
* Internally set to use SQL DISTINCT on the query but still have id property included.
*/
public DefaultOrmQuery<T> setSqlDistinct(boolean sqlDistinct) {
public void setSqlDistinct(boolean sqlDistinct) {
this.sqlDistinct = sqlDistinct;
return this;
}
public Class<T> getBeanType() {
@@ -258,12 +258,11 @@ public class OrmQueryDetail implements Serializable {
* @param partialProps
* the properties on the join property to include
*/
public OrmQueryProperties addFetch(String path, String partialProps, FetchConfig fetchConfig) {
public void addFetch(String path, String partialProps, FetchConfig fetchConfig) {
OrmQueryProperties chunk = getChunk(path, true);
chunk.setProperties(partialProps);
chunk.setFetchConfig(fetchConfig);
return chunk;
}
public void sortFetchPaths(BeanDescriptor<?> d) {
@@ -443,10 +443,9 @@ public class OrmQueryProperties implements Serializable {
return included == null || included.contains(propName);
}
public OrmQueryProperties setQueryFetch(int batch, boolean queryFetchAll) {
public void setQueryFetch(int batch, boolean queryFetchAll) {
this.queryFetchBatch = batch;
this.queryFetchAll = queryFetchAll;
return this;
}
public boolean isFetchJoin() {
@@ -194,8 +194,8 @@ public final class DefaultPersistenceContext implements PersistenceContext {
map.clear();
}
private Object remove(Object id) {
return map.remove(id);
private void remove(Object id) {
map.remove(id);
}
private void deleted(Object id) {
@@ -352,9 +352,8 @@ public class JdbcTransaction implements SpiTransaction {
* @return the current depth plus the diff
*/
@Override
public int depth(int diff) {
public void depth(int diff) {
depth += diff;
return depth;
}
/**
@@ -15,9 +15,8 @@ public class EnumToDbIntegerMap extends EnumToDbValueMap<Integer> {
return Types.INTEGER;
}
public EnumToDbIntegerMap add(Object beanValue, Integer dbValue) {
public void add(Object beanValue, Integer dbValue) {
addInternal(beanValue, dbValue);
return this;
}
@Override