[tomcat] branch master updated: Fix entry category

2019-05-08 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 9b1cb7f  Fix entry category
9b1cb7f is described below

commit 9b1cb7f0913c89eb1e635c36e0e7cd3323e01c07
Author: remm 
AuthorDate: Thu May 9 08:15:45 2019 +0200

Fix entry category
---
 webapps/docs/changelog.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 69c5f45..273e3d1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -63,6 +63,9 @@
 Filter out some cases of incorrect HTTP/2 connection timeout. (remm)
   
   
+Avoid useless exception wrapping in async IO. (remm)
+  
+  
 63412: Security manager failure when using the async IO
 API from a webapp. (remm)
   
@@ -81,9 +84,6 @@
 63403: Fix TestHttp2InitialConnection test failures when
 running with a non-English locale. (kkolinko)
   
-  
-Avoid useless exception wrapping in async IO. (remm)
-  
 
   
 


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



[tomcat] branch master updated: Gump nag

2019-05-08 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new ddaba13  Gump nag
ddaba13 is described below

commit ddaba136bd42d5b8599008da5979453b88fde073
Author: remm 
AuthorDate: Thu May 9 08:14:48 2019 +0200

Gump nag
---
 java/org/apache/jasper/compiler/JspUtil.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index bf2f41c..a3411bd 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
-
 import java.util.ArrayList;
 
 import org.apache.jasper.Constants;
@@ -30,7 +29,6 @@ import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
 import org.apache.tomcat.Jar;
 import org.apache.tomcat.util.security.Escape;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 


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



Re: The migration guide configuration file difference feature is broken

2019-05-08 Thread Konstantin Kolinko
> >>> Looking at the "configure
> >>> file differences" section on the 9.0 migration guide (
> >>> http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences),
> >>> if you click the "view differences" button you get taken to the gitbox web
> >>> UI, but it returns a 403. Does anyone have any idea how to fix it? I 
> >>> looked
> >>> to see if there was an alternative method to get the diff in the web UI 
> >>> but
> >>> I don't see one that allows you to compare files across tags.
> >>
> >> The feature has been (hopefully)  temporarily disabled by infra due to
> >> abuse. If there was a way of doing this in GitHub, we could use that.
> >> I've tried, and failed, to find one.
> >
> > I think that one solution is generate a series of diff files and
> > upload the diff files to the Tomcat web site. The web form can be
> > replaces with a static table that links to the diff files.
>
> That is an n-squared problem where n is the number of formally released
> versions. Do we really want to create that many files?
>
> It isn't impossible and it should be easy to script. But still I
> hesitate to start down that road.

I mean just for adjacent pairs (diff N vs N-1). There are not many
changes really.

Best regards,
Konstantin Kolinko

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



[GUMP@vmgump-vm3]: Project tomcat-trunk-validate (in module tomcat-trunk) failed

2019-05-08 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-trunk-validate has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 13 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-trunk-validate :  Tomcat 9.x, a web server implementing the Java 
Servlet 4.0,
...


Full details are available at:
http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-validate/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on checkstyle exists, no need to add for property 
checkstyle.jar.
 -INFO- Failed with reason build failed



The following work was performed:
http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-validate/gump_work/build_tomcat-trunk_tomcat-trunk-validate.html
Work Name: build_tomcat-trunk_tomcat-trunk-validate (Type: Build)
Work ended in a state of : Failed
Elapsed: 24 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only -Dsun.zip.disableMemoryMapping=true 
org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dbase.path=/srv/gump/public/workspace/tomcat-trunk/tomcat-build-libs 
-Dcheckstyle.jar=/srv/gump/public/workspace/checkstyle/target/checkstyle-8.21-SNAPSHOT.jar
 -Dexecute.validate=true validate 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/checkstyle/target/checkstyle-8.21-SNAPSHOT.jar:/srv/gump/packages/antlr/antlr-3.1.3.jar:/srv/gump/public/workspace/commons-beanutils/dist/commons-beanutils-20190509.jar:/srv/gump/packages/commons-collections3/commons-collections-3.2.1.jar:/srv/gump/public/workspace/commons-cli/target/commons-cli-1.5-SNAPSHOT.jar:/srv/gump/public/workspace/commons-lang-trunk/target/commons-lang3-3.10-SNAPSHOT.jar:/srv/gump/p
 
ublic/workspace/apache-commons/logging/target/commons-logging-20190509.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-20190509.jar:/srv/gump/public/workspace/google-guava/guava/target/guava-HEAD-jre-SNAPSHOT.jar
-
Buildfile: /srv/gump/public/workspace/tomcat-trunk/build.xml

build-prepare:
   [delete] Deleting directory 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp

compile-prepare:

download-validate:

testexist:
 [echo] Testing  for 
/srv/gump/public/workspace/checkstyle/target/checkstyle-8.21-SNAPSHOT.jar

setproxy:

downloadfile:

validate:
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/res/checkstyle
[checkstyle] Running Checkstyle 8.21-SNAPSHOT on 3863 files
[checkstyle] [ERROR] 
/srv/gump/public/workspace/tomcat-trunk/java/org/apache/jasper/compiler/JspUtil.java:26:
 Extra separation in import group before 'java.util.ArrayList' [ImportOrder]
[checkstyle] [ERROR] 
/srv/gump/public/workspace/tomcat-trunk/java/org/apache/jasper/compiler/JspUtil.java:34:
 Extra separation in import group before 'org.xml.sax.Attributes' [ImportOrder]

BUILD FAILED
/srv/gump/public/workspace/tomcat-trunk/build.xml:560: Got 2 errors and 0 
warnings.

Total time: 24 seconds
-

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-validate/rss.xml
- Atom: http://vmgump-vm3.apache.org/tomcat-trunk/tomcat-trunk-validate/atom.xml

== Gump Tracking Only ===
Produced by Apache Gump(TM) version 2.3.
Gump Run 2019050906, vmgump-vm3.apache.org:vmgump:2019050906
Gump E-mail Identifier (unique within run) #6.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump-vm3]

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



Re: The migration guide configuration file difference feature is broken

2019-05-08 Thread Mark Thomas
On 08/05/2019 17:21, Konstantin Kolinko wrote:
> ср, 8 мая 2019 г. в 18:16, Mark Thomas :
>>
>> On 08/05/2019 15:35, Coty Sutherland wrote:
>>> Hi,
>>>
>>> Someone on freenode (CiscoEagle) pointed out to me that the migration
>>> guide's file comparison feature doesn't work :(
> 
> This has already been reported 5-6 times. See the archives.
> 
>>> Looking at the "configure
>>> file differences" section on the 9.0 migration guide (
>>> http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences),
>>> if you click the "view differences" button you get taken to the gitbox web
>>> UI, but it returns a 403. Does anyone have any idea how to fix it? I looked
>>> to see if there was an alternative method to get the diff in the web UI but
>>> I don't see one that allows you to compare files across tags.
>>
>> The feature has been (hopefully)  temporarily disabled by infra due to
>> abuse. If there was a way of doing this in GitHub, we could use that.
>> I've tried, and failed, to find one.
> 
> I think that one solution is generate a series of diff files and
> upload the diff files to the Tomcat web site. The web form can be
> replaces with a static table that links to the diff files.

That is an n-squared problem where n is the number of formally released
versions. Do we really want to create that many files?

It isn't impossible and it should be easy to script. But still I
hesitate to start down that road.

Mark

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



Re: javax.tools based JSP compiler

2019-05-08 Thread Mark Thomas
On 08/05/2019 21:58, Rémy Maucherat wrote:
> On Wed, May 8, 2019 at 10:31 PM Emmanuel Bourg  wrote:
> 
>> Hi all,
>>
>> I've rebased the javax.tools JSP compiler on top of the current master
>> branch :
>>
>>   https://github.com/ebourg/tomcat/tree/jasper-javax-tools-support
>>
>> Please let me know how you feel about this stuff and if it's worth merging.
>>
> Ok, so it feels like a win over Ant, so it should be merged, but I didn't
> test it.

+1

Need to remove the @author tags and add some info on how to configure
jasper to use them.

A few daft questions:

1. If we used the JSR199Complier by default would that allow us to
remove the Eclipse compiler as a dependency?

2. Why would anyone use the JavacCompiler in preference to JSR199Complier?

Mark

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



[tomcat] branch master updated: Removed the redundant 'static' modifier on the enums

2019-05-08 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new a7a4b72  Removed the redundant 'static' modifier on the enums
a7a4b72 is described below

commit a7a4b72ecf3e47afc5318b30685847d3470c97df
Author: Emmanuel Bourg 
AuthorDate: Thu May 9 00:06:52 2019 +0200

Removed the redundant 'static' modifier on the enums
---
 java/org/apache/tomcat/util/net/SSLHostConfigCertificate.java   | 4 ++--
 test/javax/el/TestArrayELResolver.java  | 2 +-
 test/javax/el/TestBeanELResolver.java   | 2 +-
 test/javax/el/TestBeanNameELResolver.java   | 2 +-
 test/javax/el/TestListELResolver.java   | 2 +-
 test/javax/el/TestMapELResolver.java| 2 +-
 test/javax/el/TestResourceBundleELResolver.java | 2 +-
 test/javax/el/TestStaticFieldELResolver.java| 2 +-
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 2 +-
 test/org/apache/el/lang/TestELSupport.java  | 6 +++---
 test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java | 2 +-
 test/org/apache/tomcat/util/net/TestCustomSsl.java  | 2 +-
 webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java  | 2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SSLHostConfigCertificate.java 
b/java/org/apache/tomcat/util/net/SSLHostConfigCertificate.java
index e0b0e9c..5f10707 100644
--- a/java/org/apache/tomcat/util/net/SSLHostConfigCertificate.java
+++ b/java/org/apache/tomcat/util/net/SSLHostConfigCertificate.java
@@ -268,7 +268,7 @@ public class SSLHostConfigCertificate implements 
Serializable {
 
 // Nested types
 
-public static enum Type {
+public enum Type {
 
 UNDEFINED,
 RSA(Authentication.RSA),
@@ -291,7 +291,7 @@ public class SSLHostConfigCertificate implements 
Serializable {
 }
 }
 
-static enum StoreType {
+enum StoreType {
 KEYSTORE,
 PEM
 }
diff --git a/test/javax/el/TestArrayELResolver.java 
b/test/javax/el/TestArrayELResolver.java
index ccad23e..cea9b97 100644
--- a/test/javax/el/TestArrayELResolver.java
+++ b/test/javax/el/TestArrayELResolver.java
@@ -385,7 +385,7 @@ public class TestArrayELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 
diff --git a/test/javax/el/TestBeanELResolver.java 
b/test/javax/el/TestBeanELResolver.java
index 6368ad5..7bd9bce 100644
--- a/test/javax/el/TestBeanELResolver.java
+++ b/test/javax/el/TestBeanELResolver.java
@@ -981,7 +981,7 @@ public class TestBeanELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE, INVOKE
 }
 
diff --git a/test/javax/el/TestBeanNameELResolver.java 
b/test/javax/el/TestBeanNameELResolver.java
index a7c90c6..f5ea30f 100644
--- a/test/javax/el/TestBeanNameELResolver.java
+++ b/test/javax/el/TestBeanNameELResolver.java
@@ -606,7 +606,7 @@ public class TestBeanNameELResolver {
 }
 
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE,
 SET_VALUE,
 GET_TYPE,
diff --git a/test/javax/el/TestListELResolver.java 
b/test/javax/el/TestListELResolver.java
index cb9d574..60aea8c 100644
--- a/test/javax/el/TestListELResolver.java
+++ b/test/javax/el/TestListELResolver.java
@@ -381,7 +381,7 @@ public class TestListELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 
diff --git a/test/javax/el/TestMapELResolver.java 
b/test/javax/el/TestMapELResolver.java
index fa8bb63..1a87b7f 100644
--- a/test/javax/el/TestMapELResolver.java
+++ b/test/javax/el/TestMapELResolver.java
@@ -312,7 +312,7 @@ public class TestMapELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, SET_VALUE, GET_TYPE
 }
 }
diff --git a/test/javax/el/TestResourceBundleELResolver.java 
b/test/javax/el/TestResourceBundleELResolver.java
index 3f9ebc7..5acf029 100644
--- a/test/javax/el/TestResourceBundleELResolver.java
+++ b/test/javax/el/TestResourceBundleELResolver.java
@@ -321,7 +321,7 @@ public class TestResourceBundleELResolver {
 Assert.assertFalse(context.isPropertyResolved());
 }
 
-private static enum MethodUnderTest {
+private enum MethodUnderTest {
 GET_VALUE, S

buildbot success in on tomcat-trunk

2019-05-08 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4317

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] ad9b99974f2018875a78bfacf679fc9f79a6308e
Blamelist: Emmanuel Bourg 

Build succeeded!

Sincerely,
 -The Buildbot




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



Applet in the documentation

2019-05-08 Thread Emmanuel Bourg
Hi,

We have a clock applet in the documentation illustrating the use of the
 tag. Applet support has been removed from all
browsers now, it's unlikely to be useful anymore.

Any objection to drop this example from the documentation?

Emmanuel Bourg

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



[tomcat] branch master updated: Fixed the javadoc in CheckEol

2019-05-08 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new ad9b999  Fixed the javadoc in CheckEol
ad9b999 is described below

commit ad9b99974f2018875a78bfacf679fc9f79a6308e
Author: Emmanuel Bourg 
AuthorDate: Wed May 8 23:38:36 2019 +0200

Fixed the javadoc in CheckEol
---
 java/org/apache/tomcat/buildutil/CheckEol.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/buildutil/CheckEol.java 
b/java/org/apache/tomcat/buildutil/CheckEol.java
index 2f32554..4c196a1 100644
--- a/java/org/apache/tomcat/buildutil/CheckEol.java
+++ b/java/org/apache/tomcat/buildutil/CheckEol.java
@@ -60,7 +60,7 @@ public class CheckEol extends Task {
 /**
  * Sets the line ending mode.
  *
- * @param mode
+ * @param mode The line ending mode (either LF or CRLF)
  */
 public void setMode( String mode ) {
 this.mode = Mode.valueOf( mode.toUpperCase() );


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



[tomcat] branch master updated: Removed the CVS and Subversion directories from the paths excluded by javac

2019-05-08 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new e9c253f  Removed the CVS and Subversion directories from the paths 
excluded by javac
e9c253f is described below

commit e9c253f1e0e0bc42a0b8ec987232ee4f8f45d0f2
Author: Emmanuel Bourg 
AuthorDate: Wed May 8 23:32:56 2019 +0200

Removed the CVS and Subversion directories from the paths excluded by javac
---
 build.xml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/build.xml b/build.xml
index ea87611..6e91e91 100644
--- a/build.xml
+++ b/build.xml
@@ -680,7 +680,6 @@
source="${compile.source}"
target="${compile.target}"
release="${compile.release}"
-   excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
   

buildbot failure in on tomcat-trunk

2019-05-08 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4315

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 1fb000c3df34a0621f75050bbcb488d94d6124de
Blamelist: Emmanuel Bourg 

BUILD FAILED: failed compile

Sincerely,
 -The Buildbot




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



[tomcat] branch master updated: Changed 'ant validate-eoln' to always check LF line endings regardless of the OS (by default Git checks out the files with LF EOL even on Windows)

2019-05-08 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 1fb000c  Changed 'ant validate-eoln' to always check LF line endings 
regardless of the OS (by default Git checks out the files with LF EOL even on 
Windows)
1fb000c is described below

commit 1fb000c3df34a0621f75050bbcb488d94d6124de
Author: Emmanuel Bourg 
AuthorDate: Wed May 8 23:25:47 2019 +0200

Changed 'ant validate-eoln' to always check LF line endings regardless of 
the OS (by default Git checks out the files with LF EOL even on Windows)
---
 BUILDING.txt   |  9 ++---
 build.xml  |  3 +-
 java/org/apache/tomcat/buildutil/CheckEol.java | 48 +++---
 3 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 1f618fb..f8695fb 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -545,15 +545,12 @@ The report file by default is written to
 You usually would not need to run this check. You can skip this section.
 
 Apache Tomcat project has convention that all of its textual source files,
-stored in Subversion repository, are marked with Subversion property
-"svn:eol-style" with value of "native". This convention makes the editing
-of source code on different platforms easier.
+stored in the Git repository, use Unix style LF line endings.
 
 This test is used by developers to check that the source code adheres to
 this convention. It verifies that the ends of lines in textual files are
-appropriate for the operating system where it is run. The idea is to run
-this check regularly on two different platforms and notify developers when
-an inconsistency is detected.
+appropriate. The idea is to run this check regularly and notify developers
+when an inconsistency is detected.
 
 The command to run this test is:
 
diff --git a/build.xml b/build.xml
index f62cb76..ea87611 100644
--- a/build.xml
+++ b/build.xml
@@ -625,7 +625,6 @@
source="${compile.source}"
target="${compile.target}"
release="${compile.release}"
-   excludes="**/.svn/**"
encoding="ISO-8859-1"
includeAntRuntime="true" >
   

Re: javax.tools based JSP compiler

2019-05-08 Thread Rémy Maucherat
On Wed, May 8, 2019 at 10:31 PM Emmanuel Bourg  wrote:

> Hi all,
>
> I've rebased the javax.tools JSP compiler on top of the current master
> branch :
>
>   https://github.com/ebourg/tomcat/tree/jasper-javax-tools-support
>
> Please let me know how you feel about this stuff and if it's worth merging.
>
> Ok, so it feels like a win over Ant, so it should be merged, but I didn't
test it.

Rémy


[tomcat] branch master updated: Use ArrayList instead of Vector.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 1b83f52  Use ArrayList instead of Vector.
1b83f52 is described below

commit 1b83f52aea261f0f349bef689354ffaac2d51483
Author: Christopher Schultz 
AuthorDate: Wed May 8 22:36:32 2019 +0200

Use ArrayList instead of Vector.
---
 java/org/apache/catalina/connector/Response.java | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 0df7e00..8fefce9 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -34,7 +34,6 @@ import java.util.Enumeration;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Vector;
 import java.util.function.Supplier;
 
 import javax.servlet.ServletOutputStream;
@@ -867,10 +866,9 @@ public class Response implements HttpServletResponse {
 
 @Override
 public Collection getHeaderNames() {
-
 MimeHeaders headers = getCoyoteResponse().getMimeHeaders();
 int n = headers.size();
-List result = new ArrayList<>(n);
+ArrayList result = new ArrayList<>(n);
 for (int i = 0; i < n; i++) {
 result.add(headers.getName(i).toString());
 }
@@ -881,12 +879,11 @@ public class Response implements HttpServletResponse {
 
 @Override
 public Collection getHeaders(String name) {
-
 Enumeration enumeration =
 getCoyoteResponse().getMimeHeaders().values(name);
-Vector result = new Vector<>();
+ArrayList result = new ArrayList<>();
 while (enumeration.hasMoreElements()) {
-result.addElement(enumeration.nextElement());
+result.add(enumeration.nextElement());
 }
 return result;
 }


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



Re: javax.tools based JSP compiler

2019-05-08 Thread Emmanuel Bourg
Hi all,

I've rebased the javax.tools JSP compiler on top of the current master
branch :

  https://github.com/ebourg/tomcat/tree/jasper-javax-tools-support

Please let me know how you feel about this stuff and if it's worth merging.

Emmanuel Bourg


Le 09/04/2018 à 17:28, Emmanuel Bourg a écrit :
> 
> I've just completed an initial implementation:
> 
>   https://github.com/ebourg/tomcat/commit/1272a1b
> 
> I tested with Java 8 and 10 on Windows and it worked fine with the JSP
> examples shipped with Tomcat. It allowed me to use the new 'var' syntax
> with Java 10.
> 
> Unlike ECJ the javax.tools API cannot take an existing ClassLoader but
> expects a list of files. So it is probably slower, and I guess it
> doesn't support non unpacked war files. The javax.tools API also
> requires the JDK (the JRE has the API but not the underlying
> implementation).
> 
> So this compiler is quite equivalent to the Ant based compiler, but at
> least it doesn't require an additional jar.
> 
> Emmanuel Bourg
> 


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



[tomcat] branch master updated: Adjust code comment.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 5d7ab23  Adjust code comment.
5d7ab23 is described below

commit 5d7ab23221d895b63c6758993b621538c3a47627
Author: Christopher Schultz 
AuthorDate: Wed May 8 22:28:52 2019 +0200

Adjust code comment.
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index b87a8d6..97f6b90 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1488,7 +1488,7 @@ public class DefaultServlet extends HttpServlet {
 
 rangeHeader = rangeHeader.substring(6);
 
-// Vector which will contain all the ranges which are successfully
+// Collection which will contain all the ranges which are successfully
 // parsed.
 ArrayList result = new ArrayList<>();
 StringTokenizer commaTokenizer = new StringTokenizer(rangeHeader, ",");


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



[tomcat] branch master updated: Ignore more IntelliJ files

2019-05-08 Thread ebourg
This is an automated email from the ASF dual-hosted git repository.

ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 95f85b7  Ignore more IntelliJ files
95f85b7 is described below

commit 95f85b74f1ae24b8490094efc2837ee15079f871
Author: Emmanuel Bourg 
AuthorDate: Wed May 8 22:20:46 2019 +0200

Ignore more IntelliJ files
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index b84d5df..69822ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,8 @@ mvn.properties
 .settings
 .idea
 *.iml
+*.ipr
+*.iws
 *.asc
 *.jj
 *.tmp


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



Re: More Vector -> ArrayList

2019-05-08 Thread Rémy Maucherat
On Wed, May 8, 2019 at 10:06 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> It seems that Vector is used a lot in Tomcat code.
>
> Since the JSP engine is riddled with uses, I figured I'd start
> elsewhere with my cleanup. Here's something glaring:
>
> o.a.c.connector.Response:882
>
> @Override
> public Collection getHeaders(String name) {
>
> Enumeration enumeration =
> getCoyoteResponse().getMimeHeaders().values(name);
> Vector result = new Vector<>();
> while (enumeration.hasMoreElements()) {
> result.addElement(enumeration.nextElement());
> }
> return result;
> }
>
> This one is straightforward to replace with ArrayList, but the
> semantics will change because ArrayList is not synchronized.
>
> Shall I return Collections.synchronizedCollection(...) or is it okay
> to change this from a synchronized list to an unsynchronized one? I
> can't find any reference to a requirement that the return value from
> this method is thread-safe, and, in general, classes such as
> HttpServletResponse are not considered thread-safe, so neither should
> the return values from any of their methods IMO.
>
> Any thoughts?
>

It uses a Vector because it was copied from older code (getHeaderValues)
and that's it. There's no need for sync here.

Rémy


More Vector -> ArrayList

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

It seems that Vector is used a lot in Tomcat code.

Since the JSP engine is riddled with uses, I figured I'd start
elsewhere with my cleanup. Here's something glaring:

o.a.c.connector.Response:882

@Override
public Collection getHeaders(String name) {

Enumeration enumeration =
getCoyoteResponse().getMimeHeaders().values(name);
Vector result = new Vector<>();
while (enumeration.hasMoreElements()) {
result.addElement(enumeration.nextElement());
}
return result;
}

This one is straightforward to replace with ArrayList, but the
semantics will change because ArrayList is not synchronized.

Shall I return Collections.synchronizedCollection(...) or is it okay
to change this from a synchronized list to an unsynchronized one? I
can't find any reference to a requirement that the return value from
this method is thread-safe, and, in general, classes such as
HttpServletResponse are not considered thread-safe, so neither should
the return values from any of their methods IMO.

Any thoughts?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTNswACgkQHPApP6U8
pFgHNw//cNV2tvwaSwkDh+dLQZSJrU29nscuKMPrX9LWw9d0LVMHKgBxZ6aeFxeN
cpzEYKZ48u5h0NfCyiswehiG7aowbAxDT2/Q16HOp1L46sPhnQv5XECDn1HthqnK
9Zj+CKaDeirohOev6E7Vnl9sHZ4khAIRjLpZzaGb8OStE5A+z8U3LNz3qnGA90uy
RckCyPG4Azcf614xn1biaPlc6ahSeLmPeu2jxIItZPETBXdDiBQo9VpkzYR5grD6
lDWb2dNO1Yxz57rNmWE7ohEt2pWq+G4knrNMihOVkNFPzOh1cPf4RgWLddGtJWlu
d5Ob/t2NH10fgWNtPomPojriUK/wnXIj/3CsU67EKNVgzAEWQ8RB8uh1IP22aemw
cRKCEUI6RvDToxA+eFcbRcUlxYA7Tvfj8L0JcMt8dqbWwzFYeZ41bj1jZ/jXi139
sUgKMajuPZZ7Y0/ThVwivSKBZzjLLjgjHha8xctbHTkl1VcK+Ul0O2qb3r9nXwuO
O/16OKGnUw8p3DgUi3f0fh7jOoovXMJH/dvNf7vv6OjOWUopq4vfp0Su8Oay9+09
vIk45Gnl6LGYSW4hn4mv5T64Wwyg7g7+LxS0INCrESohNeEkQWAyrd43r9bkxPZQ
5BwXn8pVJfiLDGXXSMFZ25Q2yXSm2fY4t7BJIsbz7N56XqlXNOo=
=qpWc
-END PGP SIGNATURE-

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



[tomcat] branch master updated: Replace custom split(String, String) method with call to String.split.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new f7c41d1  Replace custom split(String,String) method with call to 
String.split.
f7c41d1 is described below

commit f7c41d120c6374a8221b684a5ad5ede3d1621ff4
Author: Christopher Schultz 
AuthorDate: Wed May 8 21:55:13 2019 +0200

Replace custom split(String,String) method with call to String.split.

String.split will optimize for a single-character delimiter and not
actually use the regular expression engine.
---
 java/org/apache/jasper/compiler/JspUtil.java | 37 +---
 1 file changed, 6 insertions(+), 31 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index 3a65eff..bf2f41c 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -741,45 +741,20 @@ public class JspUtil {
  * @return Java package corresponding to the given path
  */
 public static final String makeJavaPackage(String path) {
-String classNameComponents[] = split(path, "/");
+String classNameComponents[] = path.split("/");
 StringBuilder legalClassNames = new StringBuilder();
 for (int i = 0; i < classNameComponents.length; i++) {
-legalClassNames.append(makeJavaIdentifier(classNameComponents[i]));
-if (i < classNameComponents.length - 1) {
-legalClassNames.append('.');
+if(0 < classNameComponents[i].length()) {
+if(0 < i) {
+legalClassNames.append('.');
+}
+
legalClassNames.append(makeJavaIdentifier(classNameComponents[i]));
 }
 }
 return legalClassNames.toString();
 }
 
 /**
- * Splits a string into it's components.
- *
- * @param path
- *String to split
- * @param pat
- *Pattern to split at
- * @return the components of the path
- */
-private static final String[] split(String path, String pat) {
-ArrayList comps = new ArrayList<>();
-int pos = path.indexOf(pat);
-int start = 0;
-while (pos >= 0) {
-if (pos > start) {
-String comp = path.substring(start, pos);
-comps.add(comp);
-}
-start = pos + pat.length();
-pos = path.indexOf(pat, start);
-}
-if (start < path.length()) {
-comps.add(path.substring(start));
-}
-return comps.toArray(new String[comps.size()]);
-}
-
-/**
  * Converts the given identifier to a legal Java identifier
  *
  * @param identifier


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



buildbot failure in on tomcat-85-trunk

2019-05-08 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-85-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-85-trunk/builds/1764

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-85-commit' 
triggered this build
Build Source Stamp: [branch 8.5.x] f295e8da59b8719bb3e159d0ea37a3a813d9a81d
Blamelist: Christopher Schultz 

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 63412] WebSocket examples in Tomcat 9.0.20 RC fail with SecurityManager

2019-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63412

Remy Maucherat  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Remy Maucherat  ---
This will be fixed in 9.0.21. This is caused by the new async IO API which is
now enabled by default (you can set useAsyncIO="false" on the Connector to
avoid the exception; or add the permission to the policy file for now, IMO it's
the best way).

In catalina.policy:
permission java.lang.RuntimePermission
"accessClassInPackage.org.apache.tomcat.util.net";

-- 
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



[tomcat] branch master updated: 63412: Fix security manager issue with async IO

2019-05-08 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new c662b54  63412: Fix security manager issue with async IO
c662b54 is described below

commit c662b54b1328acf9db89085ffba0b2ad5e186306
Author: remm 
AuthorDate: Wed May 8 21:33:35 2019 +0200

63412: Fix security manager issue with async IO

Seen with websockets.
---
 java/org/apache/catalina/security/SecurityClassLoad.java |  8 
 java/org/apache/tomcat/util/net/Nio2Endpoint.java| 10 +++---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 10 +++---
 webapps/docs/changelog.xml   |  4 
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/catalina/security/SecurityClassLoad.java 
b/java/org/apache/catalina/security/SecurityClassLoad.java
index 2d902bc..8e34f4e 100644
--- a/java/org/apache/catalina/security/SecurityClassLoad.java
+++ b/java/org/apache/catalina/security/SecurityClassLoad.java
@@ -190,6 +190,14 @@ public final class SecurityClassLoad {
 loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableAdd");
 loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableCancel");
 loader.loadClass(basePackage + 
"util.net.NioBlockingSelector$BlockPoller$RunnableRemove");
+loader.loadClass(basePackage + 
"util.net.NioEndpoint$NioSocketWrapper$OperationState");
+loader.loadClass(basePackage + 
"util.net.NioEndpoint$NioSocketWrapper$VectoredIOCompletionHandler");
+loader.loadClass(basePackage + 
"util.net.Nio2Endpoint$Nio2SocketWrapper$OperationState");
+loader.loadClass(basePackage + 
"util.net.Nio2Endpoint$Nio2SocketWrapper$VectoredIOCompletionHandler");
+loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$BlockingMode");
+loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$CompletionCheck");
+loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$CompletionHandlerCall");
+loader.loadClass(basePackage + 
"util.net.SocketWrapperBase$CompletionState");
 // security
 loader.loadClass(basePackage + "util.security.PrivilegedGetTccl");
 loader.loadClass(basePackage + "util.security.PrivilegedSetTccl");
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index a4844bc..c307369 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -1148,15 +1148,11 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint
 boolean complete = true;
 boolean completion = true;
 if (state.check != null) {
-switch (state.check.callHandler(currentState, 
state.buffers, state.offset, state.length)) {
-case CONTINUE:
+CompletionHandlerCall call = 
state.check.callHandler(currentState, state.buffers, state.offset, 
state.length);
+if (call == CompletionHandlerCall.CONTINUE) {
 complete = false;
-break;
-case DONE:
-break;
-case NONE:
+} else if (call == CompletionHandlerCall.NONE) {
 completion = false;
-break;
 }
 }
 if (complete) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1a2085c..69c5f45 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -62,6 +62,10 @@
   
 Filter out some cases of incorrect HTTP/2 connection timeout. (remm)
   
+  
+63412: Security manager failure when using the async IO
+API from a webapp. (remm)
+  
 
   
   


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



[tomcat] branch master updated: Replace uses of Vector with ArrayList.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new a5d2c73  Replace uses of Vector with ArrayList.
a5d2c73 is described below

commit a5d2c73544191763f3a20a12e810d1b0caee
Author: Christopher Schultz 
AuthorDate: Wed May 8 21:26:11 2019 +0200

Replace uses of Vector with ArrayList.
---
 java/org/apache/jasper/compiler/JspUtil.java | 23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JspUtil.java 
b/java/org/apache/jasper/compiler/JspUtil.java
index d5dc2c7..3a65eff 100644
--- a/java/org/apache/jasper/compiler/JspUtil.java
+++ b/java/org/apache/jasper/compiler/JspUtil.java
@@ -22,13 +22,15 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
-import java.util.Vector;
+
+import java.util.ArrayList;
 
 import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
 import org.apache.tomcat.Jar;
 import org.apache.tomcat.util.security.Escape;
+
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 
@@ -129,12 +131,12 @@ public class JspUtil {
 
 // AttributesImpl.removeAttribute is broken, so we do this...
 int tempLength = (attrs == null) ? 0 : attrs.getLength();
-Vector temp = new Vector<>(tempLength, 1);
+ArrayList temp = new ArrayList<>(tempLength);
 for (int i = 0; i < tempLength; i++) {
 @SuppressWarnings("null")  // If attrs==null, tempLength == 0
 String qName = attrs.getQName(i);
 if ((!qName.equals("xmlns")) && (!qName.startsWith("xmlns:"))) {
-temp.addElement(qName);
+temp.add(qName);
 }
 }
 
@@ -146,7 +148,7 @@ public class JspUtil {
 Node node = tagBody.getNode(i);
 if (node instanceof Node.NamedAttribute) {
 String attrName = node.getAttributeValue("name");
-temp.addElement(attrName);
+temp.add(attrName);
 // Check if this value appear in the attribute of the node
 if (n.getAttributeValue(attrName) != null) {
 err.jspError(n,
@@ -196,11 +198,8 @@ public class JspUtil {
 }
 
 // Now check to see if the rest of the attributes are valid too.
-String attribute = null;
-
-for (int j = 0; j < attrLeftLength; j++) {
+for(String attribute : temp) {
 valid = false;
-attribute = temp.elementAt(j);
 for (int i = 0; i < validAttributes.length; i++) {
 if (attribute.equals(validAttributes[i].name)) {
 valid = true;
@@ -763,7 +762,7 @@ public class JspUtil {
  * @return the components of the path
  */
 private static final String[] split(String path, String pat) {
-Vector comps = new Vector<>();
+ArrayList comps = new ArrayList<>();
 int pos = path.indexOf(pat);
 int start = 0;
 while (pos >= 0) {
@@ -777,11 +776,7 @@ public class JspUtil {
 if (start < path.length()) {
 comps.add(path.substring(start));
 }
-String[] result = new String[comps.size()];
-for (int i = 0; i < comps.size(); i++) {
-result[i] = comps.elementAt(i);
-}
-return result;
+return comps.toArray(new String[comps.size()]);
 }
 
 /**


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



[tomcat] branch 8.5.x updated: Remove custom split() method. String.split is already optimized for single-character splits and won't use a regex.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new f295e8d  Remove custom split() method. String.split is already 
optimized for single-character splits and won't use a regex.
f295e8d is described below

commit f295e8da59b8719bb3e159d0ea37a3a813d9a81d
Author: Christopher Schultz 
AuthorDate: Wed May 8 21:15:20 2019 +0200

Remove custom split() method. String.split is already optimized for
single-character splits and won't use a regex.
---
 .../apache/catalina/servlets/DefaultServlet.java   | 75 +-
 1 file changed, 1 insertion(+), 74 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 59dea4e..fdcb1da 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2804,7 +2804,7 @@ public class DefaultServlet extends HttpServlet {
 if(null == order || 0 == order.trim().length())
 return Order.DEFAULT;
 
-String[] options = split(order);
+String[] options = order.split(";");
 
 if(0 == options.length)
 return Order.DEFAULT;
@@ -2851,79 +2851,6 @@ public class DefaultServlet extends HttpServlet {
 return Order.DEFAULT;
 }
 
-/**
- * Split a string using a semicolon as a delimiter.
- *
- * @param s The string to split.
- *
- * @return An array of non-empty/null strings which have been
- * separated by semicolons.
- */
-private String[] split(String s) {
-if(null == s)
-return new String[0];
-s = s.trim();
-int length = s.length();
-if(0 == length)
-return new String[0];
-
-String[] strings;
-
-int index = 0;
-int start = 0;
-int pos = s.indexOf(';');
-
-if(0 <= pos) {
-int len = 2;
-strings = new String[len]; // Usually just 2 options
-
-while(0 <= pos) {
-if(len > 9)
-pos = length; // Maximum of 10 options
-
-if(index + 1 > len) {
-// Expand by double
-String[] old = strings;
-strings = new String[old.length << 1];
-System.arraycopy(old, 0, strings, 0, len);
-len = len << 1;
-}
-
-String option = s.substring(start, pos).trim();
-
-if(0 < option.length()) {
-strings[index++] = option;
-}
-
-start = pos + 1;
-pos = s.indexOf(';', start);
-}
-
-if(start < length) {
-String option = s.substring(start).trim();
-
-if(0 < option.length()) {
-strings[index] = option;
-} else {
-index--;
-}
-} else {
-index--;
-}
-
-if(len > index) {
-// Shrink
-String[] old = strings;
-strings = new String[index + 1];
-System.arraycopy(old, 0, strings, 0, index + 1);
-}
-} else {
-strings = new String[] { s };
-}
-
-return strings;
-}
-
 public static class Order {
 final char column;
 final boolean ascending;


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



Re: Micro-optimizations

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Martin,

On 5/8/19 13:58, Martin Grigorov wrote:
> Hi,
> 
> On Wed, May 8, 2019 at 7:16 PM Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
> All,
> 
> While working on the sort-file-listing enhancement over the
> weekend, I looked in the Tomcat code to see if we already had a
> method to split a string by a single character. The closest method
> I found was
> 
> 
>> Since few years java.lang.String#split(String) is optimized to
>> not use Regex when the following condition passes:
> 
>> if (((regex.value.length == 1 && ".$|()[{^?*+\\".indexOf(ch =
>> regex.charAt(0)) == -1) || (regex.length() == 2 && 
>> regex.charAt(0) == '\\' && (((ch =
>> regex.charAt(1))-'0')|('9'-ch)) < 0 && ((ch-'a')|('z'-ch)) < 0
>> && ((ch-'A')|('Z'-ch)) < 0)) && (ch <
>> Character.MIN_HIGH_SURROGATE || ch >
>> Character.MAX_LOW_SURROGATE)) {
> 
>> i.e. in many cases it is already fast enough.

This is a great point. My method removes "empty" items and trims
stuff, but it does not really have to ; it just does because it was
easy enough to add at the time.

I'm happy to remove my custom split() method and use String.split in
my case.

I'll check to see if JspUtil.split() can be used in this way as well
and we can remove it.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTKfQACgkQHPApP6U8
pFh+9g//SXxOvwH5IAtfBUdq8nDOnkjB06j0HY8cefEnGS4W1KBVJBihtHpTI0IV
vN5Z5yqAslV7kbcc+/0ezV5g8JdToOhD2K+xn2ulT9o5gjX8MiI267luVvoaYbGM
hG/1tWPDft/IMLV5XkO6Cpr/1Bot0dBcEX9ASMb3tDKnhorOCmb9u+Oq2Fu4lZZ8
VSaPZItWc/9C7wQ5Uw3gj5WIeSThcG6i0o5HFEB3NqJiMi2LOwScz7Dk2YZkdIch
BuhsSdN97VuNO40TNLy71YLEPygHF3X3u1PtuKxjXLR4VhWBounGVzLlDvm/VJcz
C4cfzaNLFyBddDq/Kg4aBLXCqM7JXRjjb2QJ4VoXilpdM8fV9fDduozfbEUgdi1U
tSnCehHqwoD/UcqEWRBL0Scodm4KAXDTIFn4DVU+nzAAUIkGyJh60PadvCwJgA9H
bKTQOuv+yGaiZ9QjegGb+r2xcqDTmOXWBFgyUXMegQJTBUb9czgZ6z81pgt+ruNq
HpJChdsK1JCC8DIfkiDHMNohU3hH323DFtuC4PFbvF225l5ywu6pyg4qjaBEfw6X
W8Mf+KwfHcQUvjXhNPqKex4PU7HnolNL8h2Jigd3C97PtUMUiD4A+zekQ7oRiibe
3HFqnDA8oiNRCB5pkG3eTyXjii61bUMEglEsYxUoCZVR74Ek+0A=
=xZct
-END PGP SIGNATURE-

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



[tomcat] branch master updated: Remove custom split() method. String.split is already optimized for single-character splits and won't use a regex.

2019-05-08 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

schultz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new bae1f02  Remove custom split() method. String.split is already 
optimized for single-character splits and won't use a regex.
bae1f02 is described below

commit bae1f0258de12481cc9e555b2448cf364f4c9814
Author: Christopher Schultz 
AuthorDate: Wed May 8 21:15:20 2019 +0200

Remove custom split() method. String.split is already optimized for
single-character splits and won't use a regex.
---
 .../apache/catalina/servlets/DefaultServlet.java   | 75 +-
 1 file changed, 1 insertion(+), 74 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 4efd553..b87a8d6 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2844,7 +2844,7 @@ public class DefaultServlet extends HttpServlet {
 if(null == order || 0 == order.trim().length())
 return Order.DEFAULT;
 
-String[] options = split(order);
+String[] options = order.split(";");
 
 if(0 == options.length)
 return Order.DEFAULT;
@@ -2891,79 +2891,6 @@ public class DefaultServlet extends HttpServlet {
 return Order.DEFAULT;
 }
 
-/**
- * Split a string using a semicolon as a delimiter.
- *
- * @param s The string to split.
- *
- * @return An array of non-empty/null strings which have been
- * separated by semicolons.
- */
-private String[] split(String s) {
-if(null == s)
-return new String[0];
-s = s.trim();
-int length = s.length();
-if(0 == length)
-return new String[0];
-
-String[] strings;
-
-int index = 0;
-int start = 0;
-int pos = s.indexOf(';');
-
-if(0 <= pos) {
-int len = 2;
-strings = new String[len]; // Usually just 2 options
-
-while(0 <= pos) {
-if(len > 9)
-pos = length; // Maximum of 10 options
-
-if(index + 1 > len) {
-// Expand by double
-String[] old = strings;
-strings = new String[old.length << 1];
-System.arraycopy(old, 0, strings, 0, len);
-len = len << 1;
-}
-
-String option = s.substring(start, pos).trim();
-
-if(0 < option.length()) {
-strings[index++] = option;
-}
-
-start = pos + 1;
-pos = s.indexOf(';', start);
-}
-
-if(start < length) {
-String option = s.substring(start).trim();
-
-if(0 < option.length()) {
-strings[index] = option;
-} else {
-index--;
-}
-} else {
-index--;
-}
-
-if(len > index) {
-// Shrink
-String[] old = strings;
-strings = new String[index + 1];
-System.arraycopy(old, 0, strings, 0, index + 1);
-}
-} else {
-strings = new String[] { s };
-}
-
-return strings;
-}
-
 public static class Order {
 final char column;
 final boolean ascending;


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



Re: Micro-optimizations

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/8/19 12:35, Mark Thomas wrote:
> On 08/05/2019 17:30, Christopher Schultz wrote:
>> 
>> Back to JspUtil.split. It's private and used exactly one place.
>> AND it's only ever called with a single-character String value.
>> So actually the use-case DID meet my needs for string-splitting
>> for the sorting. Perhaps I'll re-factor that method a little and
>> then use it across these two use-cases.
> 
> Doesn't that mean that DefaultServlet would depend on Jasper? That
> isn't allowed as the Jasper is meant to be an optional component.

That's what the re-factoring would be for: move the JspUtil.split
method somewhere else that is shared and use that from both places.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIyBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTKO0ACgkQHPApP6U8
pFj+7w/4gEfDhab5/dGDLNB1GODQPI963rD+GwyZFbrPaWxSLXnxkSUO70Z8xUfj
5t+L9xW7WqPI7yJzS0mIcCjskiYfsHoc2nSlaDtitduGMnSDMsPd0EJQaw9JXIqk
3gInxFQ7nKHjyVZpGQI6epKQQLk1RHgvGWGQxrTVZEqUgPO31sSiIZCbQZrLD1j+
msjRhYrtYYz2m1p/vp8waPdb9LF5QuczR/+cVQO8XdtkTthjfsv62z/pYTGC0Zza
3ZSsJDNdtjlEBuqdFAZX6YaK0oisA690+dChyVZ7Cc/OfQ++Al9t4Am2dpMADiCa
KyimX8uUzg2nW2+qxVaMvlu58jIcpDyo+alfBnhQ1/lon+qxbHE15eea8VmKFfH0
BIB+Aq1PUkWSqrXZGjs4vMjQeFZ3CfHSoe5coWjELDJwSx5gcN+5cEPbDEbxHHUa
yCprx1GipEYoa5rRspP9xOEXg7WjsVzify7ZHKrgkerUtpWRy4Ui3jlImetoXTji
G2tmQUiDDgq7iOKvmDxKWf0O+ImbPbXrZ5aXtYDS7iYKWGd9jwFSS6xYQJ7/FVib
t180MGHeH7DNO8rtFKBM47+byHGOtW9GY6LrH4gCqcxqUHwVAy21MO67Nm3WTgXt
ACMhRn6fHzYjXjjYbtr91XscBFjXnvd1Tc+5Iq3ulra7GlRyeA==
=nbT1
-END PGP SIGNATURE-

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



Re: Micro-optimizations

2019-05-08 Thread Martin Grigorov
Hi,

On Wed, May 8, 2019 at 7:16 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> While working on the sort-file-listing enhancement over the weekend, I
> looked in the Tomcat code to see if we already had a method to split a
> string by a single character. The closest method I found was
>

Since few years java.lang.String#split(String) is optimized to not use
Regex when the following condition passes:

if (((regex.value.length == 1 &&
 ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) ||
 (regex.length() == 2 &&
  regex.charAt(0) == '\\' &&
  (((ch = regex.charAt(1))-'0')|('9'-ch)) < 0 &&
  ((ch-'a')|('z'-ch)) < 0 &&
  ((ch-'A')|('Z'-ch)) < 0)) &&
(ch < Character.MIN_HIGH_SURROGATE ||
 ch > Character.MAX_LOW_SURROGATE))
{

i.e. in many cases it is already fast enough.


> org.pache.jasper.compiler.JspUtil which splits on a string, so I
> rejected it as being a bit too general-purpose for my needs.
>
> But it got me looking into the implementation of the method, and it
> looks a little sketchy.
>
> First, it uses a java.util.Vector. Yep, a Vector. Remember those?
> Synchronized everything? The Vector is not used outside of the method
> at all -- it's just local and temporary. So, the obvious conclusion is
> that it should be changed to ArrayList, right?
>
> But, modern JVMs are fairly good at (a) processing contention-less
> locks more quickly and (b) identifying objects which cannot possibly
> have lock-contention and simply skipping the locking.
>
> What's the right move in these cases? Should we change Vector ->
> ArrayList and "help-out" the compiler and runtime, or should we leave
> the code alone because "it's fine"?
>
> Similar arguments can be made for using StringBuilder over
> StringBuffer, etc.
>
> WDYT?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTAMcACgkQHPApP6U8
> pFjEOQ//SpbOVCErJu8SCue+RagRp0Z0PsAwbquf2z4NuMsPZVST66fcjE7QY7aI
> 9whVdUBauxNiUCwMUOkgV8g8IGBB8KoWyhyIkTWCZuh+cwan6+5aKesE5UcUdYW5
> Xg93cqB4oGUWsR1YaEWEdycBObCTcXx/oHTq26/rXZvrGDHGU7rrGGOgTqO4TETU
> 6xvME86xTaImrBYIrnSUTo2S3QyPbqsoOOzEWinyW75cvR6xFw4iNNRfgzHIlb8f
> EIUjCqHasm4qAcxQ+t0DIoeVbWvcLpX49UMNyXP5Wt2frOjeTzpx4ErFrNXsAlQd
> JYoNgo50nAYNwxAsnBbZCrqSkaFO89I+nj7Tq9WDovOTF17CyMMaYtJiBe/ocTNv
> 25JmldlsM/wFY+ol9PQz9UmfzOHCcKGWEV4DcKaro6aTBzhELGYHpRh3z+ZNNuHD
> zkbJPRZFDZ4XC9dwRSfm0DUbIsYP2peBp3z7/1hWm+lnK6NIAZQQh0TzJ/cIliKw
> 6uWvCesERD1GyQosqoL0h9MHSckGpTSfbk+iI6MZtEwQc3AH4C27fm6MpfAc8YQU
> sr0jf2EdgzrC990jazPZcRbpwT8Eifc5kF6QgkbiockkqC/Zr28awL7vY2m5Szg9
> n2scZoWUAnkGM8k0x3sFM4DZpthjUGVe78ZsBnJkKX4Q5LAnAYQ=
> =U4Jd
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


ApacheCon call for presentations, httpd content

2019-05-08 Thread jean-frederic clere
Hi, folks.

The call for presentations for ApacheCon North America closes in a
little less than 6 days.

The CFP is here - https://www.apachecon.com/acna19/cfp.html - and closes
May 13th.

Thanks!

Jean-Frederic


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



[Bug 63412] WebSocket examples in Tomcat 9.0.20 RC fail with SecurityManager

2019-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63412

Remy Maucherat  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Remy Maucherat  ---
I'm pretty sure it tries and fails to load the enums only there. Things worked
mostly by accident before, and the classes of SocketWrapperBase should all be
preloaded now since they're API usable in webapps now.
Will test it.

-- 
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



Re: [OT] Jakarta package change

2019-05-08 Thread Rémy Maucherat
On Wed, May 8, 2019 at 6:22 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Mark,
>
> On 5/7/19 06:31, Mark Thomas wrote:
> > Rather than announcing a solution, how about we announce that we
> > will continue to support the javax.* APIS (Servlet 4.0, JSP 2.3, EL
> > 3.0, WebSocket 1.1 and JASPIC 1.1) until at least 31 Dec 2030*.
> > Note: that means supporting all the older versions of those specs
> > as well. Exactly how we do that is TBD. Extending Tomcat 9 support
> > to the end of 2030 is just one possible option.
> >
> > Mark
> >
> > * Insert date of choice here. I picked first Tomcat 9 release + 10
> > years for typical support period + 5 years extension and rounded to
> > the end of the year.
>
> The first release of Tomcat 9 was in 2015? WOW. I didn't realize it
> has almost been 5 years.
>

M1 = milestone 1, it's not a real release. It was in 11/2015, so that's
only 3.5 years ago, not 5. The first real release was less than two years
ago, so not very long.

Rémy


>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTAl0ACgkQHPApP6U8
> pFhw9Q//VksNNJQUJJswI4XYq/MCYlFlua1fu/BoCBkLZGjS2d1Mq+rqs2Ogtzu/
> 7JELHfwru8irDmn1GK0vRjoYS4Xdrc9anDtchgogGIaJ0Ky5yPdrjYfSPfTDYi/N
> JaiIkqGZZABYJMocoFTqYvtNT0v5WHrVJunehDJCmM9b2UO6y9oVMoT6+hsJ3Il8
> RNbWektqrB+s3ZWcqtPGZWMJ0zeIITSsUM00iKpdXaJZsSNUaN2KvRJJHg2o26Gk
> 7HBdcP6b23wMrMVOslWmS62zZtTXTLcKOCepIF5I8+fJuTaBD17eUi0ly6z2iXuB
> RNYhojxhGQe+YSozggPydrBnLniMONVBdIlJAVHbrrbnfIo4K3xwpq8vnFeTrlJd
> zqRK+PM8z6Duo1ulEaFLP88C49AQP8an1BJay1uKKXg0TBy70pXP3E3hFxi+AjQq
> vBv10c1Zuk1BYA2DTHoxCS8H73FTKKEEpZa37zL+p9/TltMxX4aNHtU29Nni2uWD
> YPMuQY55AeP+wXsR+sV8WmQWDGM2Bcvcx4LwzHCdO7N5aRVFsc2VCIIQPp58V8nA
> 6u3uiHAtk60hjHbukpXaggqeSWmJmGIhZ8Ixh5FNpK5ZL3lXMhTSTZp4GO8w4aAD
> IeJRuG2GSJW7AdRZmL4sZmRYH2gPB6pOUDp3QDwyHNbQA1gJFvc=
> =Ih7W
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


Re: Micro-optimizations

2019-05-08 Thread Mark Thomas
On 08/05/2019 17:30, Christopher Schultz wrote:
> Mark,
> 
> On 5/8/19 12:20, Mark Thomas wrote:
>> On 08/05/2019 17:16, Christopher Schultz wrote:
>>> All,
>>>
>>> While working on the sort-file-listing enhancement over the
>>> weekend, I looked in the Tomcat code to see if we already had a
>>> method to split a string by a single character. The closest
>>> method I found was org.pache.jasper.compiler.JspUtil which splits
>>> on a string, so I rejected it as being a bit too general-purpose
>>> for my needs.
>>>
>>> But it got me looking into the implementation of the method, and
>>> it looks a little sketchy.
>>>
>>> First, it uses a java.util.Vector. Yep, a Vector. Remember
>>> those? Synchronized everything? The Vector is not used outside of
>>> the method at all -- it's just local and temporary. So, the
>>> obvious conclusion is that it should be changed to ArrayList,
>>> right?
>>>
>>> But, modern JVMs are fairly good at (a) processing
>>> contention-less locks more quickly and (b) identifying objects
>>> which cannot possibly have lock-contention and simply skipping
>>> the locking.
>>>
>>> What's the right move in these cases? Should we change Vector -> 
>>> ArrayList and "help-out" the compiler and runtime, or should we
>>> leave the code alone because "it's fine"?
>>>
>>> Similar arguments can be made for using StringBuilder over 
>>> StringBuffer, etc.
>>>
>>> WDYT?
> 
>> I think the code is cleaner and easier to understand when the code 
>> matches the intention rather than when the code plus some expected 
>> compiler optimisation match the intention. So I'd say +1 to making
>> these sorts of changes.
> 
> This is kind of my thought as well.
> 
> I also feel like code coming from Apache ought to be an example of the
> "right way of doing things" wherever possible. Obviously, that's not a
> goal of many projects both within and outside the ASF, but I kind of
> feel like we should be able to point to Tomcat code and say "yes, this
> is how it should be done".
> 
> If it doesn't look nice, then it should be changed. I'm guessing
> that's one of the reasons you went through all the code and changed
> try/finally to try-with-resources and Foo baz = new Foo to
> Foo baz = new Foo<>() everywhere. I think this is kind of the same.

try-with-resources was partly about reducing code verbosity and partly
about ensuring resources were actually closed.

Foo baz = new Foo<>() was to reduce/eliminate IDE warnings. My
preference is to keep the code clean of IDE warnings so when I make a
stupid mistake and my IDE tries to point it out it isn't lost in the noise.

> Back to JspUtil.split. It's private and used exactly one place. AND
> it's only ever called with a single-character String value. So
> actually the use-case DID meet my needs for string-splitting for the
> sorting. Perhaps I'll re-factor that method a little and then use it
> across these two use-cases.

Doesn't that mean that DefaultServlet would depend on Jasper? That isn't
allowed as the Jasper is meant to be an optional component.

Mark

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



Re: Micro-optimizations

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/8/19 12:20, Mark Thomas wrote:
> On 08/05/2019 17:16, Christopher Schultz wrote:
>> All,
>> 
>> While working on the sort-file-listing enhancement over the
>> weekend, I looked in the Tomcat code to see if we already had a
>> method to split a string by a single character. The closest
>> method I found was org.pache.jasper.compiler.JspUtil which splits
>> on a string, so I rejected it as being a bit too general-purpose
>> for my needs.
>> 
>> But it got me looking into the implementation of the method, and
>> it looks a little sketchy.
>> 
>> First, it uses a java.util.Vector. Yep, a Vector. Remember
>> those? Synchronized everything? The Vector is not used outside of
>> the method at all -- it's just local and temporary. So, the
>> obvious conclusion is that it should be changed to ArrayList,
>> right?
>> 
>> But, modern JVMs are fairly good at (a) processing
>> contention-less locks more quickly and (b) identifying objects
>> which cannot possibly have lock-contention and simply skipping
>> the locking.
>> 
>> What's the right move in these cases? Should we change Vector -> 
>> ArrayList and "help-out" the compiler and runtime, or should we
>> leave the code alone because "it's fine"?
>> 
>> Similar arguments can be made for using StringBuilder over 
>> StringBuffer, etc.
>> 
>> WDYT?
> 
> I think the code is cleaner and easier to understand when the code 
> matches the intention rather than when the code plus some expected 
> compiler optimisation match the intention. So I'd say +1 to making
> these sorts of changes.

This is kind of my thought as well.

I also feel like code coming from Apache ought to be an example of the
"right way of doing things" wherever possible. Obviously, that's not a
goal of many projects both within and outside the ASF, but I kind of
feel like we should be able to point to Tomcat code and say "yes, this
is how it should be done".

If it doesn't look nice, then it should be changed. I'm guessing
that's one of the reasons you went through all the code and changed
try/finally to try-with-resources and Foo baz = new Foo to
Foo baz = new Foo<>() everywhere. I think this is kind of the same.

Back to JspUtil.split. It's private and used exactly one place. AND
it's only ever called with a single-character String value. So
actually the use-case DID meet my needs for string-splitting for the
sorting. Perhaps I'll re-factor that method a little and then use it
across these two use-cases.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTBCsACgkQHPApP6U8
pFjXaxAAmStuVV4R5xLXOuI7+svzqZ9qPBiDMa/KjBk2lvFBoZ7H1pg8OZcLH2qO
z+iGmf7IvdJ13SBwQfaGGZ556iJGjFkx3IX6+sC8jeBJt0se2BKU8UrsKlesYnnw
ZWaz9+gfg0Ab/N0l7Oh+BtHAdk60l1Lhg+3Pb4owHkJZj40VeIe59c7iF2OshBh9
PZOtek1TJkE1Mi2XmQKAqA6MJ8LDdUIIuFj+p4pWy+OOOzzywTvYNSlPe8Ozo8u9
9EpXis8wi66DMGMQXLtCbC9TW1z2DAV0r5lHfCuX1tdhvyDb9PvBKnL9SdIEB1Tf
4HUjnQ+XCUlXpsP1GjKD1W9v3z+dxuWbFoA/tZgtagc3+nsizkEwX7EFMAa9nfZq
7dYwbMIi6ypZZbDfzYTw3VD73KUZa8IRQd6zQBU8jYp/gT1sb4uSLzPhV73IyHDQ
tzdjtrwUzk0TPFJR7LgaOJBuGfIwh3gN19c+mNOgft6l7OBsu8rxXH+B7haoPkVD
u3KBWpvXhKTY6QWoUPQt3wgYysWUGjpigPJyFx5ndk5zVl5MSB0AXSZBEkBRuAG+
yEfumxHKtVy2OFLFgw65Wc2P6CZcYLIdGu5qccKFiyD/f8zh4vdeWcfWtsG8Siye
sCXJRBg4CwysWzVusTTus6ajb/MkMtOsj7NkU7f24o3KQ+EyIAY=
=/PKS
-END PGP SIGNATURE-

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



Re: [OT] Jakarta package change

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/7/19 06:31, Mark Thomas wrote:
> Rather than announcing a solution, how about we announce that we
> will continue to support the javax.* APIS (Servlet 4.0, JSP 2.3, EL
> 3.0, WebSocket 1.1 and JASPIC 1.1) until at least 31 Dec 2030*.
> Note: that means supporting all the older versions of those specs
> as well. Exactly how we do that is TBD. Extending Tomcat 9 support
> to the end of 2030 is just one possible option.
> 
> Mark
> 
> * Insert date of choice here. I picked first Tomcat 9 release + 10
> years for typical support period + 5 years extension and rounded to
> the end of the year.

The first release of Tomcat 9 was in 2015? WOW. I didn't realize it
has almost been 5 years.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTAl0ACgkQHPApP6U8
pFhw9Q//VksNNJQUJJswI4XYq/MCYlFlua1fu/BoCBkLZGjS2d1Mq+rqs2Ogtzu/
7JELHfwru8irDmn1GK0vRjoYS4Xdrc9anDtchgogGIaJ0Ky5yPdrjYfSPfTDYi/N
JaiIkqGZZABYJMocoFTqYvtNT0v5WHrVJunehDJCmM9b2UO6y9oVMoT6+hsJ3Il8
RNbWektqrB+s3ZWcqtPGZWMJ0zeIITSsUM00iKpdXaJZsSNUaN2KvRJJHg2o26Gk
7HBdcP6b23wMrMVOslWmS62zZtTXTLcKOCepIF5I8+fJuTaBD17eUi0ly6z2iXuB
RNYhojxhGQe+YSozggPydrBnLniMONVBdIlJAVHbrrbnfIo4K3xwpq8vnFeTrlJd
zqRK+PM8z6Duo1ulEaFLP88C49AQP8an1BJay1uKKXg0TBy70pXP3E3hFxi+AjQq
vBv10c1Zuk1BYA2DTHoxCS8H73FTKKEEpZa37zL+p9/TltMxX4aNHtU29Nni2uWD
YPMuQY55AeP+wXsR+sV8WmQWDGM2Bcvcx4LwzHCdO7N5aRVFsc2VCIIQPp58V8nA
6u3uiHAtk60hjHbukpXaggqeSWmJmGIhZ8Ixh5FNpK5ZL3lXMhTSTZp4GO8w4aAD
IeJRuG2GSJW7AdRZmL4sZmRYH2gPB6pOUDp3QDwyHNbQA1gJFvc=
=Ih7W
-END PGP SIGNATURE-

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



Re: The migration guide configuration file difference feature is broken

2019-05-08 Thread Konstantin Kolinko
ср, 8 мая 2019 г. в 18:16, Mark Thomas :
>
> On 08/05/2019 15:35, Coty Sutherland wrote:
> > Hi,
> >
> > Someone on freenode (CiscoEagle) pointed out to me that the migration
> > guide's file comparison feature doesn't work :(

This has already been reported 5-6 times. See the archives.

> > Looking at the "configure
> > file differences" section on the 9.0 migration guide (
> > http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences),
> > if you click the "view differences" button you get taken to the gitbox web
> > UI, but it returns a 403. Does anyone have any idea how to fix it? I looked
> > to see if there was an alternative method to get the diff in the web UI but
> > I don't see one that allows you to compare files across tags.
>
> The feature has been (hopefully)  temporarily disabled by infra due to
> abuse. If there was a way of doing this in GitHub, we could use that.
> I've tried, and failed, to find one.

I think that one solution is generate a series of diff files and
upload the diff files to the Tomcat web site. The web form can be
replaces with a static table that links to the diff files.

Best regards,
Konstantin Kolinko

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



Re: Micro-optimizations

2019-05-08 Thread Mark Thomas
On 08/05/2019 17:16, Christopher Schultz wrote:
> All,
> 
> While working on the sort-file-listing enhancement over the weekend, I
> looked in the Tomcat code to see if we already had a method to split a
> string by a single character. The closest method I found was
> org.pache.jasper.compiler.JspUtil which splits on a string, so I
> rejected it as being a bit too general-purpose for my needs.
> 
> But it got me looking into the implementation of the method, and it
> looks a little sketchy.
> 
> First, it uses a java.util.Vector. Yep, a Vector. Remember those?
> Synchronized everything? The Vector is not used outside of the method
> at all -- it's just local and temporary. So, the obvious conclusion is
> that it should be changed to ArrayList, right?
> 
> But, modern JVMs are fairly good at (a) processing contention-less
> locks more quickly and (b) identifying objects which cannot possibly
> have lock-contention and simply skipping the locking.
> 
> What's the right move in these cases? Should we change Vector ->
> ArrayList and "help-out" the compiler and runtime, or should we leave
> the code alone because "it's fine"?
> 
> Similar arguments can be made for using StringBuilder over
> StringBuffer, etc.
> 
> WDYT?

I think the code is cleaner and easier to understand when the code
matches the intention rather than when the code plus some expected
compiler optimisation match the intention. So I'd say +1 to making these
sorts of changes.

Mark

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



Micro-optimizations

2019-05-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

While working on the sort-file-listing enhancement over the weekend, I
looked in the Tomcat code to see if we already had a method to split a
string by a single character. The closest method I found was
org.pache.jasper.compiler.JspUtil which splits on a string, so I
rejected it as being a bit too general-purpose for my needs.

But it got me looking into the implementation of the method, and it
looks a little sketchy.

First, it uses a java.util.Vector. Yep, a Vector. Remember those?
Synchronized everything? The Vector is not used outside of the method
at all -- it's just local and temporary. So, the obvious conclusion is
that it should be changed to ArrayList, right?

But, modern JVMs are fairly good at (a) processing contention-less
locks more quickly and (b) identifying objects which cannot possibly
have lock-contention and simply skipping the locking.

What's the right move in these cases? Should we change Vector ->
ArrayList and "help-out" the compiler and runtime, or should we leave
the code alone because "it's fine"?

Similar arguments can be made for using StringBuilder over
StringBuffer, etc.

WDYT?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlzTAMcACgkQHPApP6U8
pFjEOQ//SpbOVCErJu8SCue+RagRp0Z0PsAwbquf2z4NuMsPZVST66fcjE7QY7aI
9whVdUBauxNiUCwMUOkgV8g8IGBB8KoWyhyIkTWCZuh+cwan6+5aKesE5UcUdYW5
Xg93cqB4oGUWsR1YaEWEdycBObCTcXx/oHTq26/rXZvrGDHGU7rrGGOgTqO4TETU
6xvME86xTaImrBYIrnSUTo2S3QyPbqsoOOzEWinyW75cvR6xFw4iNNRfgzHIlb8f
EIUjCqHasm4qAcxQ+t0DIoeVbWvcLpX49UMNyXP5Wt2frOjeTzpx4ErFrNXsAlQd
JYoNgo50nAYNwxAsnBbZCrqSkaFO89I+nj7Tq9WDovOTF17CyMMaYtJiBe/ocTNv
25JmldlsM/wFY+ol9PQz9UmfzOHCcKGWEV4DcKaro6aTBzhELGYHpRh3z+ZNNuHD
zkbJPRZFDZ4XC9dwRSfm0DUbIsYP2peBp3z7/1hWm+lnK6NIAZQQh0TzJ/cIliKw
6uWvCesERD1GyQosqoL0h9MHSckGpTSfbk+iI6MZtEwQc3AH4C27fm6MpfAc8YQU
sr0jf2EdgzrC990jazPZcRbpwT8Eifc5kF6QgkbiockkqC/Zr28awL7vY2m5Szg9
n2scZoWUAnkGM8k0x3sFM4DZpthjUGVe78ZsBnJkKX4Q5LAnAYQ=
=U4Jd
-END PGP SIGNATURE-

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



Re: [VOTE] Release Apache Tomcat 9.0.20

2019-05-08 Thread Konstantin Kolinko
сб, 4 мая 2019 г. в 01:52, Mark Thomas :
>
> The proposed Apache Tomcat 9.0.20 release is now available for voting.
>
>
> The proposed 9.0.20 release is:
> [ ] Broken - do not release
> [ ] Stable - go ahead and release as 9.0.20

Not voting yet.

1. Unit tests (Java 8 32-bit, windows 10, all connectors):
- All text pass except the following one:
- TestHttp2InitialConnection test fails. The text itself is broken.
This is not a stopper.
This was filed as
https://bz.apache.org/bugzilla/show_bug.cgi?id=63403
and has already been fixed in master.

2. Smoke-testing. Running apache-tomcat-9.0.20-windows-x64.zip +
64-bit OpenJDK Java 12.0.1 + SecurityManager enabled
- WebSocket examples are failing.
This was filed as
https://bz.apache.org/bugzilla/show_bug.cgi?id=63412

Usually such issues can be worked-around by adding some harmless
permissions into catalina.policy file, but I have not yet verified
what is needed for this specific case.

- Other examples are OK.
- If I run without SecurityManager, the WebSocket examples run correctly.


Best regards,
Konstantin Kolinko

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



[Bug 63412] New: WebSocket examples in Tomcat 9.0.20 RC fail with SecurityManager

2019-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63412

Bug ID: 63412
   Summary: WebSocket examples in Tomcat 9.0.20 RC fail with
SecurityManager
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Examples
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com
  Target Milestone: -

Created attachment 36577
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36577&action=edit
catalina.2019-05-08.log

Smoke-testing Tomcat 9.0.20 release candidate:
running apache-tomcat-9.0.20-windows-x64.zip + OpenJDK Java 12.0.1 64-bit on
Windows 10.

WebSocket examples are failing and are not usable.

1. I opened all websocket examples in different tabs.
2. Testing the "echo" example:

1) The "Connect" button works, a connection is opened. 
2) Messages are sent to the server ("Sent: Here is a message!" line is
printed), but there is no echo from server (nothing is received).
3) The "Disconnect" button does not work.
4) The connection closes itself after a timeout. The following is printed:
"Info: WebSocket connection closed, Code: 1006"

3. Other WebSocket examples fail to initialize. They open a connection but fail
to operate any further.

4. If I run the same version of Tomcat and Java without enabling a
SecurityManager, the WebSocket examples work correctly.

BTW, other examples work correctly. Running them with SecurityManager being
enabled I do not note any issues.

-- 
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



Re: The migration guide configuration file difference feature is broken

2019-05-08 Thread Coty Sutherland
On Wed, May 8, 2019 at 11:17 AM Mark Thomas  wrote:

> On 08/05/2019 15:35, Coty Sutherland wrote:
> > Hi,
> >
> > Someone on freenode (CiscoEagle) pointed out to me that the migration
> > guide's file comparison feature doesn't work :( Looking at the "configure
> > file differences" section on the 9.0 migration guide (
> >
> http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences
> ),
> > if you click the "view differences" button you get taken to the gitbox
> web
> > UI, but it returns a 403. Does anyone have any idea how to fix it? I
> looked
> > to see if there was an alternative method to get the diff in the web UI
> but
> > I don't see one that allows you to compare files across tags.
>
> The feature has been (hopefully)  temporarily disabled by infra due to
> abuse. If there was a way of doing this in GitHub, we could use that.
> I've tried, and failed, to find one.
>

Ah, OK. I tried to find a quick way to do it on GitHub but all I can find
is comparing all files in a tag, like
https://github.com/apache/tomcat/compare/9.0.1...9.0.17. It's really easy
to do in the git CLI, but I don't see an easy way in the web UI.


>
> > Additionally the 8.0.x configuration file differences section is
> completely
> > broken (returns a 404) because it tries to use the svn repo for
> comparison,
> > which no longer exists. Example:
> >
> http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/conf/catalina.policy?diff_format=h&r1=1830460&r2=1834688
>
> That page shouldn't be publicly linked any more but we can fix it to
> point to the new svn location.
>

OK. I can adjust it if you tell me where the new location is :)


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


Re: The migration guide configuration file difference feature is broken

2019-05-08 Thread Mark Thomas
On 08/05/2019 15:35, Coty Sutherland wrote:
> Hi,
> 
> Someone on freenode (CiscoEagle) pointed out to me that the migration
> guide's file comparison feature doesn't work :( Looking at the "configure
> file differences" section on the 9.0 migration guide (
> http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences),
> if you click the "view differences" button you get taken to the gitbox web
> UI, but it returns a 403. Does anyone have any idea how to fix it? I looked
> to see if there was an alternative method to get the diff in the web UI but
> I don't see one that allows you to compare files across tags.

The feature has been (hopefully)  temporarily disabled by infra due to
abuse. If there was a way of doing this in GitHub, we could use that.
I've tried, and failed, to find one.

> Additionally the 8.0.x configuration file differences section is completely
> broken (returns a 404) because it tries to use the svn repo for comparison,
> which no longer exists. Example:
> http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/conf/catalina.policy?diff_format=h&r1=1830460&r2=1834688

That page shouldn't be publicly linked any more but we can fix it to
point to the new svn location.

Mark

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



The migration guide configuration file difference feature is broken

2019-05-08 Thread Coty Sutherland
Hi,

Someone on freenode (CiscoEagle) pointed out to me that the migration
guide's file comparison feature doesn't work :( Looking at the "configure
file differences" section on the 9.0 migration guide (
http://tomcat.apache.org/migration-9.html#Tomcat_9.0.x_configuration_file_differences),
if you click the "view differences" button you get taken to the gitbox web
UI, but it returns a 403. Does anyone have any idea how to fix it? I looked
to see if there was an alternative method to get the diff in the web UI but
I don't see one that allows you to compare files across tags.

Additionally the 8.0.x configuration file differences section is completely
broken (returns a 404) because it tries to use the svn repo for comparison,
which no longer exists. Example:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/conf/catalina.policy?diff_format=h&r1=1830460&r2=1834688



Thanks,
Coty