You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/06/28 18:26:22 UTC

[GitHub] matthiasblaesing commented on a change in pull request #606: [NETBEANS-853] Fix license info for entity definitions and DTDs

matthiasblaesing commented on a change in pull request #606: [NETBEANS-853] Fix license info for entity definitions and DTDs
URL: https://github.com/apache/incubator-netbeans/pull/606#discussion_r198940510
 
 

 ##########
 File path: maven.coverage/src/org/netbeans/modules/maven/coverage/MavenCoverageProvider.java
 ##########
 @@ -199,17 +200,16 @@ private void fire() {
             return null;
         }
         try {
-            org.w3c.dom.Document report = XMLUtil.parse(new InputSource(r.toURI().toString()), true, false, XMLUtil.defaultErrorHandler(), new EntityResolver() {
-                                     public @Override InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-                                         if (systemId.equals("http://cobertura.sourceforge.net/xml/coverage-04.dtd")) {
-                                             return new InputSource(MavenCoverageProvider.class.getResourceAsStream("coverage-04.dtd")); // NOI18N
-                                         } else if (publicId.equals("-//JACOCO//DTD Report 1.0//EN")) {
-                                             return new InputSource(MavenCoverageProvider.class.getResourceAsStream("jacoco-1.0.dtd"));
-                                         } else {
-                                             return null;
-                                         }
-                                     }
-                                 });
+            // Entity resolver is overriden to prevent retrieval of the cobertura
+            // DTDs. The license situation around the DTDs is unclear and as the
+            // DTDs don't contain entity definitions, they are not strictly
+            // necessary to parse the XML files
+            org.w3c.dom.Document report = XMLUtil.parse(new InputSource(r.toURI().toString()), false, false, XMLUtil.defaultErrorHandler(), new EntityResolver() {
+                @Override
+                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+                    return new InputSource(new ByteArrayInputStream(new byte[0]));
 
 Review comment:
   No it would not. Returning null triggers "default" behavior, which downloads the DTD from network, causing slower loads and error cases, we don't need to face.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists