1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

To access static members of classes in Java we will need to import the whole name of the class

This commit is contained in:
Kevin Glynn 2010-10-20 18:56:26 +02:00
parent 50cff4d439
commit 948f702ad1

View File

@ -304,8 +304,7 @@ namespace RusticiSoftware.Translator.CLR
public override string[] mkImports() { public override string[] mkImports() {
if (SurroundingTypeName != null) { if (SurroundingTypeName != null) {
int idxDot = SurroundingTypeName.LastIndexOf('.'); return new string[] {"CS2JNet." + SurroundingTypeName};
return new string[] {"CS2JNet." + SurroundingTypeName.Substring(0, idxDot)};
} }
else { else {
return null; return null;
@ -414,8 +413,7 @@ namespace RusticiSoftware.Translator.CLR
public override string[] mkImports() { public override string[] mkImports() {
if (IsStatic && SurroundingTypeName != null) { if (IsStatic && SurroundingTypeName != null) {
int idxDot = SurroundingTypeName.LastIndexOf('.'); return new string[] {"CS2JNet." + SurroundingTypeName};
return new string[] {"CS2JNet." + SurroundingTypeName.Substring(0, idxDot)};
} }
else { else {
return null; return null;
@ -518,7 +516,7 @@ namespace RusticiSoftware.Translator.CLR
return null; return null;
} }
else { else {
return new string[] {"CS2JNet." + From.Substring(0, From.LastIndexOf('.'))}; return new string[] {"CS2JNet." + From};
} }
} }
@ -854,13 +852,12 @@ namespace RusticiSoftware.Translator.CLR
if (TypeName == null || TypeName == String.Empty) { if (TypeName == null || TypeName == String.Empty) {
return null; return null;
} }
return TypeName.Substring(TypeName.LastIndexOf('.')+1); return TypeName.Substring(TypeName.LastIndexOf('.') + 1);
} }
public override string[] mkImports() { public override string[] mkImports() {
int idxDot = TypeName.LastIndexOf('.'); if (TypeName != null) {
if (idxDot > 0) { return new string[] {"CS2JNet." + TypeName};
return new string[] {"CS2JNet." + TypeName.Substring(0,idxDot)};
} }
else { else {
return null; return null;