From 83fe6fed6e812648e032bb7e0ba3911c5ca95482 Mon Sep 17 00:00:00 2001 From: petef Date: Mon, 27 May 2002 04:33:43 +0000 Subject: Fix a critical bug in 1.8.2 & bump PORTREVISION, for details see: http://www.mail-archive.com/cocoon-users@xml.apache.org/msg05651.html PR: 37989 Submitted by: Volker Stolz --- www/cocoon/Makefile | 2 +- www/cocoon/files/patch-Utils.java | 51 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 www/cocoon/files/patch-Utils.java (limited to 'www') diff --git a/www/cocoon/Makefile b/www/cocoon/Makefile index 468bb6f..8df5072 100644 --- a/www/cocoon/Makefile +++ b/www/cocoon/Makefile @@ -7,7 +7,7 @@ PORTNAME= cocoon PORTVERSION= 1.8.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= textproc www java MASTER_SITES= http://xml.apache.org/cocoon/dist/cocoon1/ \ http://www.metaverse.nl/~ernst/ \ diff --git a/www/cocoon/files/patch-Utils.java b/www/cocoon/files/patch-Utils.java new file mode 100644 index 0000000..5f89c38 --- /dev/null +++ b/www/cocoon/files/patch-Utils.java @@ -0,0 +1,51 @@ +$FreeBSD$ + +--- src/org/apache/cocoon/Utils.java.orig Sun May 12 13:30:49 2002 ++++ src/org/apache/cocoon/Utils.java Sun May 12 13:30:58 2002 +@@ -331,16 +331,20 @@ + */ + public static final Object getLocationResource(String location) throws MalformedURLException { + Object resource = null; +- ++ + if (location.indexOf("://") < 0) { + resource = new File(location); + } else if (location.startsWith("resource://")) { + // FIXME (SM): this should _not_ be system resource, but rather a resource of current classloader +- resource = ClassLoader.getSystemResource(location.substring("resource://".length())); ++// resource = ClassLoader.getSystemResource(location.substring("resource://".length())); ++ ++ // The Fix! ++ Dummy classloadrefernce = new Dummy(); ++ resource = classloadrefernce.getClass().getClassLoader().getResource(location.substring("resource://".length())); + } else { + resource = new URL(location); + } +- ++ + return resource; + } + +@@ -362,11 +366,20 @@ + resource = new File(location); + } else if (location.startsWith("resource://")) { + // FIXME (SM): this should _not_ be system resource, but rather a resource of current classloader +- resource = ClassLoader.getSystemResource(location.substring("resource://".length())); ++// resource = ClassLoader.getSystemResource(location.substring("resource://".length())); ++ ++ // The Fix! ++ Dummy classloadrefernce = new Dummy(); ++ resource = classloadrefernce.getClass().getClassLoader().getResource(location.substring("resource://".length())); + } else { + resource = new URL(location); + } +- ++ + return resource; + } ++ ++} ++ ++class Dummy { ++ String why = "to provide a classloader ref"; + } -- cgit v1.1