From bfbe0022222157023bf36080bc8556ead1412cb1 Mon Sep 17 00:00:00 2001 From: coalado Date: Sat, 19 Jan 2013 11:51:04 +0000 Subject: [PATCH] git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@19451 ebf7c1c2-ba36-0410-9fe8-c592906822b4 --- build/newBuild/build.xml | 30 ++----- .../linkcollector/LinkCollector.java | 80 ++++++++++--------- .../views/linkgrabber/AutoConfirmButton.java | 25 +++--- src/org/jdownloader/updatev2/InstallLog.java | 23 +++++- 4 files changed, 87 insertions(+), 71 deletions(-) diff --git a/build/newBuild/build.xml b/build/newBuild/build.xml index 2202763f10..56f264b780 100644 --- a/build/newBuild/build.xml +++ b/build/newBuild/build.xml @@ -152,53 +152,41 @@ - - - + - - - + - - - + - - - + - - - + - - - + @@ -230,9 +218,7 @@ - - - + @@ -307,7 +293,7 @@ - + diff --git a/src/jd/controlling/linkcollector/LinkCollector.java b/src/jd/controlling/linkcollector/LinkCollector.java index 1265fa9d0c..5559a32ecb 100644 --- a/src/jd/controlling/linkcollector/LinkCollector.java +++ b/src/jd/controlling/linkcollector/LinkCollector.java @@ -683,48 +683,54 @@ public class LinkCollector extends PackageController 0) return null; - final LinkCollectorCrawler lc = new LinkCollectorCrawler() { - private LinkCollectingInformation collectingInfo = new LinkCollectingInformation(this, linkChecker); + try { + if (job == null) throw new IllegalArgumentException("job is null"); + lazyInit(); + synchronized (shutdownRequests) { + if (shutdownRequests.get() > 0) return null; + final LinkCollectorCrawler lc = new LinkCollectorCrawler() { + private LinkCollectingInformation collectingInfo = new LinkCollectingInformation(this, linkChecker); - @Override - protected CrawledLink crawledLinkFactorybyURL(String url) { - CrawledLink ret = new CrawledLink(url); - ret.setCollectingInfo(collectingInfo); - ret.setSourceJob(job); - return ret; - } + @Override + protected CrawledLink crawledLinkFactorybyURL(String url) { + CrawledLink ret = new CrawledLink(url); + ret.setCollectingInfo(collectingInfo); + ret.setSourceJob(job); + return ret; + } - @Override - protected void generalCrawledLinkModifier(CrawledLink link) { - crawledLinkModifier(link, job); - } + @Override + protected void generalCrawledLinkModifier(CrawledLink link) { + crawledLinkModifier(link, job); + } - @Override - protected void crawlerStopped() { - eventsender.removeListener(this); - super.crawlerStopped(); - } + @Override + protected void crawlerStopped() { + eventsender.removeListener(this); + super.crawlerStopped(); + } - @Override - protected void crawlerStarted() { - eventsender.addListener(this, true); - super.crawlerStarted(); - } - }; + @Override + protected void crawlerStarted() { + eventsender.addListener(this, true); + super.crawlerStarted(); + } + }; - lc.setFilter(crawlerFilter); - lc.setHandler(this); - String jobText = job.getText(); - /* - * we don't want to keep reference on text during the whole link grabbing/checking/collecting way - */ - job.setText(null); - lc.crawl(jobText, job.getCustomSourceUrl(), job.isDeepAnalyse()); - return lc; + lc.setFilter(crawlerFilter); + lc.setHandler(this); + String jobText = job.getText(); + /* + * we don't want to keep reference on text during the whole link grabbing/checking/collecting way + */ + job.setText(null); + lc.crawl(jobText, job.getCustomSourceUrl(), job.isDeepAnalyse()); + return lc; + } + } catch (VerifyError e) { + Dialog.getInstance().showExceptionDialog("Eclipse Java 1.7 Bug", "This is an eclipse Java 7 bug. See here: http://goo.gl/REs9c\r\nAdd JVM Parameter -XX:-UseSplitVerifier", e); + + throw e; } } diff --git a/src/org/jdownloader/gui/views/linkgrabber/AutoConfirmButton.java b/src/org/jdownloader/gui/views/linkgrabber/AutoConfirmButton.java index 3ea0058fba..45ef8a258d 100644 --- a/src/org/jdownloader/gui/views/linkgrabber/AutoConfirmButton.java +++ b/src/org/jdownloader/gui/views/linkgrabber/AutoConfirmButton.java @@ -32,6 +32,7 @@ import org.appwork.swing.components.ExtButton; import org.appwork.utils.event.predefined.changeevent.ChangeEvent; import org.appwork.utils.event.predefined.changeevent.ChangeListener; import org.appwork.utils.swing.EDTRunner; +import org.appwork.utils.swing.dialog.Dialog; import org.jdownloader.gui.translate._GUI; import org.jdownloader.gui.views.SelectionInfo; import org.jdownloader.gui.views.linkgrabber.actions.ConfirmAction; @@ -136,17 +137,23 @@ public class AutoConfirmButton extends ExtButton implements ChangeListener, Tabl setVisible(false); } }); - LinkCrawler.getEventSender().addListener(new LinkCrawlerListener() { + try { + LinkCrawler.getEventSender().addListener(new LinkCrawlerListener() { - public void onLinkCrawlerEvent(LinkCrawlerEvent event) { - if (event.getCaller() instanceof LinkCollectorCrawler) { - /* - * we only want to react on the LinkCrawler of the LinkCollector - */ - update(); + public void onLinkCrawlerEvent(LinkCrawlerEvent event) { + if (event.getCaller() instanceof LinkCollectorCrawler) { + /* + * we only want to react on the LinkCrawler of the LinkCollector + */ + update(); + } } - } - }); + }); + } catch (VerifyError e) { + Dialog.getInstance().showExceptionDialog("Eclipse Java 1.7 Bug", "This is an eclipse Java 7 bug. See here: http://goo.gl/REs9c\r\nAdd -XX:-UseSplitVerifier as JVM Parameter", e); + + throw e; + } LinkChecker.getEventSender().addListener(new LinkCheckerListener() { public void onLinkCheckerEvent(LinkCheckerEvent event) { diff --git a/src/org/jdownloader/updatev2/InstallLog.java b/src/org/jdownloader/updatev2/InstallLog.java index 66bf20a4c4..c9f4cfb3fa 100644 --- a/src/org/jdownloader/updatev2/InstallLog.java +++ b/src/org/jdownloader/updatev2/InstallLog.java @@ -48,19 +48,36 @@ public class InstallLog { private Collection modifiedRestartRequiredFiles; private Collection modifiedExtensionFiles; + public static final String FILE_EXT_JARSIGNATURE = ".jarSignature"; + + public static final String FILE_EXT_UPDATESIGNATURE = ".updateSignature"; + public static final String FILE_EXT_REMOVEDFILE = ".removed"; + public static final String FILE_EXT_JAR = ".jar"; + public static final String CLIENT_OPTIONS = ".clientOptions"; + public static final String SERVER_OPTIONS = ".serverOptions"; public void add(String relPath) { + if (relPath.endsWith(FILE_EXT_UPDATESIGNATURE)) return; + if (relPath.endsWith(FILE_EXT_JARSIGNATURE)) return; modifiedFiles.add(relPath); - if (relPath.equals("build.json")) { + String check = relPath; + if (check.endsWith(CLIENT_OPTIONS)) { + check = relPath.substring(0, relPath.length() - CLIENT_OPTIONS.length()); + } else if (check.endsWith(SERVER_OPTIONS)) { + check = relPath.substring(0, relPath.length() - SERVER_OPTIONS.length()); + } else if (check.endsWith(FILE_EXT_REMOVEDFILE)) { + check = relPath.substring(0, relPath.length() - FILE_EXT_REMOVEDFILE.length()); + } + if (check.equals("build.json")) { modifiedDirects.add(relPath); return; } - if (relPath.endsWith(".lng")) { + if (check.endsWith(".lng")) { modifiedDirects.add(relPath); return; } - if (relPath.endsWith(".class") && relPath.toLowerCase(Locale.ENGLISH).startsWith("jd/plugins")) { + if (check.endsWith(".class") && check.toLowerCase(Locale.ENGLISH).startsWith("jd/plugins")) { modifiedPlugins.add(relPath); return; }