Author: roeie
Date: 2007-04-26 02:54:37 -0400 (Thu, 26 Apr 2007)
New Revision: 76299
Modified:
branches/mainsoft/gh20/mcs/class/System.XML/System.Xml/XmlTextReader.cs
Log:
ibm git bug
Modified:
branches/mainsoft/gh20/mcs/class/System.XML/System.Xml/XmlTextReader.cs
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.XML/System.Xml/XmlTextReader.cs
2007-04-26 04:34:04 UTC (rev 76298)
+++ branches/mainsoft/gh20/mcs/class/System.XML/System.Xml/XmlTextReader.cs
2007-04-26 06:54:37 UTC (rev 76299)
@@ -269,15 +269,15 @@
#if NET_2_0
#else
public override string this [int i] {
- get { return GetAttribute (i); }
+ get { return This.GetAttribute (i); }
}
public override string this [string name] {
- get { return GetAttribute (name); }
+ get { return This.GetAttribute (name); }
}
public override string this [string localName, string
namespaceName] {
- get { return GetAttribute (localName, namespaceName); }
+ get { return This.GetAttribute (localName,
namespaceName); }
}
#endif
@@ -379,6 +379,14 @@
get { return parserContext.XmlSpace; }
}
+ // When running on IBM JVM, access of some instance methods/properties
cause AbstractMethodError (due to a JIT compiler bug).
+ // The workaround is to replace virtual methods/properties
access with indirect access via another refrerence to 'this'.
+ // The property is used for this purpose.
+ public XmlTextReader This
+ {
+ get {return this;}
+ }
+
#endregion
#region Methods
@@ -503,7 +511,7 @@
for (int i = 0; i < attributeCount; i++) {
XmlAttributeTokenInfo ti = attributeTokens [i];
if (ti.Name == name) {
- MoveToAttribute (i);
+ This.MoveToAttribute (i);
return true;
}
}
@@ -515,7 +523,7 @@
int idx = GetIndexOfQualifiedAttribute (localName,
namespaceName);
if (idx < 0)
return false;
- MoveToAttribute (idx);
+ This.MoveToAttribute (idx);
return true;
}
@@ -541,8 +549,8 @@
{
if (attributeCount == 0)
return false;
- MoveToElement ();
- return MoveToNextAttribute ();
+ This.MoveToElement ();
+ return This.MoveToNextAttribute ();
}
public override bool MoveToNextAttribute ()
@@ -666,12 +674,12 @@
else if (buffer.Length < offset + length)
throw new ArgumentOutOfRangeException ("buffer
length is smaller than the sum of offset and length.");
- if (IsEmptyElement) {
+ if (This.IsEmptyElement) {
Read ();
return 0;
}
- if (!readCharsInProgress && NodeType !=
XmlNodeType.Element)
+ if (!readCharsInProgress && This.NodeType !=
XmlNodeType.Element)
return 0;
preserveCurrentTag = false;
@@ -950,7 +958,7 @@
private XmlException NotWFError (string message)
{
- return new XmlException (this as IXmlLineInfo, BaseURI,
message);
+ return new XmlException(this, This.BaseURI, message);
}
private void Init ()
@@ -1310,7 +1318,8 @@
}
}
}
- return this.ReadState != ReadState.EndOfFile;
+
+ return This.ReadState != ReadState.EndOfFile;
}
private void SetEntityReferenceProperties ()
@@ -1412,16 +1421,16 @@
currentToken.NamespaceURI =
parserContext.NamespaceManager.DefaultNamespace;
if (namespaces) {
- if (NamespaceURI == null)
- throw NotWFError (String.Format ("'{0}'
is undeclared namespace.", Prefix));
+ if (This.NamespaceURI == null)
+ throw NotWFError (String.Format ("'{0}'
is undeclared namespace.", This.Prefix));
try {
for (int i = 0; i < attributeCount;
i++) {
- MoveToAttribute (i);
- if (NamespaceURI == null)
- throw NotWFError
(String.Format ("'{0}' is undeclared namespace.", Prefix));
+ This.MoveToAttribute (i);
+ if (This.NamespaceURI == null)
+ throw NotWFError
(String.Format ("'{0}' is undeclared namespace.", This.Prefix));
}
} finally {
- MoveToElement ();
+ This.MoveToElement ();
}
}
@@ -1434,8 +1443,8 @@
case "base":
if (this.resolver != null) {
Uri buri =
- BaseURI != String.Empty
?
- new Uri (BaseURI) :
null;
+ This.BaseURI != String.Empty ?
+ new Uri (This.BaseURI)
: null;
Uri uri = resolver.ResolveUri (
buri, value);
parserContext.BaseURI =
@@ -1464,7 +1473,7 @@
}
}
- if (IsEmptyElement)
+ if (This.IsEmptyElement)
CheckCurrentStateUpdate ();
}
@@ -1519,7 +1528,7 @@
private void CheckCurrentStateUpdate ()
{
- if (depth == 0 && !allowMultipleRoot && (IsEmptyElement
|| NodeType == XmlNodeType.EndElement))
+ if (depth == 0 && !allowMultipleRoot &&
(This.IsEmptyElement || This.NodeType == XmlNodeType.EndElement))
currentState = XmlNodeType.EndElement;
}
@@ -1560,7 +1569,8 @@
// Since whitespace strings are mostly identical
// depending on the Depth, we make use of NameTable
// to atomize whitespace strings.
- switch (NodeType) {
+ switch (This.NodeType)
+ {
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
int len = valueBuffer.Length;
@@ -1647,7 +1657,7 @@
SetEntityReferenceProperties ();
} else {
XmlNodeType nodeType = notWhitespace ?
XmlNodeType.Text :
- this.XmlSpace == XmlSpace.Preserve ?
XmlNodeType.SignificantWhitespace : XmlNodeType.Whitespace;
+ This.XmlSpace == XmlSpace.Preserve ?
XmlNodeType.SignificantWhitespace : XmlNodeType.Whitespace;
SetProperties (
nodeType, // nodeType
String.Empty, // name
@@ -2439,8 +2449,8 @@
string systemId, string internalSubset, int
intSubsetStartLine, int intSubsetStartColumn)
{
// now compile DTD
- parserContext.Dtd = new DTDObjectModel
(this.NameTable); // merges both internal and external subsets in the
meantime,
- DTD.BaseURI = BaseURI;
+ parserContext.Dtd = new DTDObjectModel
(This.NameTable); // merges both internal and external subsets in the
meantime,
+ DTD.BaseURI = This.BaseURI;
DTD.Name = name;
DTD.PublicId = publicId;
DTD.SystemId = systemId;
@@ -2848,7 +2858,7 @@
bool isText = currentState == XmlNodeType.Element && ch
!= -1 && ch != '<';
if (!isText && (whitespaceHandling ==
WhitespaceHandling.None ||
- whitespaceHandling ==
WhitespaceHandling.Significant && XmlSpace != XmlSpace.Preserve))
+ whitespaceHandling ==
WhitespaceHandling.Significant && This.XmlSpace != XmlSpace.Preserve))
return false;
ClearValueBuffer ();
@@ -2858,7 +2868,7 @@
if (isText) {
ReadText (false);
} else {
- XmlNodeType nodeType = (this.XmlSpace ==
XmlSpace.Preserve) ?
+ XmlNodeType nodeType = (This.XmlSpace ==
XmlSpace.Preserve) ?
XmlNodeType.SignificantWhitespace :
XmlNodeType.Whitespace;
SetProperties (nodeType,
String.Empty,
@@ -2923,7 +2933,7 @@
private bool ReadUntilEndTag ()
{
- if (Depth == 0)
+ if (This.Depth == 0)
currentState = XmlNodeType.EndElement;
int ch;
do {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches