Re: Proposed patch for JDTCompiler

2014-05-10 Thread Rémy Maucherat
2014-05-06 19:25 GMT+02:00 Christopher Schultz :

>
> Since this is not really a "bug" per se, I decided not to create a BZ
> issue. If it would be easier for everyone if I attached the patch to a
> BZ issue I'm happy to do that as well.
>

Ok, but this is not a review then commit branch, so you can commit it
without asking. I think it is a good idea to ask for comments for features
and significant refactorings, but this one looks like a regular enhancement.

Rémy


Re: JDK 9 build 06 is available on java.net

2014-05-10 Thread Mark Thomas
On 02/05/2014 12:39, Rory O'Donnell Oracle, Dublin Ireland wrote:
> Hi Mark,
> 
> The fix for JDK-8039751
>  fix  is in 9 b10, now
> available for download  .
> 
> Can you test and let me know results, assuming a fix we will them work
> on backports.

The Tomcat UTF-8 tests now all pass without having to add any
workarounds for bugs in the JRE provided UTF-8 decoder.

This looks good to back-port to me.

Cheers,

Mark


> 
> Rgds,Rory
> 
> 
> On 09/04/2014 14:36, Rory O'Donnell Oracle, Dublin ireland wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8039751
>>
>> Dalibor has written a blog
>>  on how to track your
>> issues in the
>> JDK bug system. I hope this helps.
>>
>> Rgds,Rory
>>
>> On 04/ 9/14 01:25 PM, Mark Thomas wrote:
>>> On 09/04/2014 05:59, Mark Thomas wrote:
 On 09/04/2014 05:14, Rory O'Donnell Oracle, Dublin ireland wrote:
> Hi Mark,
>
> If you log a bug, send me the incident number, I will follow
> it up.
 I'll see if I can find the incident number for the bug I already
 reported but I think I deleted the e-mail after 6 or so months of no
 response. If I don't find it, I open a new incident.
>>> Your Report (Review ID: JI-9011609) - UTF-8 decoder fails to handle some
>>> edge cases correctly
>>>
>>> I didn't say so in the bug report but I'm happy to walk Oracle through
>>> any of the failing test cases if it isn't clear why any of them are
>>> bugs. Just point them towards the Tomcat dev list.
>>>
>>> If you can nudge the right folks into getting this fixed for both Java 7
>>> and Java 8 that would great. I'd be extremely happy to be able to delete
>>> Tomcat's customer UTF-8 decoder.
>>>
>>> Mark
>>>
>>>
 Mark


> Rgds, Rory
>
> On 04/ 9/14 12:00 PM, Mark Thomas wrote:
>> On 09/04/2014 04:36, Rory O'Donnell Oracle, Dublin ireland wrote:
>>> Hi Mark,
>>>
>>> I suggest you send an email to core-libs-...@openjdk.java.net
>>> or log a bug.
>> I've already filed the bug against Java. As far as I recall I never
>> received any response  - not unusual in my experience of reporting bugs
>> with Java. I've pretty much reached the conclusion - after reporting
>> multiple bugs only to have them completely ignored - that reporting bugs
>> in Java is a waste of my time.
>>
>> I'll try the e-mail route but I have little hope that anything will
>> actually come of it.
>>
>> Mark
>>
>>
>>> Rgds, Rory
>>>
>>> On 04/ 8/14 12:49 PM, Mark Thomas wrote:
 On 08/04/2014 02:25, Rory O'Donnell Oracle, Dublin Ireland wrote:
> Hi Mladen,
>
> JDK 9 Build 06 Early Access Build is now available for download
>  & test.
>
> Rgds, Rory
>
 Rory,

 Java 8 (and I am guessing Java 9) still has issues with UTF-8 decoding.

 For the latest status, see the Tomcat 8 unit tests for Java 8 decoding
 [1]. If you look at the change history you'll see how things improved
 between Java 7 and Java 8. It should be obvious what the problems are
 from that unit test but ask of the Tomcat dev list if things aren't
 clear.


 Mark


 [1]
 http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java?view=annotate



>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org

>>> -
>>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>>
>>
>> -- 
>> Rgds,
>> Rory O'Donnell
>>
>> Senior Quality Engineering Manager
>> Java Platform Group
>> Oracle EMEA , Block P5,
>> East Point Business Park, Dublin 3
>> Phone: +353 (0)1 8033887 
> 
> -- 
> Rgds,Rory O'Donnell
> Quality Engineering Manager
> Oracle EMEA , Dublin, Ireland
> 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593698 - in /tomcat/tc7.0.x/trunk: ./ webapps/docs/config/listeners.xml

2014-05-10 Thread kkolinko
Author: kkolinko
Date: Sat May 10 13:11:58 2014
New Revision: 1593698

URL: http://svn.apache.org/r1593698
Log:
Merged r1593697 from tomcat/trunk:
Split into two paragraphs, so that note is more visible.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1593697

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml?rev=1593698&r1=1593697&r2=1593698&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/listeners.xml Sat May 10 13:11:58 
2014
@@ -118,8 +118,8 @@
 will occur if OpenSSL is already in FIPS mode).
 Set to require to require that OpenSSL already be
 in FIPS mode (an error will occur if OpenSSL is not already in FIPS
-mode).
-FIPS mode requires you to have a FIPS-capable OpenSSL library which
+mode).
+FIPS mode requires you to have a FIPS-capable OpenSSL library 
which
 you must build yourself.
 If this attribute is set to any of the above values, the 
SSLEngine
 must be enabled as well.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56400] Change POOL2/DBCP2 consumption strategy

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56400

Konstantin Kolinko  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #2 from Konstantin Kolinko  ---
1. Fore a record,
 'ant release' with Java 8 completes successfully.

Good.
So we are not limited to Java 7 as it were with DBCP 1.

2. There are several minor cleanups pending:
a. Correct DBCP description in

BUILDING.txt

b. Remove DBCP and pool versions from

build.properties.default

c. Remove TOMCAT_LIBS_BASE/tomcat8-deps/dbcp/tomcat-dbcp.jar reference from

res/ide-support/eclipse/eclipse.classpath

The IDEA and NetBeans files look OK.


3. There is javadoc link to an absent class (ProxiedObjectPool) in
dbcp2/package-info.java (see buildbot output for 'ant release' step)


4. I wonder whether it is worth and feasible to fork the tests as well.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593697 - /tomcat/trunk/webapps/docs/config/listeners.xml

2014-05-10 Thread kkolinko
Author: kkolinko
Date: Sat May 10 13:10:36 2014
New Revision: 1593697

URL: http://svn.apache.org/r1593697
Log:
Split into two paragraphs, so that note is more visible.

Modified:
tomcat/trunk/webapps/docs/config/listeners.xml

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1593697&r1=1593696&r2=1593697&view=diff
==
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Sat May 10 13:10:36 2014
@@ -118,8 +118,8 @@
 will occur if OpenSSL is already in FIPS mode).
 Set to require to require that OpenSSL already be
 in FIPS mode (an error will occur if OpenSSL is not already in FIPS
-mode).
-FIPS mode requires you to have a FIPS-capable OpenSSL library which
+mode).
+FIPS mode requires you to have a FIPS-capable OpenSSL library 
which
 you must build yourself.
 If this attribute is set to any of the above values, the 
SSLEngine
 must be enabled as well.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593290 - /tomcat/trunk/webapps/docs/changelog.xml

2014-05-10 Thread markt
Author: markt
Date: Thu May  8 14:10:27 2014
New Revision: 1593290

URL: http://svn.apache.org/r1593290
Log:
Update changelog

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1593290&r1=1593289&r2=1593290&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu May  8 14:10:27 2014
@@ -165,6 +165,10 @@
 code to have the defineClassInPackage permission when
 running under a security manager. (markt)
   
+  
+Make the naming context tokens for containers more robust by using a
+separate object. (markt)
+  
 
   
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot success in ASF Buildbot on tomcat-6-trunk

2014-05-10 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-6-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-6-trunk/builds/5

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/tc6.0.x/trunk] 1593695
Blamelist: fhanik,kkolinko

Build succeeded!

sincerely,
 -The Buildbot




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56501] problems with urlencoding in webapp name

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56501

Kay  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WORKSFORME  |---

