xml - Why is creation of syntactically illegal QNames permitted in java serialization frameworks? -


I am running in a lot of JASB serialization errors which arise from the fact that the code is making an invalid qualified name different Places I am using APIs and checking other Java XML options, and one thing that is strange is that there are no input checks in sections that implement such eligible classes.

This is really problematic, because the complex code generates many JACAB objects, and it is not until you understand that something went wrong. The exception stack usually does not tell you which element / character is wrong, just something is wrong.

Does this not make much sense for these libraries so that it is non-serializable content first place?

Here's a code snippet: Why does this work? Should not it be a illegal employment exception ? In other APIs, which define the QN name, the same behavior is similar. The javadocs for this class are specified that if the name space is empty, you will get an IllegalArgumentException but not otherwise.

  QName q = New QName ("Namespace URI is considered a anyURI, but clearly it is not !! !!", "Local part is considered and an NCName, But obviously !! it is not !! "<< << <<  

Reference:,. In other words, according to the spec, the code above is completely irrelevant, without affecting the ordering.

itemprop = "text">

hypothesizing

The primary user of the QName constructor is not likely to have a normal Java code But this is the XML parser.

The XML parsing display is sensitive if the creator is called by the parser, in theory Parser has already validated the syntax, so accepting it again is a waste of time.

This is a 95% issue why users pay the price for 5%.

If you want a valid QName manufacturer, you can extend the QName and add your own code.

For example:

  Public Squow Quikquename QN Name {Public Validated QN Name (String Namespace UI, String Local Part) {Super (NamespaceURI, Local Part) extends ; VerfiyNamespaceURI (namespaceURI); // throws invalidArmentationApplicationLocal (LocalPart); // throws illegal IllegalArgumentException} ...}  

At least the class has not been certified.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -