Skip to content

Commit

Permalink
Fixed: Remove unused type parameters (OFBIZ-10909)
Browse files Browse the repository at this point in the history
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 8700328
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public static <V, E extends Exception> void assertFuture(String label, Future<V>
}
}

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;
Expand Down Expand Up @@ -223,7 +223,7 @@ public static <T> void assertEquals(String msg, Set<T> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class EntityClause {
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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class EntityExpr implements EntityCondition {
/** 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;

Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
*/
@SuppressWarnings("serial")
public class EntityJoinOperator extends EntityOperator<EntityCondition, EntityCondition, Boolean> {
public class EntityJoinOperator extends EntityOperator<EntityCondition, EntityCondition> {

protected boolean shortCircuitValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -59,33 +59,33 @@ public abstract class EntityOperator<L, R, T> implements Serializable {
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");
}
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static interface Condition extends Serializable {
@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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8700328

Please sign in to comment.