--- Comment #5 from Kay  ---
I just uploaded a sample project.

- git clone https://github.com/dodgex/tomcat-issue-56501
- mvn package
- deploy on a tomcat server as test_app
- open http://tomcat/test_app/test.html (in firefox)

click the links.
SUCCESS => IndexFilter
FAILURE => real index.html

as mentioned in the comment before, for Chrome and IE every link yields
"SUCCESS" but for Firefox it is failure in two cases.

a look on the network tab of FireBug and Chrome dev tools i can see that chrome
decodes the %5F to _ for the requests while firefox actually sends the request
with %5F to the server.

i think there should be some kind on URL decode on tomcat side.


Kind regards,
Kay

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56488] jaas custom login module

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56488

--- Comment #13 from dstojkov  ---
I also find that 

http://marc.info/?l=tomcat-user&m=135180802717290&w=4


which related to my pb as well but without response

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56501] problems with urlencoding in webapp name

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56501

--- Comment #4 from Kay  ---
What Browser did you use to test?

I tested with some and found that Chrome and IE (tested with 8, so 8+ should
work too i think) work, but on Firefox this issue occurs.

I'l try to build a little sample app for you to test.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593421 - /tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java

2014-05-10 Thread markt
Author: markt
Date: Thu May  8 21:19:26 2014
New Revision: 1593421

URL: http://svn.apache.org/r1593421
Log:
Testing with Java 9 early access.
UTF-8 issues resolved.

Modified:
tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java?rev=1593421&r1=1593420&r2=1593421&view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java Thu May  8 
21:19:26 2014
@@ -69,6 +69,9 @@ public class TestUtf8 {
 } catch (Exception e) {
 // Ignore
 }
+// TODO Identify a class to test for Java 9
+//javaVersion = 9;
+
 Utf8TestCase testCase = null;
 
 TEST_CASES.add(new Utf8TestCase(
@@ -96,12 +99,17 @@ public class TestUtf8 {
 new int[] {0xF0, 0x90, 0x90, 0x80},
 -1,
 "\uD801\uDC00"));
-// JVM decoder does not report error until all 4 bytes are available
-TEST_CASES.add(new Utf8TestCase(
+// Java 7/8 JVM decoder does not report error until all 4 bytes are
+// available
+testCase = new Utf8TestCase(
 "Invalid code point - out of range",
 new int[] {0x41, 0xF4, 0x90, 0x80, 0x80, 0x41},
 2,
-"A\uFFFD\uFFFD\uFFFD\uFFFDA").addForJvm(ERROR_POS_PLUS2));
+"A\uFFFD\uFFFD\uFFFD\uFFFDA");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
 
 // Java 7 JVM decoder does not report error until all 2 bytes are 
available
 testCase = new Utf8TestCase(
@@ -125,12 +133,18 @@ public class TestUtf8 {
 }
 TEST_CASES.add(testCase);
 
-// JVM decoder does not report error until all 4 bytes are available
-TEST_CASES.add(new Utf8TestCase(
+// Java 7/8 JVM decoder does not report error until all 4 bytes are
+// available
+testCase = new Utf8TestCase(
 "Valid sequence padded from one byte to four",
 new int[] {0x41, 0xF0, 0x80, 0x80, 0xC1, 0x41},
 2,
-"A\uFFFD\uFFFD\uFFFD\uFFFDA").addForJvm(ERROR_POS_PLUS2));
+"A\uFFFD\uFFFD\uFFFD\uFFFDA");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
+
 TEST_CASES.add(new Utf8TestCase(
 "Invalid one byte  ",
 new int[] {0x41, 0xFF, 0x41},
@@ -333,26 +347,46 @@ public class TestUtf8 {
 new int[] {0x61, 0xE1, 0x80, 0xC0, 0x61},
 3,
 "a\uFFFD\uFFFDa"));
-TEST_CASES.add(new Utf8TestCase(
+testCase = new Utf8TestCase(
 "Four bytes, U+ zero-padded",
 new int[] {0x61, 0xF0, 0x80, 0x80, 0x80, 0x61},
 2,
-"a\uFFFD\uFFFD\uFFFD\uFFFDa").addForJvm(ERROR_POS_PLUS2));
-TEST_CASES.add(new Utf8TestCase(
+"a\uFFFD\uFFFD\uFFFD\uFFFDa");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
+
+testCase = new Utf8TestCase(
 "Four bytes, U+007F zero-padded",
 new int[] {0x61, 0xF0, 0x80, 0x81, 0xBF, 0x61},
 2,
-"a\uFFFD\uFFFD\uFFFD\uFFFDa").addForJvm(ERROR_POS_PLUS2));
-TEST_CASES.add(new Utf8TestCase(
+"a\uFFFD\uFFFD\uFFFD\uFFFDa");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
+
+testCase = new Utf8TestCase(
 "Four bytes, U+07FF zero-padded",
 new int[] {0x61, 0xF0, 0x80, 0x9F, 0xBF, 0x61},
 2,
-"a\uFFFD\uFFFD\uFFFD\uFFFDa").addForJvm(ERROR_POS_PLUS2));
-TEST_CASES.add(new Utf8TestCase(
+"a\uFFFD\uFFFD\uFFFD\uFFFDa");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
+
+testCase = new Utf8TestCase(
 "Four bytes, U+ zero-padded",
 new int[] {0x61, 0xF0, 0x8F, 0xBF, 0xBF, 0x61},
 2,
-"a\uFFFD\uFFFD\uFFFD\uFFFDa").addForJvm(ERROR_POS_PLUS2));
+"a\uFFFD\uFFFD\uFFFD\uFFFDa");
+if (javaVersion < 9) {
+testCase.addForJvm(ERROR_POS_PLUS2);
+}
+TEST_CASES.add(testCase);
+
 TEST_CASES.add(new Utf8TestCase(
 "Four bytes, all 1's",
 new int[] {0x61, 0xFF, 0xFF, 0xFF, 0xFF, 0x61},



-

Early Access builds for JDK 9 b11, JDK 8u20 b13 and JDK 7u60 b15 are available on java.net

2014-05-10 Thread Rory O'Donnell Oracle, Dublin Ireland

Hi Mladen,

Early Access builds for JDK 9 b11 , JDK 
8u20 b13  and JDK 7u60 b15 
 are available on java.net.


As we enter the later phases of development for JDK 7u60 & JDK 8u20 , 
please log any show

stoppers as soon as possible.

Rgds, Rory

--
Rgds,Rory O'Donnell
Quality Engineering Manager
Oracle EMEA , Dublin, Ireland



[Bug 56501] problems with urlencoding in webapp name

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56501

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from Mark Thomas  ---
This works for me with the latest code for 7.0.x.

The one thing that looks odd with this report is that http://tomcat/test%5Fapp
works but http://tomcat/test%5Fapp/ doesn't since the response to the first URL
should be a redirect to the latter url so I can;t see how the first works but
the second fails.

I suspect something a little more complex is going on, probably with welcome
files.

You need to follow this up on the users mailing list (when ASF e-mail is
restored). Until then, I'd suggest trying to put together the simplest test
case the demonstrates this issue - I suspect that process will be illuminating.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot success in ASF Buildbot on tomcat-7-trunk

2014-05-10 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-7-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-7-trunk/builds/54

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1593392
Blamelist: slaurent

Build succeeded!

sincerely,
 -The Buildbot




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56488] jaas custom login module

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56488

--- Comment #5 from dstojkov  ---
my web.xml


http://xmlns.jcp.org/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd";>

javax.faces.PROJECT_STAGE
Development


Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
*.xhtml



30



index.xhtml



users_homepage

/logged/*


user




user



-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot failure in ASF Buildbot on tomcat-7-trunk

2014-05-10 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-7-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-7-trunk/builds/52

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1593364
Blamelist: kkolinko

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56488] jaas custom login module

2014-05-10 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56488

--- Comment #10 from dstojkov  ---
I used jsf mojarra 2.2.6 without extra framework the like primeface

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593390 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/NamingContextListener.java

2014-05-10 Thread kkolinko
Author: kkolinko
Date: Thu May  8 19:21:49 2014
New Revision: 1593390

URL: http://svn.apache.org/r1593390
Log:
Merged r1593387 from tomcat/trunk:
Small optimization: move "getRegistry(null, null)" call out of the loop.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1593387

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=1593390&r1=1593389&r2=1593390&view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java 
Thu May  8 19:21:49 2014
@@ -337,9 +337,12 @@ public class NamingContextListener
 ContextAccessController.unsetSecurityToken(container, 
container);
 
 // unregister mbeans.
-Collection names = objectNames.values();
-for (ObjectName objectName : names) {
-Registry.getRegistry(null, 
null).unregisterComponent(objectName);
+if (!objectNames.isEmpty()) {
+Collection names = objectNames.values();
+Registry registry = Registry.getRegistry(null, null);
+for (ObjectName objectName : names) {
+registry.unregisterComponent(objectName);
+}
 }
 } finally {
 objectNames.clear();



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1593621 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/mapper/ test/org/apache/catalina/connector/ webapps/docs/

2014-05-10 Thread markt
Author: markt
Date: Fri May  9 21:02:10 2014
New Revision: 1593621

URL: http://svn.apache.org/r1593621
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56501
HttpServletRequest.getContextPath() should return the undecoded context path 
used by the user agent.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/Request.java
tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java
tomcat/trunk/java/org/apache/catalina/mapper/MappingData.java
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1593621&r1=1593620&r2=1593621&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri May  9 
21:02:10 2014
@@ -1894,7 +1894,17 @@ public class Request
  */
 @Override
 public String getContextPath() {
-return mappingData.contextPath.toString();
+String uri = getRequestURI();
+int lastSlash = mappingData.contextSlashCount;
+int pos = 0;
+while (lastSlash > 0) {
+pos = uri.indexOf('/', pos + 1);
+if (pos == -1) {
+return uri;
+}
+lastSlash--;
+}
+return uri.substring(0, pos);
 }
 
 

Modified: tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java?rev=1593621&r1=1593620&r2=1593621&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java Fri May  9 
21:02:10 2014
@@ -229,6 +229,7 @@ public final class Mapper {
 new ContextVersion[contextVersions.length + 1];
 ContextVersion newContextVersion = new ContextVersion();
 newContextVersion.path = path;
+newContextVersion.slashCount = slashCount;
 newContextVersion.name = version;
 newContextVersion.object = context;
 newContextVersion.welcomeResources = welcomeResources;
@@ -799,6 +800,7 @@ public final class Mapper {
 }
 }
 mappingData.context = contextVersion.object;
+mappingData.contextSlashCount = contextVersion.slashCount;
 }
 
 // Wrapper mapping
@@ -1480,6 +1482,7 @@ public final class Mapper {
 
 protected static final class ContextVersion extends MapElement {
 public String path = null;
+public int slashCount;
 public String[] welcomeResources = new String[0];
 public WebResourceRoot resources = null;
 public MappedWrapper defaultWrapper = null;

Modified: tomcat/trunk/java/org/apache/catalina/mapper/MappingData.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mapper/MappingData.java?rev=1593621&r1=1593620&r2=1593621&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/mapper/MappingData.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mapper/MappingData.java Fri May  9 
21:02:10 2014
@@ -31,6 +31,7 @@ public class MappingData {
 
 public Host host = null;
 public Context context = null;
+public int contextSlashCount = 0;
 public Context[] contexts = null;
 public Wrapper wrapper = null;
 public boolean jspWildCard = false;
@@ -45,6 +46,7 @@ public class MappingData {
 public void recycle() {
 host = null;
 context = null;
+contextSlashCount = 0;
 contexts = null;
 wrapper = null;
 jspWildCard = false;

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=1593621&r1=1593620&r2=1593621&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java Fri May  9 
21:02:10 2014
@@ -685,4 +685,114 @@ public class TestRequest extends TomcatB
 fail("OK status was expected: " + status);
 }
 }
+
+@Test
+public void testBug56501a() throws Exception {
+doBug56501("/path", "/path", "/path");
+}
+
+@Test
+public void testBug56501b() throws Exception {
+doBug56501("/path", "/path/", "/path");
+}
+
+@Test
+public void testBug56501c() throws Exception {
+doBug56501("/path", "/path