diff --git a/.gitignore b/.gitignore index 622b946..16ba627 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /icedtea-web-1.7pre-RC05.tar.gz /icedtea-web-1.7pre-RC06.tar.gz /icedtea-web-1.7.tar.gz +/icedtea-web-1.7.1.tar.gz diff --git a/icedtea-web.spec b/icedtea-web.spec index 9a60ead..e0f1b1f 100644 --- a/icedtea-web.spec +++ b/icedtea-web.spec @@ -16,8 +16,8 @@ %define preffered_java java-%{javaver}-openjdk Name: icedtea-web -Version: 1.7 -Release: 6%{?dist} +Version: 1.7.1 +Release: 1%{?dist} Summary: Additional Java components for OpenJDK - Java browser plug-in and Web Start implementation # will become arched again with rust on board BuildArch: noarch @@ -26,7 +26,6 @@ Group: Applications/Internet License: LGPLv2+ and GPLv2 with exceptions URL: http://icedtea.classpath.org/wiki/IcedTea-Web Source0: http://icedtea.classpath.org/download/source/%{name}-%{version}.tar.gz -Patch1: selectedPatches.patch BuildRequires: javapackages-tools #for deprecated add_maven_depmap, see https://www.spinics.net/lists/fedora-devel/msg233211.html @@ -105,7 +104,6 @@ This package contains ziped sources of the IcedTea-Web project. %prep %setup -q -%patch1 -p1 %build autoreconf -vfi @@ -225,6 +223,9 @@ exit 0 %license COPYING %changelog +* Mon Dec 18 2017 Jiri Vanek 1.7.1-1 +* bump to 1.7.1 + * Fri Nov 03 2017 Jiri Vanek 1.7-6 - javaws specific manpage renmed from -suffix to .suffix diff --git a/selectedPatches.patch b/selectedPatches.patch deleted file mode 100644 index ba16f1f..0000000 --- a/selectedPatches.patch +++ /dev/null @@ -1,794 +0,0 @@ -diff -r 7560f34ddab8 -r b3564f5e62ff launcher/launchers.in ---- a/launcher/launchers.in Thu Jul 20 18:10:10 2017 +0200 -+++ b/launcher/launchers.in Tue Sep 12 09:25:10 2017 +0200 -@@ -167,6 +167,10 @@ - k=$((k+1)) - COMMAND[k]="java.base/sun.net.www.protocol.http=ALL-UNNAMED,java.desktop" - k=$((k+1)) -+COMMAND[k]="--add-exports" -+k=$((k+1)) -+COMMAND[k]="java.desktop/sun.applet=ALL-UNNAMED,jdk.jsobject" -+k=$((k+1)) - fi - - -diff -r 7560f34ddab8 -r b3564f5e62ff plugin/icedteanp/IcedTeaNPPlugin.cc ---- a/plugin/icedteanp/IcedTeaNPPlugin.cc Thu Jul 20 18:10:10 2017 +0200 -+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Tue Sep 12 09:25:10 2017 +0200 -@@ -1588,7 +1588,8 @@ - "java.naming/com.sun.jndi.toolkit.url=ALL-UNNAMED,java.desktop", - "java.desktop/sun.applet=ALL-UNNAMED,java.desktop", - "java.base/sun.security.action=ALL-UNNAMED,java.desktop", -- "java.base/sun.net.www.protocol.http=ALL-UNNAMED,java.desktop" -+ "java.base/sun.net.www.protocol.http=ALL-UNNAMED,java.desktop", -+ "java.desktop/sun.applet=ALL-UNNAMED,jdk.jsobject" - }; - - NPError -diff -r b3564f5e62ff -r 31922f65280b configure.ac ---- a/configure.ac Tue Sep 12 09:25:10 2017 +0200 -+++ b/configure.ac Tue Sep 12 09:56:48 2017 +0200 -@@ -95,7 +95,6 @@ - IT_CHECK_FOR_CLASS(JAVA_NET_HTTPCOOKIE, [java.net.HttpCookie], [some.pkg], []) - IT_CHECK_FOR_CLASS(JAVA_NET_COOKIEHANDLER, [java.net.CookieHandler], [some.pkg], []) - # in jdk9, those classes are using internal apis, must be enabled via module cheats --IT_CHECK_FOR_CLASS(SUN_SECURITY_PROVIDER_X509FACTORY, [sun.security.provider.X509Factory], [some.pkg], [$JAVA_BASE]) - IT_CHECK_FOR_CLASS(SUN_SECURITY_UTIL_SECURITYCONSTANTS, [sun.security.util.SecurityConstants], [some.pkg], [$JAVA_BASE]) - IT_CHECK_FOR_CLASS(SUN_SECURITY_UTIL_HOSTNAMECHECKER, [sun.security.util.HostnameChecker], [some.pkg], [$JAVA_BASE]) - IT_CHECK_FOR_CLASS(SUN_SECURITY_X509_X500NAME, [sun.security.x509.X500Name], [some.pkg], [$JAVA_BASE]) -diff -r b3564f5e62ff -r 31922f65280b netx/net/sourceforge/jnlp/security/CertificateUtils.java ---- a/netx/net/sourceforge/jnlp/security/CertificateUtils.java Tue Sep 12 09:25:10 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/security/CertificateUtils.java Tue Sep 12 09:56:48 2017 +0200 -@@ -58,7 +58,6 @@ - import net.sourceforge.jnlp.runtime.Translator; - import net.sourceforge.jnlp.util.logging.OutputController; - import net.sourceforge.jnlp.util.replacements.BASE64Encoder; --import sun.security.provider.X509Factory; - - /** - * Common utilities to manipulate certificates. Provides methods to add -@@ -193,9 +192,9 @@ - CertificateException { - - BASE64Encoder encoder = new BASE64Encoder(); -- out.println(X509Factory.BEGIN_CERT); -+ out.println("-----BEGIN CERTIFICATE-----"); - encoder.encodeBuffer(cert.getEncoded(), out); -- out.println(X509Factory.END_CERT); -+ out.println("-----END CERTIFICATE-----"); - } - - public static void dumpPKCS12(String alias, File file, KeyStore ks, char[] password) -diff -r 31922f65280b -r 0ef6f6c93476 Makefile.am ---- a/Makefile.am Tue Sep 12 09:56:48 2017 +0200 -+++ b/Makefile.am Tue Sep 12 10:16:24 2017 +0200 -@@ -218,6 +218,9 @@ - if ENABLE_DOCS - JAVADOC_OPTS=-use -keywords -encoding UTF-8 -splitIndex \ - -bottom ' Submit a bug or feature' -+if HAVE_JAVA9 -+JAVADOC_OPTS+=-source $(IT_LANGUAGE_SOURCE_VERSION) -+endif - if JAVADOC_SUPPORTS_J_OPTIONS - JAVADOC_MEM_OPTS=-J-Xmx1024m -J-Xms128m - endif -diff -r 0ef6f6c93476 -r e9102a5cb03c AUTHORS ---- a/AUTHORS Tue Sep 12 10:16:24 2017 +0200 -+++ b/AUTHORS Thu Sep 14 15:13:49 2017 +0200 -@@ -11,7 +11,7 @@ - Adam Domurad - Lukasz Dracz - Thomas Fitzsimmons --Michał Górny < mgorny@gentoo.org > -+Michał Górny - Mark Greenwood - Tereza Hlavackova - Peter Hatina -@@ -43,6 +43,5 @@ - Man Lung Wong - - This project also includes code from the following projects: -- - OpenJDK - Netx -diff -r 0ef6f6c93476 -r e9102a5cb03c Makefile.am ---- a/Makefile.am Tue Sep 12 10:16:24 2017 +0200 -+++ b/Makefile.am Thu Sep 14 15:13:49 2017 +0200 -@@ -730,6 +730,7 @@ - HTML_DOCS_TARGET_DIR="$(DOCS_DIR)/html" ; \ - PLAIN_DOCS_TARGET_DIR="$(DOCS_DIR)/plain" ; \ - MAN_DOCS_TARGET_DIR="$(DOCS_DIR)/man" ; \ -+ AUTHORS_FILE_TARGET="$(TOP_SRC_DIR)/AUTHORS" ; \ - mkdir "$$HTML_DOCS_TARGET_DIR" ; \ - mkdir "$$PLAIN_DOCS_TARGET_DIR" ; \ - mkdir "$$MAN_DOCS_TARGET_DIR" ; \ -@@ -745,16 +746,16 @@ - export LANG=$$LANG_ID; \ - mkdir "$$HTML_DOCS_TARGET_DIR/$$ID" ; \ - echo "
  • $$LANG_ID
  • " >> "$$HTML_DOCS_INDEX" ; \ -- $$TP_COMMAND html "$$HTML_DOCS_TARGET_DIR/$$ID" $$TP_TAIL ; \ -+ $$TP_COMMAND html "$$HTML_DOCS_TARGET_DIR/$$ID" $$TP_TAIL "-authorFile=$$AUTHORS_FILE_TARGET" ; \ - mkdir "$$PLAIN_DOCS_TARGET_DIR/$$ID" ; \ -- $$TP_COMMAND plain "$$PLAIN_DOCS_TARGET_DIR/$$ID" 160 $$TP_TAIL; \ -+ $$TP_COMMAND plain "$$PLAIN_DOCS_TARGET_DIR/$$ID" 160 $$TP_TAIL "-authorFile=$$AUTHORS_FILE_TARGET" ; \ - if [ $$ID = "en" ] ; then \ - MAN_DESC="$$MAN_DOCS_TARGET_DIR/man1" ; \ - else \ - MAN_DESC="$$MAN_DOCS_TARGET_DIR/$$ID/man1" ; \ - fi ; \ - mkdir -p "$$MAN_DESC" ; \ -- $$TP_COMMAND man $$ENCOD "$$MAN_DESC" $$TP_TAIL ; \ -+ $$TP_COMMAND man $$ENCOD "$$MAN_DESC" $$TP_TAIL "-authorFile=$$AUTHORS_FILE_TARGET" ; \ - $$TP_COMMAND htmlIntro "$(NETX_DIR)/net/sourceforge/jnlp/resources/about_$$ID.html" $$TP_TAIL; \ - done ; \ - export LANG=$$LANG_BACKUP ; \ -diff -r 0ef6f6c93476 -r e9102a5cb03c netx/net/sourceforge/jnlp/resources/Messages.properties ---- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Sep 12 10:16:24 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Sep 14 15:13:49 2017 +0200 -@@ -30,6 +30,7 @@ - BUTback=Back - BUTforward=Forward - BUTreload=Reload -+ITWdocsMissingAuthors=See authors file - - HEADLESS_MISSCONFIGURED=Headless check failed. You are forced to run without any graphics. IcedTea-Web can run like this, but your app probably not. This is likely bug in your system. - -diff -r 0ef6f6c93476 -r e9102a5cb03c netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java ---- a/netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java Tue Sep 12 10:16:24 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java Thu Sep 14 15:13:49 2017 +0200 -@@ -33,18 +33,23 @@ - this exception to your version of the library, but you are not - obligated to do so. If you do not wish to do so, delete this - exception statement from your version. --*/ -- -+ */ - package net.sourceforge.jnlp.util.docprovider; - -+import java.io.BufferedReader; - import java.io.BufferedWriter; - import java.io.File; -+import java.io.FileInputStream; - import java.io.FileOutputStream; - import java.io.IOException; - import java.io.InputStream; -+import java.io.InputStreamReader; - import java.io.OutputStream; - import java.io.OutputStreamWriter; -+import java.io.Reader; - import java.io.Writer; -+import java.util.ArrayList; -+import java.util.Arrays; - import java.util.Collections; - import java.util.Comparator; - import java.util.List; -@@ -63,13 +68,16 @@ - import net.sourceforge.jnlp.util.docprovider.formatters.formatters.ReplacingTextFormatter; - - public abstract class TextsProvider { -+ -+ private static File authorFileFromUserInput = null; - - private final String encoding; - private final Formatter formatter; - private final boolean forceTitles; - protected final boolean expandVariables; - private boolean prepared = false; -- -+ private File authorFilePath = null; -+ - private boolean introduction = true; - private boolean synopsis = true; - private boolean description = true; -@@ -184,7 +192,6 @@ - for (Map.Entry> entry : defs) { - if (matchSttingsValueWithInfrastrucutreFile(entry.getValue(), f)) { - controlledBy = " " + Translator.R("BUTControlledBy", getFormatter().getBold(entry.getKey())); -- - break; - } - } -@@ -271,13 +278,9 @@ - public String getAuthors() { - if (forceTitles) { - return getFormatter().getTitle(ManFormatter.KnownSections.AUTHOR) -- + getFormatter().wrapParagraph( -- getFormatter().process(Translator.R("ITWTBdebug")) -- + getFormatter().getNewLine()); -+ + generateAuthorsSection(authorFilePath); - } else { -- return getFormatter().wrapParagraph( -- getFormatter().process(Translator.R("ITWTBdebug")) -- + getFormatter().getNewLine()); -+ return generateAuthorsSection(authorFilePath); - } - } - -@@ -399,7 +402,7 @@ - public static void main(String[] args) throws IOException { - // Shutdown hook from OutputController was causing hanging build on Windows. It's not used on headless. - JNLPRuntime.setHeadless(true); -- -+ - if (args.length == 0) { - System.out.println(" * IcedTea-Web self documentation tool list of arguments *"); - System.out.println(" * argument version - last parameter of each command, is used when there is no internal versionknown *"); -@@ -412,24 +415,38 @@ - System.out.println("man encoding targetDir expand version - will generate man documentation to target dir in desired encoding"); - System.out.println("plain targetDir maxLineWidth expand version - will generate plain text documentation to target dir in desired encoding"); - System.out.println(" - maxLineWidth is in <5," + Integer.MAX_VALUE + ">"); -+ System.out.println("to generate informations about authors from a file, use argument '-authorFile' with path to AUTHORS file located in icedtea-web." -+ + "\n eg. -authorFile=/home/user/icedtea-web/AUTHORS"); - } else { -- ReplacingTextFormatter.backupVersion = args[args.length - 1]; -- boolean expand = Boolean.valueOf(args[args.length - 2]); -- switch (args[0]) { -+ List argsList = new ArrayList<>(); -+ argsList.addAll(Arrays.asList(args)); -+ for (String s : argsList) { -+ if (s.startsWith("-authorFile=")) { -+ authorFileFromUserInput = new File(s.split("=")[1]); -+ if (!authorFileFromUserInput.exists()) { -+ throw new RuntimeException(authorFileFromUserInput.getAbsolutePath() + " does not exists"); -+ } -+ argsList.remove(s); -+ break; -+ } -+ } -+ ReplacingTextFormatter.backupVersion = argsList.get(argsList.size() - 1); -+ boolean expand = Boolean.valueOf(argsList.get(argsList.size() - 2)); -+ switch (argsList.get(0)) { - case "all": - generateAll(new File(System.getProperty("user.dir")), expand); - break; - case "html": -- generateOnlineHtmlHelp(new File(args[1]), expand); -+ generateOnlineHtmlHelp(new File(argsList.get(1)), expand); - break; - case "htmlIntro": -- generateItwIntro(new File(args[1]), expand); -+ generateItwIntro(new File(argsList.get(1)), expand); - break; - case "man": -- generateManText(args[1], new File(args[2]), expand); -+ generateManText(argsList.get(1), new File(argsList.get(2)), expand); - break; - case "plain": -- generatePlainTextDocs(new File(args[1]), Integer.valueOf(args[2]), expand); -+ generatePlainTextDocs(new File(argsList.get(1)), Integer.valueOf(argsList.get(2)), expand); - break; - default: - System.out.println("unknown param"); -@@ -441,6 +458,7 @@ - - public static void generateItwIntro(File f, boolean expand) throws IOException { - IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider("utf-8", new HtmlFormatter(false, true, false), false, expand); -+ //!!AUTHORS FILE IS NOT NEEDED IN THIS METHOD, AUTHORS ARE GENERATED SEPARATELY INTO ANOTHER TAB - itw.setSeeAlso(false); - itw.writeToFile(f); - } -@@ -481,15 +499,15 @@ - } - } - JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); -- javaws.writeToDir(dir); - ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); -- itws.writeToDir(dir); - PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); -- pe.writeToDir(dir); - IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); -- itw.writeToDir(dir); - ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); -- pl.writeToDir(dir); -+ TextsProvider[] providers = new TextsProvider[]{javaws, itws, pe, itw, pl}; -+ for (TextsProvider provider : providers) { -+ provider.setAuthorFilePath(authorFileFromUserInput); -+ provider.writeToDir(dir); -+ } - - } - -@@ -499,15 +517,15 @@ - - public static void generateManText(String encoding, File dir, boolean titles, boolean expand) throws IOException { - JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new ManFormatter(), titles, expand); -- javaws.writeToDir(dir); - ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new ManFormatter(), titles, expand); -- itws.writeToDir(dir); - PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new ManFormatter(), titles, expand); -- pe.writeToDir(dir); - IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new ManFormatter(), titles, expand); -- itw.writeToDir(dir); - ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new ManFormatter(), titles, expand); -- pl.writeToDir(dir); -+ TextsProvider[] providers = new TextsProvider[]{javaws, itws, pe, itw, pl}; -+ for (TextsProvider provider : providers) { -+ provider.setAuthorFilePath(authorFileFromUserInput); -+ provider.writeToDir(dir); -+ } - - } - -@@ -517,15 +535,15 @@ - - public static void generatePlainTextDocs(String encoding, File dir, String indent, int lineWidth, boolean titles, boolean expand) throws IOException { - JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); -- javaws.writeToDir(dir); - ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); -- itws.writeToDir(dir); - PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); -- pe.writeToDir(dir); - IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); -- itw.writeToDir(dir); - ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); -- pl.writeToDir(dir); -+ TextsProvider[] providers = new TextsProvider[]{javaws, itws, pe, itw, pl}; -+ for(TextsProvider provider : providers){ -+ provider.setAuthorFilePath(authorFileFromUserInput); -+ provider.writeToDir(dir); -+ } - - } - -@@ -671,6 +689,11 @@ - this.authors = authors; - } - -+ public void setAuthorFilePath(File authorFilePath) { -+ this.authorFilePath = authorFilePath; -+ } -+ -+ - /** - * @return the seeAlso - */ -@@ -695,4 +718,55 @@ - return s; - } - -+ private String readAuthors(File authors) { -+ try { -+ return readAuthorsImpl(authors); -+ } catch (IOException e) { -+ throw new RuntimeException(e); -+ } -+ } -+ -+ private String readAuthorsImpl(File authors) throws IOException { -+ return readAuthorsImpl(new InputStreamReader(new FileInputStream(authors), "UTF-8")); -+ -+ } -+ -+ String readAuthorsImpl(Reader authors) throws IOException { -+ StringBuilder sb = new StringBuilder(); -+ boolean areAuthors = false; -+ BufferedReader reader = new BufferedReader(authors); -+ while (true) { -+ String line = reader.readLine(); -+ if (line == null) { -+ break; -+ } -+ if (line.trim().isEmpty()) { -+ areAuthors = !areAuthors; -+ } -+ if (getFormatter() instanceof HtmlFormatter) { -+ String replace = line.replaceAll("<", "<"); -+ String replaceAll = replace.replaceAll(">", ">"); -+ sb.append(getFormatter().process(replaceAll)); -+ } else { -+ sb.append(getFormatter().process(line)); -+ } -+ if (getFormatter() instanceof HtmlFormatter || areAuthors == false) { -+ sb.append(getFormatter().getNewLine()); -+ } -+ } -+ return sb.toString(); -+ } -+ -+ private String generateAuthorsSection(File filePath) { -+ if (filePath == null) { -+ return getFormatter().wrapParagraph( -+ getFormatter().process(Translator.R("ITWdocsMissingAuthors")) -+ + getFormatter().getNewLine()); -+ } else { -+ return getFormatter().wrapParagraph( -+ getFormatter().process(readAuthors(filePath)) -+ + getFormatter().getNewLine()); -+ } -+ } - } -+ -diff -r 0ef6f6c93476 -r e9102a5cb03c tests/netx/unit/net/sourceforge/jnlp/util/docprovider/ReadAutorsTest.java ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/ReadAutorsTest.java Thu Sep 14 15:13:49 2017 +0200 -@@ -0,0 +1,155 @@ -+/* ReadAutorsTest.java -+ Copyright (C) 2017 Red Hat, Inc. -+ -+This file is part of IcedTea. -+ -+IcedTea is free software; you can redistribute it and/or -+modify it under the terms of the GNU General Public License as published by -+the Free Software Foundation, version 2. -+ -+IcedTea is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with IcedTea; see the file COPYING. If not, write to -+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+02110-1301 USA. -+ -+Linking this library statically or dynamically with other modules is -+making a combined work based on this library. Thus, the terms and -+conditions of the GNU General Public License cover the whole -+combination. -+ -+As a special exception, the copyright holders of this library give you -+permission to link this library with independent modules to produce an -+executable, regardless of the license terms of these independent -+modules, and to copy and distribute the resulting executable under -+terms of your choice, provided that you also meet, for each linked -+independent module, the terms and conditions of the license of that -+module. An independent module is a module which is not derived from -+or based on this library. If you modify this library, you may extend -+this exception to your version of the library, but you are not -+obligated to do so. If you do not wish to do so, delete this -+exception statement from your version. -+ */ -+ -+package net.sourceforge.jnlp.util.docprovider; -+ -+import java.io.IOException; -+import java.io.StringReader; -+import net.sourceforge.jnlp.util.docprovider.formatters.formatters.HtmlFormatter; -+import net.sourceforge.jnlp.util.docprovider.formatters.formatters.ManFormatter; -+import net.sourceforge.jnlp.util.docprovider.formatters.formatters.PlainTextFormatter; -+import static org.junit.Assert.assertEquals; -+import org.junit.Test; -+ -+public class ReadAutorsTest { -+ -+ public static final String NEWLINE = System.getProperty("line.separator"); -+ public static final String HTMLNEWLINE = "
    "; -+ public static final String MANNEWLINE = ".br"; -+ -+ public static final String TESTTEXT = "<<>><><>" + NEWLINE + "<><><>"; -+ public static final String BRACKETSTESTREPLACEDHTML = "<test@test.test><<>><><>" + HTMLNEWLINE + NEWLINE + "<><><>" + HTMLNEWLINE + NEWLINE; -+ public static final String BRACKETSTESTREPLACEDMAN = "<<>><><>" + NEWLINE + MANNEWLINE + NEWLINE + "<><><>" + NEWLINE + MANNEWLINE + NEWLINE; -+ public static final String BRACKETSTESTREPLACEDPLAIN = TESTTEXT + NEWLINE; -+ -+ public static final String FILESTREAM = "RANDOM TEXT" + NEWLINE + "RANDOM TEXT" + NEWLINE -+ + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE; -+ public static final String FILESTREAMHTML = "RANDOM TEXT" + HTMLNEWLINE + NEWLINE + "RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + HTMLNEWLINE + NEWLINE -+ + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE; -+ public static final String FILESTREAMPLAIN = "RANDOM TEXT" + NEWLINE + "RANDOM TEXT" + NEWLINE -+ + "ANOTHER RANDOM TEXT" -+ + "ANOTHER RANDOM TEXT" -+ + "ANOTHER RANDOM TEXT" -+ + "ANOTHER RANDOM TEXT" -+ + "ANOTHER RANDOM TEXT" -+ + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE -+ + "MORE RANDOM TEXT" + NEWLINE; -+ -+ @Test -+ public void replaceBracketsWithEntitiesHtml() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new HtmlFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test1"; -+ } -+ }; -+ String output = tp.readAuthorsImpl(new StringReader(TESTTEXT)); -+ assertEquals(BRACKETSTESTREPLACEDHTML, output); -+ } -+ -+ @Test -+ public void replaceBracketsWithEntitiesMan() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new ManFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test2"; -+ } -+ }; -+ String output = tp.readAuthorsImpl(new StringReader(TESTTEXT)); -+ assertEquals(BRACKETSTESTREPLACEDMAN, output); -+ } -+ -+ @Test -+ public void replaceBracketsWithEntitiesPlain() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new PlainTextFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test3"; -+ } -+ }; -+ String output = tp.readAuthorsImpl(new StringReader(TESTTEXT)); -+ assertEquals(BRACKETSTESTREPLACEDPLAIN, output); -+ } -+ -+ @Test -+ public void newLineTestHtml() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new HtmlFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test4"; -+ } -+ }; -+ String output = tp.readAuthorsImpl(new StringReader(FILESTREAM)); -+ assertEquals(FILESTREAMHTML, output); -+ -+ } -+ -+ @Test -+ public void newLineTestPlainText() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new PlainTextFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test5"; -+ } -+ }; -+ String output = tp.readAuthorsImpl(new StringReader(FILESTREAM)); -+ assertEquals(FILESTREAMPLAIN, output); -+ -+ } -+} -diff -r e9102a5cb03c -r 676a6ba5bc31 netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java ---- a/netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java Thu Sep 14 15:13:49 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java Mon Sep 25 18:05:33 2017 +0200 -@@ -743,13 +743,7 @@ - if (line.trim().isEmpty()) { - areAuthors = !areAuthors; - } -- if (getFormatter() instanceof HtmlFormatter) { -- String replace = line.replaceAll("<", "<"); -- String replaceAll = replace.replaceAll(">", ">"); -- sb.append(getFormatter().process(replaceAll)); -- } else { -- sb.append(getFormatter().process(line)); -- } -+ sb.append(getFormatter().process(getFormatter().getAdressLink(line))); - if (getFormatter() instanceof HtmlFormatter || areAuthors == false) { - sb.append(getFormatter().getNewLine()); - } -diff -r e9102a5cb03c -r 676a6ba5bc31 netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java ---- a/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java Thu Sep 14 15:13:49 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java Mon Sep 25 18:05:33 2017 +0200 -@@ -74,5 +74,9 @@ - public String getTail(); - - public String getFileSuffix(); -+ -+ public String getAdressLink(String s); -+ -+ public String replaceLtGtCharacters(String s); - - } -diff -r e9102a5cb03c -r 676a6ba5bc31 netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java ---- a/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java Thu Sep 14 15:13:49 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java Mon Sep 25 18:05:33 2017 +0200 -@@ -33,8 +33,7 @@ - this exception to your version of the library, but you are not - obligated to do so. If you do not wish to do so, delete this - exception statement from your version. --*/ -- -+ */ - package net.sourceforge.jnlp.util.docprovider.formatters.formatters; - - import java.util.Date; -@@ -43,14 +42,15 @@ - import java.util.TreeMap; - import net.sourceforge.jnlp.runtime.JNLPRuntime; - -- - public class HtmlFormatter extends ReplacingTextFormatter { - - private final Map content = new TreeMap<>(); - private final boolean allowContext; - private final boolean allowLogo; - private final boolean includeXmlHeader; -- public static final String SUFFIX = "html"; -+ private final String lT = "<"; -+ private final String gT = ">"; -+ public static final String SUFFIX = "html"; - - @Override - public String process(String s) { -@@ -58,7 +58,6 @@ - return s; - } - -- - public HtmlFormatter(boolean allowContext, boolean allowLogo, boolean includeXmlHeader) { - this.allowContext = allowContext; - this.allowLogo = allowLogo; -@@ -146,7 +145,7 @@ - - @Override - public String getFileSuffix() { -- return "."+SUFFIX; -+ return "." + SUFFIX; - } - - @Override -@@ -182,4 +181,30 @@ - return "
  • " + key + " - " + process(value) + "
  • "; - } - -+ @Override -+ public String getAdressLink(String s) { -+ String emailDelBracket = s.replaceAll(".*<", ""); -+ String adress = emailDelBracket.replaceAll(">.*", ""); -+ if (s.contains("@")) { -+ String name = s.replaceAll("<.*", "").trim(); -+ return "" + name + ""; -+ } else { -+ return s.replaceAll("<.*>", "" + adress + ""); -+ } -+ } -+ -+ @Override -+ public String replaceLtGtCharacters(String s) { -+ String replaceLt = s.replaceAll("<", lT); -+ String replaceLtGt = replaceLt.replaceAll(">", gT); -+ return replaceLtGt; -+ } -+ -+ private static String antiSpam(String adress) { -+ StringBuilder sb = new StringBuilder(); -+ for (int x = 0; x < adress.length(); x++) { -+ sb.append(adress.charAt(x)).append(" "); -+ } -+ return sb.toString().trim(); -+ } - } -diff -r e9102a5cb03c -r 676a6ba5bc31 netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java ---- a/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java Thu Sep 14 15:13:49 2017 +0200 -+++ b/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java Mon Sep 25 18:05:33 2017 +0200 -@@ -99,8 +99,16 @@ - return sb.toString(); - } - -+ @Override -+ public String getAdressLink(String s) { -+ return s; -+ } - -- -+ @Override -+ public String replaceLtGtCharacters(String s) { -+ return s; -+ } -+ - - - } -diff -r e9102a5cb03c -r 676a6ba5bc31 tests/netx/unit/net/sourceforge/jnlp/util/docprovider/ReadAutorsTest.java ---- a/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/ReadAutorsTest.java Thu Sep 14 15:13:49 2017 +0200 -+++ b/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/ReadAutorsTest.java Mon Sep 25 18:05:33 2017 +0200 -@@ -50,46 +50,48 @@ - public static final String NEWLINE = System.getProperty("line.separator"); - public static final String HTMLNEWLINE = "
    "; - public static final String MANNEWLINE = ".br"; -+ private static final String ANTISPAM_EMAIL="t e s t @ t e s t . t e s t"; - -- public static final String TESTTEXT = "<<>><><>" + NEWLINE + "<><><>"; -- public static final String BRACKETSTESTREPLACEDHTML = "<test@test.test><<>><><>" + HTMLNEWLINE + NEWLINE + "<><><>" + HTMLNEWLINE + NEWLINE; -- public static final String BRACKETSTESTREPLACEDMAN = "<<>><><>" + NEWLINE + MANNEWLINE + NEWLINE + "<><><>" + NEWLINE + MANNEWLINE + NEWLINE; -+ public static final String TESTTEXT = "NAME SURNAME " + NEWLINE + "<><><>"; -+ public static final String BRACKETSTESTREPLACED = "NAME SURNAME <test@test.test>" + NEWLINE + "<><><>"; -+ public static final String BRACKETSTESTREPLACEDHTML = "NAME SURNAME" + HTMLNEWLINE + NEWLINE + "" + HTMLNEWLINE + NEWLINE; -+ public static final String BRACKETSTESTREPLACEDMAN = "NAME SURNAME " + NEWLINE + MANNEWLINE + NEWLINE + "<><><>" + NEWLINE + MANNEWLINE + NEWLINE; - public static final String BRACKETSTESTREPLACEDPLAIN = TESTTEXT + NEWLINE; - -- public static final String FILESTREAM = "RANDOM TEXT" + NEWLINE + "RANDOM TEXT" + NEWLINE -+ public static final String FILESTREAM = "This is autor list." + NEWLINE + "This is random text." + NEWLINE - + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" + NEWLINE -+ + "NAME SURNAME " + NEWLINE -+ + "NAME SURNAME " + NEWLINE -+ + "NAME SURNAME " + NEWLINE -+ + "NAME SURNAME " + NEWLINE -+ + "NAME SURNAME " + NEWLINE -+ + "NAME SURNAME " + NEWLINE - + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE; -- public static final String FILESTREAMHTML = "RANDOM TEXT" + HTMLNEWLINE + NEWLINE + "RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "This is list with links" + NEWLINE -+ + "OpenJDK " + NEWLINE -+ + "OpenJDK " + NEWLINE; -+ public static final String FILESTREAMHTML = "This is autor list." + HTMLNEWLINE + NEWLINE + "This is random text." + HTMLNEWLINE + NEWLINE - + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "ANOTHER RANDOM TEXT" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE -+ + "NAME SURNAME" + HTMLNEWLINE + NEWLINE - + HTMLNEWLINE + NEWLINE -- + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE -- + "MORE RANDOM TEXT" + HTMLNEWLINE + NEWLINE; -- public static final String FILESTREAMPLAIN = "RANDOM TEXT" + NEWLINE + "RANDOM TEXT" + NEWLINE -- + "ANOTHER RANDOM TEXT" -- + "ANOTHER RANDOM TEXT" -- + "ANOTHER RANDOM TEXT" -- + "ANOTHER RANDOM TEXT" -- + "ANOTHER RANDOM TEXT" -- + "ANOTHER RANDOM TEXT" + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE -- + "MORE RANDOM TEXT" + NEWLINE; -+ + "This is list with links" + HTMLNEWLINE + NEWLINE -+ + "OpenJDK http://openjdk.java.net/" + HTMLNEWLINE + NEWLINE -+ + "OpenJDK http://openjdk.java.net/" + HTMLNEWLINE + NEWLINE; -+ public static final String FILESTREAMPLAIN = "This is autor list." + NEWLINE + "This is random text." + NEWLINE -+ + "NAME SURNAME " -+ + "NAME SURNAME " -+ + "NAME SURNAME " -+ + "NAME SURNAME " -+ + "NAME SURNAME " -+ + "NAME SURNAME " + NEWLINE -+ + "This is list with links" + NEWLINE -+ + "OpenJDK " + NEWLINE -+ + "OpenJDK " + NEWLINE; - - @Test - public void replaceBracketsWithEntitiesHtml() throws IOException { -@@ -150,6 +152,17 @@ - }; - String output = tp.readAuthorsImpl(new StringReader(FILESTREAM)); - assertEquals(FILESTREAMPLAIN, output); -- -+ } -+ -+ @Test -+ public void replaceLtGtTest() throws IOException { -+ TextsProvider tp = new TextsProvider("utf-8", new HtmlFormatter(), true, true) { -+ @Override -+ public String getId() { -+ return "test6"; -+ } -+ }; -+ String output = tp.getFormatter().replaceLtGtCharacters(TESTTEXT); -+ assertEquals(BRACKETSTESTREPLACED, output); - } - } diff --git a/sources b/sources index 391fb68..dcd0568 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (icedtea-web-1.7.tar.gz) = 8542399869462c004d6654ac62fa3c8368369c1f9ebf30642644bcee4600c538ccfa9ce066879dc3da04993508f623c6382237253b4dc59b36d06a2d255543d7 +SHA512 (icedtea-web-1.7.1.tar.gz) = 9415fc8a2ba03e8ab050f760c2ace3d8cd72bc363491569baef416452ffdb2f55813264af1dce4369a575339bb6d43aef7f04bb05b06808a3ba6aaf3b6cdd627