Skip to content

Commit b39015f

Browse files
petekanevPlamen5kov
authored andcommitted
revert generated class name creation to include the base class name
1 parent bda5fe4 commit b39015f

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

test-app/build-tools/static-binding-generator/src/main/java/org/nativescript/staticbindinggenerator/Generator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public Binding generateBinding(DataRow dataRow, HashSet interfaceNames) throws C
9797
if (isInterface) {
9898
name = getSimpleClassname(clazz.getClassName());
9999
} else {
100+
name = getSimpleClassname(clazz.getClassName().replace("$", "_")) + "_";
100101
// name of the class: last portion of the full file name + line + column + variable name
101102
String[] lastFilePathPart = dataRow.getFile().split("_");
102103
name += lastFilePathPart[lastFilePathPart.length - 1] + "_" + dataRow.getLine() + "_" + dataRow.getColumn() + "_" + dataRow.getNewClassName();

test-app/runtime/src/main/cpp/MetadataNode.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,19 +1258,11 @@ MetadataNode::ExtendedClassCacheData MetadataNode::GetCachedExtendedClassData(Is
12581258
string MetadataNode::CreateFullClassName(const std::string& className, const std::string& extendNameAndLocation = "") {
12591259
string fullClassName = className;
12601260

1261-
// create a class name consisting only of the last file name part + line + column + variable identifier
1261+
// create a class name consisting only of the base class name + last file name part + line + column + variable identifier
12621262
if (!extendNameAndLocation.empty()) {
1263-
vector<string> classNameParts;
1264-
1265-
Util::SplitString(className, "/", classNameParts);
1266-
1267-
// remove the class name and leave just the package identifier of the original class
1268-
while (std::isupper(classNameParts.back().at(0))) {
1269-
classNameParts.pop_back();
1270-
}
1271-
1272-
Util::JoinString(classNameParts, "/", fullClassName);
1273-
fullClassName += "/" + extendNameAndLocation;
1263+
string tempClassName = className;
1264+
fullClassName = Util::ReplaceAll(tempClassName, "$", "_");
1265+
fullClassName += "_" + extendNameAndLocation;
12741266
}
12751267

12761268
return fullClassName;

0 commit comments

Comments
 (0)