Fix generation of calls to List.remove(int) which should become RemoveAt

This commit is contained in:
Sam Harwell 2013-02-17 15:31:14 -06:00
parent fb5c7655ea
commit a960ca940e
7 changed files with 11 additions and 13 deletions

View File

@ -360,7 +360,7 @@ namespace Antlr4.Runtime.Atn
if (addKey)
{
mergedConfigs.Put(key, unmergedConfig);
unmerged.Remove(i);
unmerged.RemoveAt(i);
}
return true;
}
@ -635,7 +635,7 @@ namespace Antlr4.Runtime.Atn
{
if (unmerged[i] == config)
{
unmerged.Remove(i);
unmerged.RemoveAt(i);
return;
}
}

View File

@ -223,7 +223,7 @@ namespace Antlr4.Runtime.Atn
public virtual Antlr4.Runtime.Atn.Transition RemoveTransition(int index)
{
return transitions.Remove(index);
return transitions.RemoveAt(index);
}
public abstract Antlr4.Runtime.Atn.StateType StateType
@ -290,7 +290,7 @@ namespace Antlr4.Runtime.Atn
{
throw new InvalidOperationException();
}
optimizedTransitions.Remove(i);
optimizedTransitions.RemoveAt(i);
}
public ATNState()

View File

@ -168,13 +168,13 @@ namespace Antlr4.Runtime.Dfa
}
if (index == values.Count - 1)
{
values.Remove(index);
values.RemoveAt(index);
return this;
}
Antlr4.Runtime.Dfa.SparseEdgeMap<T> result = new Antlr4.Runtime.Dfa.SparseEdgeMap
<T>(this, GetMaxSparseSize());
System.Array.Copy(result.keys, index + 1, result.keys, index, Size() - index - 1);
result.values.Remove(index);
result.values.RemoveAt(index);
return result;
}

View File

@ -780,7 +780,7 @@ namespace Antlr4.Runtime.Misc
// if whole interval x..x, rm
if (el == a && el == b)
{
intervals.Remove(i);
intervals.RemoveAt(i);
break;
}
// if on left edge x..b, adjust left

View File

@ -75,7 +75,7 @@ namespace Antlr4.Runtime.Misc
public virtual bool Remove(int i)
{
T o = elements.Remove(i);
T o = elements.RemoveAt(i);
return base.Remove(o);
}

View File

@ -202,7 +202,7 @@ namespace Antlr4.Runtime
{
if (children != null)
{
children.Remove(children.Count - 1);
children.RemoveAt(children.Count - 1);
}
}

View File

@ -14,7 +14,8 @@
-typeMapping java.util.Comparator System.Collections.IComparer
-typeMapping java.util.ArrayList System.Collections.ArrayList
-methodMapping java.util.List.addAll AddRange
-methodMapping java.util.List.addAll AddRange
-methodMapping java.util.List.remove(int) RemoveAt
-methodMapping java.util.AbstractList.addAll AddRange
-methodMapping java.util.ArrayList.addAll AddRange
@ -43,9 +44,6 @@
-namespaceMapping javax.net.ssl Sharpen
-methodMapping java.lang.Object.memberwiseClone Clone
-methodMapping java.nio.charset.Charset.forName Sharpen.Extensions.GetEncoding
-methodMapping java.util.List<>.remove RemoveAt
-methodMapping java.util.IList<>.remove RemoveAt
-methodMapping java.util.ArrayList.remove RemoveAt
-methodMapping java.util.ArrayList.trimToSize TrimExcess
-methodMapping java.lang.Integer.toOctalString Sharpen.Extensions.ToOctalString
-methodMapping java.lang.Integer.toHexString Sharpen.Extensions.ToHexString