Skip to content

Commit c9213f3

Browse files
committed
Change parameter of generated enum fromValue() methods to int
Contrary to what I thought, this has to be int, because the first argument of FlagSet.fromValues() has to be int - that is the version that returns an IntValuedEnum.
1 parent cc1178e commit c9213f3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/gir2java/GirParser.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,8 @@ private void parseEnumeration(Element root, ParsingContext context) {
406406

407407
//fromValue method
408408
JMethod fromValue = enumClass.method(JMod.PUBLIC | JMod.STATIC, concreteIntValuedEnumClass, "fromValue");
409-
/*
410-
* XXX: This parameter is an int in the BridJ type mapping doc. This seems to be incorrect,
411-
* as this method accepts one or more ORed values, and these values are longs.
412-
*/
413-
JVar fromValueParam = fromValue.param(long.class, "value");
409+
410+
JVar fromValueParam = fromValue.param(int.class, "value");
414411
JClass flagSetClass = cm.ref(FlagSet.class);
415412
JInvocation fromValueCall = flagSetClass.staticInvoke("fromValue")
416413
.arg(fromValueParam)

0 commit comments

Comments
 (0)