You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jl...@apache.org on 2017/09/21 18:08:46 UTC

[01/12] incubator-netbeans-tools git commit: Adding NOTICE, LICENSE.

Repository: incubator-netbeans-tools
Updated Branches:
  refs/heads/master [created] 97d41efb6


Adding NOTICE, LICENSE.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/157ca290
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/157ca290
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/157ca290

Branch: refs/heads/master
Commit: 157ca290b76c9f6252b874b95bb9acd0c604f701
Parents: 
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Wed Sep 6 22:36:39 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Wed Sep 6 22:36:39 2017 +0200

----------------------------------------------------------------------
 LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 NOTICE  |   5 ++
 2 files changed, 207 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/157ca290/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/157ca290/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..85fa785
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache NetBeans
+Copyright 2017-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).


[07/12] incubator-netbeans-tools git commit: More tolerant header detection.

Posted by jl...@apache.org.
More tolerant header detection.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/ab25500a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/ab25500a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/ab25500a

Branch: refs/heads/master
Commit: ab25500a7d21423227127ee6aa49b67035a4bea2
Parents: 7687b93
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Thu Sep 14 10:20:36 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Thu Sep 14 10:20:36 2017 +0200

----------------------------------------------------------------------
 convert/src/convert/CategorizeLicenses.java | 66 ++++++++++++++++++------
 convert/src/convert/Convert.java            | 14 ++---
 2 files changed, 53 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/ab25500a/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index 576a0d0..0928f10 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -32,6 +32,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -122,23 +123,44 @@ public class CategorizeLicenses {
         }
     }
     
+    private static final Map<String, Function<String, Description>> extension2Convertor = new HashMap<>();
+    
+    static {
+        enterExtensions(code -> snipLicense(code, "/\\*+", "\\*+/", "^[ \t]*\\**[ \t]*", CommentType.JAVA),
+                        "javx", "c", "h", "cpp", "pass", "hint", "css", "java");
+        enterExtensions(code -> snipLicense(code, "<!--+", "-+->", "^[ \t]*(-[ \t]*)?", CommentType.XML),
+                        "html", "xsd", "xsl", "dtd", "settings", "wstcgrp", "wstcref",
+                        "wsgrp", "xml");
+        enterExtensions(code -> snipLicenseBundle(code, "#!.*"), "sh");
+        enterExtensions(code -> snipLicenseBundle(code, null), "properties");
+    }
+    
+    private static void enterExtensions(Function<String, Description> convertor, String... extensions) {
+        for (String ext : extensions) {
+            extension2Convertor.put(ext, convertor);
+        }
+    }
+
     public static Description snipUnifiedLicenseOrNull(String code, Path file) {
         String fn = file.getFileName().toString();
-        switch (fn.substring(fn.lastIndexOf('.') + 1)) {
-            case "javx": case "c": case "h": case "cpp":
-            case "java": return snipLicense(code, "/\\*+", "\\*+/", "^[ \t]*\\**[ \t]*");
-            case "html": case "xsd": case "xsl": case "dtd":
-            case "settings": case "wstcgrp": case "wstcref":
-            case "wsgrp": 
-            case "xml": return snipLicense(code, "<!--+", "-+->", "^[ \t]*(-[ \t]*)?");
-            case "sh": return snipLicenseBundle(code, "#!.*");
-            case "properties": return snipLicenseBundle(code, null);
+        String ext = fn.substring(fn.lastIndexOf('.') + 1);
+        Function<String, Description> preferredConvertor = extension2Convertor.get(ext);
+        Description desc = preferredConvertor != null ? preferredConvertor.apply(ext) : null;
+        
+        if (desc == null) {
+            for (Function<String, Description> convertor : extension2Convertor.values()) {
+                desc = convertor.apply(code);
+                
+                if (desc != null) {
+                    return desc;
+                }
+            }
         }
         
         return null;
     }
 
-    private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines) {
+    private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines, CommentType commentType) {
         Matcher startM = Pattern.compile(commentStart).matcher(code);
         if (!startM.find())
             return null;
@@ -151,7 +173,7 @@ public class CategorizeLicenses {
                         .map(l -> l.replaceAll(normalizeLines, ""))
                         .collect(Collectors.joining("\n"));
         }
-        return createUnifiedDescriptionOrNull(startM.start(), endM.end(), lic);
+        return createUnifiedDescriptionOrNull(startM.start(), endM.end(), lic, commentType);
     }
     
     private static Description snipLicenseBundle(String code, String firstLinePattern) {
@@ -168,6 +190,8 @@ public class CategorizeLicenses {
             line = line.trim();
             if (firstLine && firstLinePattern != null && Pattern.compile(firstLinePattern).matcher(line).matches())
                 continue;
+            if (firstLine && line.trim().isEmpty())
+                continue;
             if (firstLine) {
                 start = pos;
             }
@@ -176,13 +200,13 @@ public class CategorizeLicenses {
                 res.append(line.substring(1).trim());
                 res.append("\n");
             } else {
-                return createUnifiedDescriptionOrNull(start, next, res.toString());
+                return createUnifiedDescriptionOrNull(start, next, res.toString(), CommentType.PROPERTIES);
             }
         }
-        return createUnifiedDescriptionOrNull(start, next, res.toString());
+        return createUnifiedDescriptionOrNull(start, next, res.toString(), CommentType.PROPERTIES);
     }
 
