Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ New Features

Jython 2.7.4b3 Bugs fixed


- [ GH-335 ] Method resolution for overridden variable arity changed as a result of PR #282

Jython 2.7.4b2 Feature added

Expand Down
2 changes: 1 addition & 1 deletion src/org/python/core/PyReflectedConstructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public PyObject __call__(PyObject self, PyObject[] args, String[] keywords) {
if (!argslist[i].isVarArgs) {
method = argslist[i].method;
break;
} else {
} else if (varargMatch == null) {
varargMatch = argslist[i].method;
varargData = callData;
callData = new ReflectedCallData();
Expand Down
2 changes: 1 addition & 1 deletion src/org/python/core/PyReflectedFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public PyObject __call__(PyObject self, PyObject[] args, String[] keywords) {
if (argslist[i].matches(self, args, keywords, callData)) {
if (!argslist[i].isVarArgs) {
match = argslist[i];
} else {
} else if (varargMatch == null) {
varargMatch = argslist[i];
varargData = callData;
callData = new ReflectedCallData();
Expand Down
8 changes: 8 additions & 0 deletions tests/java/javatests/Reflection.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public Overloaded(int a, int... others) {
constructorVersion = "int, int...";
}

public Overloaded(boolean a, boolean... others) {
constructorVersion = "boolean, boolean...";
}

public Overloaded(String s) {
constructorVersion = "String";
}
Expand Down Expand Up @@ -165,6 +169,10 @@ public String foo(int... a) {
return "int...";
}

public String foo(boolean a, boolean... b) {
return "boolean, boolean...";
}

public String bar(int a) {
return "int";
}
Expand Down