Make sure that method signature for Integer getModelIndex() is exactly the same, otherwise the class file may include two method signature for exactly the same method, and differences with annotations in the output class files in the Eclipse and Oracle javac can lead to unexpected bugs and changes in behavior from development to deployment. Scary!
This commit is contained in:
parent
9347f36b0a
commit
8606ef44ca
|
@ -30,8 +30,9 @@ public class ExpressionBindings extends AbstractMap<String, Object> implements B
|
|||
for (String name : define.value()) {
|
||||
Method existingBinding = bindings.put(name, method);
|
||||
|
||||
if (existingBinding != null)
|
||||
if (existingBinding != null) {
|
||||
throw new IllegalArgumentException(String.format("Illegal binding {%s} on %s", name, method.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -953,18 +953,18 @@ public class MediaBindingBean {
|
|||
}
|
||||
|
||||
@Define("i")
|
||||
public Number getModelIndex() {
|
||||
public Integer getModelIndex() {
|
||||
return 1 + identityIndexOf(context.values(), getInfoObject());
|
||||
}
|
||||
|
||||
@Define("di")
|
||||
public Number getDuplicateIndex() {
|
||||
public Integer getDuplicateIndex() {
|
||||
return 1 + identityIndexOf(context.values().stream().filter(getInfoObject()::equals).collect(toList()), getInfoObject());
|
||||
}
|
||||
|
||||
@Define("dc")
|
||||
public Number getDuplicateCount() {
|
||||
return context.values().stream().filter(getInfoObject()::equals).count();
|
||||
public Integer getDuplicateCount() {
|
||||
return context.values().stream().filter(getInfoObject()::equals).mapToInt(i -> 1).sum();
|
||||
}
|
||||
|
||||
@Define("plex")
|
||||
|
|
|
@ -24,6 +24,7 @@ public class IndexedBindingBean extends MediaBindingBean {
|
|||
this.to = to;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Define("i")
|
||||
public Integer getModelIndex() {
|
||||
return i;
|
||||
|
|
Loading…
Reference in New Issue