Changeset 103

Show
Ignore:
Timestamp:
08/04/07 13:34:12 (5 years ago)
Author:
edrishn
Message:

Upgrading NRefactory to Revision 2621 - Changes required because of Generic AST?, some classes which made internal and C# 3.0 support (new keywords)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Janett.build

    r102 r103  
    9090        </target> 
    9191         
     92        <target name="run-tests"> 
     93                <setenv name="COMPLUS_Version" value="v${framework::get-clr-version(Framework)}"/> 
     94                <exec program="${nunit.path}nunit-console.exe" commandline="${TestAssembly}"/> 
     95                <setenv name="COMPLUS_Version" value=""/> 
     96        </target> 
     97         
    9298        <target name="test"> 
    93                 <setenv name="COMPLUS_Version" value="v${framework::get-clr-version(Framework)}"/> 
    94                 <exec program="${nunit.path}nunit-console.exe" workingdir="Source/UnitTests/bin/Debug" commandline="UnitTest.dll"/> 
    95                 <setenv name="COMPLUS_Version" value=""/> 
     99                <property name="TestAssembly" value="Source/UnitTests/bin/Debug/UnitTest.dll"/> 
     100                <call target="test"/> 
    96101        </target> 
    97102         
     
    108113                <exec program="Bin/janett.exe" commandline="Classifier/Java ../IKVM /m IKVM"/> 
    109114                <solution solutionfile="Classifier/IKVM/NClassifier.sln" configuration="debug"/> 
    110                 <exec program="${nunit.path}nunit-console.exe" workingdir="Classifier/IKVM/UnitTests/bin/Debug" commandline="UnitTests.dll"/> 
     115                <property name="TestAssembly" value="Classifier/IKVM/UnitTests/bin/Debug/UnitTests.dll"/> 
     116                <call target="run-tests"/> 
    111117                 
    112118                <delete dir="Classifier/DotNet" if="${directory::exists('Classifier/DotNet')}"/> 
    113119                <exec program="Bin/janett.exe" commandline="Classifier/Java ../DotNet /m DotNet"/> 
    114120                <solution solutionfile="Classifier/DotNet/NClassifier.sln" configuration="debug"/> 
    115                 <exec program="${nunit.path}nunit-console.exe" workingdir="Classifier/DotNet/UnitTests/bin/Debug" commandline="UnitTests.dll"/> 
     121                <property name="TestAssembly" value="Classifier/DotNet/UnitTests/bin/Debug/UnitTests.dll"/> 
     122                <call target="run-tests"/> 
    116123        </target> 
    117124         
  • trunk/Source/Framework/AstUtil.cs

    r11 r103  
    22{ 
    33        using System; 
    4         using System.Collections
     4        using System.Collections.Generic
    55 
    66        using ICSharpCode.NRefactory.Ast; 
     
    2727                } 
    2828 
    29                 public ArrayList GetChildrenWithType(INode parentNode, Type specificType) 
     29                public List<INode> GetChildrenWithType(INode parentNode, Type specificType) 
    3030                { 
    31                         ArrayList list = new ArrayList(); 
     31                        List<INode> list = new List<INode>(); 
    3232                        foreach (INode node in parentNode.Children) 
    3333                        { 
  • trunk/Source/Framework/ExpressionTypeResolver.cs

    r66 r103  
    33        using System; 
    44        using System.Collections; 
     5        using System.Collections.Generic; 
    56 
    67        using ICSharpCode.NRefactory.Ast; 
     
    1617                { 
    1718                        primitiveTypeMappings = new Hashtable(); 
    18                         foreach (DictionaryEntry entry in TypeReference.PrimitiveTypesCSharp) 
     19                        foreach (KeyValuePair<string, string> entry in TypeReference.PrimitiveTypesCSharp) 
    1920                                primitiveTypeMappings.Add(entry.Value, entry.Key); 
    2021                } 
     
    128129                                return ((ParameterDeclarationExpression) ex).TypeReference; 
    129130                        } 
    130                         else if (ex is NullExpression
     131                        else if (ex == Expression.Null
    131132                        { 
    132133                                return null; 
     
    186187                        { 
    187188                                BlockStatement body = GetBody(parentScope); 
    188                                 ArrayList parameters = ((ParametrizedNode) parentScope).Parameters; 
     189                                List<ParameterDeclarationExpression> parameters = ((ParametrizedNode) parentScope).Parameters; 
    189190                                TypeDeclaration typeDeclaration = AstUtil.GetParentOfType(parentScope, typeof(TypeDeclaration)) as TypeDeclaration; 
    190191                                typeReference = GetTypeInLocalVariables(body, identifier); 
     
    230231                } 
    231232 
    232                 protected TypeReference GetTypeInArguments(ArrayList parameters, string identifier) 
     233                protected TypeReference GetTypeInArguments(List<ParameterDeclarationExpression> parameters, string identifier) 
    233234                { 
    234235                        foreach (ParameterDeclarationExpression parameter in parameters) 
     
    302303                        if (expression.Value == null) 
    303304                        { 
    304                                 NullTypeReference nullType = NullTypeReference.Instance
     305                                TypeReference nullType = TypeReference.Null
    305306                                nullType.Parent = expression.Parent; 
    306307                                return nullType; 
  • trunk/Source/Framework/Mapping/MemberMapper.cs

    r76 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45        using System.IO; 
    56 
     
    196197                        { 
    197198                                replacedExpression = GetReplacedExpression(invocationExpression, methodKey, mapping.Members); 
    198                                 if (replacedExpression[0] is NullExpression
     199                                if (replacedExpression[0] == Expression.Null
    199200                                { 
    200201                                        RemoveCurrentNode(); 
     
    308309 
    309310                        Substitution substitution = new Substitution(); 
    310                         ArrayList parameters = GetParameters(expression); 
     311                        List<Expression> parameters = GetParameters(expression); 
    311312                        Expression targetId = GetTargetObject(expression); 
    312313                        substitution.Identifier = targetId; 
     
    361362                } 
    362363 
    363                 private ArrayList GetParameters(Expression expression) 
     364                private List<Expression> GetParameters(Expression expression) 
    364365                { 
    365366                        if (expression is InvocationExpression) 
  • trunk/Source/Framework/ParentVisitor.cs

    r21 r103  
    370370                } 
    371371 
    372                 public override object VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, object data) 
     372                public override object VisitCollectionInitializerExpression(CollectionInitializerExpression arrayInitializerExpression, object data) 
    373373                { 
    374374                        foreach (INode node in arrayInitializerExpression.CreateExpressions) 
     
    376376                                node.Parent = arrayInitializerExpression; 
    377377                        } 
    378                         return base.VisitArrayInitializerExpression(arrayInitializerExpression, data); 
     378                        return base.VisitCollectionInitializerExpression(arrayInitializerExpression, data); 
    379379                } 
    380380 
  • trunk/Source/Framework/Refactoring/AccessorRefactoring.cs

    r83 r103  
    9494                        string fieldName = accessorMethod.Name.Substring(3); 
    9595                        TypeDeclaration typeDeclaration = (TypeDeclaration) accessorMethod.Parent; 
    96                         if (IsInterface(typeDeclaration) || (IsAbstractClass(typeDeclaration) && !HasField(fields, fieldName) && accessorMethod.Body is NullBlockStatement)) 
    97                                 block = NullBlockStatement.Instance
     96                        if (IsInterface(typeDeclaration) || (IsAbstractClass(typeDeclaration) && !HasField(fields, fieldName) && accessorMethod.Body == BlockStatement.Null)) 
     97                                block = BlockStatement.Null
    9898                        else 
    9999                        { 
     
    260260                                                BlockStatement block; 
    261261                                                if (IsInterface(typeDeclaration) || (IsAbstractClass(typeDeclaration) && !HasField(fields, propertyName))) 
    262                                                         block = NullBlockStatement.Instance
     262                                                        block = BlockStatement.Null
    263263                                                else 
    264264                                                { 
  • trunk/Source/Framework/Refactoring/ImplementPropertyRegionTransformer.cs

    r83 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    1415                        { 
    1516                                method.TypeReference = new TypeReference("void"); 
    16                                 ArrayList parameters = new ArrayList(); 
     17                                List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(); 
    1718                                parameters.Add(new ParameterDeclarationExpression(typeReference, "Parameter1")); 
    1819                                method.Parameters = parameters; 
  • trunk/Source/Framework/Refactoring/RemoveEmptyBlocksTransformer.cs

    r80 r103  
    11namespace Janett.Framework 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    1919                        if (ifElseStatement.HasElseIfSections) 
    2020                        { 
    21                                 ArrayList elseIfSections = new ArrayList(); 
     21                                List<ElseIfSection> elseIfSections = new List<ElseIfSection>(); 
    2222                                elseIfSections.AddRange(ifElseStatement.ElseIfSections); 
    2323                                foreach (ElseIfSection stm in ifElseStatement.ElseIfSections) 
  • trunk/Source/Framework/ReferenceTransformer.cs

    r87 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    360361                        IList fields = new ArrayList(); 
    361362 
    362                         ArrayList fieldDeclarations = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
     363                        List<INode> fieldDeclarations = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
    363364                        foreach (FieldDeclaration fieldDeclaration in fieldDeclarations) 
    364365                                fields.Add(((VariableDeclaration) fieldDeclaration.Fields[0]).Name); 
  • trunk/Source/Framework/SameFieldAndMethodNameTransformer.cs

    r84 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    910                public override object TrackedVisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) 
    1011                { 
    11                         ArrayList fields = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
     12                        List<INode> fields = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
    1213                        if (fields.Count > 0) 
    1314                        { 
  • trunk/Source/Framework/ShortenReferencesTransformer.cs

    r11 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    1718                        { 
    1819                                NamespaceDeclaration replaceNamespace = namespaceDeclaration; 
    19                                 ArrayList children = namespaceDeclaration.Children; 
     20                                List<INode> children = namespaceDeclaration.Children; 
    2021                                INode[] childMembers = new INode[children.Count]; 
    2122                                children.CopyTo(childMembers); 
  • trunk/Source/Framework/StubTransformer.cs

    r91 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    5556                        blockStatement.Children.Clear(); 
    5657                        TypeReference notImplmentedException = new TypeReference("System.NotImplementedException"); 
    57                         ObjectCreateExpression objectCreate = new ObjectCreateExpression(notImplmentedException, new ArrayList()); 
     58                        ObjectCreateExpression objectCreate = new ObjectCreateExpression(notImplmentedException, new List<Expression>()); 
    5859                        blockStatement.Children.Add(new ThrowStatement(objectCreate)); 
    5960                        return null; 
  • trunk/Source/Framework/Transformer.cs

    r76 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory; 
     
    227228                protected bool AreSameTypes(TypeReference parameterType, TypeReference argumentType) 
    228229                { 
    229                         if (argumentType is NullTypeReference
     230                        if (argumentType == TypeReference.Null
    230231                                return true; 
    231232                        string parameterFullType = GetFullName(parameterType); 
     
    313314                } 
    314315 
    315                 protected string GetArgumentsMap(ArrayList arguments, ArgumentMapType argumentMapType) 
     316                protected string GetArgumentsMap<T>(List<T> arguments, ArgumentMapType argumentMapType) 
    316317                { 
    317318                        string argumentsMap = ""; 
     
    328329                                        { 
    329330                                                argumentType = GetFullName(argumentTypeReference); 
    330                                                 if (TypeReference.PrimitiveTypesJavaReverse.Contains(argumentType)) 
     331                                                if (TypeReference.PrimitiveTypesJavaReverse.ContainsKey(argumentType)) 
    331332                                                        argumentType = (string) TypeReference.PrimitiveTypesJavaReverse[argumentType]; 
    332333                                                if (argumentType == "java.lang.String") 
     
    419420                } 
    420421 
    421                 protected IList GetAccessibleMethods(TypeDeclaration typeDeclaration) 
    422                 { 
    423                         ArrayList methods = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
     422                protected List<INode> GetAccessibleMethods(TypeDeclaration typeDeclaration) 
     423                { 
     424                        List<INode> methods = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
    424425                        if (typeDeclaration.BaseTypes.Count > 0) 
    425426                        { 
     
    540541                private void InsertSidesOfCurrentNode(IList nodes, BlockStatement blockStatement, int index, Position position) 
    541542                { 
    542                         ArrayList coll = new ArrayList(); 
     543                        List<INode> coll = new List<INode>(); 
    543544                        foreach (INode node in nodes) 
    544545                        { 
     
    554555                } 
    555556 
    556                 private int GetIndex(ArrayList list, INode node) 
     557                private int GetIndex(List<INode> list, INode node) 
    557558                { 
    558559                        int index = 0; 
     
    576577                } 
    577578 
    578                 protected bool MatchArguments(ArrayList parameters, ArrayList arguments) 
     579                protected bool MatchArguments(List<ParameterDeclarationExpression> parameters, List<Expression> arguments) 
    579580                { 
    580581                        if (parameters.Count == arguments.Count) 
  • trunk/Source/Framework/TypeResolver.cs

    r89 r103  
    8787                        } 
    8888 
    89                         if (TypeReference.PrimitiveTypesJava.Contains(typeReference.Type)) 
     89                        if (TypeReference.PrimitiveTypesJava.ContainsKey(typeReference.Type)) 
    9090                                return (string) TypeReference.PrimitiveTypesJava[typeReference.Type]; 
    9191 
  • trunk/Source/Translator/Transformation/AbstractClassTransformer.cs

    r32 r103  
    8989                        foreach (MethodDeclaration method in comparedList) 
    9090                        { 
    91                                 if (!Contains(baseList, method) && method.Body is NullBlockStatement
     91                                if (!Contains(baseList, method) && method.Body == BlockStatement.Null
    9292                                        diffList.Add(method); 
    9393                        } 
  • trunk/Source/Translator/Transformation/AnonymousClassTransformer.cs

    r102 r103  
    33        using System.Collections; 
    44        using System.Collections.Specialized; 
     5        using System.Collections.Generic; 
    56 
    67        using ICSharpCode.NRefactory.Ast; 
     
    6667                                IDictionary anonymousFields = unknownFields; 
    6768 
    68                                 ArrayList constructorParameters = new ArrayList(); 
     69                                List<ParameterDeclarationExpression> constructorParameters = new List<ParameterDeclarationExpression>(); 
    6970 
    7071                                ParameterDeclarationExpression parentInstance = new ParameterDeclarationExpression( 
     
    216217                        { 
    217218                                IList list = AstUtil.GetChildrenWithType(eqType, typeof(FieldDeclaration)); 
    218                                 ArrayList constructors = AstUtil.GetChildrenWithType(eqType, typeof(ConstructorDeclaration)); 
     219                                List<INode> constructors = AstUtil.GetChildrenWithType(eqType, typeof(ConstructorDeclaration)); 
    219220                                if (constructors.Count > 0) 
    220221                                { 
     
    226227                } 
    227228 
    228                 private void AddAnonymousClassConstructor(ObjectCreateExpression obc, TypeDeclaration typeDeclaration, ArrayList parameters) 
    229                 { 
    230                         ArrayList constructorParameters = new ArrayList(); 
    231                         ArrayList baseArguments = GetBaseConstructorParameters(obc); 
     229                private void AddAnonymousClassConstructor(ObjectCreateExpression obc, TypeDeclaration typeDeclaration, List<ParameterDeclarationExpression> parameters) 
     230                { 
     231                        List<ParameterDeclarationExpression> constructorParameters = new List<ParameterDeclarationExpression>(); 
     232                        List<ParameterDeclarationExpression> baseArguments = GetBaseConstructorParameters(obc); 
    232233                        constructorParameters.AddRange(baseArguments); 
    233234                        constructorParameters.AddRange(parameters); 
     
    287288                } 
    288289 
    289                 private ArrayList GetBaseConstructorParameters(ObjectCreateExpression obc) 
    290                 { 
    291                         ArrayList result = new ArrayList(); 
     290                private List<ParameterDeclarationExpression> GetBaseConstructorParameters(ObjectCreateExpression obc) 
     291                { 
     292                        List<ParameterDeclarationExpression> result = new List<ParameterDeclarationExpression>(); 
    292293                        TypeDeclaration anonymousClass = obc.AnonymousClass; 
    293294                        if (obc.Parameters.Count > 0) 
     
    335336                } 
    336337 
    337                 private void InitializeConstructor(ConstructorDeclaration constructor, ArrayList initializerArguments, string initializerType) 
     338                private void InitializeConstructor(ConstructorDeclaration constructor, List<ParameterDeclarationExpression> initializerArguments, string initializerType) 
    338339                { 
    339340                        if (initializerType != null) 
     
    346347                                        constructor.ConstructorInitializer.ConstructorInitializerType = ConstructorInitializerType.This; 
    347348 
    348                                 constructor.ConstructorInitializer.Arguments = new ArrayList(); 
     349                                constructor.ConstructorInitializer.Arguments = new List<Expression>(); 
    349350                                if (initializerArguments != null) 
    350351                                { 
  • trunk/Source/Translator/Transformation/ArrayInitializerTransformer.cs

    r76 r103  
    11namespace Janett.Translator 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    1212                { 
    1313                        string variableName = GetVariableName(arrayCreateExpression); 
    14                         ArrayList initializerList = arrayCreateExpression.ArrayInitializer.CreateExpressions; 
     14                        List<Expression> initializerList = arrayCreateExpression.ArrayInitializer.CreateExpressions; 
    1515                        Expression replacedExpression = arrayCreateExpression; 
    16                         if (initializerList.Count > 0 && initializerList[0] is ArrayInitializerExpression && data is InsertionBlockData) 
     16                        if (initializerList.Count > 0 && initializerList[0] is CollectionInitializerExpression && data is InsertionBlockData) 
    1717                        { 
    1818                                ArrayCreateExpression replacedArrayCreateExpression = arrayCreateExpression; 
     
    2828                                } 
    2929 
    30                                 IList initStatements = GetArrayInitStatements(replacedArrayCreateExpression, variableName, initializerList); 
     30                                List<Statement> initStatements = GetArrayInitStatements(replacedArrayCreateExpression, variableName, initializerList); 
    3131                                InsertionBlockData insertionBlockData = (InsertionBlockData) data; 
    3232                                insertionBlockData.Block = (BlockStatement) AstUtil.GetParentOfType(replacedArrayCreateExpression, typeof(BlockStatement)); 
     
    6161                                if (blockStatement.GetHashCode() == insertionBlockData.Block.GetHashCode()) 
    6262                                { 
    63                                         replaced.Children.InsertRange(insertionBlockData.BlockChildIndex, insertionBlockData.Statements); 
     63                                        IList<INode> nodes = new List<INode>(); 
     64                                        foreach (Statement node in insertionBlockData.Statements) 
     65                                                nodes.Add(node); 
     66                                        replaced.Children.InsertRange(insertionBlockData.BlockChildIndex, nodes); 
    6467                                        ReplaceCurrentNode(replaced); 
    6568                                } 
     
    6871                } 
    6972 
    70                 private IList GetArrayInitStatements(ArrayCreateExpression arrayCreateExpression, string variableName, ArrayList initializerList) 
     73                private List<Statement> GetArrayInitStatements(ArrayCreateExpression arrayCreateExpression, string variableName, List<Expression> initializerList) 
    7174                { 
    72                         IList list = new ArrayList(); 
     75                        List<Statement> list = new List<Statement>(); 
    7376                        for (int idx = 0; idx < initializerList.Count; idx++) 
    7477                        { 
    75                                 AssignmentExpression assignment = InitArrayStatement(arrayCreateExpression, variableName, ((ArrayInitializerExpression) initializerList[idx]).CreateExpressions, idx); 
     78                                AssignmentExpression assignment = InitArrayStatement(arrayCreateExpression, variableName, ((CollectionInitializerExpression) initializerList[idx]).CreateExpressions, idx); 
    7679                                ExpressionStatement expressionStatement = new ExpressionStatement(assignment); 
    7780                                list.Add(expressionStatement); 
     
    9699                } 
    97100 
    98                 private AssignmentExpression InitArrayStatement(ArrayCreateExpression arrayCreateExpression, string variableName, ArrayList creatExpressions, int index) 
     101                private AssignmentExpression InitArrayStatement(ArrayCreateExpression arrayCreateExpression, string variableName, List<Expression> creatExpressions, int index) 
    99102                { 
    100103                        IdentifierExpression identifierExpression = new IdentifierExpression(variableName); 
    101                         ArrayList indexes = new ArrayList(); 
     104                        List<Expression> indexes = new List<Expression>(); 
    102105                        indexes.Add(new PrimitiveExpression(index, index.ToString())); 
    103106                        IndexerExpression left = new IndexerExpression(identifierExpression, indexes); 
    104107                        string createType = arrayCreateExpression.CreateType.Type; 
    105108                        ArrayCreateExpression right = new ArrayCreateExpression(new TypeReference(createType, new int[1])); 
    106                         right.ArrayInitializer = new ArrayInitializerExpression(creatExpressions); 
     109                        right.ArrayInitializer = new CollectionInitializerExpression(creatExpressions); 
    107110                        return new AssignmentExpression(left, AssignmentOperatorType.Assign, right); 
    108111                } 
     
    142145 
    143146                public int BlockChildIndex; 
    144                 public IList Statements; 
     147                public List<Statement> Statements; 
    145148        } 
    146149} 
  • trunk/Source/Translator/Transformation/DotClassTransformer.cs

    r6 r103  
    11namespace Janett.Translator 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    2525                        FieldReferenceExpression argument = new FieldReferenceExpression(typeOfExpression, "AssemblyQualifiedName"); 
    2626                        typeOfExpression.Parent = argument; 
    27                         ArrayList arguments = new ArrayList(); 
     27                        List<Expression> arguments = new List<Expression>(); 
    2828                        arguments.Add(argument); 
    2929                        IdentifierExpression methodIdentifier = new IdentifierExpression("java.lang.Class"); 
  • trunk/Source/Translator/Transformation/IKVMDifferencesTransformer.cs

    r2 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    1718 
    1819                                MethodDeclaration equalsMethod = new MethodDeclaration("equals", 
    19                                                                                        Modifiers.Public, AstUtil.GetTypeReference("bool", typeDeclaration), new ArrayList(), null); 
     20                                                                                       Modifiers.Public, AstUtil.GetTypeReference("bool", typeDeclaration), new List<ParameterDeclarationExpression>(), null); 
    2021                                equalsMethod.Parent = typeDeclaration; 
    2122 
     
    6768                        IdentifierExpression targetObject = new IdentifierExpression("java.lang.Object"); 
    6869 
    69                         ArrayList arguments = new ArrayList(); 
     70                        List<Expression> arguments = new List<Expression>(); 
    7071                        arguments.Add(new ThisReferenceExpression()); 
    7172                        string parameterName = ((ParameterDeclarationExpression) equalsMethod.Parameters[0]).ParameterName; 
  • trunk/Source/Translator/Transformation/InnerClassTransformer.cs

    r52 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    4243                                if (typeDeclaration.Parent is TypeDeclaration) 
    4344                                { 
    44                                         ArrayList argList = new ArrayList(); 
     45                                        List<ParameterDeclarationExpression> argList = new List<ParameterDeclarationExpression>(); 
    4546                                        int i = 0; 
    4647                                        foreach (Expression argument in invocationExpression.Arguments) 
     
    154155                        { 
    155156                                string name = typeDeclaration.Name; 
    156                                 ArrayList parameters = new ArrayList(); 
     157                                List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(); 
    157158                                parameters.Add(fieldParameter); 
    158159                                ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration(name, Modifiers.Public, parameters, null); 
  • trunk/Source/Translator/Transformation/InterfaceTransformer.cs

    r45 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    2021                private void CreateInterfaceFieldsClass(TypeDeclaration typeDeclaration) 
    2122                { 
    22                         IList fields = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
     23                        List<INode> fields = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
    2324                        if (fields.Count > 0) 
    2425                        { 
  • trunk/Source/Translator/Transformation/InternalMethodInvocationTransformer.cs

    r43 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    6566                        TypeReferenceExpression helper = new TypeReferenceExpression("Helpers.ReflectionHelper"); 
    6667                        FieldReferenceExpression target = new FieldReferenceExpression(helper, "InstantiateClass"); 
    67                         ArrayList arguments = new ArrayList(); 
     68                        List<Expression> arguments = new List<Expression>(); 
    6869                        TypeOfExpression typeofExpression = new TypeOfExpression(objectCreateExpression.CreateType); 
    69                         ArrayInitializerExpression arrayInitializer = new ArrayInitializerExpression(objectCreateExpression.Parameters); 
     70                        CollectionInitializerExpression arrayInitializer = new CollectionInitializerExpression(objectCreateExpression.Parameters); 
    7071                        TypeReference reference = new TypeReference("object"); 
    7172                        reference.RankSpecifier = new int[1]; 
     
    9293                private InvocationExpression CreateReflectionInvocation(InvocationExpression invocationExpression, bool staticMethod) 
    9394                { 
    94                         ArrayList arguments = new ArrayList(); 
     95                        List<Expression> arguments = new List<Expression>(); 
    9596                        FieldReferenceExpression fieldReferenceExpression = (FieldReferenceExpression) invocationExpression.TargetObject; 
    9697                        Expression invoker = fieldReferenceExpression.TargetObject; 
     
    107108                                arguments.Add(invoker); 
    108109 
    109                         ArrayInitializerExpression arrayInitializer = new ArrayInitializerExpression(invocationExpression.Arguments); 
     110                        CollectionInitializerExpression arrayInitializer = new CollectionInitializerExpression(invocationExpression.Arguments); 
    110111                        TypeReference reference = AstUtil.GetTypeReference("object", invocationExpression); 
    111112                        reference.RankSpecifier = new int[1]; 
  • trunk/Source/Translator/Transformation/JavaModifiersTransformer.cs

    r11 r103  
    11namespace Janett.Translator 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    2323                        if (AstUtil.ContainsModifier(methodDeclaration, Modifiers.Synchronized)) 
    2424                        { 
    25                                 ArrayList positionalArgs = new ArrayList(); 
     25                                List<Expression> positionalArgs = new List<Expression>(); 
    2626                                TypeReferenceExpression system = new TypeReferenceExpression("System.Runtime.CompilerServices.MethodImplOptions"); 
    2727                                FieldReferenceExpression attributeArgument = new FieldReferenceExpression(system, "Synchronized"); 
     
    4949                } 
    5050 
    51                 private AttributeSection CreateAttributeSection(string attributeName, ArrayList args) 
     51                private AttributeSection CreateAttributeSection(string attributeName, List<Expression> args) 
    5252                { 
    5353                        Attribute attribute = new Attribute(attributeName, args, null); 
    54                         ArrayList attributes = new ArrayList(); 
     54                        List<Attribute> attributes = new List<Attribute>(); 
    5555                        attributes.Add(attribute); 
    5656                        AttributeSection attributeSection = new AttributeSection("", attributes); 
  • trunk/Source/Translator/Transformation/NullableValueTypeTransformer.cs

    r82 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    175176                        { 
    176177                                TypeDeclaration typeDeclaration = (TypeDeclaration) CodeBase.Types[fullName]; 
    177                                 ArrayList args = ReplaceNullArguments(typeDeclaration, objectCreateExpression.Parameters, objectCreateExpression); 
     178                                List<Expression> args = ReplaceNullArguments(typeDeclaration, objectCreateExpression.Parameters, objectCreateExpression); 
    178179                                objectCreateExpression.Parameters = args; 
    179180                        } 
     
    186187                        { 
    187188                                TypeDeclaration typeDeclaration = (TypeDeclaration) AstUtil.GetParentOfType(constructorInitializer, typeof(TypeDeclaration)); 
    188                                 ArrayList args = ReplaceNullArguments(typeDeclaration, constructorInitializer.Arguments, constructorInitializer); 
     189                                List<Expression> args = ReplaceNullArguments(typeDeclaration, constructorInitializer.Arguments, constructorInitializer); 
    189190                                constructorInitializer.Arguments = args; 
    190191                        } 
     
    197198                        { 
    198199                                TypeDeclaration typeDeclaration = (TypeDeclaration) AstUtil.GetParentOfType(invocationExpression, typeof(TypeDeclaration)); 
    199                                 ArrayList args = ReplaceNullArguments(typeDeclaration, invocationExpression.Arguments, invocationExpression); 
     200                                List<Expression> args = ReplaceNullArguments(typeDeclaration, invocationExpression.Arguments, invocationExpression); 
    200201                                invocationExpression.Arguments = args; 
    201202                        } 
     
    203204                } 
    204205 
    205                 private ArrayList ReplaceNullArguments(TypeDeclaration typeDeclaration, ArrayList ArgExpressions, INode node) 
     206                private List<Expression> ReplaceNullArguments(TypeDeclaration typeDeclaration, List<Expression> ArgExpressions, INode node) 
    206207                { 
    207208                        int index = 0; 
    208                         ArrayList args = new ArrayList(); 
     209                        List<Expression> args = new List<Expression>(); 
    209210 
    210211                        foreach (Expression argument in ArgExpressions) 
     
    237238                } 
    238239 
    239                 private ParametrizedNode GetAssociateMember(TypeDeclaration typeDeclaration, INode node, ArrayList argExpressions) 
     240                private ParametrizedNode GetAssociateMember(TypeDeclaration typeDeclaration, INode node, List<Expression> argExpressions) 
    240241                { 
    241242                        if (node is InvocationExpression) 
  • trunk/Source/Translator/Transformation/ProjectInterfaceTransformer.cs

    r45 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    1718                        if (typeDeclaration.Type == ClassType.Interface) 
    1819                        { 
    19                                 ArrayList methods = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
    20                                 ArrayList typeDeclarations = AstUtil.GetChildrenWithType(typeDeclaration, typeof(TypeDeclaration)); 
     20                                IEnumerable<INode> methods = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
     21                                List<INode> typeDeclarations = AstUtil.GetChildrenWithType(typeDeclaration, typeof(TypeDeclaration)); 
    2122 
    2223                                typeDeclaration.Children.Clear(); 
     
    2930                } 
    3031 
    31                 private void RemoveMethodsModifier(IList methods) 
     32                private void RemoveMethodsModifier(IEnumerable<INode> methods) 
    3233                { 
    3334                        foreach (MethodDeclaration method in methods) 
     
    3536                } 
    3637 
    37                 private void SeperateTypes(TypeDeclaration typeDeclaration, ArrayList typeDeclarations) 
     38                private void SeperateTypes(TypeDeclaration typeDeclaration, List<INode> typeDeclarations) 
    3839                { 
    3940                        NamespaceDeclaration namespaceDeclaration = (NamespaceDeclaration) AstUtil.GetParentOfType(typeDeclaration, typeof(NamespaceDeclaration)); 
     
    4243                                CodeBase.References.Add(typeDeclaration.Name + "." + type.Name, namespaceDeclaration.Name + "." + type.Name); 
    4344                                namespaceDeclaration.Children.Add(type); 
    44                                 IList typeMethods = AstUtil.GetChildrenWithType(type, typeof(MethodDeclaration)); 
     45                                IEnumerable<INode> typeMethods = AstUtil.GetChildrenWithType(type, typeof(MethodDeclaration)); 
    4546                                if (type.Type == ClassType.Interface) 
    4647                                        RemoveMethodsModifier(typeMethods); 
  • trunk/Source/Translator/Transformation/SerializableTransformer.cs

    r19 r103  
    11namespace Janett.Translator 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    1919                                if (typeDeclaration.Type == ClassType.Class) 
    2020                                { 
    21                                         ArrayList attributes = new ArrayList(); 
     21                                        List<Attribute> attributes = new List<Attribute>(); 
    2222                                        Attribute attribute = new Attribute("System.SerializableAttribute", null, null); 
    2323                                        attributes.Add(attribute); 
  • trunk/Source/Translator/Transformation/StaticConstructorTransformer.cs

    r2 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    1213                { 
    1314                        TypeDeclaration replacedType = typeDeclaration; 
    14                         ArrayList typeChildren = new ArrayList(); 
     15                        List<INode> typeChildren = new List<INode>(); 
    1516                        typeChildren.AddRange(typeDeclaration.Children); 
    1617 
     
    4041                                for (int i = 1; i < staticConstructors.Count; i++) 
    4142                                { 
    42                                         ArrayList children = ((ConstructorDeclaration) staticConstructors[i]).Body.Children; 
     43                                        IEnumerable<INode> children = ((ConstructorDeclaration) staticConstructors[i]).Body.Children; 
    4344                                        replacedConstructor.Body.Children.AddRange(children); 
    4445                                } 
     
    5859                } 
    5960 
    60                 private ArrayList RemoveStaticConstructors(ArrayList typeChildren, out int firstStaticCotrIndex) 
     61                private List<INode> RemoveStaticConstructors(List<INode> typeChildren, out int firstStaticCotrIndex) 
    6162                { 
    62                         ArrayList cleanList = new ArrayList(); 
     63                        List<INode> cleanList = new List<INode>(); 
    6364                        firstStaticCotrIndex = 0; 
    6465                        int index = 0; 
  • trunk/Source/Translator/Transformation/StaticPrimitiveTypeFieldsTransformer.cs

    r85 r103  
    2424                private bool IsJavaPrimitiveType(TypeReference typeReference) 
    2525                { 
    26                         return (TypeReference.PrimitiveTypesJava.Contains(typeReference.Type)); 
     26                        return (TypeReference.PrimitiveTypesJava.ContainsKey(typeReference.Type)); 
    2727                } 
    2828        } 
  • trunk/Source/Translator/Transformation/TestCaseTransformer.cs

    r69 r103  
    11namespace Janett.Translator 
    22{ 
    3         using System.Collections
     3        using System.Collections.Generic
    44 
    55        using ICSharpCode.NRefactory.Ast; 
     
    1717                                        TypeDeclaration newType = typeDeclaration; 
    1818                                        Attribute attr = new Attribute("NUnit.Framework.TestFixture", null, null); 
    19                                         ArrayList attributes = new ArrayList(); 
     19                                        List<Attribute> attributes = new List<Attribute>(); 
    2020                                        attributes.Add(attr); 
    2121                                        AttributeSection attrSection = new AttributeSection(null, attributes); 
     
    4242                                        MethodDeclaration replaced = methodDeclaration; 
    4343                                        Attribute attr = new Attribute("NUnit.Framework.Test", null, null); 
    44                                         ArrayList attributes = new ArrayList(); 
     44                                        List<Attribute> attributes = new List<Attribute>(); 
    4545                                        attributes.Add(attr); 
    4646                                        AttributeSection testAttribute = new AttributeSection(null, attributes); 
     
    6262 
    6363                                                Attribute attribute = new Attribute(attributeName, null, null); 
    64                                                 ArrayList attributes = new ArrayList(); 
     64                                                List<Attribute> attributes = new List<Attribute>(); 
    6565                                                attributes.Add(attribute); 
    6666                                                AttributeSection attributeSection = new AttributeSection(null, attributes); 
  • trunk/Source/UnitTests/Framework/AstUtilTest.cs

    r2 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    2930                        TypeDeclaration typeDeclaration = (TypeDeclaration) ns.Children[0]; 
    3031 
    31                         ArrayList fieldList = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
    32                         ArrayList methodList = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
     32                        List<INode> fieldList = AstUtil.GetChildrenWithType(typeDeclaration, typeof(FieldDeclaration)); 
     33                        List<INode> methodList = AstUtil.GetChildrenWithType(typeDeclaration, typeof(MethodDeclaration)); 
    3334 
    3435                        Assert.IsNotNull(fieldList); 
  • trunk/Source/UnitTests/Framework/ExpressionTypeResolverTest.cs

    r66 r103  
    558558                        TypeReference type = GetType(nl); 
    559559                        Assert.IsNotNull(type); 
    560                         Assert.IsTrue(type is NullTypeReference); 
     560                        Assert.AreEqual(TypeReference.Null, type); 
    561561                } 
    562562        } 
  • trunk/Source/UnitTests/Framework/MethodRelatedTransformerTest.cs

    r16 r103  
    22{ 
    33        using System.Collections; 
     4        using System.Collections.Generic; 
    45 
    56        using ICSharpCode.NRefactory.Ast; 
     
    2324                        ParameterDeclarationExpression p2 = new ParameterDeclarationExpression(new TypeReference("string"), "text"); 
    2425                        p2.TypeReference.RankSpecifier = new int[] {}; 
    25                         ArrayList argList = new ArrayList(); 
     26                        List<ParameterDeclarationExpression> argList = new List<ParameterDeclarationExpression>(); 
    2627                        argList.Add(p1); 
    2728                        argList.Add(p2); 
     
    7576                                new TypeReference("int"), "from"); 
    7677                        pm.TypeReference.RankSpecifier = new int[] {}; 
    77                         ArrayList al = new ArrayList(); 
     78                        List<ParameterDeclarationExpression> al = new List<ParameterDeclarationExpression>(); 
    7879                        al.Add(pm); 
    7980                        MethodDeclaration myMethod = new MethodDeclaration("Distance", Modifiers.Protected, 
     
    9596                        ParameterDeclarationExpression p1 = new ParameterDeclarationExpression(new TypeReference("Circle"), "circle"); 
    9697                        p1.TypeReference.RankSpecifier = new int[] {}; 
    97                         ArrayList md1Param = new ArrayList(); 
     98                        List<ParameterDeclarationExpression> md1Param = new List<ParameterDeclarationExpression>(); 
    9899                        md1Param.Add(p1); 
    99100                        MethodDeclaration md1 = new MethodDeclaration("GetRadius", Modifiers.Private, new TypeReference("int"), md1Param, null); 
  • trunk/Source/UnitTests/Framework/ShortenReferencesTransformerTest.cs

    r2 r103  
    11namespace Janett.Framework 
    22{ 
     3        using ICSharpCode.NRefactory; 
    34        using ICSharpCode.NRefactory.Ast; 
    45 
     
    2021                        string expected = TestUtil.GetExpected(); 
    2122 
    22                         CompilationUnit cu = TestUtil.ParseProgram(program); 
     23                        CompilationUnit cu = TestUtil.ParseProgram(program, SupportedLanguage.CSharp); 
    2324                        VisitCompilationUnit(cu, null); 
    2425 
  • trunk/Source/UnitTests/Framework/TypeResolverTest.cs

    r89 r103  
    142142                public void InnerTypeImportedViaPackage() 
    143143                { 
    144                         string program = TestUtil.PackageMemberParse("import import java.util.*; public class A { Map.Entry entry;}"); 
     144                        string program = TestUtil.PackageMemberParse("import java.util.*; public class A { Map.Entry entry;}"); 
    145145                        CompilationUnit cu = TestUtil.ParseProgram(program); 
    146146                        NamespaceDeclaration ns = (NamespaceDeclaration) cu.Children[0]; 
  • trunk/Source/UnitTests/Framework/UsingVisitorTest.cs

    r11 r103  
    11namespace Janett.Framework 
    22{ 
     3        using ICSharpCode.NRefactory; 
    34        using ICSharpCode.NRefactory.Ast; 
    45 
     
    2728                public void Attribute() 
    2829                { 
    29                         string program = "package Test; [NUnit.Framework.TestFixtureAttribute] public class A {} "; 
    30                         CompilationUnit cu = TestUtil.ParseProgram(program); 
     30                        string program = "namespace Test{ [NUnit.Framework.TestFixtureAttribute] public class A {} }"; 
     31                        CompilationUnit cu = TestUtil.ParseProgram(program, SupportedLanguage.CSharp); 
    3132                        VisitCompilationUnit(cu, null); 
    3233 
  • trunk/Source/UnitTests/TestCode/AbstractClassTransformerTest/Polymorphism.cs

    r32 r103  
    33        public interface Comparator 
    44        { 
    5                 int equals(Object arg); 
     5                int @equals(Object arg); 
    66        } 
    77        public class Object 
    88        { 
    9                 public int equals(Object obj) 
     9                public int @equals(Object obj) 
    1010                { 
    1111                        return 0; 
  • trunk/Source/UnitTests/TestCode/IKVMDifferencesTransformerTest/ComparatorDerivedClass.cs

    r2 r103  
    77                        return 0; 
    88                } 
    9                 public bool equals(java.lang.Object obj) 
     9                public bool @equals(java.lang.Object obj) 
    1010                { 
    1111                        return java.lang.Object.instancehelper_equals(this, obj); 
  • trunk/Source/UnitTests/TestCode/InternalMethodInvocationTest/InternalConstructor.java

    r43 r103  
    1 package Test; 
    2 [NUnit.Framework.TestFixture()] 
    3 public class TestA 
     1namespace Test 
    42{ 
    5         public void testMethod() 
     3        [NUnit.Framework.TestFixture()] 
     4        public class TestA 
    65        { 
    7                 Test test = new Test("TestClass", 0);  
     6                public void testMethod() 
     7                { 
     8                        Test test = new Test("TestClass", 0);  
     9                } 
    810        } 
    911} 
  • trunk/Source/UnitTests/TestCode/InternalMethodInvocationTest/InvocationInTestCase.java

    r2 r103  
    1 package Test; 
    2 [NUnit.Framework.TestFixture()] 
    3 public class TestA 
     1namespace Test 
    42{ 
    5         public void testMethod() 
     3        [NUnit.Framework.TestFixture()] 
     4        public class TestA 
    65        { 
    7                 A a = null; 
    8                 a.method(0, 1); 
    9                 int r = a.method(1, 0); 
     6                public void testMethod() 
     7                { 
     8                        A a = null; 
     9                        a.method(0, 1); 
     10                        int r = a.method(1, 0); 
     11                } 
    1012        } 
    1113} 
  • trunk/Source/UnitTests/TestCode/InternalMethodInvocationTest/StaticInvocationInTestCase.java

    r30 r103  
    1 package Test; 
    2 [NUnit.Framework.TestFixture()] 
    3 public class TestA 
     1namespace Test 
    42{ 
    5         public void testMethod() 
     3        [NUnit.Framework.TestFixture()] 
     4        public class TestA 
    65        { 
    7                 A a = null; 
    8                 a.method(0, 1); 
    9                 int r = a.method(1, 0); 
     6                public void testMethod() 
     7                { 
     8                        A a = null; 
     9                        a.method(0, 1); 
     10                        int r = a.method(1, 0); 
     11                } 
    1012        } 
    1113} 
  • trunk/Source/UnitTests/TestCode/MemberMapperTest/AddingCast.cs

    r30 r103  
    77                public void Method() 
    88                { 
    9                         List myList; Set set; ((System.Collections.ArrayList)set).AddRange(myList); 
     9                        List myList; Set @set; ((System.Collections.ArrayList)@set).AddRange(myList); 
    1010                } 
    1111        } 
  • trunk/Source/UnitTests/TestCode/ShortenReferencesTransformerTest/OptimizeUsings.java

    r11 r103  
    1 package Test; 
    2 public class A implements System.IComparable 
     1namespace Test 
    32{ 
    4         [System.NonSerializedAttribute()] 
    5         System.IComparable com; 
     3        public class A : System.IComparable 
     4        { 
     5                [System.NonSerializedAttribute()] 
     6                System.IComparable com; 
     7        } 
    68} 
  • trunk/Source/UnitTests/Translator/IntegrationTest/IKVMExpected/Class1.cs

    r96 r103  
    4646                        Name = name; 
    4747                        java.util.Calendar cal = java.util.Calendar.getInstance(); 
    48                         int min = cal.get(java.util.Calendar.MINUTE); 
    49                         cal.set(java.util.Calendar.MONTH, java.util.Calendar.AUGUST); 
    50                         cal.add(java.util.Calendar.HOUR, 12); 
     48                        int min = cal.@get(java.util.Calendar.MINUTE); 
     49                        cal.@set(java.util.Calendar.MONTH, java.util.Calendar.AUGUST); 
     50                        cal.@add(java.util.Calendar.HOUR, 12); 
    5151                        return base.ExistSimilarFieldAndMethod(); 
    5252                } 
     
    139139                        } 
    140140                } 
    141                 public override bool equals(object obj) 
     141                public override bool @equals(object obj) 
    142142                { 
    143143                        return java.lang.Object.instancehelper_equals(this, obj); 
  • trunk/Source/UnitTests/Translator/InternalMethodInvocationTest.cs

    r43 r103  
    11namespace Janett.Translator 
    22{ 
     3        using ICSharpCode.NRefactory; 
    34        using ICSharpCode.NRefactory.Ast; 
    45 
     
    2930                        string expected = TestUtil.GetExpected(); 
    3031 
    31                         CompilationUnit cu2 = TestUtil.ParseProgram(program2); 
     32                        CompilationUnit cu2 = TestUtil.ParseProgram(program2, SupportedLanguage.CSharp); 
    3233                        NamespaceDeclaration ns2 = (NamespaceDeclaration) cu2.Children[0]; 
    3334                        TypeDeclaration ty2 = (TypeDeclaration) ns2.Children[0]; 
     
    5253                        string expected = TestUtil.GetExpected(); 
    5354 
    54                         CompilationUnit cu2 = TestUtil.ParseProgram(program2); 
     55                        CompilationUnit cu2 = TestUtil.ParseProgram(program2, SupportedLanguage.CSharp); 
    5556                        NamespaceDeclaration ns2 = (NamespaceDeclaration) cu2.Children[0]; 
    5657                        TypeDeclaration ty2 = (TypeDeclaration) ns2.Children[0]; 
     
    7475                        NamespaceDeclaration ns = (NamespaceDeclaration) cu1.Children[0]; 
    7576                        TypeDeclaration ty = (TypeDeclaration) ns.Children[0]; 
    76                         CompilationUnit cu2 = TestUtil.ParseProgram(usageProgram); 
     77                        CompilationUnit cu2 = TestUtil.ParseProgram(usageProgram, SupportedLanguage.CSharp); 
    7778 
    7879                        CodeBase.Types.Add("Test.Test", ty);