-    private static Description createUnifiedDescriptionOrNull(int start, int end, String lic) {
+    private static Description createUnifiedDescriptionOrNull(int start, int end, String lic, CommentType commentType) {
         if (lic != null && lic.contains("CDDL")) {
             if (start == (-1)) {
                 System.err.println("!!!");
@@ -194,7 +218,7 @@ public class CategorizeLicenses {
             lic = lic.replaceAll("\n+", "\n");
             lic = lic.replaceAll("^\n+", "");
             lic = lic.replaceAll("\n+$", "");
-            return new Description(start, end, lic);
+            return new Description(start, end, lic, commentType);
         }
         
         return null;
@@ -204,12 +228,20 @@ public class CategorizeLicenses {
         public final int start;
         public final int end;
         public final String header;
+        public final CommentType commentType;
 
-        public Description(int start, int end, String header) {
+        public Description(int start, int end, String header, CommentType commentType) {
             this.start = start;
             this.end = end;
             this.header = header;
+            this.commentType = commentType;
         }
         
-    }    
+    }
+    
+    public enum CommentType {
+        JAVA,
+        XML,
+        PROPERTIES;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/ab25500a/convert/src/convert/Convert.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/Convert.java b/convert/src/convert/Convert.java
index fcf6bb8..c8fc1fa 100644
--- a/convert/src/convert/Convert.java
+++ b/convert/src/convert/Convert.java
@@ -173,17 +173,11 @@ public class Convert {
     }
     
     private static void fixHeader(Path file, String code, Description desc) {
-        String fn = file.getFileName().toString();
         String outputLicense;
-        switch (fn.substring(fn.lastIndexOf('.') + 1)) {
-            case "javx": case "c": case "h": case "cpp":
-            case "java": outputLicense = JAVA_OUTPUT; break;
-            case "html": case "xsd": case "xsl": case "dtd":
-            case "settings": case "wstcgrp": case "wstcref":
-            case "wsgrp": 
-            case "xml": outputLicense = XML_OUTPUT; break;
-            case "sh":
-            case "properties": outputLicense = BUNDLE_OUTPUT; break;
+        switch (desc.commentType) {
+            case JAVA: outputLicense = JAVA_OUTPUT; break;
+            case XML: outputLicense = XML_OUTPUT; break;
+            case PROPERTIES: outputLicense = BUNDLE_OUTPUT; break;
             default:
                 System.err.println("cannot rewrite: " + file);
                 return ;


[06/12] incubator-netbeans-tools git commit: Improving license header normalization, adding ability to rewrite a curated set of license headers to ASF headers.

Posted by jl...@apache.org.
Improving license header normalization, adding ability to rewrite a curated set of license headers to ASF headers.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/7687b93f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/7687b93f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/7687b93f

Branch: refs/heads/master
Commit: 7687b93fb412b85afd4a42725dd702ec30c46ef7
Parents: aaa4ac0
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Thu Sep 14 09:49:40 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Thu Sep 14 09:49:40 2017 +0200

----------------------------------------------------------------------
 convert/nbproject/project.properties            |   2 +-
 convert/src/convert/CategorizeLicenses.java     |  73 +-
 convert/src/convert/Convert.java                | 200 ++++++
 .../src/javaapplication9/JavaApplication9.java  | 660 -------------------
 4 files changed, 258 insertions(+), 677 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/7687b93f/convert/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/convert/nbproject/project.properties b/convert/nbproject/project.properties
index 4b111c8..7fe4bb0 100644
--- a/convert/nbproject/project.properties
+++ b/convert/nbproject/project.properties
@@ -73,7 +73,7 @@ jlink.additionalmodules=
 jlink.additionalparam=
 jlink.launcher=true
 jlink.launcher.name=convert
-main.class=convert.CategorizeLicenses
+main.class=convert.Convert
 manifest.file=manifest.mf
 meta.inf.dir=${src.dir}/META-INF
 mkdist.disabled=false

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/7687b93f/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index ee7d5c1..576a0d0 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -44,6 +44,7 @@ public class CategorizeLicenses {
             return ;
         }
         Path root = Paths.get(args[0]);
+        int[] recognizedCount = new int[1];
         Map<String, List<String>> licenses = new HashMap<>();
         Map<String, List<String>> paragraphs = new HashMap<>();
         Set<String> noCDDL = new HashSet<>();
@@ -55,14 +56,12 @@ public class CategorizeLicenses {
                     String code = new String(Files.readAllBytes(p));
 
                     if (code.contains("CDDL")) {
-                        String lic = snipLicense(code, p);
+                        Description lic = snipUnifiedLicenseOrNull(code, p);
 
-                        if (lic != null && lic.contains("CDDL")) {
-                            lic = YEARS_PATTERN.matcher(lic).replaceAll(Matcher.quoteReplacement("<YEARS>"));
-                            lic = lic.replaceAll("([^\n])\n([^\n])", "$1 $2");
-                            lic = lic.replaceAll("[ \t]+", " ");
-                            licenses.computeIfAbsent(lic, l -> new ArrayList<>()).add(path);
-                            for (String par : lic.split("\n")) {
+                        if (lic != null) {
+                            recognizedCount[0]++;
+                            licenses.computeIfAbsent(lic.header, l -> new ArrayList<>()).add(path);
+                            for (String par : lic.header.split("\n")) {
                                 paragraphs.computeIfAbsent(par, l -> new ArrayList<>()).add(path);
                             }
                             return ;
@@ -90,6 +89,7 @@ public class CategorizeLicenses {
                 }
             }
         }
+        System.err.println("files with recognized license headers: " + recognizedCount[0]);
         System.err.println("licenses count: " + licenses.size());
         System.err.println("paragraphs count: " + paragraphs.size());
         
@@ -121,7 +121,8 @@ public class CategorizeLicenses {
             }
         }
     }
-    private static String snipLicense(String code, Path file) {
+    
+    public static Description snipUnifiedLicenseOrNull(String code, Path file) {
         String fn = file.getFileName().toString();
         switch (fn.substring(fn.lastIndexOf('.') + 1)) {
             case "javx": case "c": case "h": case "cpp":
@@ -129,7 +130,7 @@ public class CategorizeLicenses {
             case "html": case "xsd": case "xsl": case "dtd":
             case "settings": case "wstcgrp": case "wstcref":
             case "wsgrp": 
-            case "xml": return snipLicense(code, "<!--+", "-+->", "^[ \t]*");
+            case "xml": return snipLicense(code, "<!--+", "-+->", "^[ \t]*(-[ \t]*)?");
             case "sh": return snipLicenseBundle(code, "#!.*");
             case "properties": return snipLicenseBundle(code, null);
         }
@@ -137,7 +138,7 @@ public class CategorizeLicenses {
         return null;
     }
 
-    private static String snipLicense(String code, String commentStart, String commentEnd, String normalizeLines) {
+    private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines) {
         Matcher startM = Pattern.compile(commentStart).matcher(code);
         if (!startM.find())
             return null;
@@ -150,25 +151,65 @@ public class CategorizeLicenses {
                         .map(l -> l.replaceAll(normalizeLines, ""))
                         .collect(Collectors.joining("\n"));
         }
-        return lic;
+        return createUnifiedDescriptionOrNull(startM.start(), endM.end(), lic);
     }
     
-    private static String snipLicenseBundle(String code, String firstLinePattern) {
+    private static Description snipLicenseBundle(String code, String firstLinePattern) {
         StringBuilder res = new StringBuilder();
         boolean firstLine = true;
-        for (String line : code.split("\n")) {
+        int start = -1;
+        int pos;
+        int next = 0;
+        String[] lines = code.split("\n");
+        for (int i = 0; i < lines.length; i++) {
+            String line = lines[i];
+            pos = next;
+            next += line.length() + ((i + 1) < lines.length ? 1 : 0);
             line = line.trim();
             if (firstLine && firstLinePattern != null && Pattern.compile(firstLinePattern).matcher(line).matches())
                 continue;
+            if (firstLine) {
+                start = pos;
+            }
             firstLine = false;
             if (line.startsWith("#")) {
                 res.append(line.substring(1).trim());
                 res.append("\n");
             } else {
-                return res.toString();
+                return createUnifiedDescriptionOrNull(start, next, res.toString());
             }
         }
-        return res.toString();
+        return createUnifiedDescriptionOrNull(start, next, res.toString());
     }
-    
+
+    private static Description createUnifiedDescriptionOrNull(int start, int end, String lic) {
+        if (lic != null && lic.contains("CDDL")) {
+            if (start == (-1)) {
+                System.err.println("!!!");
+            }
+            lic = YEARS_PATTERN.matcher(lic).replaceAll(Matcher.quoteReplacement("<YEARS>"));
+            lic = lic.replaceAll("\\Q<p/>\\E", "\n"); //normalize <p/> to newlines
+            lic = lic.replaceAll("([^\n])\n([^\n])", "$1 $2");
+            lic = lic.replaceAll("[ \t]+", " ");
+            lic = lic.replaceAll("\n+", "\n");
+            lic = lic.replaceAll("^\n+", "");
+            lic = lic.replaceAll("\n+$", "");
+            return new Description(start, end, lic);
+        }
+        
+        return null;
+    }
+
+    public static class Description {
+        public final int start;
+        public final int end;
+        public final String header;
+
+        public Description(int start, int end, String header) {
+            this.start = start;
+            this.end = end;
+            this.header = header;
+        }
+        
+    }    
 }

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/7687b93f/convert/src/convert/Convert.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/Convert.java b/convert/src/convert/Convert.java
new file mode 100644
index 0000000..fcf6bb8
--- /dev/null
+++ b/convert/src/convert/Convert.java
@@ -0,0 +1,200 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package convert;
+
+import convert.CategorizeLicenses.Description;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.regex.Pattern;
+
+public class Convert {
+
+    private static final String LICENSE_INPUT_PATTERN1 =
+            "\\QDO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\\E\\s*" +
+            "(" +
+            "\\QCopyright <YEARS> Oracle and/or its affiliates. All rights reserved.\\E\\s*" +
+            "|" +
+            "\\QCopyright (c) <YEARS> Oracle and/or its affiliates. All rights reserved.\\E\\s*" +
+            "|" +
+            "\\QCopyright \u00A9 <YEARS> Oracle and/or its affiliates. All rights reserved.\\E\\s*" +
+            "|" +
+            "\\QCopyright <YEARS> Sun Microsystems, Inc. All rights reserved.\\E\\s*" +
+            ")" +
+            "(\\QOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\\E\\s*)?" +
+            "(" +
+            "\\QThe contents of this file are subject to the terms of either the GNU General Public License Version 2 only (\"GPL\") or the Common Development and Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use this file except in compliance with the License. You can obtain a copy of the License at http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this particular file as subject to the \"Classpath\" exception as provided by Oracle in the GPL Version 2 section of the License file that accompanied this code. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: \"Portions Copyrighted
  [year] [name of copyright owner]\"\\E\\s*" +
+            "|" +
+            "\\QThe contents of this file are subject to the terms of either the GNU General Public License Version 2 only (\"GPL\") or the Common Development and Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use this file except in compliance with the License. You can obtain x copy of the License at http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this particular file as subject to the \"Classpath\" exception as provided by Oracle in the GPL Version 2 section of the License file that accompanied this code. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: \"Portions Copyrighted
  [year] [name of copyright owner]\"\\E\\s*" + //note: typo "x copy" instead of "a copy"
+            "|" +
+            "\\QThe contents of this file are subject to the terms of either the GNU General Public License Version 2 only (\"GPL\") or the Common Development and Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use this file except in compliance with the License. You can obtain a copy of the License at http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this particular file as subject to the \"Classpath\" exception as provided by Sun in the GPL Version 2 section of the License file that accompanied this code. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: \"Portions Copyrighted [year
 ] [name of copyright owner]\"\\E\\s*" +
+            "|" +
+            "\\QThe contents of this file are subject to the terms of either the GNU General Public License Version 2 only (\"GPL\") or the Common Development and Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use this file except in compliance with the License. You can obtain a copy of the License at http:www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this particular file as subject to the \"Classpath\" exception as provided by Sun in the GPL Version 2 section of the License file that accompanied this code. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: \"Portions Copyrighted [year] 
 [name of copyright owner]\"\\E\\s*" + //note: mistake in URL (no '//'), otherwise as above
+            ")" +
+            "(" +
+            "\\QIf you wish your version of this file to be governed by only the CDDL or only the GPL Version 2, indicate your decision by adding \"[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 2] license.\" If you do not indicate a single choice of license, a recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 2 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder.\\E\\s*" +
+            "|" +
+            "\\QIf you wish your version of this file to be governed by only the CDDL or only the GPL Version 2, indicate your decision by adding \"[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 2] license.\" If you do not indicate x single choice of license, x recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 2 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder.\\E\\s*" + //note: typos "a single choice" -> "x single choice", "a recipient" -> "x recipient"
+            "|" +
+            //empty
+            ")" +
+            "(\\QContributor(s):\\E\\s*)?" +
+            "(" +
+            "\\QThe Original Software is NetBeans. The Initial Developer of the Original Software is Sun Microsystems, Inc. Portions Copyright <YEARS> Sun Microsystems, Inc. All Rights Reserved.\\E\\s*" +
+            "|" +
+            "\\QThe Original Software is NetBeans. The Initial Developer of the Original Software is Sun Microsystems, Inc. Portions created by Sun Microsystems, Inc. are Copyright (C) <YEARS> All Rights Reserved.\\E\\s*" +
+            "|" +
+            "\\QThe Original Software is NetBeans. The Initial Developer of the Original Code is Sun Microsystems, Inc. Portions Copyright <YEARS> Sun Microsystems, Inc. All Rights Reserved.\\E\\s*" +
+            "|" +
+            "\\QThe Original Software is NetBeans. The Initial Developer of the Original Software is Oracle. Portions Copyright <YEARS> Oracle. All Rights Reserved.\\E\\s*" +
+            "|" +
+            "\\QThe original software is NetBeans. The initial developer of the original software was Sun Microsystems, Inc.; portions copyright <YEARS> Sun Microsystems, Inc. All rights reserved.\\E\\s*" +
+            "|" +
+            "\\QThe Original Software is NetBeans. The Initial Developer of the Original Software is Sun Microsystems, Inc.\nPortions Copyrighted <YEARS> Sun Microsystems, Inc.\\E\\s*" +
+            "|" +
+            "\\QPortions Copyrighted <YEARS> Sun Microsystems, Inc.\\E\\s*" +
+            "|" +
+            "\\QPortions Copyrighted <YEARS> Oracle, Inc.\\E\\s*" +
+            "|" +
+            "\\QPortions Copyrighted <YEARS> Oracle\\E\\s*" +
+            "|)" +
+            "(\\QIf you wish your version of this file to be governed by only the CDDL or only the GPL Version 2, indicate your decision by adding \"[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 2] license.\" If you do not indicate a single choice of license, a recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 2 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder.\\E\\s*)?";
+
+    private static final String JAVA_OUTPUT =
+            "/**\n" +
+            " * Licensed to the Apache Software Foundation (ASF) under one\n" +
+            " * or more contributor license agreements.  See the NOTICE file\n" +
+            " * distributed with this work for additional information\n" +
+            " * regarding copyright ownership.  The ASF licenses this file\n" +
+            " * to you under the Apache License, Version 2.0 (the\n" +
+            " * \"License\"); you may not use this file except in compliance\n" +
+            " * with the License.  You may obtain a copy of the License at\n" +
+            " *\n" +
+            " *   http://www.apache.org/licenses/LICENSE-2.0\n" +
+            " *\n" +
+            " * Unless required by applicable law or agreed to in writing,\n" +
+            " * software distributed under the License is distributed on an\n" +
+            " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+            " * KIND, either express or implied.  See the License for the\n" +
+            " * specific language governing permissions and limitations\n" +
+            " * under the License.\n" +
+            " */";
+
+    private static final String XML_OUTPUT =
+            "<!--\n" +
+            "\n" +
+            "    Licensed to the Apache Software Foundation (ASF) under one\n" +
+            "    or more contributor license agreements.  See the NOTICE file\n" +
+            "    distributed with this work for additional information\n" +
+            "    regarding copyright ownership.  The ASF licenses this file\n" +
+            "    to you under the Apache License, Version 2.0 (the\n" +
+            "    \"License\"); you may not use this file except in compliance\n" +
+            "    with the License.  You may obtain a copy of the License at\n" +
+            "\n" +
+            "      http://www.apache.org/licenses/LICENSE-2.0\n" +
+            "\n" +
+            "    Unless required by applicable law or agreed to in writing,\n" +
+            "    software distributed under the License is distributed on an\n" +
+            "    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+            "    KIND, either express or implied.  See the License for the\n" +
+            "    specific language governing permissions and limitations\n" +
+            "    under the License.\n" +
+            "\n" +
+            "-->";
+
+    private static final String BUNDLE_OUTPUT =
+            "#\n" +
+            "# Licensed to the Apache Software Foundation (ASF) under one\n" +
+            "# or more contributor license agreements.  See the NOTICE file\n" +
+            "# distributed with this work for additional information\n" +
+            "# regarding copyright ownership.  The ASF licenses this file\n" +
+            "# to you under the Apache License, Version 2.0 (the\n" +
+            "# \"License\"); you may not use this file except in compliance\n" +
+            "# with the License.  You may obtain a copy of the License at\n" +
+            "#\n" +
+            "#   http://www.apache.org/licenses/LICENSE-2.0\n" +
+            "#\n" +
+            "# Unless required by applicable law or agreed to in writing,\n" +
+            "# software distributed under the License is distributed on an\n" +
+            "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+            "# KIND, either express or implied.  See the License for the\n" +
+            "# specific language governing permissions and limitations\n" +
+            "# under the License.\n" +
+            "#\n";
+
+    public static void main(String[] args) throws IOException {
+        if (args.length != 1) {
+            System.err.println("Use: Convert <source-directory>");
+            return ;
+        }
+        Pattern headerPattern = Pattern.compile(LICENSE_INPUT_PATTERN1, Pattern.MULTILINE);
+        Path root = Paths.get(args[0]);
+        int[] count = new int[1];
+        Files.find(root, Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
+             .forEach(p -> {
+                try {
+                    String path = root.relativize(p).toString();
+                    String code = new String(Files.readAllBytes(p));
+
+                    if (code.contains("CDDL")) {
+                        CategorizeLicenses.Description lic = CategorizeLicenses.snipUnifiedLicenseOrNull(code, p);
+
+                        if (lic != null) {
+                            if (headerPattern.matcher(lic.header).matches()) {
+                                fixHeader(p, code, lic);
+                                count[0]++;
+                            }
+                        }
+                    }
+                } catch (IOException ex) {
+                    ex.printStackTrace();
+                }
+             });
+        
+        System.err.println("convertible: " + count[0]);
+    }
+    
+    private static void fixHeader(Path file, String code, Description desc) {
+        String fn = file.getFileName().toString();
+        String outputLicense;
+        switch (fn.substring(fn.lastIndexOf('.') + 1)) {
+            case "javx": case "c": case "h": case "cpp":
+            case "java": outputLicense = JAVA_OUTPUT; break;
+            case "html": case "xsd": case "xsl": case "dtd":
+            case "settings": case "wstcgrp": case "wstcref":
+            case "wsgrp": 
+            case "xml": outputLicense = XML_OUTPUT; break;
+            case "sh":
+            case "properties": outputLicense = BUNDLE_OUTPUT; break;
+            default:
+                System.err.println("cannot rewrite: " + file);
+                return ;
+        }
+        
+        try (Writer out = Files.newBufferedWriter(file)) {
+            String newCode = code.substring(0, desc.start) + outputLicense + code.substring(desc.end);
+            out.write(newCode);
+        } catch (IOException ex) {
+            throw new IllegalStateException(ex);
+        }
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/7687b93f/convert/src/javaapplication9/JavaApplication9.java
----------------------------------------------------------------------
diff --git a/convert/src/javaapplication9/JavaApplication9.java b/convert/src/javaapplication9/JavaApplication9.java
deleted file mode 100644
index 6be06b1..0000000
--- a/convert/src/javaapplication9/JavaApplication9.java
+++ /dev/null
@@ -1,660 +0,0 @@
-package javaapplication9;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class JavaApplication9 {
-
-    private static final String INPUT =
-"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-"#\n" +
-"# Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-"#\n" +
-"# Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-"# Other names may be trademarks of their respective owners.\n" +
-"#\n" +
-"# The contents of this file are subject to the terms of either the GNU\n" +
-"# General Public License Version 2 only (\"GPL\") or the Common\n" +
-"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
-"# \"License\"). You may not use this file except in compliance with the\n" +
-"# License. You can obtain a copy of the License at\n" +
-"# http://www.netbeans.org/cddl-gplv2.html\n" +
-"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-"# specific language governing permissions and limitations under the\n" +
-"# License.  When distributing the software, include this License Header\n" +
-"# Notice in each file and include the License file at\n" +
-"# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-"# particular file as subject to the \"Classpath\" exception as provided\n" +
-"# by Oracle in the GPL Version 2 section of the License file that\n" +
-"# accompanied this code. If applicable, add the following below the\n" +
-"# License Header, with the fields enclosed by brackets [] replaced by\n" +
-"# your own identifying information:\n" +
-"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-"#\n" +
-"# If you wish your version of this file to be governed by only the CDDL\n" +
-"# or only the GPL Version 2, indicate your decision by adding\n" +
-"# \"[Contributor] elects to include this software in this distribution\n" +
-"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-"# single choice of license, a recipient has the option to distribute\n" +
-"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
-"# to extend the choice of license to its licensees as provided above.\n" +
-"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-"# Version 2 license, then the option applies only if the new code is\n" +
-"# made subject to such option by the copyright holder.\n" +
-"#\n" +
-"# Contributor(s):\n" +
-"#\n" +
-"# Portions Copyrighted 2010 Sun Microsystems, Inc.";
-
-//    private static final String INPUT =
-//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-//"#\n" +
-//"# Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
-//"#\n" +
-//"# The contents of this file are subject to the terms of either the GNU\n" +
-//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
-//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
-//"# \"License\"). You may not use this file except in compliance with the\n" +
-//"# License. You can obtain a copy of the License at\n" +
-//"# http://www.netbeans.org/cddl-gplv2.html\n" +
-//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-//"# specific language governing permissions and limitations under the\n" +
-//"# License.  When distributing the software, include this License Header\n" +
-//"# Notice in each file and include the License file at\n" +
-//"# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-//"# particular file as subject to the \"Classpath\" exception as provided\n" +
-//"# by Sun in the GPL Version 2 section of the License file that\n" +
-//"# accompanied this code. If applicable, add the following below the\n" +
-//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
-//"# your own identifying information:\n" +
-//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-//"#\n" +
-//"# Contributor(s):\n" +
-//"#\n" +
-//"#The Original Software is NetBeans. The Initial Developer of the Original\n" +
-//"# Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
-//"#Microsystems, Inc. All Rights Reserved.\n" +
-//"#\n" +
-//"# If you wish your version of this file to be governed by only the CDDL\n" +
-//"# or only the GPL Version 2, indicate your decision by adding\n" +
-//"# \"[Contributor] elects to include this software in this distribution\n" +
-//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-//"# single choice of license, a recipient has the option to distribute\n" +
-//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
-//"# to extend the choice of license to its licensees as provided above.\n" +
-//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-//"# Version 2 license, then the option applies only if the new code is\n" +
-//"# made subject to such option by the copyright holder.";
-
-//    private static final String INPUT =
-//" # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-//" #\n" +
-//" # Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-//" #\n" +
-//" # Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-//" # Other names may be trademarks of their respective owners.\n" +
-//" #\n" +
-//" # The contents of this file are subject to the terms of either the GNU\n" +
-//" # General Public License Version 2 only (\"GPL\") or the Common\n" +
-//" # Development and Distribution License(\"CDDL\") (collectively, the\n" +
-//" # \"License\"). You may not use this file except in compliance with the\n" +
-//" # License. You can obtain a copy of the License at\n" +
-//" # http://www.netbeans.org/cddl-gplv2.html\n" +
-//" # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-//" # specific language governing permissions and limitations under the\n" +
-//" # License.  When distributing the software, include this License Header\n" +
-//" # Notice in each file and include the License file at\n" +
-//" # nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-//" # particular file as subject to the \"Classpath\" exception as provided\n" +
-//" # by Oracle in the GPL Version 2 section of the License file that\n" +
-//" # accompanied this code. If applicable, add the following below the\n" +
-//" # License Header, with the fields enclosed by brackets [] replaced by\n" +
-//" # your own identifying information:\n" +
-//" # \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-//" #\n" +
-//" # Contributor(s):\n" +
-//" #\n" +
-//" # The Original Software is NetBeans. The Initial Developer of the Original\n" +
-//" # Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
-//" # Microsystems, Inc. All Rights Reserved.\n" +
-//" #\n" +
-//" # If you wish your version of this file to be governed by only the CDDL\n" +
-//" # or only the GPL Version 2, indicate your decision by adding\n" +
-//" # \"[Contributor] elects to include this software in this distribution\n" +
-//" # under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-//" # single choice of license, a recipient has the option to distribute\n" +
-//" # your version of this file under either the CDDL, the GPL Version 2 or\n" +
-//" # to extend the choice of license to its licensees as provided above.\n" +
-//" # However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-//" # Version 2 license, then the option applies only if the new code is\n" +
-//" # made subject to such option by the copyright holder.";
-
-//    private static final String INPUT =
-//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-//"#\n" +
-//"# Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
-//"#\n" +
-//"# The contents of this file are subject to the terms of either the GNU\n" +
-//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
-//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
-//"# \"License\"). You may not use this file except in compliance with the\n" +
-//"# License. You can obtain a copy of the License at\n" +
-//"# http://www.netbeans.org/cddl-gplv2.html\n" +
-//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-//"# specific language governing permissions and limitations under the\n" +
-//"# License.  When distributing the software, include this License Header\n" +
-//"# Notice in each file and include the License file at\n" +
-//"# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-//"# particular file as subject to the \"Classpath\" exception as provided\n" +
-//"# by Sun in the GPL Version 2 section of the License file that\n" +
-//"# accompanied this code. If applicable, add the following below the\n" +
-//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
-//"# your own identifying information:\n" +
-//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-//"#\n" +
-//"# If you wish your version of this file to be governed by only the CDDL\n" +
-//"# or only the GPL Version 2, indicate your decision by adding\n" +
-//"# \"[Contributor] elects to include this software in this distribution\n" +
-//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-//"# single choice of license, a recipient has the option to distribute\n" +
-//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
-//"# to extend the choice of license to its licensees as provided above.\n" +
-//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-//"# Version 2 license, then the option applies only if the new code is\n" +
-//"# made subject to such option by the copyright holder.\n" +
-//"#\n" +
-//"# Contributor(s):\n" +
-//"#\n" +
-//"# Portions Copyrighted 2010 Sun Microsystems, Inc.";
-
-//    private static final String INPUT =
-//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-//"#\n" +
-//"# Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-//"#\n" +
-//"# Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-//"# Other names may be trademarks of their respective owners.\n" +
-//"#\n" +
-//"# The contents of this file are subject to the terms of either the GNU\n" +
-//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
-//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
-//"# \"License\"). You may not use this file except in compliance with the\n" +
-//"# License. You can obtain a copy of the License at\n" +
-//"# http://www.netbeans.org/cddl-gplv2.html\n" +
-//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-//"# specific language governing permissions and limitations under the\n" +
-//"# License.  When distributing the software, include this License Header\n" +
-//"# Notice in each file and include the License file at\n" +
-//"# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-//"# particular file as subject to the \"Classpath\" exception as provided\n" +
-//"# by Oracle in the GPL Version 2 section of the License file that\n" +
-//"# accompanied this code. If applicable, add the following below the\n" +
-//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
-//"# your own identifying information:\n" +
-//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-//"#\n" +
-//"# Contributor(s):\n" +
-//"#\n" +
-//"# The Original Software is NetBeans. The Initial Developer of the Original\n" +
-//"# Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
-//"# Microsystems, Inc. All Rights Reserved.\n" +
-//"#\n" +
-//"# If you wish your version of this file to be governed by only the CDDL\n" +
-//"# or only the GPL Version 2, indicate your decision by adding\n" +
-//"# \"[Contributor] elects to include this software in this distribution\n" +
-//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-//"# single choice of license, a recipient has the option to distribute\n" +
-//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
-//"# to extend the choice of license to its licensees as provided above.\n" +
-//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-//"# Version 2 license, then the option applies only if the new code is\n" +
-//"# made subject to such option by the copyright holder.";
-
-    private static final String OUTPUT =
-"# Licensed to the Apache Software Foundation (ASF) under one or more\n" +
-"# contributor license agreements.  See the NOTICE file distributed with\n" +
-"# this work for additional information regarding copyright ownership.\n" +
-"# The ASF licenses this file to You under the Apache License, Version 2.0\n" +
-"# (the \"License\"); you may not use this file except in compliance with\n" +
-"# the License.  You may obtain a copy of the License at\n" +
-"#\n" +
-"# http://www.apache.org/licenses/LICENSE-2.0\n" +
-"#\n" +
-"# Unless required by applicable law or agreed to in writing, software\n" +
-"# distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
-"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
-"# See the License for the specific language governing permissions and\n" +
-"# limitations under the License.\n";
-
-//    private static final String INPUT =
-//"<!--\n" +
-//"DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-//"\n" +
-//"Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.\n" +
-//"\n" +
-//"Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-//"Other names may be trademarks of their respective owners.\n" +
-//"\n" +
-//"The contents of this file are subject to the terms of either the GNU\n" +
-//"General Public License Version 2 only (\"GPL\") or the Common\n" +
-//"Development and Distribution License(\"CDDL\") (collectively, the\n" +
-//"\"License\"). You may not use this file except in compliance with the\n" +
-//"License. You can obtain a copy of the License at\n" +
-//"http://www.netbeans.org/cddl-gplv2.html\n" +
-//"or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-//"specific language governing permissions and limitations under the\n" +
-//"License.  When distributing the software, include this License Header\n" +
-//"Notice in each file and include the License file at\n" +
-//"nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-//"particular file as subject to the \"Classpath\" exception as provided\n" +
-//"by Oracle in the GPL Version 2 section of the License file that\n" +
-//"accompanied this code. If applicable, add the following below the\n" +
-//"License Header, with the fields enclosed by brackets [] replaced by\n" +
-//"your own identifying information:\n" +
-//"\"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-//"\n" +
-//"Contributor(s):\n" +
-//"\n" +
-//"The Original Software is NetBeans. The Initial Developer of the Original\n" +
-//"Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun\n" +
-//"Microsystems, Inc. All Rights Reserved.\n" +
-//"\n" +
-//"If you wish your version of this file to be governed by only the CDDL\n" +
-//"or only the GPL Version 2, indicate your decision by adding\n" +
-//"\"[Contributor] elects to include this software in this distribution\n" +
-//"under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-//"single choice of license, a recipient has the option to distribute\n" +
-//"your version of this file under either the CDDL, the GPL Version 2 or\n" +
-//"to extend the choice of license to its licensees as provided above.\n" +
-//"However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-//"Version 2 license, then the option applies only if the new code is\n" +
-//"made subject to such option by the copyright holder.\n" +
-//"-->";
-//
-////    private static final String INPUT =
-////"<!--\n" +
-////"DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////"\n" +
-////"Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.\n" +
-////"\n" +
-////"\n" +
-////"The contents of this file are subject to the terms of either the GNU\n" +
-////"General Public License Version 2 only (\"GPL\") or the Common\n" +
-////"Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////"\"License\"). You may not use this file except in compliance with the\n" +
-////"License. You can obtain a copy of the License at\n" +
-////"http://www.netbeans.org/cddl-gplv2.html\n" +
-////"or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////"specific language governing permissions and limitations under the\n" +
-////"License.  When distributing the software, include this License Header\n" +
-////"Notice in each file and include the License file at\n" +
-////"nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-////"particular file as subject to the \"Classpath\" exception as provided\n" +
-////"by Sun in the GPL Version 2 section of the License file that\n" +
-////"accompanied this code. If applicable, add the following below the\n" +
-////"License Header, with the fields enclosed by brackets [] replaced by\n" +
-////"your own identifying information:\n" +
-////"\"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////"\n" +
-////"Contributor(s):\n" +
-////"\n" +
-////"The Original Software is NetBeans. The Initial Developer of the Original\n" +
-////"Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun\n" +
-////"Microsystems, Inc. All Rights Reserved.\n" +
-////"\n" +
-////"If you wish your version of this file to be governed by only the CDDL\n" +
-////"or only the GPL Version 2, indicate your decision by adding\n" +
-////"\"[Contributor] elects to include this software in this distribution\n" +
-////"under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-////"single choice of license, a recipient has the option to distribute\n" +
-////"your version of this file under either the CDDL, the GPL Version 2 or\n" +
-////"to extend the choice of license to its licensees as provided above.\n" +
-////"However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////"Version 2 license, then the option applies only if the new code is\n" +
-////"made subject to such option by the copyright holder.\n" +
-////"-->";
-//
-//    private static final String OUTPUT =
-//"<!--\n" +
-//"\n" +
-//"  Licensed to the Apache Software Foundation (ASF) under one or more\n" +
-//"  contributor license agreements.  See the NOTICE file distributed with\n" +
-//"  this work for additional information regarding copyright ownership.\n" +
-//"  The ASF licenses this file to You under the Apache License, Version 2.0\n" +
-//"  (the \"License\"); you may not use this file except in compliance with\n" +
-//"  the License.  You may obtain a copy of the License at\n" +
-//"\n" +
-//"  http://www.apache.org/licenses/LICENSE-2.0\n" +
-//"\n" +
-//"  Unless required by applicable law or agreed to in writing, software\n" +
-//"  distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
-//"  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
-//"  See the License for the specific language governing permissions and\n" +
-//"  limitations under the License.\n" +
-//"-->";
-
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-////" *\n" +
-////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-////" * Other names may be trademarks of their respective owners.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Oracle in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
-////" */";
-//
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-////" *\n" +
-////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-////" * Other names may be trademarks of their respective owners.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU General\n" +
-////" * Public License Version 2 only (\"GPL\") or the Common Development and\n" +
-////" * Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use\n" +
-////" * this file except in compliance with the License. You can obtain a copy of the\n" +
-////" * License at http://www.netbeans.org/cddl-gplv2.html or\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language\n" +
-////" * governing permissions and limitations under the License. When distributing\n" +
-////" * the software, include this License Header Notice in each file and include the\n" +
-////" * License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided by Oracle\n" +
-////" * in the GPL Version 2 section of the License file that accompanied this code.\n" +
-////" * If applicable, add the following below the License Header, with the fields\n" +
-////" * enclosed by brackets [] replaced by your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * If you wish your version of this file to be governed by only the CDDL or only\n" +
-////" * the GPL Version 2, indicate your decision by adding \"[Contributor] elects to\n" +
-////" * include this software in this distribution under the [CDDL or GPL Version 2]\n" +
-////" * license.\" If you do not indicate a single choice of license, a recipient has\n" +
-////" * the option to distribute your version of this file under either the CDDL, the\n" +
-////" * GPL Version 2 or to extend the choice of license to its licensees as provided\n" +
-////" * above. However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////" * Version 2 license, then the option applies only if the new code is made\n" +
-////" * subject to such option by the copyright holder.\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
-////" */";
-//
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Sun in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * The Original Software is NetBeans. The Initial Developer of the Original\n" +
-////" * Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
-////" * Microsystems, Inc. All Rights Reserved.\n" +
-////" *\n" +
-////" * If you wish your version of this file to be governed by only the CDDL\n" +
-////" * or only the GPL Version 2, indicate your decision by adding\n" +
-////" * \"[Contributor] elects to include this software in this distribution\n" +
-////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-////" * single choice of license, a recipient has the option to distribute\n" +
-////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
-////" * to extend the choice of license to its licensees as provided above.\n" +
-////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////" * Version 2 license, then the option applies only if the new code is\n" +
-////" * made subject to such option by the copyright holder.\n" +
-////" */";
-//
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Sun in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
-////" */";
-//
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-////" *\n" +
-////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-////" * Other names may be trademarks of their respective owners.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Oracle in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * The Original Software is NetBeans. The Initial Developer of the Original\n" +
-////" * Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
-////" * Microsystems, Inc. All Rights Reserved.\n" +
-////" *\n" +
-////" * If you wish your version of this file to be governed by only the CDDL\n" +
-////" * or only the GPL Version 2, indicate your decision by adding\n" +
-////" * \"[Contributor] elects to include this software in this distribution\n" +
-////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-////" * single choice of license, a recipient has the option to distribute\n" +
-////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
-////" * to extend the choice of license to its licensees as provided above.\n" +
-////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////" * Version 2 license, then the option applies only if the new code is\n" +
-////" * made subject to such option by the copyright holder.\n" +
-////" */";
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
-////" *\n" +
-////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
-////" * Other names may be trademarks of their respective owners.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Oracle in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * If you wish your version of this file to be governed by only the CDDL\n" +
-////" * or only the GPL Version 2, indicate your decision by adding\n" +
-////" * \"[Contributor] elects to include this software in this distribution\n" +
-////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-////" * single choice of license, a recipient has the option to distribute\n" +
-////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
-////" * to extend the choice of license to its licensees as provided above.\n" +
-////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////" * Version 2 license, then the option applies only if the new code is\n" +
-////" * made subject to such option by the copyright holder.\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
-////" */";
-//
-////    private static final String INPUT =
-////"/*\n" +
-////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
-////" *\n" +
-////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
-////" *\n" +
-////" * The contents of this file are subject to the terms of either the GNU\n" +
-////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
-////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
-////" * \"License\"). You may not use this file except in compliance with the\n" +
-////" * License. You can obtain a copy of the License at\n" +
-////" * http://www.netbeans.org/cddl-gplv2.html\n" +
-////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
-////" * specific language governing permissions and limitations under the\n" +
-////" * License.  When distributing the software, include this License Header\n" +
-////" * Notice in each file and include the License file at\n" +
-////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
-////" * particular file as subject to the \"Classpath\" exception as provided\n" +
-////" * by Sun in the GPL Version 2 section of the License file that\n" +
-////" * accompanied this code. If applicable, add the following below the\n" +
-////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
-////" * your own identifying information:\n" +
-////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
-////" *\n" +
-////" * If you wish your version of this file to be governed by only the CDDL\n" +
-////" * or only the GPL Version 2, indicate your decision by adding\n" +
-////" * \"[Contributor] elects to include this software in this distribution\n" +
-////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
-////" * single choice of license, a recipient has the option to distribute\n" +
-////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
-////" * to extend the choice of license to its licensees as provided above.\n" +
-////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
-////" * Version 2 license, then the option applies only if the new code is\n" +
-////" * made subject to such option by the copyright holder.\n" +
-////" *\n" +
-////" * Contributor(s):\n" +
-////" *\n" +
-////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
-////" */";
-//    private static final String OUTPUT =
-//"/**\n" +
-//" * Licensed to the Apache Software Foundation (ASF) under one\n" +
-//" * or more contributor license agreements.  See the NOTICE file\n" +
-//" * distributed with this work for additional information\n" +
-//" * regarding copyright ownership.  The ASF licenses this file\n" +
-//" * to you under the Apache License, Version 2.0 (the\n" +
-//" * \"License\"); you may not use this file except in compliance\n" +
-//" * with the License.  You may obtain a copy of the License at\n" +
-//" *\n" +
-//" *   http://www.apache.org/licenses/LICENSE-2.0\n" +
-//" *\n" +
-//" * Unless required by applicable law or agreed to in writing,\n" +
-//" * software distributed under the License is distributed on an\n" +
-//" * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
-//" * KIND, either express or implied.  See the License for the\n" +
-//" * specific language governing permissions and limitations\n" +
-//" * under the License.\n" +
-//" */";
-
-    public static void main(String[] args) throws IOException {
-        StringBuilder pattern = new StringBuilder();
-        
-        for (String piece : INPUT.split("2010")) {
-            if (pattern.length() != 0) {
-                pattern.append("[0-9][0-9][0-9][0-9](-[0-9][0-9][0-9][0-9])?");
-            }
-            pattern.append(Pattern.quote(piece));
-        }
-        
-        Pattern inputPattern = Pattern.compile(pattern.toString());
-//        Pattern inputPattern = Pattern.compile(Pattern.quote(INPUT), Pattern.MULTILINE);
-        
-        Path root = Paths.get("/home/lahvac/src/nb/apache-jackpot30/");
-//        Path root = Paths.get("/home/lahvac/src/nb/apache-jackpot30/cmdline/compiler/antsrc/org/netbeans/modules/jackpot30/compiler/ant/JackpotCompiler.java");
-        
-        Files.find(root, Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
-             .forEach(p -> {
-                try {
-                    Matcher m = inputPattern.matcher(new String(Files.readAllBytes(p)));
-                    if (m.find()) {
-                        try (Writer w = Files.newBufferedWriter(p)) {
-                            w.write(m.replaceAll(Matcher.quoteReplacement(OUTPUT)));
-                        }
-                    }
-                } catch (IOException ex) {
-                    ex.printStackTrace();
-                }
-             });
-    }
-    
-}


[02/12] incubator-netbeans-tools git commit: Very first version of the convertor (was used to convert license headers for the jackpot30 repository).

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/nbproject/genfiles.properties
----------------------------------------------------------------------
diff --git a/convert/nbproject/genfiles.properties b/convert/nbproject/genfiles.properties
new file mode 100644
index 0000000..5735aec
--- /dev/null
+++ b/convert/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=9755aca8
+build.xml.script.CRC32=816a776e
+build.xml.stylesheet.CRC32=8064a381@1.88.0.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=9755aca8
+nbproject/build-impl.xml.script.CRC32=e25a02d7
+nbproject/build-impl.xml.stylesheet.CRC32=bade6ae5@1.88.0.48

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/convert/nbproject/project.properties b/convert/nbproject/project.properties
new file mode 100644
index 0000000..0227ea7
--- /dev/null
+++ b/convert/nbproject/project.properties
@@ -0,0 +1,95 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.modulepath=\
+    ${run.modulepath}
+debug.test.classpath=\
+    ${run.test.classpath}
+debug.test.modulepath=\
+    ${run.test.modulepath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/convert.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+dist.jlink.dir=${dist.dir}/jlink
+dist.jlink.output=${dist.jlink.dir}/convert
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.external.vm=true
+javac.modulepath=
+javac.processormodulepath=
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+javac.test.modulepath=\
+    ${javac.modulepath}
+javac.test.processorpath=\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.html5=false
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+# The jlink additional root modules to resolve
+jlink.additionalmodules=
+# The jlink additional command line parameters
+jlink.additionalparam=
+jlink.launcher=true
+jlink.launcher.name=convert
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.modulepath=\
+    ${javac.modulepath}
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+run.test.modulepath=\
+    ${javac.test.modulepath}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/nbproject/project.xml
----------------------------------------------------------------------
diff --git a/convert/nbproject/project.xml b/convert/nbproject/project.xml
new file mode 100644
index 0000000..29d2235
--- /dev/null
+++ b/convert/nbproject/project.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>convert</name>
+            <source-roots>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+    </configuration>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/src/javaapplication9/JavaApplication9.java
----------------------------------------------------------------------
diff --git a/convert/src/javaapplication9/JavaApplication9.java b/convert/src/javaapplication9/JavaApplication9.java
new file mode 100644
index 0000000..6be06b1
--- /dev/null
+++ b/convert/src/javaapplication9/JavaApplication9.java
@@ -0,0 +1,660 @@
+package javaapplication9;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class JavaApplication9 {
+
+    private static final String INPUT =
+"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+"#\n" +
+"# Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+"#\n" +
+"# Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+"# Other names may be trademarks of their respective owners.\n" +
+"#\n" +
+"# The contents of this file are subject to the terms of either the GNU\n" +
+"# General Public License Version 2 only (\"GPL\") or the Common\n" +
+"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
+"# \"License\"). You may not use this file except in compliance with the\n" +
+"# License. You can obtain a copy of the License at\n" +
+"# http://www.netbeans.org/cddl-gplv2.html\n" +
+"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+"# specific language governing permissions and limitations under the\n" +
+"# License.  When distributing the software, include this License Header\n" +
+"# Notice in each file and include the License file at\n" +
+"# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+"# particular file as subject to the \"Classpath\" exception as provided\n" +
+"# by Oracle in the GPL Version 2 section of the License file that\n" +
+"# accompanied this code. If applicable, add the following below the\n" +
+"# License Header, with the fields enclosed by brackets [] replaced by\n" +
+"# your own identifying information:\n" +
+"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+"#\n" +
+"# If you wish your version of this file to be governed by only the CDDL\n" +
+"# or only the GPL Version 2, indicate your decision by adding\n" +
+"# \"[Contributor] elects to include this software in this distribution\n" +
+"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+"# single choice of license, a recipient has the option to distribute\n" +
+"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
+"# to extend the choice of license to its licensees as provided above.\n" +
+"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+"# Version 2 license, then the option applies only if the new code is\n" +
+"# made subject to such option by the copyright holder.\n" +
+"#\n" +
+"# Contributor(s):\n" +
+"#\n" +
+"# Portions Copyrighted 2010 Sun Microsystems, Inc.";
+
+//    private static final String INPUT =
+//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+//"#\n" +
+//"# Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
+//"#\n" +
+//"# The contents of this file are subject to the terms of either the GNU\n" +
+//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
+//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
+//"# \"License\"). You may not use this file except in compliance with the\n" +
+//"# License. You can obtain a copy of the License at\n" +
+//"# http://www.netbeans.org/cddl-gplv2.html\n" +
+//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+//"# specific language governing permissions and limitations under the\n" +
+//"# License.  When distributing the software, include this License Header\n" +
+//"# Notice in each file and include the License file at\n" +
+//"# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+//"# particular file as subject to the \"Classpath\" exception as provided\n" +
+//"# by Sun in the GPL Version 2 section of the License file that\n" +
+//"# accompanied this code. If applicable, add the following below the\n" +
+//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
+//"# your own identifying information:\n" +
+//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+//"#\n" +
+//"# Contributor(s):\n" +
+//"#\n" +
+//"#The Original Software is NetBeans. The Initial Developer of the Original\n" +
+//"# Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
+//"#Microsystems, Inc. All Rights Reserved.\n" +
+//"#\n" +
+//"# If you wish your version of this file to be governed by only the CDDL\n" +
+//"# or only the GPL Version 2, indicate your decision by adding\n" +
+//"# \"[Contributor] elects to include this software in this distribution\n" +
+//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+//"# single choice of license, a recipient has the option to distribute\n" +
+//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
+//"# to extend the choice of license to its licensees as provided above.\n" +
+//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+//"# Version 2 license, then the option applies only if the new code is\n" +
+//"# made subject to such option by the copyright holder.";
+
+//    private static final String INPUT =
+//" # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+//" #\n" +
+//" # Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+//" #\n" +
+//" # Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+//" # Other names may be trademarks of their respective owners.\n" +
+//" #\n" +
+//" # The contents of this file are subject to the terms of either the GNU\n" +
+//" # General Public License Version 2 only (\"GPL\") or the Common\n" +
+//" # Development and Distribution License(\"CDDL\") (collectively, the\n" +
+//" # \"License\"). You may not use this file except in compliance with the\n" +
+//" # License. You can obtain a copy of the License at\n" +
+//" # http://www.netbeans.org/cddl-gplv2.html\n" +
+//" # or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+//" # specific language governing permissions and limitations under the\n" +
+//" # License.  When distributing the software, include this License Header\n" +
+//" # Notice in each file and include the License file at\n" +
+//" # nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+//" # particular file as subject to the \"Classpath\" exception as provided\n" +
+//" # by Oracle in the GPL Version 2 section of the License file that\n" +
+//" # accompanied this code. If applicable, add the following below the\n" +
+//" # License Header, with the fields enclosed by brackets [] replaced by\n" +
+//" # your own identifying information:\n" +
+//" # \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+//" #\n" +
+//" # Contributor(s):\n" +
+//" #\n" +
+//" # The Original Software is NetBeans. The Initial Developer of the Original\n" +
+//" # Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
+//" # Microsystems, Inc. All Rights Reserved.\n" +
+//" #\n" +
+//" # If you wish your version of this file to be governed by only the CDDL\n" +
+//" # or only the GPL Version 2, indicate your decision by adding\n" +
+//" # \"[Contributor] elects to include this software in this distribution\n" +
+//" # under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+//" # single choice of license, a recipient has the option to distribute\n" +
+//" # your version of this file under either the CDDL, the GPL Version 2 or\n" +
+//" # to extend the choice of license to its licensees as provided above.\n" +
+//" # However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+//" # Version 2 license, then the option applies only if the new code is\n" +
+//" # made subject to such option by the copyright holder.";
+
+//    private static final String INPUT =
+//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+//"#\n" +
+//"# Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
+//"#\n" +
+//"# The contents of this file are subject to the terms of either the GNU\n" +
+//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
+//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
+//"# \"License\"). You may not use this file except in compliance with the\n" +
+//"# License. You can obtain a copy of the License at\n" +
+//"# http://www.netbeans.org/cddl-gplv2.html\n" +
+//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+//"# specific language governing permissions and limitations under the\n" +
+//"# License.  When distributing the software, include this License Header\n" +
+//"# Notice in each file and include the License file at\n" +
+//"# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+//"# particular file as subject to the \"Classpath\" exception as provided\n" +
+//"# by Sun in the GPL Version 2 section of the License file that\n" +
+//"# accompanied this code. If applicable, add the following below the\n" +
+//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
+//"# your own identifying information:\n" +
+//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+//"#\n" +
+//"# If you wish your version of this file to be governed by only the CDDL\n" +
+//"# or only the GPL Version 2, indicate your decision by adding\n" +
+//"# \"[Contributor] elects to include this software in this distribution\n" +
+//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+//"# single choice of license, a recipient has the option to distribute\n" +
+//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
+//"# to extend the choice of license to its licensees as provided above.\n" +
+//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+//"# Version 2 license, then the option applies only if the new code is\n" +
+//"# made subject to such option by the copyright holder.\n" +
+//"#\n" +
+//"# Contributor(s):\n" +
+//"#\n" +
+//"# Portions Copyrighted 2010 Sun Microsystems, Inc.";
+
+//    private static final String INPUT =
+//"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+//"#\n" +
+//"# Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+//"#\n" +
+//"# Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+//"# Other names may be trademarks of their respective owners.\n" +
+//"#\n" +
+//"# The contents of this file are subject to the terms of either the GNU\n" +
+//"# General Public License Version 2 only (\"GPL\") or the Common\n" +
+//"# Development and Distribution License(\"CDDL\") (collectively, the\n" +
+//"# \"License\"). You may not use this file except in compliance with the\n" +
+//"# License. You can obtain a copy of the License at\n" +
+//"# http://www.netbeans.org/cddl-gplv2.html\n" +
+//"# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+//"# specific language governing permissions and limitations under the\n" +
+//"# License.  When distributing the software, include this License Header\n" +
+//"# Notice in each file and include the License file at\n" +
+//"# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+//"# particular file as subject to the \"Classpath\" exception as provided\n" +
+//"# by Oracle in the GPL Version 2 section of the License file that\n" +
+//"# accompanied this code. If applicable, add the following below the\n" +
+//"# License Header, with the fields enclosed by brackets [] replaced by\n" +
+//"# your own identifying information:\n" +
+//"# \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+//"#\n" +
+//"# Contributor(s):\n" +
+//"#\n" +
+//"# The Original Software is NetBeans. The Initial Developer of the Original\n" +
+//"# Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
+//"# Microsystems, Inc. All Rights Reserved.\n" +
+//"#\n" +
+//"# If you wish your version of this file to be governed by only the CDDL\n" +
+//"# or only the GPL Version 2, indicate your decision by adding\n" +
+//"# \"[Contributor] elects to include this software in this distribution\n" +
+//"# under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+//"# single choice of license, a recipient has the option to distribute\n" +
+//"# your version of this file under either the CDDL, the GPL Version 2 or\n" +
+//"# to extend the choice of license to its licensees as provided above.\n" +
+//"# However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+//"# Version 2 license, then the option applies only if the new code is\n" +
+//"# made subject to such option by the copyright holder.";
+
+    private static final String OUTPUT =
+"# Licensed to the Apache Software Foundation (ASF) under one or more\n" +
+"# contributor license agreements.  See the NOTICE file distributed with\n" +
+"# this work for additional information regarding copyright ownership.\n" +
+"# The ASF licenses this file to You under the Apache License, Version 2.0\n" +
+"# (the \"License\"); you may not use this file except in compliance with\n" +
+"# the License.  You may obtain a copy of the License at\n" +
+"#\n" +
+"# http://www.apache.org/licenses/LICENSE-2.0\n" +
+"#\n" +
+"# Unless required by applicable law or agreed to in writing, software\n" +
+"# distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
+"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+"# See the License for the specific language governing permissions and\n" +
+"# limitations under the License.\n";
+
+//    private static final String INPUT =
+//"<!--\n" +
+//"DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+//"\n" +
+//"Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.\n" +
+//"\n" +
+//"Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+//"Other names may be trademarks of their respective owners.\n" +
+//"\n" +
+//"The contents of this file are subject to the terms of either the GNU\n" +
+//"General Public License Version 2 only (\"GPL\") or the Common\n" +
+//"Development and Distribution License(\"CDDL\") (collectively, the\n" +
+//"\"License\"). You may not use this file except in compliance with the\n" +
+//"License. You can obtain a copy of the License at\n" +
+//"http://www.netbeans.org/cddl-gplv2.html\n" +
+//"or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+//"specific language governing permissions and limitations under the\n" +
+//"License.  When distributing the software, include this License Header\n" +
+//"Notice in each file and include the License file at\n" +
+//"nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+//"particular file as subject to the \"Classpath\" exception as provided\n" +
+//"by Oracle in the GPL Version 2 section of the License file that\n" +
+//"accompanied this code. If applicable, add the following below the\n" +
+//"License Header, with the fields enclosed by brackets [] replaced by\n" +
+//"your own identifying information:\n" +
+//"\"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+//"\n" +
+//"Contributor(s):\n" +
+//"\n" +
+//"The Original Software is NetBeans. The Initial Developer of the Original\n" +
+//"Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun\n" +
+//"Microsystems, Inc. All Rights Reserved.\n" +
+//"\n" +
+//"If you wish your version of this file to be governed by only the CDDL\n" +
+//"or only the GPL Version 2, indicate your decision by adding\n" +
+//"\"[Contributor] elects to include this software in this distribution\n" +
+//"under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+//"single choice of license, a recipient has the option to distribute\n" +
+//"your version of this file under either the CDDL, the GPL Version 2 or\n" +
+//"to extend the choice of license to its licensees as provided above.\n" +
+//"However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+//"Version 2 license, then the option applies only if the new code is\n" +
+//"made subject to such option by the copyright holder.\n" +
+//"-->";
+//
+////    private static final String INPUT =
+////"<!--\n" +
+////"DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////"\n" +
+////"Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.\n" +
+////"\n" +
+////"\n" +
+////"The contents of this file are subject to the terms of either the GNU\n" +
+////"General Public License Version 2 only (\"GPL\") or the Common\n" +
+////"Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////"\"License\"). You may not use this file except in compliance with the\n" +
+////"License. You can obtain a copy of the License at\n" +
+////"http://www.netbeans.org/cddl-gplv2.html\n" +
+////"or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////"specific language governing permissions and limitations under the\n" +
+////"License.  When distributing the software, include this License Header\n" +
+////"Notice in each file and include the License file at\n" +
+////"nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+////"particular file as subject to the \"Classpath\" exception as provided\n" +
+////"by Sun in the GPL Version 2 section of the License file that\n" +
+////"accompanied this code. If applicable, add the following below the\n" +
+////"License Header, with the fields enclosed by brackets [] replaced by\n" +
+////"your own identifying information:\n" +
+////"\"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////"\n" +
+////"Contributor(s):\n" +
+////"\n" +
+////"The Original Software is NetBeans. The Initial Developer of the Original\n" +
+////"Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun\n" +
+////"Microsystems, Inc. All Rights Reserved.\n" +
+////"\n" +
+////"If you wish your version of this file to be governed by only the CDDL\n" +
+////"or only the GPL Version 2, indicate your decision by adding\n" +
+////"\"[Contributor] elects to include this software in this distribution\n" +
+////"under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+////"single choice of license, a recipient has the option to distribute\n" +
+////"your version of this file under either the CDDL, the GPL Version 2 or\n" +
+////"to extend the choice of license to its licensees as provided above.\n" +
+////"However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////"Version 2 license, then the option applies only if the new code is\n" +
+////"made subject to such option by the copyright holder.\n" +
+////"-->";
+//
+//    private static final String OUTPUT =
+//"<!--\n" +
+//"\n" +
+//"  Licensed to the Apache Software Foundation (ASF) under one or more\n" +
+//"  contributor license agreements.  See the NOTICE file distributed with\n" +
+//"  this work for additional information regarding copyright ownership.\n" +
+//"  The ASF licenses this file to You under the Apache License, Version 2.0\n" +
+//"  (the \"License\"); you may not use this file except in compliance with\n" +
+//"  the License.  You may obtain a copy of the License at\n" +
+//"\n" +
+//"  http://www.apache.org/licenses/LICENSE-2.0\n" +
+//"\n" +
+//"  Unless required by applicable law or agreed to in writing, software\n" +
+//"  distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
+//"  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+//"  See the License for the specific language governing permissions and\n" +
+//"  limitations under the License.\n" +
+//"-->";
+
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+////" *\n" +
+////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+////" * Other names may be trademarks of their respective owners.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Oracle in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
+////" */";
+//
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+////" *\n" +
+////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+////" * Other names may be trademarks of their respective owners.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU General\n" +
+////" * Public License Version 2 only (\"GPL\") or the Common Development and\n" +
+////" * Distribution License(\"CDDL\") (collectively, the \"License\"). You may not use\n" +
+////" * this file except in compliance with the License. You can obtain a copy of the\n" +
+////" * License at http://www.netbeans.org/cddl-gplv2.html or\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language\n" +
+////" * governing permissions and limitations under the License. When distributing\n" +
+////" * the software, include this License Header Notice in each file and include the\n" +
+////" * License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided by Oracle\n" +
+////" * in the GPL Version 2 section of the License file that accompanied this code.\n" +
+////" * If applicable, add the following below the License Header, with the fields\n" +
+////" * enclosed by brackets [] replaced by your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * If you wish your version of this file to be governed by only the CDDL or only\n" +
+////" * the GPL Version 2, indicate your decision by adding \"[Contributor] elects to\n" +
+////" * include this software in this distribution under the [CDDL or GPL Version 2]\n" +
+////" * license.\" If you do not indicate a single choice of license, a recipient has\n" +
+////" * the option to distribute your version of this file under either the CDDL, the\n" +
+////" * GPL Version 2 or to extend the choice of license to its licensees as provided\n" +
+////" * above. However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////" * Version 2 license, then the option applies only if the new code is made\n" +
+////" * subject to such option by the copyright holder.\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
+////" */";
+//
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Sun in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * The Original Software is NetBeans. The Initial Developer of the Original\n" +
+////" * Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
+////" * Microsystems, Inc. All Rights Reserved.\n" +
+////" *\n" +
+////" * If you wish your version of this file to be governed by only the CDDL\n" +
+////" * or only the GPL Version 2, indicate your decision by adding\n" +
+////" * \"[Contributor] elects to include this software in this distribution\n" +
+////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+////" * single choice of license, a recipient has the option to distribute\n" +
+////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
+////" * to extend the choice of license to its licensees as provided above.\n" +
+////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////" * Version 2 license, then the option applies only if the new code is\n" +
+////" * made subject to such option by the copyright holder.\n" +
+////" */";
+//
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Sun in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
+////" */";
+//
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+////" *\n" +
+////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+////" * Other names may be trademarks of their respective owners.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Oracle in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * The Original Software is NetBeans. The Initial Developer of the Original\n" +
+////" * Software is Sun Microsystems, Inc. Portions Copyright 2010 Sun\n" +
+////" * Microsystems, Inc. All Rights Reserved.\n" +
+////" *\n" +
+////" * If you wish your version of this file to be governed by only the CDDL\n" +
+////" * or only the GPL Version 2, indicate your decision by adding\n" +
+////" * \"[Contributor] elects to include this software in this distribution\n" +
+////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+////" * single choice of license, a recipient has the option to distribute\n" +
+////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
+////" * to extend the choice of license to its licensees as provided above.\n" +
+////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////" * Version 2 license, then the option applies only if the new code is\n" +
+////" * made subject to such option by the copyright holder.\n" +
+////" */";
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Oracle and/or its affiliates. All rights reserved.\n" +
+////" *\n" +
+////" * Oracle and Java are registered trademarks of Oracle and/or its affiliates.\n" +
+////" * Other names may be trademarks of their respective owners.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Oracle in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * If you wish your version of this file to be governed by only the CDDL\n" +
+////" * or only the GPL Version 2, indicate your decision by adding\n" +
+////" * \"[Contributor] elects to include this software in this distribution\n" +
+////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+////" * single choice of license, a recipient has the option to distribute\n" +
+////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
+////" * to extend the choice of license to its licensees as provided above.\n" +
+////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////" * Version 2 license, then the option applies only if the new code is\n" +
+////" * made subject to such option by the copyright holder.\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
+////" */";
+//
+////    private static final String INPUT =
+////"/*\n" +
+////" * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n" +
+////" *\n" +
+////" * Copyright 2010 Sun Microsystems, Inc. All rights reserved.\n" +
+////" *\n" +
+////" * The contents of this file are subject to the terms of either the GNU\n" +
+////" * General Public License Version 2 only (\"GPL\") or the Common\n" +
+////" * Development and Distribution License(\"CDDL\") (collectively, the\n" +
+////" * \"License\"). You may not use this file except in compliance with the\n" +
+////" * License. You can obtain a copy of the License at\n" +
+////" * http://www.netbeans.org/cddl-gplv2.html\n" +
+////" * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the\n" +
+////" * specific language governing permissions and limitations under the\n" +
+////" * License.  When distributing the software, include this License Header\n" +
+////" * Notice in each file and include the License file at\n" +
+////" * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this\n" +
+////" * particular file as subject to the \"Classpath\" exception as provided\n" +
+////" * by Sun in the GPL Version 2 section of the License file that\n" +
+////" * accompanied this code. If applicable, add the following below the\n" +
+////" * License Header, with the fields enclosed by brackets [] replaced by\n" +
+////" * your own identifying information:\n" +
+////" * \"Portions Copyrighted [year] [name of copyright owner]\"\n" +
+////" *\n" +
+////" * If you wish your version of this file to be governed by only the CDDL\n" +
+////" * or only the GPL Version 2, indicate your decision by adding\n" +
+////" * \"[Contributor] elects to include this software in this distribution\n" +
+////" * under the [CDDL or GPL Version 2] license.\" If you do not indicate a\n" +
+////" * single choice of license, a recipient has the option to distribute\n" +
+////" * your version of this file under either the CDDL, the GPL Version 2 or\n" +
+////" * to extend the choice of license to its licensees as provided above.\n" +
+////" * However, if you add GPL Version 2 code and therefore, elected the GPL\n" +
+////" * Version 2 license, then the option applies only if the new code is\n" +
+////" * made subject to such option by the copyright holder.\n" +
+////" *\n" +
+////" * Contributor(s):\n" +
+////" *\n" +
+////" * Portions Copyrighted 2010 Sun Microsystems, Inc.\n" +
+////" */";
+//    private static final String OUTPUT =
+//"/**\n" +
+//" * Licensed to the Apache Software Foundation (ASF) under one\n" +
+//" * or more contributor license agreements.  See the NOTICE file\n" +
+//" * distributed with this work for additional information\n" +
+//" * regarding copyright ownership.  The ASF licenses this file\n" +
+//" * to you under the Apache License, Version 2.0 (the\n" +
+//" * \"License\"); you may not use this file except in compliance\n" +
+//" * with the License.  You may obtain a copy of the License at\n" +
+//" *\n" +
+//" *   http://www.apache.org/licenses/LICENSE-2.0\n" +
+//" *\n" +
+//" * Unless required by applicable law or agreed to in writing,\n" +
+//" * software distributed under the License is distributed on an\n" +
+//" * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+//" * KIND, either express or implied.  See the License for the\n" +
+//" * specific language governing permissions and limitations\n" +
+//" * under the License.\n" +
+//" */";
+
+    public static void main(String[] args) throws IOException {
+        StringBuilder pattern = new StringBuilder();
+        
+        for (String piece : INPUT.split("2010")) {
+            if (pattern.length() != 0) {
+                pattern.append("[0-9][0-9][0-9][0-9](-[0-9][0-9][0-9][0-9])?");
+            }
+            pattern.append(Pattern.quote(piece));
+        }
+        
+        Pattern inputPattern = Pattern.compile(pattern.toString());
+//        Pattern inputPattern = Pattern.compile(Pattern.quote(INPUT), Pattern.MULTILINE);
+        
+        Path root = Paths.get("/home/lahvac/src/nb/apache-jackpot30/");
+//        Path root = Paths.get("/home/lahvac/src/nb/apache-jackpot30/cmdline/compiler/antsrc/org/netbeans/modules/jackpot30/compiler/ant/JackpotCompiler.java");
+        
+        Files.find(root, Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
+             .forEach(p -> {
+                try {
+                    Matcher m = inputPattern.matcher(new String(Files.readAllBytes(p)));
+                    if (m.find()) {
+                        try (Writer w = Files.newBufferedWriter(p)) {
+                            w.write(m.replaceAll(Matcher.quoteReplacement(OUTPUT)));
+                        }
+                    }
+                } catch (IOException ex) {
+                    ex.printStackTrace();
+                }
+             });
+    }
+    
+}



[08/12] incubator-netbeans-tools git commit: Fixing bundles handling.

Posted by jl...@apache.org.
Fixing bundles handling.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/97838d66
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/97838d66
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/97838d66

Branch: refs/heads/master
Commit: 97838d665f83ff56dcddc19b18f53f8963fe50c5
Parents: ab25500
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sun Sep 17 07:47:36 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sun Sep 17 07:47:36 2017 +0200

----------------------------------------------------------------------
 convert/nbproject/project.properties            |  4 +-
 convert/src/convert/CategorizeLicenses.java     | 23 +++++----
 convert/src/convert/Convert.java                |  4 +-
 .../test/convert/CategorizeLicensesTest.java    | 49 ++++++++++++++++++++
 4 files changed, 68 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/97838d66/convert/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/convert/nbproject/project.properties b/convert/nbproject/project.properties
index 7fe4bb0..7dc3b49 100644
--- a/convert/nbproject/project.properties
+++ b/convert/nbproject/project.properties
@@ -50,7 +50,9 @@ javac.source=1.8
 javac.target=1.8
 javac.test.classpath=\
     ${javac.classpath}:\
-    ${build.classes.dir}
+    ${build.classes.dir}:\
+    ${libs.junit_4.classpath}:\
+    ${libs.hamcrest.classpath}
 javac.test.modulepath=\
     ${javac.modulepath}
 javac.test.processorpath=\

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/97838d66/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index 0928f10..42b57cf 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -176,12 +176,13 @@ public class CategorizeLicenses {
         return createUnifiedDescriptionOrNull(startM.start(), endM.end(), lic, commentType);
     }
     
-    private static Description snipLicenseBundle(String code, String firstLinePattern) {
+    public static Description snipLicenseBundle(String code, String firstLinePattern) {
         StringBuilder res = new StringBuilder();
         boolean firstLine = true;
         int start = -1;
         int pos;
         int next = 0;
+        int end = 0;
         String[] lines = code.split("\n");
         for (int i = 0; i < lines.length; i++) {
             String line = lines[i];
@@ -192,18 +193,24 @@ public class CategorizeLicenses {
                 continue;
             if (firstLine && line.trim().isEmpty())
                 continue;
-            if (firstLine) {
-                start = pos;
-            }
-            firstLine = false;
             if (line.startsWith("#")) {
-                res.append(line.substring(1).trim());
+                String part = line.substring(1).trim();
+                if (firstLine && part.isEmpty())
+                    continue;
+                if (firstLine) {
+                    start = pos;
+                }
+                firstLine = false;
+                res.append(part);
                 res.append("\n");
+                if (!part.isEmpty()) {
+                    end = next;
+                }
             } else {
-                return createUnifiedDescriptionOrNull(start, next, res.toString(), CommentType.PROPERTIES);
+                return createUnifiedDescriptionOrNull(start, end, res.toString(), CommentType.PROPERTIES);
             }
         }
-        return createUnifiedDescriptionOrNull(start, next, res.toString(), CommentType.PROPERTIES);
+        return createUnifiedDescriptionOrNull(start, end, res.toString(), CommentType.PROPERTIES);
     }
 
     private static Description createUnifiedDescriptionOrNull(int start, int end, String lic, CommentType commentType) {

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/97838d66/convert/src/convert/Convert.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/Convert.java b/convert/src/convert/Convert.java
index c8fc1fa..1cd72f2 100644
--- a/convert/src/convert/Convert.java
+++ b/convert/src/convert/Convert.java
@@ -121,7 +121,6 @@ public class Convert {
             "-->";
 
     private static final String BUNDLE_OUTPUT =
-            "#\n" +
             "# Licensed to the Apache Software Foundation (ASF) under one\n" +
             "# or more contributor license agreements.  See the NOTICE file\n" +
             "# distributed with this work for additional information\n" +
@@ -137,8 +136,7 @@ public class Convert {
             "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
             "# KIND, either express or implied.  See the License for the\n" +
             "# specific language governing permissions and limitations\n" +
-            "# under the License.\n" +
-            "#\n";
+            "# under the License.\n";
 
     public static void main(String[] args) throws IOException {
         if (args.length != 1) {

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/97838d66/convert/test/convert/CategorizeLicensesTest.java
----------------------------------------------------------------------
diff --git a/convert/test/convert/CategorizeLicensesTest.java b/convert/test/convert/CategorizeLicensesTest.java
new file mode 100644
index 0000000..e77e4f9
--- /dev/null
+++ b/convert/test/convert/CategorizeLicensesTest.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package convert;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author lahvac
+ */
+public class CategorizeLicensesTest {
+
+    public CategorizeLicensesTest() {
+    }
+
+    @Test
+    public void testSnipLicenseBundle1() {
+        final String code = "\n" +
+                            "#\n" +
+                            "#CDDL\n" +
+                            "#\n" +
+                            "#lic\n" +
+                            "#\n" +
+                            "\n";
+        CategorizeLicenses.Description desc =
+                CategorizeLicenses.snipLicenseBundle(code,
+                                                     null);
+        assertEquals("CDDL\nlic", desc.header);
+        assertEquals("#CDDL\n#\n#lic\n", code.substring(desc.start, desc.end));
+    }
+
+}


[05/12] incubator-netbeans-tools git commit: A first attempt to create a tool to categorize license headers.

Posted by jl...@apache.org.
A first attempt to create a tool to categorize license headers.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/aaa4ac02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/aaa4ac02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/aaa4ac02

Branch: refs/heads/master
Commit: aaa4ac02885268d59de82d7a21bef0f41e3e26c6
Parents: 3cdd16d
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sat Sep 9 10:38:48 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sat Sep 9 10:38:48 2017 +0200

----------------------------------------------------------------------
 .gitignore                                  |   4 +-
 convert/nbproject/project.properties        |   6 +-
 convert/src/convert/CategorizeLicenses.java | 174 +++++++++++++++++++++++
 3 files changed, 181 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/aaa4ac02/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 34f5785..f4a9236 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
-/convert/nbproject/private/
\ No newline at end of file
+/convert/nbproject/private/
+/convert/build/
+/convert/dist/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/aaa4ac02/convert/nbproject/project.properties
----------------------------------------------------------------------
diff --git a/convert/nbproject/project.properties b/convert/nbproject/project.properties
index 0227ea7..4b111c8 100644
--- a/convert/nbproject/project.properties
+++ b/convert/nbproject/project.properties
@@ -1,9 +1,10 @@
 annotation.processing.enabled=true
 annotation.processing.enabled.in.editor=false
-annotation.processing.processor.options=
 annotation.processing.processors.list=
 annotation.processing.run.all.processors=true
 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=convert
+application.vendor=lahvac
 build.classes.dir=${build.dir}/classes
 build.classes.excludes=**/*.java,**/*.form
 # This directory is removed when the project is cleaned:
@@ -32,6 +33,7 @@ dist.jar=${dist.dir}/convert.jar
 dist.javadoc.dir=${dist.dir}/javadoc
 dist.jlink.dir=${dist.dir}/jlink
 dist.jlink.output=${dist.jlink.dir}/convert
+endorsed.classpath=
 excludes=
 includes=**
 jar.compress=false
@@ -71,7 +73,7 @@ jlink.additionalmodules=
 jlink.additionalparam=
 jlink.launcher=true
 jlink.launcher.name=convert
-main.class=
+main.class=convert.CategorizeLicenses
 manifest.file=manifest.mf
 meta.inf.dir=${src.dir}/META-INF
 mkdist.disabled=false

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/aaa4ac02/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
new file mode 100644
index 0000000..ee7d5c1
--- /dev/null
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -0,0 +1,174 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package convert;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+public class CategorizeLicenses {
+
+    public static void main(String[] args) throws IOException {
+        if (args.length != 2) {
+            System.err.println("Use: CategorizeLicenses <source-directory> <target-directory>");
+            return ;
+        }
+        Path root = Paths.get(args[0]);
+        Map<String, List<String>> licenses = new HashMap<>();
+        Map<String, List<String>> paragraphs = new HashMap<>();
+        Set<String> noCDDL = new HashSet<>();
+        Set<String> cddlNotRecognized = new HashSet<>();
+        Files.find(root, Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
+             .forEach(p -> {
+                try {
+                    String path = root.relativize(p).toString();
+                    String code = new String(Files.readAllBytes(p));
+
+                    if (code.contains("CDDL")) {
+                        String lic = snipLicense(code, p);
+
+                        if (lic != null && lic.contains("CDDL")) {
+                            lic = YEARS_PATTERN.matcher(lic).replaceAll(Matcher.quoteReplacement("<YEARS>"));
+                            lic = lic.replaceAll("([^\n])\n([^\n])", "$1 $2");
+                            lic = lic.replaceAll("[ \t]+", " ");
+                            licenses.computeIfAbsent(lic, l -> new ArrayList<>()).add(path);
+                            for (String par : lic.split("\n")) {
+                                paragraphs.computeIfAbsent(par, l -> new ArrayList<>()).add(path);
+                            }
+                            return ;
+                        }
+                    
+                        cddlNotRecognized.add(path);
+                        return ;
+                    }
+                    noCDDL.add(path);
+                } catch (IOException ex) {
+                    ex.printStackTrace();
+                }
+             });
+        
+        Path target = Paths.get(args[1]);
+
+        int i = 0;
+        for (Map.Entry<String, List<String>> e : licenses.entrySet()) {
+            try (Writer w = Files.newBufferedWriter(target.resolve("lic" + i++))) {
+                w.write(e.getKey());
+                w.write("\n\n");
+                for (String file : e.getValue()) {
+                    w.write(file);
+                    w.write("\n");
+                }
+            }
+        }
+        System.err.println("licenses count: " + licenses.size());
+        System.err.println("paragraphs count: " + paragraphs.size());
+        
+        System.err.println("cddl, unrecognized file: " + cddlNotRecognized.size());
+        System.err.println("no cddl license: " + noCDDL.size());
+
+        dump(licenses, target, "lic");
+        dump(paragraphs, target, "par");
+        dump(Collections.singletonMap("Files which contain string CDDL, but their comment structure is not (yet) recognized.", cddlNotRecognized), target, "have-cddl-not-recognized-filetype");
+        dump(Collections.singletonMap("Files which do not contain string CDDL", noCDDL), target, "do-not-have-cddl");
+    }
+        private static final Pattern YEARS_PATTERN = Pattern.compile("[12][019][0-9][0-9]([ \t]*[-,/][ \t]*[12][019][0-9][0-9])?");
+
+    private static void dump(Map<String, ? extends Collection<String>> cat, Path target, String name) throws IOException {
+        int i = 0;
+        for (Map.Entry<String, ? extends Collection<String>> e : cat.entrySet()) {
+            try (Writer w = Files.newBufferedWriter(target.resolve(name + i++))) {
+                w.write(e.getKey());
+                w.write("\n\n");
+                w.write("files:\n");
+                e.getValue().stream().sorted().forEach(file -> {
+                    try {
+                        w.write(file);
+                        w.write("\n");
+                    } catch (IOException ex) {
+                        throw new IllegalStateException(ex);
+                    }
+                });
+            }
+        }
+    }
+    private static String snipLicense(String code, Path file) {
+        String fn = file.getFileName().toString();
+        switch (fn.substring(fn.lastIndexOf('.') + 1)) {
+            case "javx": case "c": case "h": case "cpp":
+            case "java": return snipLicense(code, "/\\*+", "\\*+/", "^[ \t]*\\**[ \t]*");
+            case "html": case "xsd": case "xsl": case "dtd":
+            case "settings": case "wstcgrp": case "wstcref":
+            case "wsgrp": 
+            case "xml": return snipLicense(code, "<!--+", "-+->", "^[ \t]*");
+            case "sh": return snipLicenseBundle(code, "#!.*");
+            case "properties": return snipLicenseBundle(code, null);
+        }
+        
+        return null;
+    }
+
+    private static String snipLicense(String code, String commentStart, String commentEnd, String normalizeLines) {
+        Matcher startM = Pattern.compile(commentStart).matcher(code);
+        if (!startM.find())
+            return null;
+        Matcher endM = Pattern.compile(commentEnd).matcher(code);
+        if (!endM.find(startM.end()))
+            return null;
+        String lic = code.substring(startM.end(), endM.start());
+        if (normalizeLines != null) {
+            lic = Arrays.stream(lic.split("\n"))
+                        .map(l -> l.replaceAll(normalizeLines, ""))
+                        .collect(Collectors.joining("\n"));
+        }
+        return lic;
+    }
+    
+    private static String snipLicenseBundle(String code, String firstLinePattern) {
+        StringBuilder res = new StringBuilder();
+        boolean firstLine = true;
+        for (String line : code.split("\n")) {
+            line = line.trim();
+            if (firstLine && firstLinePattern != null && Pattern.compile(firstLinePattern).matcher(line).matches())
+                continue;
+            firstLine = false;
+            if (line.startsWith("#")) {
+                res.append(line.substring(1).trim());
+                res.append("\n");
+            } else {
+                return res.toString();
+            }
+        }
+        return res.toString();
+    }
+    
+}


[12/12] incubator-netbeans-tools git commit: Print statistics file.

Posted by jl...@apache.org.
Print statistics file.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/97d41efb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/97d41efb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/97d41efb

Branch: refs/heads/master
Commit: 97d41efb64b5f36d0b4543ef356badc4aa4dc30f
Parents: 864dfc5
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sun Sep 17 16:52:05 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sun Sep 17 16:52:05 2017 +0200

----------------------------------------------------------------------
 convert/src/convert/Convert.java | 58 ++++++++++++++++++++++++++++++-----
 1 file changed, 51 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/97d41efb/convert/src/convert/Convert.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/Convert.java b/convert/src/convert/Convert.java
index 240c5a6..d47d9c4 100644
--- a/convert/src/convert/Convert.java
+++ b/convert/src/convert/Convert.java
@@ -24,6 +24,8 @@ import java.io.Writer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
 import java.util.regex.Pattern;
 
 public class Convert {
@@ -175,13 +177,16 @@ public class Convert {
             "@rem under the License.\n";
 
     public static void main(String[] args) throws IOException {
-        if (args.length != 1) {
-            System.err.println("Use: Convert <source-directory>");
+        if (args.length != 1 && args.length != 2) {
+            System.err.println("Use: Convert <source-directory> [<statistics-file>]");
             return ;
         }
         Pattern headerPattern = Pattern.compile(LICENSE_INPUT_PATTERN1, Pattern.MULTILINE);
         Path root = Paths.get(args[0]);
         int[] count = new int[1];
+        Set<String> converted = new HashSet<>();
+        Set<String> cddlNoRewrite = new HashSet<>();
+        Set<String> noCDDL = new HashSet<>();
         Files.find(root, Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
              .forEach(p -> {
                 try {
@@ -189,24 +194,62 @@ public class Convert {
                     String code = new String(Files.readAllBytes(p));
 
                     if (code.contains("CDDL")) {
+                        boolean success = false;
                         CategorizeLicenses.Description lic = CategorizeLicenses.snipUnifiedLicenseOrNull(code, p);
 
                         if (lic != null) {
                             if (headerPattern.matcher(lic.header).matches()) {
-                                fixHeader(p, code, lic);
+                                success = fixHeader(p, code, lic);
                                 count[0]++;
                             }
                         }
+
+                        if (success) {
+                            converted.add(path);
+                        } else {
+                            cddlNoRewrite.add(path);
+                        }
+                    } else {
+                        noCDDL.add(path);
                     }
                 } catch (IOException ex) {
-                    ex.printStackTrace();
+                    throw new IllegalStateException(ex);
                 }
              });
         
-        System.err.println("convertible: " + count[0]);
+        System.err.println("converted: " + count[0]);
+
+        if (args.length == 2) {
+            Path statistics = Paths.get(args[1]);
+
+            try (Writer out = Files.newBufferedWriter(statistics)) {
+                out.write("Converted files (" + converted.size() + "):\n");
+                out.write("--------------------------------------------------\n");
+                dumpFiles(out, converted);
+                out.write("Files with CDDL, but not converted (" + cddlNoRewrite.size() + "):\n");
+                out.write("--------------------------------------------------\n");
+                dumpFiles(out, cddlNoRewrite);
+                out.write("Files without CDDL (" + noCDDL.size() + "):\n");
+                out.write("--------------------------------------------------\n");
+                dumpFiles(out, noCDDL);
+            }
+        }
+    }
+
+    private static void dumpFiles(Writer out, Set<String> paths) throws IOException {
+        paths.stream().sorted().forEach(p -> {
+            try {
+                out.write(p);
+                out.write("\n");
+            } catch (IOException ex) {
+                throw new IllegalStateException(ex);
+            }
+        });
+
+        out.write("\n");
     }
     
-    private static void fixHeader(Path file, String code, Description desc) {
+    private static boolean fixHeader(Path file, String code, Description desc) {
         String outputLicense;
         switch (desc.commentType) {
             case JAVA: outputLicense = JAVA_OUTPUT; break;
@@ -216,12 +259,13 @@ public class Convert {
             case BAT2: outputLicense = BAT2_OUTPUT; break;
             default:
                 System.err.println("cannot rewrite: " + file);
-                return ;
+                return false;
         }
         
         try (Writer out = Files.newBufferedWriter(file)) {
             String newCode = code.substring(0, desc.start) + outputLicense + code.substring(desc.end);
             out.write(newCode);
+            return true;
         } catch (IOException ex) {
             throw new IllegalStateException(ex);
         }


[11/12] incubator-netbeans-tools git commit: Testing bat files.

Posted by jl...@apache.org.
Testing bat files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/864dfc5b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/864dfc5b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/864dfc5b

Branch: refs/heads/master
Commit: 864dfc5b1987226ad3561c7c07e77b3ea9962b42
Parents: 9bea96e
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sun Sep 17 10:18:02 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sun Sep 17 10:18:02 2017 +0200

----------------------------------------------------------------------
 convert/src/convert/CategorizeLicenses.java     | 48 ++++++++++----------
 convert/src/convert/Convert.java                | 38 ++++++++++++++++
 .../test/convert/CategorizeLicensesTest.java    |  4 +-
 3 files changed, 65 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/864dfc5b/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index a492a17..ee22b8c 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -36,6 +36,7 @@ import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 public class CategorizeLicenses {
 
@@ -123,7 +124,7 @@ public class CategorizeLicenses {
         }
     }
     
-    private static final Map<String, Function<String, Description>> extension2Convertor = new HashMap<>();
+    private static final Map<String, Collection<Function<String, Description>>> extension2Convertor = new HashMap<>();
     
     static {
         enterExtensions(code -> snipLicense(code, "/\\*+", "\\*+/", "^[ \t]*\\**[ \t]*", CommentType.JAVA),
@@ -131,33 +132,30 @@ public class CategorizeLicenses {
         enterExtensions(code -> snipLicense(code, "<!--+", "-+->", "^[ \t]*(-[ \t]*)?", CommentType.XML),
                         "html", "xsd", "xsl", "dtd", "settings", "wstcgrp", "wstcref",
                         "wsgrp", "xml", "xslt");
-        enterExtensions(code -> snipLicenseBundle(code, "#!.*"), "sh");
-        enterExtensions(code -> snipLicenseBundle(code, null), "properties");
+        enterExtensions(code -> snipLicenseBundle(code, "#!.*", "#", CommentType.PROPERTIES), "sh");
+        enterExtensions(code -> snipLicenseBundle(code, null, "#", CommentType.PROPERTIES), "properties");
+        enterExtensions(code -> snipLicenseBundle(code, null, "rem", CommentType.BAT1), "bat");
+        enterExtensions(code -> snipLicenseBundle(code, null, "@rem", CommentType.BAT2), "bat");
     }
     
     private static void enterExtensions(Function<String, Description> convertor, String... extensions) {
         for (String ext : extensions) {
-            extension2Convertor.put(ext, convertor);
+            extension2Convertor.computeIfAbsent(ext, x -> new ArrayList<>()).add(convertor);
         }
     }
 
     public static Description snipUnifiedLicenseOrNull(String code, Path file) {
         String fn = file.getFileName().toString();
         String ext = fn.substring(fn.lastIndexOf('.') + 1);
-        Function<String, Description> preferredConvertor = extension2Convertor.get(ext);
-        Description desc = preferredConvertor != null ? preferredConvertor.apply(code) : null;
-        
-        if (desc == null) {
-            for (Function<String, Description> convertor : extension2Convertor.values()) {
-                desc = convertor.apply(code);
-                
-                if (desc != null) {
-                    return desc;
-                }
-            }
-        }
-        
-        return desc;
+        return Stream.concat(extension2Convertor.getOrDefault(ext, Collections.emptyList())
+                                                .stream(),
+                             extension2Convertor.values()
+                                                .stream()
+                                                .flatMap(c -> c.stream()))
+              .map(c -> c.apply(code))
+              .filter(desc -> desc != null)
+              .findFirst()
+              .orElse(null);
     }
 
     private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines, CommentType commentType) {
@@ -176,7 +174,7 @@ public class CategorizeLicenses {
         return createUnifiedDescriptionOrNull(startM.start(), endM.end(), lic, commentType);
     }
     
-    public static Description snipLicenseBundle(String code, String firstLinePattern) {
+    public static Description snipLicenseBundle(String code, String firstLinePattern, String commentMarker, CommentType commentType) {
         StringBuilder res = new StringBuilder();
         boolean firstLine = true;
         int start = -1;
@@ -193,8 +191,8 @@ public class CategorizeLicenses {
                 continue;
             if (firstLine && line.trim().isEmpty())
                 continue;
-            if (line.startsWith("#")) {
-                String part = line.substring(1).trim();
+            if (line.startsWith(commentMarker)) {
+                String part = line.substring(commentMarker.length()).trim();
                 if (firstLine && part.isEmpty())
                     continue;
                 if (firstLine) {
@@ -207,10 +205,10 @@ public class CategorizeLicenses {
                     end = next;
                 }
             } else {
-                return createUnifiedDescriptionOrNull(start, end, res.toString(), CommentType.PROPERTIES);
+                return createUnifiedDescriptionOrNull(start, end, res.toString(), commentType);
             }
         }
-        return createUnifiedDescriptionOrNull(start, end, res.toString(), CommentType.PROPERTIES);
+        return createUnifiedDescriptionOrNull(start, end, res.toString(), commentType);
     }
 
     private static Description createUnifiedDescriptionOrNull(int start, int end, String lic, CommentType commentType) {
@@ -249,6 +247,8 @@ public class CategorizeLicenses {
     public enum CommentType {
         JAVA,
         XML,
-        PROPERTIES;
+        PROPERTIES,
+        BAT1,
+        BAT2;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/864dfc5b/convert/src/convert/Convert.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/Convert.java b/convert/src/convert/Convert.java
index 1cd72f2..240c5a6 100644
--- a/convert/src/convert/Convert.java
+++ b/convert/src/convert/Convert.java
@@ -138,6 +138,42 @@ public class Convert {
             "# specific language governing permissions and limitations\n" +
             "# under the License.\n";
 
+    private static final String BAT1_OUTPUT =
+            "rem Licensed to the Apache Software Foundation (ASF) under one\n" +
+            "rem or more contributor license agreements.  See the NOTICE file\n" +
+            "rem distributed with this work for additional information\n" +
+            "rem regarding copyright ownership.  The ASF licenses this file\n" +
+            "rem to you under the Apache License, Version 2.0 (the\n" +
+            "rem \"License\"); you may not use this file except in compliance\n" +
+            "rem with the License.  You may obtain a copy of the License at\n" +
+            "rem\n" +
+            "rem   http://www.apache.org/licenses/LICENSE-2.0\n" +
+            "rem\n" +
+            "rem Unless required by applicable law or agreed to in writing,\n" +
+            "rem software distributed under the License is distributed on an\n" +
+            "rem \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+            "rem KIND, either express or implied.  See the License for the\n" +
+            "rem specific language governing permissions and limitations\n" +
+            "rem under the License.\n";
+
+    private static final String BAT2_OUTPUT =
+            "@rem Licensed to the Apache Software Foundation (ASF) under one\n" +
+            "@rem or more contributor license agreements.  See the NOTICE file\n" +
+            "@rem distributed with this work for additional information\n" +
+            "@rem regarding copyright ownership.  The ASF licenses this file\n" +
+            "@rem to you under the Apache License, Version 2.0 (the\n" +
+            "@rem \"License\"); you may not use this file except in compliance\n" +
+            "@rem with the License.  You may obtain a copy of the License at\n" +
+            "@rem\n" +
+            "@rem   http://www.apache.org/licenses/LICENSE-2.0\n" +
+            "@rem\n" +
+            "@rem Unless required by applicable law or agreed to in writing,\n" +
+            "@rem software distributed under the License is distributed on an\n" +
+            "@rem \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
+            "@rem KIND, either express or implied.  See the License for the\n" +
+            "@rem specific language governing permissions and limitations\n" +
+            "@rem under the License.\n";
+
     public static void main(String[] args) throws IOException {
         if (args.length != 1) {
             System.err.println("Use: Convert <source-directory>");
@@ -176,6 +212,8 @@ public class Convert {
             case JAVA: outputLicense = JAVA_OUTPUT; break;
             case XML: outputLicense = XML_OUTPUT; break;
             case PROPERTIES: outputLicense = BUNDLE_OUTPUT; break;
+            case BAT1: outputLicense = BAT1_OUTPUT; break;
+            case BAT2: outputLicense = BAT2_OUTPUT; break;
             default:
                 System.err.println("cannot rewrite: " + file);
                 return ;

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/864dfc5b/convert/test/convert/CategorizeLicensesTest.java
----------------------------------------------------------------------
diff --git a/convert/test/convert/CategorizeLicensesTest.java b/convert/test/convert/CategorizeLicensesTest.java
index e77e4f9..960b2a3 100644
--- a/convert/test/convert/CategorizeLicensesTest.java
+++ b/convert/test/convert/CategorizeLicensesTest.java
@@ -41,7 +41,9 @@ public class CategorizeLicensesTest {
                             "\n";
         CategorizeLicenses.Description desc =
                 CategorizeLicenses.snipLicenseBundle(code,
-                                                     null);
+                                                     null,
+                                                     "#",
+                                                     CategorizeLicenses.CommentType.PROPERTIES);
         assertEquals("CDDL\nlic", desc.header);
         assertEquals("#CDDL\n#\n#lic\n", code.substring(desc.start, desc.end));
     }


[09/12] incubator-netbeans-tools git commit: Fixing re-write by extension.

Posted by jl...@apache.org.
Fixing re-write by extension.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/7a55d15e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/7a55d15e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/7a55d15e

Branch: refs/heads/master
Commit: 7a55d15e14e0aa7f06837aab12b44039aafea4b5
Parents: 97838d6
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sun Sep 17 09:51:15 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sun Sep 17 09:51:15 2017 +0200

----------------------------------------------------------------------
 convert/src/convert/CategorizeLicenses.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/7a55d15e/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index 42b57cf..9c29d31 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -145,7 +145,7 @@ public class CategorizeLicenses {
         String fn = file.getFileName().toString();
         String ext = fn.substring(fn.lastIndexOf('.') + 1);
         Function<String, Description> preferredConvertor = extension2Convertor.get(ext);
-        Description desc = preferredConvertor != null ? preferredConvertor.apply(ext) : null;
+        Description desc = preferredConvertor != null ? preferredConvertor.apply(code) : null;
         
         if (desc == null) {
             for (Function<String, Description> convertor : extension2Convertor.values()) {
@@ -157,7 +157,7 @@ public class CategorizeLicenses {
             }
         }
         
-        return null;
+        return desc;
     }
 
     private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines, CommentType commentType) {


[10/12] incubator-netbeans-tools git commit: Registering more extensions, limit the positions where the header may start.

Posted by jl...@apache.org.
Registering more extensions, limit the positions where the header may start.


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/9bea96e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/9bea96e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/9bea96e2

Branch: refs/heads/master
Commit: 9bea96e2d1f3ae578005ddf901811d30673f26be
Parents: 7a55d15
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Sun Sep 17 10:01:00 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Sun Sep 17 10:01:00 2017 +0200

----------------------------------------------------------------------
 convert/src/convert/CategorizeLicenses.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/9bea96e2/convert/src/convert/CategorizeLicenses.java
----------------------------------------------------------------------
diff --git a/convert/src/convert/CategorizeLicenses.java b/convert/src/convert/CategorizeLicenses.java
index 9c29d31..a492a17 100644
--- a/convert/src/convert/CategorizeLicenses.java
+++ b/convert/src/convert/CategorizeLicenses.java
@@ -127,10 +127,10 @@ public class CategorizeLicenses {
     
     static {
         enterExtensions(code -> snipLicense(code, "/\\*+", "\\*+/", "^[ \t]*\\**[ \t]*", CommentType.JAVA),
-                        "javx", "c", "h", "cpp", "pass", "hint", "css", "java");
+                        "javx", "c", "h", "cpp", "pass", "hint", "css", "java", "js", "jj");
         enterExtensions(code -> snipLicense(code, "<!--+", "-+->", "^[ \t]*(-[ \t]*)?", CommentType.XML),
                         "html", "xsd", "xsl", "dtd", "settings", "wstcgrp", "wstcref",
-                        "wsgrp", "xml");
+                        "wsgrp", "xml", "xslt");
         enterExtensions(code -> snipLicenseBundle(code, "#!.*"), "sh");
         enterExtensions(code -> snipLicenseBundle(code, null), "properties");
     }
@@ -162,7 +162,7 @@ public class CategorizeLicenses {
 
     private static Description snipLicense(String code, String commentStart, String commentEnd, String normalizeLines, CommentType commentType) {
         Matcher startM = Pattern.compile(commentStart).matcher(code);
-        if (!startM.find())
+        if (!startM.find() || startM.start() > 100) //only first 100 characters
             return null;
         Matcher endM = Pattern.compile(commentEnd).matcher(code);
         if (!endM.find(startM.end()))


[04/12] incubator-netbeans-tools git commit: Very first version of the convertor (was used to convert license headers for the jackpot30 repository).

Posted by jl...@apache.org.
Very first version of the convertor (was used to convert license headers for the jackpot30 repository).


Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/commit/3cdd16d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/tree/3cdd16d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/diff/3cdd16d0

Branch: refs/heads/master
Commit: 3cdd16d0cec22f4f9486106675327dee41d5974a
Parents: 157ca29
Author: Jan Lahoda <jl...@netbeans.org>
Authored: Wed Sep 6 22:39:01 2017 +0200
Committer: Jan Lahoda <jl...@netbeans.org>
Committed: Wed Sep 6 22:39:01 2017 +0200

----------------------------------------------------------------------
 .gitignore                                      |    1 +
 convert/build.xml                               |   73 +
 convert/manifest.mf                             |    3 +
 convert/nbproject/build-impl.xml                | 1768 ++++++++++++++++++
 convert/nbproject/genfiles.properties           |    8 +
 convert/nbproject/project.properties            |   95 +
 convert/nbproject/project.xml                   |   15 +
 .../src/javaapplication9/JavaApplication9.java  |  660 +++++++
 8 files changed, 2623 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..34f5785
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/convert/nbproject/private/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/build.xml
----------------------------------------------------------------------
diff --git a/convert/build.xml b/convert/build.xml
new file mode 100644
index 0000000..cac51d8
--- /dev/null
+++ b/convert/build.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="convert" default="default" basedir=".">
+    <description>Builds, tests, and runs the project convert.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar:                  JAR building
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="convert-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/manifest.mf
----------------------------------------------------------------------
diff --git a/convert/manifest.mf b/convert/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/convert/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+


[03/12] incubator-netbeans-tools git commit: Very first version of the convertor (was used to convert license headers for the jackpot30 repository).

Posted by jl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-tools/blob/3cdd16d0/convert/nbproject/build-impl.xml
----------------------------------------------------------------------
diff --git a/convert/nbproject/build-impl.xml b/convert/nbproject/build-impl.xml
new file mode 100644
index 0000000..3cdf3fe
--- /dev/null
+++ b/convert/nbproject/build-impl.xml
@@ -0,0 +1,1768 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - test compilation
+  - test execution
+  - test debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="convert-impl">
+    <fail message="Please build using Ant 1.8.0 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.8.0"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.6"/>
+        <property name="default.javac.target" value="1.6"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target name="-init-modules-supported">
+        <condition property="modules.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
+        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute name="property"/>
+            <attribute name="sourcepath"/>
+            <sequential>
+                <loadresource property="@{property}" quiet="true">
+                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
+                    <filterchain>
+                        <stripjavacomments/>
+                        <linecontainsregexp>
+                            <regexp pattern="module .* \{"/>
+                        </linecontainsregexp>
+                        <tokenfilter>
+                            <linetokenizer/>
+                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
+                        </tokenfilter>
+                        <striplinebreaks/>
+                    </filterchain>
+                </loadresource>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
+        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
+            <condition>
+                <not>
+                    <antversion atleast="1.10.0"/>
+                </not>
+            </condition>
+        </fail>
+        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
+        <condition property="named.module.internal">
+            <and>
+                <isset property="module.name"/>
+                <length length="0" string="${module.name}" when="greater"/>
+            </and>
+        </condition>
+        <condition property="unnamed.module.internal">
+            <not>
+                <isset property="named.module.internal"/>
+            </not>
+        </condition>
+        <property name="javac.modulepath" value=""/>
+        <property name="run.modulepath" value="${javac.modulepath}"/>
+        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
+        <property name="debug.modulepath" value="${run.modulepath}"/>
+        <property name="javac.upgrademodulepath" value=""/>
+        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
+        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
+            <and>
+                <isset property="javac.systemmodulepath"/>
+                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
+            </and>
+        </condition>
+        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
+        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
+        <property name="module.name" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
+        <property name="platform.java" value="${java.home}/bin/java"/>
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="profile.available">
+            <and>
+                <isset property="javac.profile"/>
+                <length length="0" string="${javac.profile}" when="greater"/>
+                <not>
+                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <or>
+                <not>
+                    <istrue value="${jar.archive.disabled}"/>
+                </not>
+                <istrue value="${not.archive.disabled}"/>
+            </or>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+                <not>
+                    <istrue value="${modules.supported.internal}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+profile.available">
+            <and>
+                <isset property="profile.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="run.jvmargs.ide" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <property name="manifest.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <and>
+                <isset property="endorsed.classpath"/>
+                <not>
+                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
+            <isset property="profile.available"/>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="javac.fork">
+            <or>
+                <istrue value="${jdkBug6558476}"/>
+                <istrue value="${javac.external.vm}"/>
+            </or>
+        </condition>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <property name="copylibs.rebase" value="true"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+        <condition property="junit.available">
+            <or>
+                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+            </or>
+        </condition>
+        <condition property="testng.available">
+            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+        </condition>
+        <condition property="junit+testng.available">
+            <and>
+                <istrue value="${junit.available}"/>
+                <istrue value="${testng.available}"/>
+            </and>
+        </condition>
+        <condition else="testng" property="testng.mode" value="mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <condition else="" property="testng.debug.mode" value="-mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <property name="java.failonerror" value="true"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.modulepath}" name="modulepath"/>
+            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
+            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition property="warn.excludes.internal">
+                    <and>
+                        <isset property="named.module.internal"/>
+                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
+                    </and>
+                </condition>
+                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <condition property="processormodulepath.set">
+                    <resourcecount count="0" when="greater">
+                        <path>
+                            <pathelement path="@{processormodulepath}"/>
+                        </path>
+                    </resourcecount>
+                </condition>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <modulepath>
+                        <path path="@{modulepath}"/>
+                    </modulepath>
+                    <upgrademodulepath>
+                        <path path="@{upgrademodulepath}"/>
+                    </upgrademodulepath>
+                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
+                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
+                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.modulepath}" name="modulepath"/>
+            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.modulepath}" name="modulepath"/>
+            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-init">
+        <condition else="false" property="nb.junit.batch" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <not>
+                    <isset property="test.method"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="nb.junit.single" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <isset property="test.method"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
+    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
+        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <element name="customizePrototype" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <modulepath>
+                        <path path="${run.test.modulepath}"/>
+                    </modulepath>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.test.jvmargs}"/>
+                    <customizePrototype/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
+        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <element name="customizePrototype" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
+                    <customizePrototype/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit-prototype>
+                    <customizePrototype>
+                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                        <customize/>
+                    </customizePrototype>
+                </j2seproject3:junit-prototype>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit-prototype>
+                    <customizePrototype>
+                        <batchtest todir="${build.test.results.dir}">
+                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                                <filename name="@{testincludes}"/>
+                            </fileset>
+                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                                <filename name="${test.binarytestincludes}"/>
+                            </fileset>
+                        </batchtest>
+                        <customize/>
+                    </customizePrototype>
+                </j2seproject3:junit-prototype>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+    <target if="${testng.available}" name="-init-macrodef-testng">
+        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+                    <isset property="test.method"/>
+                </condition>
+                <union id="test.set">
+                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
+                </union>
+                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="convert" testname="TestNG tests" workingDir="${work.dir}">
+                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+                    <propertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </propertyset>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <customize/>
+                </testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-test-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <echo>No tests executed.</echo>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <sequential>
+                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customize>
+                </j2seproject3:test-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customizeDebuggee" optional="true"/>
+            <sequential>
+                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+                        <customizeDebuggee/>
+                    </customize>
+                </j2seproject3:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${testng.available}" name="-init-macrodef-testng-debug">
+        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element name="customize2" optional="true"/>
+            <sequential>
+                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+                    <isset property="test.method"/>
+                </condition>
+                <condition else="-suitename convert -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                    <matches pattern=".*\.xml" string="@{testClass}"/>
+                </condition>
+                <delete dir="${build.test.results.dir}" quiet="true"/>
+                <mkdir dir="${build.test.results.dir}"/>
+                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
+                    <customizeDebuggee>
+                        <customize2/>
+                        <jvmarg value="-ea"/>
+                        <arg line="${testng.debug.mode}"/>
+                        <arg line="-d ${build.test.results.dir}"/>
+                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
+                        <arg line="${testng.cmd.args}"/>
+                    </customizeDebuggee>
+                </j2seproject3:debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element implicit="true" name="customize2" optional="true"/>
+            <sequential>
+                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2/>
+                </j2seproject3:testng-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customizeDebuggee>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customizeDebuggee>
+                </j2seproject3:test-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2>
+                        <syspropertyset>
+                            <propertyref prefix="test-sys-prop."/>
+                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                        </syspropertyset>
+                    </customize2>
+                </j2seproject3:testng-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+                end of pre NB7.2 profiling section
+            -->
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.modulepath}" name="modulepath"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <modulepath>
+                        <path path="@{modulepath}"/>
+                    </modulepath>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${module.name}" name="modulename"/>
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.modulepath}" name="modulepath"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customizeDebuggee" optional="true"/>
+            <sequential>
+                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
+                    <customize>
+                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+                        <customizeDebuggee/>
+                    </customize>
+                </j2seproject1:java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${module.name}" name="modulename"/>
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.modulepath}" name="modulepath"/>
+            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <attribute default="jvm" name="jvm"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <modulepath>
+                        <pathelement path="@{modulepath}"/>
+                        <pathelement location="${module.build.classes.dir}"/>
+                    </modulepath>
+                    <upgrademodulepath>
+                        <path path="@{upgrademodulepath}"/>
+                    </upgrademodulepath>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="" name="modulename"/>
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.modulepath}" name="modulepath"/>
+            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <attribute default="jvm" name="jvm"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <modulepath>
+                        <path path="@{modulepath}"/>
+                    </modulepath>
+                    <upgrademodulepath>
+                        <path path="@{upgrademodulepath}"/>
+                    </upgrademodulepath>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="" name="modulename"/>
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="" name="modulepath"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <attribute default="jvm" name="jvm"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <filtermapper>
+                            <replacestring from=" " to="%20"/>
+                        </filtermapper>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
+                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: convert was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean">
+            <param name="no.dependencies" value="true"/>
+        </antcall>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile" name="-check-module-main-class">
+        <pathconvert property="main.class.file">
+            <string value="${main.class}"/>
+            <unpackagemapper from="*" to="*.class"/>
+        </pathconvert>
+        <condition property="do.module.main.class">
+            <and>
+                <isset property="main.class.available"/>
+                <available file="${build.classes.dir}/module-info.class"/>
+                <available file="${build.classes.dir}/${main.class.file}"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
+        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
+        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+            <attribute name="Profile" value="${javac.profile}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
+        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
+            <isset property="named.module.internal"/>
+        </condition>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
+        </pathconvert>
+        <pathconvert property="run.modulepath.with.dist.jar">
+            <path location="${dist.jar.resolved}"/>
+            <path path="${run.modulepath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
+            <isset property="named.module.internal"/>
+        </condition>
+        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
+            <and>
+                <isset property="modules.supported.internal"/>
+                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
+            </and>
+        </condition>
+        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
+            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
+        </condition>
+        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
+            <isset property="do.module.main.class"/>
+        </condition>
+        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
+            <isset property="named.module.internal"/>
+        </condition>
+        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
+            <isset property="main.class.available"/>
+        </condition>
+        <condition else="debug" property="jar.usage.level" value="info">
+            <isset property="main.class.available"/>
+        </condition>
+        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
+    </target>
+    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
+    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                DEPLOY SECTION
+                =================
+            -->
+    <target name="-pre-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init" name="-check-jlink">
+        <condition property="do.jlink.internal">
+            <and>
+                <istrue value="${do.jlink}"/>
+                <isset property="do.archive"/>
+                <isset property="named.module.internal"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
+        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
+        <property name="jlink.launcher.name" value="${application.title}"/>
+        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
+            <and>
+                <isset property="jlink.additionalmodules"/>
+                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
+            </and>
+        </condition>
+        <condition property="jlink.do.strip.internal">
+            <and>
+                <isset property="jlink.strip"/>
+                <istrue value="${jlink.strip}"/>
+            </and>
+        </condition>
+        <condition property="jlink.do.additionalparam.internal">
+            <and>
+                <isset property="jlink.additionalparam"/>
+                <length length="0" string="${jlink.additionalparam}" when="greater"/>
+            </and>
+        </condition>
+        <condition property="jlink.do.launcher.internal">
+            <and>
+                <istrue value="${jlink.launcher}"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
+        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
+        <exec executable="${platform.jlink}">
+            <arg value="--module-path"/>
+            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
+            <arg value="--add-modules"/>
+            <arg value="${jlink.add.modules}"/>
+            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
+            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
+            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
+            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
+            <arg value="--output"/>
+            <arg value="${dist.jlink.output}"/>
+        </exec>
+    </target>
+    <target name="-post-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customizeDebuggee>
+                <arg line="${application.args}"/>
+            </customizeDebuggee>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <!--
+                pre NB7.2 profiler integration
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
+            <customize>
+                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                <jvmarg line="${profiler.info.jvmargs}"/>
+                <classpath>
+                    <path path="${run.test.classpath}"/>
+                </classpath>
+            </customize>
+        </j2seproject3:junit>
+    </target>
+    <!--
+                end of pre NB72 profiling section
+            -->
+    <target if="netbeans.home" name="-profile-check">
+        <condition property="profiler.configured">
+            <or>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+            </or>
+        </condition>
+    </target>
+    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+        <startprofiler/>
+        <antcall target="run"/>
+    </target>
+    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcall target="run-single"/>
+    </target>
+    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
+    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <startprofiler/>
+        <antcall target="test-single"/>
+    </target>
+    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcall target="run-test-with-main"/>
+    </target>
+    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <startprofiler/>
+        <antcall target="run-applet"/>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+            <and>
+                <isset property="endorsed.classpath.cmd.line.arg"/>
+                <not>
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <condition else="" property="bug5101868workaround" value="*.java">
+            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
+        </condition>
+        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
+            <and>
+                <isset property="javadoc.html5"/>
+                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
+            </and>
+        </condition>
+        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+                <exclude name="*.java"/>
+            </fileset>
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
+            <arg line="${javadoc.html5.cmd.line.arg}"/>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                TEST COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
+        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
+        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
+            <and>
+                <isset property="test.module.name"/>
+                <length length="0" string="${test.module.name}" when="greater"/>
+            </and>
+        </condition>
+        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
+            <and>
+                <isset property="test.module.name"/>
+                <length length="0" string="${test.module.name}" when="greater"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
+        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
+            <and>
+                <isset property="test.module.name"/>
+                <length length="0" string="${test.module.name}" when="greater"/>
+            </and>
+        </condition>
+        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
+        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
+        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
+            <chainedmapper>
+                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
+                <filtermapper>
+                    <uniqfilter/>
+                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
+                </filtermapper>
+                <cutdirsmapper dirs="1"/>
+                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
+            </chainedmapper>
+        </pathconvert>
+        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
+            <and>
+                <isset property="test.module.name"/>
+                <length length="0" string="${test.module.name}" when="greater"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
+        <property name="javac.test.sourcepath" value="${empty.dir}"/>
+        <property name="javac.test.compilerargs" value=""/>
+        <property name="run.test.jvmargs" value=""/>
+    </target>
+    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-m

<TRUNCATED>