Project

Profile

Help

Bug #2524

closed

AssertionError due to class loading order

Added by Gunther Rademacher over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
Start date:
2015-12-03
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

Running this Java program

import net.sf.saxon.s9api.ItemType;
import net.sf.saxon.s9api.XdmAtomicValue;

public class ValidateNCName {

  public static void main(String[] args) throws Exception {
//  Class.forName("net.sf.saxon.type.BuiltInAtomicType");
//  Class.forName("net.sf.saxon.type.StringConverter");
    new XdmAtomicValue("x", ItemType.NCNAME);
    System.out.println("success");
  }
}

with JVM argument -verbose shows that

  • net.sf.saxon.type.StringConverter

  • net.sf.saxon.type.BuiltInAtomicType

are loaded in this very order, which however causes their static initialization to behave in an unintended way, which subsequently causes an AssertionError:

This can be worked around by uncommenting the Class.forName invocations.

Originally observed in a more complex setup with Saxon-EE 9.6.0.5, but also occurs with 9.7.0.1.

Please register to edit this issue

Also available in: Atom PDF