Skip to content
Permalink
Browse files

Fixed: Remove unused type parameters (OFBIZ-10909)

No functional change.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857087 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Apr 7, 2019
1 parent 264ed9c commit 8700328f09329a3b063b6866af1f9795a57b027a
@@ -87,11 +87,11 @@ public static void assertComparison(String label, int wanted, int result) {
}
}

public static <T> void assertNotEquals(Object wanted, Object got) {
public static void assertNotEquals(Object wanted, Object got) {
assertNotEquals(null, wanted, got);
}

public static <T> void assertNotEquals(String msg, Object wanted, Object got) {
public static void assertNotEquals(String msg, Object wanted, Object got) {
if (wanted == null) {
if (got != null) {
return;
@@ -223,7 +223,7 @@ private static void failEquals(String msg, Object wanted, Object got) {
}
}

private static <T> void assertEqualsArrayArray(String msg, Object wanted, Object got) {
private static void assertEqualsArrayArray(String msg, Object wanted, Object got) {
int i = 0;
while (i < Array.getLength(wanted) && i < Array.getLength(got)) {
Object left = Array.get(wanted, i);
@@ -38,11 +38,11 @@
public class UtilCacheTests extends GenericTestCaseBase implements Serializable {
public static final String module = UtilCacheTests.class.getName();

protected static abstract class Change<V> {
protected static abstract class Change {
protected int count = 1;
}

protected static final class Removal<V> extends Change<V> {
protected static final class Removal<V> extends Change {
private final V oldValue;

protected Removal(V oldValue) {
@@ -64,7 +64,7 @@ public boolean equals(Object o) {
}
}

protected static final class Addition<V> extends Change<V> {
protected static final class Addition<V> extends Change {
private final V newValue;

protected Addition(V newValue) {
@@ -86,7 +86,7 @@ public boolean equals(Object o) {
}
}

protected static final class Update<V> extends Change<V> {
protected static final class Update<V> extends Change {
private final V newValue;
private final V oldValue;

@@ -114,15 +114,15 @@ public boolean equals(Object o) {
}

protected static class Listener<K, V> implements CacheListener<K, V> {
protected Map<K, Set<Change<V>>> changeMap = new HashMap<>();
protected Map<K, Set<Change>> changeMap = new HashMap<>();

private void add(K key, Change<V> change) {
Set<Change<V>> changeSet = changeMap.get(key);
private void add(K key, Change change) {
Set<Change> changeSet = changeMap.get(key);
if (changeSet == null) {
changeSet = new HashSet<>();
changeMap.put(key, changeSet);
}
for (Change<V> checkChange: changeSet) {
for (Change checkChange: changeSet) {
if (checkChange.equals(change)) {
checkChange.count++;
return;
@@ -37,13 +37,13 @@
private String secondField = "";
private ModelEntity firstModelEntity = null;
private ModelEntity secondModelEntity = null;
private EntityOperator<?,?,?> interFieldOperation = null;
private EntityOperator<?,?,?> intraFieldOperation = null;
private EntityOperator<?,?> interFieldOperation = null;
private EntityOperator<?,?> intraFieldOperation = null;

private Object value = null;
public EntityClause() {}

public EntityClause(String firstEntity, String secondEntity, String firstField, String secondField, EntityOperator<?, ?, ?> interFieldOperation, EntityOperator<?, ?, ?> intraFieldOperation) {
public EntityClause(String firstEntity, String secondEntity, String firstField, String secondField, EntityOperator<?, ?> interFieldOperation, EntityOperator<?, ?> intraFieldOperation) {
this.firstEntity = firstEntity;
this.secondEntity = secondEntity;
this.firstField = firstField;
@@ -52,7 +52,7 @@ public EntityClause(String firstEntity, String secondEntity, String firstField,
this.intraFieldOperation = intraFieldOperation;
}

public EntityClause(String firstEntity, String firstField, Object value, EntityOperator<?, ?, ?> interFieldOperation, EntityOperator<?, ?, ?> intraFieldOperation) {
public EntityClause(String firstEntity, String firstField, Object value, EntityOperator<?, ?> interFieldOperation, EntityOperator<?, ?> intraFieldOperation) {
this.firstEntity = firstEntity;
this.firstField = firstField;
this.value = value;
@@ -83,11 +83,11 @@ public Object getValue() {
return value;
}

public <L,R,T> EntityOperator<L,R,T> getInterFieldOperation() {
public <L,R> EntityOperator<L,R> getInterFieldOperation() {
return UtilGenerics.cast(interFieldOperation);
}

public <L,R,T> EntityOperator<L,R,T> getIntraFieldOperation() {
public <L,R> EntityOperator<L,R> getIntraFieldOperation() {
return UtilGenerics.cast(intraFieldOperation);
}

@@ -107,11 +107,11 @@ public void setSecondField(String secondField) {
this.secondField = secondField;
}

public <L,R,T> void setInterFieldOperation(EntityOperator<L,R,T> interFieldOperation) {
public <L,R> void setInterFieldOperation(EntityOperator<L,R> interFieldOperation) {
this.interFieldOperation = interFieldOperation;
}

public <L,R,T> void setIntraFieldOperation(EntityOperator<L,R,T> intraFieldOperation) {
public <L,R> void setIntraFieldOperation(EntityOperator<L,R> intraFieldOperation) {
this.intraFieldOperation = intraFieldOperation;
}

@@ -43,7 +43,7 @@
* Base class for comparisons.
*/
@SuppressWarnings("serial")
public abstract class EntityComparisonOperator<L, R> extends EntityOperator<L, R, Boolean> {
public abstract class EntityComparisonOperator<L, R> extends EntityOperator<L, R> {

public static final String module = EntityComparisonOperator.class.getName();

@@ -45,7 +45,7 @@
/** The left hand side of the expression. */
private final Object lhs;
/** The operator used to combine the two sides of the expression. */
private final EntityOperator<Object, Object, ?> operator;
private final EntityOperator<Object, Object> operator;
/** The right hand side of the expression. */
private final Object rhs;

@@ -120,7 +120,7 @@ public Object getLhs() {
*
* @return the operator used to combine the two sides of the condition expression.
*/
public <L,R,T> EntityOperator<L,R,T> getOperator() {
public <L,R> EntityOperator<L,R> getOperator() {
return UtilGenerics.cast(operator);
}

@@ -37,7 +37,7 @@
*
*/
@SuppressWarnings("serial")
public class EntityJoinOperator extends EntityOperator<EntityCondition, EntityCondition, Boolean> {
public class EntityJoinOperator extends EntityOperator<EntityCondition, EntityCondition> {

protected boolean shortCircuitValue;

@@ -42,7 +42,7 @@
*
*/
@SuppressWarnings("serial")
public abstract class EntityOperator<L, R, T> implements Serializable {
public abstract class EntityOperator<L, R> implements Serializable {

public static final int ID_EQUALS = 1;
public static final int ID_NOT_EQUAL = 2;
@@ -59,33 +59,33 @@
public static final int ID_NOT_IN = 13;
public static final int ID_NOT_LIKE = 14;

private static HashMap<String, EntityOperator<?,?,?>> registry = new HashMap<>();
private static HashMap<String, EntityOperator<?,?>> registry = new HashMap<>();

private static <L,R,T> void registerCase(String name, EntityOperator<L,R,T> operator) {
private static <L,R> void registerCase(String name, EntityOperator<L,R> operator) {
registry.put(name.toLowerCase(Locale.getDefault()), operator);
registry.put(name.toUpperCase(Locale.getDefault()), operator);
}

public static <L,R,T> void register(String name, EntityOperator<L,R,T> operator) {
public static <L,R> void register(String name, EntityOperator<L,R> operator) {
registerCase(name, operator);
registerCase(name.replaceAll("-", "_"), operator);
registerCase(name.replaceAll("_", "-"), operator);
}

public static <L,R,T> EntityOperator<L,R,T> lookup(String name) {
public static <L,R> EntityOperator<L,R> lookup(String name) {
return UtilGenerics.cast(registry.get(name));
}

public static <L,R> EntityComparisonOperator<L,R> lookupComparison(String name) {
EntityOperator<?,?,Boolean> operator = lookup(name);
EntityOperator<?,?> operator = lookup(name);
if (!(operator instanceof EntityComparisonOperator<?,?>)) {
throw new IllegalArgumentException(name + " is not a comparison operator");
}
return UtilGenerics.cast(operator);
}

public static EntityJoinOperator lookupJoin(String name) {
EntityOperator<?,?,Boolean> operator = lookup(name);
EntityOperator<?,?> operator = lookup(name);
if (!(operator instanceof EntityJoinOperator)) {
throw new IllegalArgumentException(name + " is not a join operator");
}
@@ -231,8 +231,8 @@ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof EntityOperator<?,?,?>) {
EntityOperator<?,?,?> otherOper = UtilGenerics.cast(obj);
if (obj instanceof EntityOperator<?,?>) {
EntityOperator<?,?> otherOper = UtilGenerics.cast(obj);
return this.idInt == otherOper.idInt;
}
return false;
@@ -154,7 +154,7 @@ public static void expandFieldMapToContext(Map<FlexibleMapAccessor<Object>, Obje
@SuppressWarnings("serial")
public static final class ConditionExpr implements Condition {
private final String fieldName;
private final EntityOperator<?,?,?> operator;
private final EntityOperator<?,?> operator;
private final FlexibleMapAccessor<Object> envNameAcsr;
private final FlexibleStringExpander valueExdr;
private final FlexibleStringExpander ignoreExdr;
@@ -258,7 +258,7 @@ public EntityCondition createCondition(Map<String, ? extends Object> context, Mo
@SuppressWarnings("serial")
public static final class ConditionList implements Condition {
private final List<Condition> conditionList;
private final EntityOperator<?,?,?> operator;
private final EntityOperator<?,?> operator;

public ConditionList(Element conditionListElement) {
String operatorAttribute = conditionListElement.getAttribute("combine");
@@ -525,14 +525,14 @@ protected ByteBuffer getByteBufferFromStream(InputStream stream) {
}

static {
Converters.registerConverter(new MimeMessageToString<>());
Converters.registerConverter(new MimeMessageToString());
}

/**
* Convert MimeMessageWrapper to String. This is used when sending emails.
*
*/
private static class MimeMessageToString<E> extends AbstractConverter<MimeMessageWrapper, String> {
private static class MimeMessageToString extends AbstractConverter<MimeMessageWrapper, String> {
public MimeMessageToString() {
super(MimeMessageWrapper.class, String.class);
}

0 comments on commit 8700328

Please sign in to comment.
You can’t perform that action at this time.