Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

529 cant call a datatype object #538

Merged
merged 2 commits into from
Oct 25, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static TypeInterface of(TypeInfo typeInfo, boolean isList) {
if (typeInfo.isModelledType()) {
return TypeInterface.of(((StepBasedType)typeInfo.getModelledType()).getGenerationType().getOriginalFqName(), false, isList);
} else {
if (typeInfo.getJavaName().equals("Object")) {
if (typeInfo.getJavaName().equals("java.lang.Object")) {
return TypeInterface.anyType();
} else if (typeInfo.getJavaName().equals("List")) {
return TypeInterface.anyType(); //FIXME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected void createStorable(XMOMStorableStructureInformation rootXMOMStorable,

if (!currentStructure.hasSuper()) {
//getprimarykey methode
cb.addLine("public Object getPrimaryKey() {");
cb.addLine("public java.lang.Object getPrimaryKey() {");
cb.addLine("return ", currentStructure.getPrimaryKeyName());
cb.addLine("}").addLB(2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public String getJavaName() {
return "null";
}
if (isAny()) {
return "Object";
return "java.lang.Object";
}
if (isList()) {
return "List";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ public void variableStarts(Variable variable) {
private Object transformation_prefix(TypeInfo toType) {
if (toType == null ||
!toType.isBaseType()) {
return Functions.class.getName()+"."+Functions.ADJUST_VALUE_METHOD_NAME+"(Object.class, ";
return Functions.class.getName()+"."+Functions.ADJUST_VALUE_METHOD_NAME+"(java.lang.Object.class, ";
} else {
return Functions.class.getName()+"."+Functions.ADJUST_VALUE_METHOD_NAME+"("+toType.getJavaName()+".class, ";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ protected void appendExecuteInternallyForDOMRef(ServiceIdentification service, C
}
if (receiveVarIds.length == 0) {
} else if (receiveVarIds.length == 1) {
cb.add("Object temp = ");
cb.add("java.lang.Object temp = ");
} else {
cb.add(Container.class.getSimpleName() + " c = ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ public static void appendToXMLSnippetForObjectReferences(CodeBuffer cb) {

public static void appendGeneralSetter(CodeBuffer cb, Set<String> imports, List<AVariable> memberVars, boolean hasSuperClassWithGeneralGetter) {
// allgemeiner setter
cb.addLine("public void set(String name, Object o) throws ", XDEV_PARAMETER_NAME_NOT_FOUND.class.getSimpleName(), " {");
cb.addLine("public void set(String name, java.lang.Object o) throws ", XDEV_PARAMETER_NAME_NOT_FOUND.class.getSimpleName(), " {");
for (int i = 0; i < memberVars.size(); i++) {
AVariable v = memberVars.get(i);
if (i > 0) {
Expand Down Expand Up @@ -1512,13 +1512,13 @@ public static void appendGeneralGetter(CodeBuffer cb, Set<String> imports, List<
cb.addLine(" * @param name variable name or path separated by \".\".");
cb.addLine(" */");

cb.addLine("public Object get(String name) throws ", InvalidObjectPathException.class.getSimpleName(), " {");
cb.addLine("public java.lang.Object get(String name) throws ", InvalidObjectPathException.class.getSimpleName(), " {");
cb.add("String[] varNames = new String[]{");
for (int i = 0; i < memberVars.size(); i++) {
cb.addListElement("\"" + memberVars.get(i).getVarName() + "\"");
}
cb.add("};").addLB();
cb.add("Object[] vars = new Object[]{");
cb.add("java.lang.Object[] vars = new java.lang.Object[]{");
for (AVariable v : memberVars) {
if (v.isList()) {
//getter verwenden, um bei listen die versionsbewusste liste zu bekommen
Expand All @@ -1528,7 +1528,7 @@ public static void appendGeneralGetter(CodeBuffer cb, Set<String> imports, List<
}
}
cb.add("};").addLB();
cb.addLine("Object o = ", XOUtils.class.getSimpleName(), ".getIfNameIsInVarNames(varNames, vars, name)");
cb.addLine("java.lang.Object o = ", XOUtils.class.getSimpleName(), ".getIfNameIsInVarNames(varNames, vars, name)");
cb.addLine("if (o == ", XOUtils.class.getSimpleName(), ".VARNAME_NOTFOUND) {");
if (hasSuperClassWithGeneralGetter) {
cb.addLine("o = super.get(name)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ public String createDelegationImplCode() {
}

//helpermethode f�r konstruktoren
cb.addLine("private static Map<String, Object> setImpls(Map<String, Object> map, ", dom.getFqClassName(), " o) {");
cb.addLine("private static Map<String, java.lang.Object> setImpls(Map<String, java.lang.Object> map, ", dom.getFqClassName(), " o) {");
if (!dom.isAbstract()) {
boolean first = true;
for (InterfaceVersion version : dom.getVersionsOfOperations(true)) {
if (first) {
cb.add("Object ");
cb.add("java.lang.Object ");
first = false;
}
cb.add("versionImpl = map.get(\"" + version.getNameCompatibleWithCurrentVersion() + "\")").addLB();
Expand All @@ -214,11 +214,11 @@ public String createDelegationImplCode() {

//konstruktor 1: wird von datentyp.init methode aus aufgerufen (oder super-aufrufe von altem (< 5.1.3) generierten code)
cb.addLine("public ", getDelegationImplSimpleClassName(), "(", dom.getFqClassName(), " o) {");
cb.addLine("this(o, new HashMap<String, Object>())");
cb.addLine("this(o, new HashMap<String, java.lang.Object>())");
cb.addLine("}").addLB();

//konstruktor 2a: wird von abgeleiteter klasse aufgerufen
cb.addLine("public ", getDelegationImplSimpleClassName(), "(", dom.getFqClassName(), " o, Map<String, Object> implMap) {");
cb.addLine("public ", getDelegationImplSimpleClassName(), "(", dom.getFqClassName(), " o, Map<String, java.lang.Object> implMap) {");
if (dom.hasSuperTypeWithJavaImpl(true, null)) {
cb.addLine("super(o, setImpls(implMap, o))");
} else {
Expand All @@ -236,7 +236,7 @@ public String createDelegationImplCode() {
//konstruktor 2b: f�r abw�rtskompatibilit�t bez�glich generiertem code <= version 5.1.3
cb.addLine("public ", getDelegationImplSimpleClassName(), "(", getProjectNonStaticImplFQClassName(InterfaceVersion.BASE), " o) {");
cb.addLine("this(o == null ? null : ((", getSuperProxySimpleClassName(InterfaceVersion.BASE), /*protected methode in gleichem package*/
") o).getInstanceVar(), o == null ? new HashMap<String, Object>() : new HashMap<String, Object>(",
") o).getInstanceVar(), o == null ? new HashMap<String, java.lang.Object>() : new HashMap<String, java.lang.Object>(",
Collections.class.getName(), ".singletonMap(\"" + InterfaceVersion.BASE.getNameCompatibleWithCurrentVersion() + "\", o)))");
cb.addLine("}").addLB();
}
Expand All @@ -245,7 +245,7 @@ public String createDelegationImplCode() {
if (!dom.isAbstract()) {
cb.addLine("public ", getDelegationImplSimpleClassName(), "() {");
if (dom.hasSuperTypeWithJavaImpl(true, null)) {
cb.addLine("super(null, new HashMap<String, Object>())");
cb.addLine("super(null, new HashMap<String, java.lang.Object>())");
}
//else leerer super-aufruf
for (InterfaceVersion version : dom.getVersionsOfOperations(true)) {
Expand Down