Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8931069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:01:34+00:00 2026-06-15T09:01:34+00:00

I found some strange code in OpenJDK JAXB: com.sun.xml.internal.bind.v2.model.impl.ModelBuilder try { XmlSchema s =

  • 0

I found some strange code in OpenJDK JAXB:

com.sun.xml.internal.bind.v2.model.impl.ModelBuilder

    try {
        XmlSchema s = null;
        s.location();
    } catch (NullPointerException e) {
        // as expected
    } catch (NoSuchMethodError e) {
        ...
    }

Can some explain why they do this? Or this is just a bad code need to fix.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:01:35+00:00Added an answer on June 15, 2026 at 9:01 am

    They are using this code as a test to determine which version of the JAXB (JSR-222) APIs are being used. The location parameter was added to @XmlSchema in JAXB 2.1, if NoSuchMethodError was thrown then JAXB 2.0 APIs are being used.

    See Lines 158-177

    • http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.jaxb.reflection/jaxb2-reflection/2.1.4/org/jvnet/jaxb/reflection/model/impl/ModelBuilder.java

    Javadoc – @XmlSchema.location

    • http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/XmlSchema.html#location()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found some classes designed for debugging in package com.sun.jdi like VirtualMachine , but
I've found some strange code... //in file ClassA.h: class ClassA { public: void Enable(
I found in some old code strange thing (at least for me). The field
Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision. Running
I found something strange while debugging some code. Apparently, >>> (0-6) is -6 False
I just found some scala code which has a strange class name: class `This
I just found some strange behavior of database's order by clause. In string comparison,
I was experimenting with toCharArray() and found some strange behavior. Suppose private static final
I'm hacking my way through learning Flex and have found some strange behaviour. When
I'm working on a heavily data-bound Win.Forms application where I've found some strange behavior.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.