Issue Details (XML | Word | Printable)

Key: XMLBEANS-285
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Radu Preotiuc-Pietro
Reporter: Valery Gorbunov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XMLBeans

XmlBeans.NO_TYPE initialized not correctly

Created: 19/Aug/06 02:04 PM   Updated: 26/Oct/09 07:01 PM
Return to search
Component/s: XmlObject
Affects Version/s: Version 2.2.1
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
XmlBeans.NO_TYPE initialized not correctly if working with XmbBeans begins with
org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem class.
Test cases:

Correct initialization:
package mypackage;

import junit.framework.TestCase;

import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;


public class XMLTest extends TestCase{

public XMLTest() {
super();
}
public XMLTest(String name) {
super(name);
}
public void test2(){
assertNotNull(XmlBeans.NO_TYPE);
assertNotNull(BuiltinSchemaTypeSystem.ST_NO_TYPE);
}
}

Incorrect initialization.

package mypackage;

import junit.framework.TestCase;

import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;


public class XMLTestWithFail extends TestCase{
public XMLTestWithFail() {
super();
}
public XMLTestWithFail(String name) {
super(name);
}

public void test(){
BuiltinSchemaTypeSystem.get();
assertNotNull(XmlBeans.NO_TYPE);
}
}


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Radu Preotiuc-Pietro added a comment - 30/Aug/06 07:52 PM
Very interesting observation. This is because BuiltinSchemaTypeSystem and XmlBeans circularily depend on one another in their static initializers, which is a bad idea. We need to fix this.