Skip to content

wrap null qname deref in xsb group loaders#77

Open
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:xsb-group-loader-null-qname
Open

wrap null qname deref in xsb group loaders#77
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:xsb-group-loader-null-qname

Conversation

@aizu-m

@aizu-m aizu-m commented Jul 7, 2026

Copy link
Copy Markdown

Traced why a corrupt .xsb drops out of the loader as a bare NullPointerException rather than the usual SchemaTypeLoaderException.

  1. readQName returns null when the local-part string code is 0, because stringForCode(0) is null.
  2. finishLoadingModelGroup and finishLoadingAttributeGroup read the QName and dereference name.getNamespaceURI() before entering their try, so that null escapes as a raw NPE out of resolveHandle.
  3. the sibling loaders (finishLoadingElement, finishLoadingAttribute, finishLoadingIdentityConstraint) already do the same readQName/getContainer work inside the try, so they report SchemaTypeLoaderException for the identical input.

Moved the readQName/getContainer/checkContainerNotNull lines into the try in both group loaders so a null name surfaces the same way as everywhere else. Added a test that feeds a zero local-part code through both loaders and expects SchemaTypeLoaderException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant