@@ -136,7 +136,7 @@ static String upcastMethodName(String javaName) {
136
136
* NS::CN::CN(int)
137
137
* Declarator.cppName contains the calling name, and this method returns the declaration name.
138
138
* Keys in info map should use the declaration name, because the calling name cannot specify
139
- * arguments in case of constructor templates, and to avoid confusion between classes and constructores info.
139
+ * arguments in case of constructor templates, and to avoid confusion between classes and constructors info.
140
140
*/
141
141
static String constructorName (String cppName ) {
142
142
String constructorName = Templates .strip (cppName );
@@ -1161,6 +1161,7 @@ else if (cppNameSplit.size() > 1 && groupNameSplit.size() == 1)
1161
1161
if (cppName .equals (groupName )) {
1162
1162
type .constructor = !type .destructor && !type .operator
1163
1163
&& type .indirections == 0 && !type .reference && tokens .get ().match ('(' , ':' );
1164
+ if (type .constructor ) type .cppName = context .cppName ; // Fix potential qualification errors
1164
1165
}
1165
1166
type .javaName = context .shorten (type .javaName );
1166
1167
}
@@ -2593,17 +2594,18 @@ boolean function(Context context, DeclarationList declList) throws ParserExcepti
2593
2594
if (context .namespace != null && !isQualified ) {
2594
2595
dcl .cppName = context .namespace + "::" + dcl .cppName ;
2595
2596
}
2596
- }
2597
2597
2598
- // use Java names that we may get here but that declarator() did not catch
2599
- for (String name : context .qualify (dcl .cppName , param1 )) {
2600
- if ((infoMap .getFirst (name , false )) != null ) {
2601
- dcl .cppName = name ;
2602
- break ;
2603
- } else if (infoMap .getFirst (name ) != null ) {
2604
- dcl .cppName = name ;
2598
+ // use Java names that we may get here but that declarator() did not catch
2599
+ for (String name : context .qualify (dcl .cppName , param1 )) {
2600
+ if ((infoMap .getFirst (name , false )) != null ) {
2601
+ dcl .cppName = name ;
2602
+ break ;
2603
+ } else if (infoMap .getFirst (name ) != null ) {
2604
+ dcl .cppName = name ;
2605
+ }
2605
2606
}
2606
2607
}
2608
+
2607
2609
String localName2 = dcl .cppName ;
2608
2610
if (context .namespace != null && localName2 .startsWith (context .namespace + "::" )) {
2609
2611
localName2 = dcl .cppName .substring (context .namespace .length () + 2 );
0 commit comments