From 09327bcefb785f493a236d223fdcdda5dac4a48c Mon Sep 17 00:00:00 2001 From: Kevin Glynn Date: Tue, 4 Jan 2011 15:49:44 +0100 Subject: [PATCH] Casts don't necessarily have both from and to types --- .../antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs index 4618af9..ce01c1e 100644 --- a/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs +++ b/CSharpTranslator/antlr3/UpdateTxFiles/UpdateTranslationTemplate.cs @@ -72,8 +72,11 @@ namespace UpdateTxFiles upgrade(inV as OldTSpace.TranslationBase, outV as NewTSpace.TranslationBase); outV.Imports = inV.Imports; - outV.From = inV.From; - outV.To = inV.To; + if (!String.IsNullOrEmpty(inV.From)) + outV.From = inV.From; + + if (!String.IsNullOrEmpty(inV.To)) + outV.To = inV.To; if (!String.IsNullOrEmpty(inV.Java)) outV.Java = inV.Java; @@ -84,6 +87,7 @@ namespace UpdateTxFiles upgrade(inV as OldTSpace.ConstructorRepTemplate, outV as NewTSpace.ConstructorRepTemplate); outV.Name = inV.Name; + // Methods should have a return type, but in at least one case don't ... outV.Return = inV.Return ?? "System.Void"; }