java - How to avoid this warning:com.sun.org.apache.xerces.internal.parsers.SAXParser is Sun proprietary API and may be removed in a future release -


recently upgraded jdk1.5 jdk1.6, during compilation below warning thrown.

import com.sun.org.apache.xerces.internal.parsers.saxparser;  ...  org.xml.sax.xmlreader l_oparser = new saxparser();    

during compilation

[javac] c:\users\project\src\com\test\ecommerce\services\paymentservices\authorization\historytransactionresponseparser.java:14: warning: com.sun.org.apache.xerces.internal.parsers.saxparser sun proprietary api , may removed in future release [javac] import com.sun.org.apache.xerces.internal.parsers.saxparser;

this warning not shown when compiling jdk1.5.

you should use approach suggested in java api xml processing (jaxp) , let runtime decide implementation of sax parser. example:

saxparserfactory spf = saxparserfactory.newinstance(); spf.setnamespaceaware(true); saxparser saxparser = spf.newsaxparser(); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -