Skip to main content
xenoveritas.org

Main navigation

  • Categories
  • Home
  • Links
  • Name Generator
  • Scramble
User account menu
  • Log in

Breadcrumb

  1. Home

I'm glad to see the StAX documentation is well proffread

By Xenoveritas, 5 February, 2010
Topics
Java
  • Add new comment

I'm glad to see the Java StAX documentation is proffread - because it certainly isn't proofread.

Two examples are below, one from XMLStreamReader, and another from XMLOutputFactory.

From the Java 1.6 documentation for XMLStreamReader.nextTag():

Essentially it does the following (implementations are free to optimized but must do equivalent processing):

int eventType = next();
while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
|| (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
// skip whitespace
|| eventType == XMLStreamConstants.SPACE
|| eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
|| eventType == XMLStreamConstants.COMMENT
) {
eventType = next();
}
if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
throw new String XMLStreamException("expected start or end tag", getLocation());
}
return eventType;

So, basically, it must fail to compile?

Brillant.

Next we have XMLOutputFactory.newInstance(String, ClassLoader). The documentation speaks for itself:

Deprecated. This method has been deprecated because it returns an instance of XMLInputFactory, which is of the wrong class. Use the new method newFactory(java.lang.String, java.lang.ClassLoader) instead.

Go copy-and-paste coders!

Current Games

I'm currently playing:

  • Final Fantasy XIV: Endwalker

I intend to maybe get around to finishing:

  • Literally anything else

Video Games Section

Thought for the Moment

I never have thoughts any more.

Old Thoughts

Has the LHC Destroyed the Earth?

  • Create new account
  • Reset your password
RSS feed
Powered by Drupal