[Bug 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #5 from Phillip Webb  ---
I'm trying to create a patch for this but I don't seem to be able to build
8.0.x from trunk.

Running `ant test` gives me:

test-bio:

BUILD FAILED
/Users/pwebb/projects/tomcat/trunk/build.xml:1374: The following error occurred
while executing this line:
/Users/pwebb/projects/tomcat/trunk/build.xml:1431: junit doesn't support the
"threads" attribute


Any ideas?

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #6 from Mark Thomas  ---
Read BUILDING.txt for details on the minimum Ant version required.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #7 from Phillip Webb  ---
Thanks! Sorry, I should have checked that.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #8 from Remy Maucherat  ---
"2) if a Server header was set by a web application, we should remove it": I
see no reason to do that.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #9 from Mark Thomas  ---
I remain unconvinced that there are any real world security benefits to be
gained by removing the security header.

The bandwidth argument carries slightly more weight but we are only talking 27
bytes per response and most responses will dwarf that by at least several
orders of magnitude. Add HTTP/2 to the mix and those 27 bytes will quickly
shrink.

If we do anything at all, I am leaning towards completely removing all Server
header processing (all ~15 lines of code of it) and let applications add it if
they wish. Users wanting to provide useful server version information via
configuration can enable the X-Powered-By header.

-- 
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 58751] Strange behaviour after calling sendError when an async request times out

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58751

--- Comment #1 from Andy Wilkinson  ---
Created attachment 33363
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33363=edit
Another variant of the testcase the resulting in a ClientAbortException

I've attached another testcase that behaves slightly differently. In this test,
the response is sent back to the client before the custom error page is called.
When the error page is then called it flushes the response and a
ClientAbortException is thrown.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

Phillip Webb  changed:

   What|Removed |Added

 CC||pw...@pivotal.io

--- Comment #10 from Phillip Webb  ---
Thanks! Sorry, I should have checked that.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #11 from Phillip Webb  ---
Removing all server header processing code will break back compatibility.
Specifically, this recently added Spring Boot feature [1] will stop working
since it relies on the `server` attribute being picked up.

[1] https://github.com/spring-projects/spring-boot/issues/4461

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #12 from Phillip Webb  ---
For more information about what's driving this request see
https://github.com/spring-projects/spring-boot/issues/4730. We've specifically
looking for feature parity across all embedded servlet containers that we
support (Tomcat, Jetty, Undertow).

I think the least invasive option is to add a flag to disable the server
header. This would be similar to Jetty's
`HttpConfiguration.setSendServerVersion`, not effect any existing users and
provide a quick way to opt-out of the header.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #13 from Phillip Webb  ---
Created attachment 33364
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33364=edit
Suggested patch

Something like this. (not including tests yet as not sure where to add them)

-- 
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: r1720752 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java webapps/docs/changelog.xml

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 11:17:34 2015
New Revision: 1720752

URL: http://svn.apache.org/viewvc?rev=1720752=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58702
Ensure an access log entry is generated if the client aborts the connection.

Modified:
tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1720752=1720751=1720752=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Dec 
18 11:17:34 2015
@@ -246,15 +246,6 @@ public class CoyoteAdapter implements Ad
 if (!request.isAsync()) {
 request.finishRequest();
 response.finishResponse();
-if (request.getMappingData().context != null) {
-request.getMappingData().context.logAccess(
-request, response,
-System.currentTimeMillis() - req.getStartTime(),
-false);
-} else {
-// Should normally not happen
-log(req, res, System.currentTimeMillis() - 
req.getStartTime());
-}
 }
 
 // Check to see if the processor is in an error state. If it is,
@@ -274,12 +265,21 @@ public class CoyoteAdapter implements Ad
 } finally {
 if (!success) {
 res.setStatus(500);
+}
+
+// Access logging
+if (!success || !request.isAsync()) {
 long time = 0;
 if (req.getStartTime() != -1) {
 time = System.currentTimeMillis() - req.getStartTime();
 }
-log(req, res, time);
+if (request.getMappingData().context != null) {
+request.getMappingData().context.logAccess(request, 
response, time, false);
+} else {
+log(req, res, time);
+}
 }
+
 req.getRequestProcessor().setWorkerThreadName(null);
 // Recycle the wrapper request and response
 if (!success || !request.isAsync()) {
@@ -290,6 +290,7 @@ public class CoyoteAdapter implements Ad
 return success;
 }
 
+
 /**
  * Service method.
  */
@@ -328,13 +329,13 @@ public class CoyoteAdapter implements Ad
 }
 
 boolean async = false;
+boolean postParseSuccess = false;
 
 try {
-
 // Parse and set Catalina and configuration specific
 // request parameters
 req.getRequestProcessor().setWorkerThreadName(THREAD_NAME.get());
-boolean postParseSuccess = postParseRequest(req, request, res, 
response);
+postParseSuccess = postParseRequest(req, request, res, response);
 if (postParseSuccess) {
 //check valves if we support async
 
request.setAsyncSupported(connector.getService().getContainer().getPipeline().isAsyncSupported());
@@ -361,6 +362,13 @@ public class CoyoteAdapter implements Ad
 } else {
 request.finishRequest();
 response.finishResponse();
+}
+
+} catch (IOException e) {
+// Ignore
+} finally {
+// Access log
+if (!async) {
 if (postParseSuccess) {
 // Log only if processing was invoked.
 // If postParseRequest() failed, it has already logged it.
@@ -371,12 +379,10 @@ public class CoyoteAdapter implements Ad
 }
 }
 
-} catch (IOException e) {
-// Ignore
-} finally {
 req.getRequestProcessor().setWorkerThreadName(null);
 AtomicBoolean error = new AtomicBoolean(false);
 res.action(ActionCode.IS_ERROR, error);
+
 // Recycle the wrapper request and response
 if (!async || error.get()) {
 request.recycle();

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1720752=1720751=1720752=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Dec 18 11:17:34 2015
@@ -143,6 +143,10 @@
 the failure of the web application. Includes a test case written by
  Derek Abdine. (markt)
   
+  
+58702: Ensure an access log entry is generated if the client
+aborts the connection. (markt)
+ 

svn commit: r1720756 - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/catalina/connector/CoyoteAdapter.java webapps/docs/changelog.xml

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 11:27:01 2015
New Revision: 1720756

URL: http://svn.apache.org/viewvc?rev=1720756=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58702
Ensure an access log entry is generated if the client aborts the connection.

Modified:
tomcat/tc8.0.x/trunk/   (props changed)
tomcat/tc8.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc8.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 11:27:01 2015
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640083-1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642233,1642280,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1642766,1643002,1643045,1643054-1643055,1643066,1643121,1643128,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643536,1643570,1643634,1643649,1643651,1643654,1643675,1643731,1643733-1643734,1643761,1643766,1643814,1643937,1643963,1644017,1644169,1644201-1644203,1644321,1644323,1644516,1644523,1644529,1644535,1644730,1644768,1644784-1644785,1644790,1644793,1644815,1644884,1644886,1644890,1644892
 
,1644910,1644924,1644929-1644930,1644935,1644989,1645011,1645247,1645355,1645357-1645358,1645455,1645465,1645469,1645471,1645473,1645475,1645486-1645488,1645626,1645641,1645685,1645743,1645763,1645951-1645953,1645955,1645993,1646098-1646106,1646178,1646220,1646302,1646304,1646420,1646470-1646471,1646476,1646559,1646717-1646723,1646773,1647026,1647042,1647530,1647655,1648304,1648815,1648907,1649973,1650081,1650365,1651116,1651120,1651280,1651470,1652938,1652970,1653041,1653471,1653550,1653574,1653797,1653815-1653816,1653819,1653840,1653857,1653888,1653972,1654013,1654030,1654050,1654123,1654148,1654159,1654513,1654515,1654517,1654522,1654524,1654725,1654735,1654766,1654785,1654851-1654852,1654978,1655122-1655124,1655126-1655127,1655129-1655130,1655132-1655133,1655312,1655351,1655438,1655441,1655454,168,1656087,1656299,1656319,1656331,1656345,1656350,1656590,1656648-1656650,1656657,1657041,1657054,1657374,1657492,1657510,1657565,1657580,1657584,1657586,1657589,1657592,1657607,1657
 
609,1657682,1657907,1658207,1658734,1658781,1658790,1658799,1658802,1658804,1658833,1658840,1658966,1659043,1659053,1659059,1659174,1659184,1659188-1659189,1659216,1659263,1659293,1659304,1659306-1659307,1659382,1659384,1659428,1659471,1659486,1659505,1659516,1659521,1659524,1659559,1659562,1659803,1659806,1659814,1659833,1659862,1659905,1659919,1659948,1659967,1659983-1659984,1660060,1660074,1660077,1660133,1660168,1660331-1660332,1660353,1660358,1660924,1661386,1661770,1661867,1661972,1661990,1662200,1662308-1662309,1662548,1662614,1662696,1662736,1662985,1662988-1662989,1663264,1663277,1663298,1663534,1663562,1663676,1663715,1663754,1663768,1663772,1663781,1663893,1663995,1664143,1664163,1664174,1664301,1664317,1664347,1664657,1664659,1664710,1664863-1664864,1664866,1665085,1665292,1665559,1665653,1665661,1665672,1665694,1665697,1665736,1665779,1665976-1665977,1665980-1665981,1665985-1665986,1665989,1665998,1666004,1666008,1666013,1666017,1666024,1666116,1666386-1666387,1666494,1
 
666496,1666552,1666569,1666579,137,149,1666757,1666966,1666972,1666985,1666995,1666997,1667292,1667402,1667406,1667546,1667615,1667630,1667636,1667688,1667764,1667871,1668026,1668135,1668193,1668593,1668596,1668630,1668639,1668843,1669353,1669370,1669451,1669800,1669838,1669876,1669882,1670394,1670433,1670591,1670598-1670600,1670610,1670631,1670719,1670724,1670726,1670730,1670940,1671112,1672272,1672284,1673754,1674294,1675461,1675486,1675594,1675830,1676231,1676250-1676251,1676364,1676381,1676393,1676479,1676525,1676552,1676615,1676630,1676634,1676721,1676926,1676943,1677140,1677802,1678011,1678162,1678174,1678339,1678426-1678427,1678694,1678701,1679534,1679708,1679710,1679716,1680034,1680246,1681056,1681123,1681138,1681280,1681283,1681286,1681450,1681697,1681701,1681729,1681770,1681779,1681793,1681807,1681837-1681838,1681854,1681862,1681958,1682028,1682033,1682311,1682315,1682317,1682320,1682324,1682330,1682842,1684172,1684366,1684383,1684526-1684527,1684549-1684550,168555
 

svn commit: r1720757 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/CoyoteAdapter.java webapps/docs/changelog.xml

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 11:33:56 2015
New Revision: 1720757

URL: http://svn.apache.org/viewvc?rev=1720757=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58702
Ensure an access log entry is generated if the client aborts the connection.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 11:33:56 2015
@@ -1,2 +1,2 @@
-/tomcat/tc8.0.x/trunk:1636525,1637336,1637685,1637709,1638726,1640089,1640276,1640349,1640363,1640366,1640642,1640672,1640674,1640689,1640884,1641001,1641065,1641067,1641375,1641638,1641723,1641726,1641729-1641730,1641736,1641988,1642669-1642670,1642698,1642701,1643205,1643215,1643217,1643230,1643232,1643273,1643285,1643329-1643330,1643511,1643513,1643521,1643539,1643571,1643581-1643582,1643635,1643655,1643738,1643964,1644018,1644333,1644954,1644992,1645014,1645360,1645456,1645627,1645642,1645686,1645903-1645904,1645908-1645909,1645913,1645920,1646458,1646460-1646462,1646735,1646738-1646741,1646744,1646746,1646748-1646755,1646757,1646759-1646760,1647043,1648816,1651420-1651422,1651844,1652926,1652939-1652940,1652973,1653798,1653817,1653841,1654042,1654161,1654736,1654767,1654787,1656592,1659907,1662986,1663265,1663278,1663325,1663535,1663567,1663679,1663997,1664175,1664321,1664872,1665061,1665086,1666027,1666395,1666503,1666506,1666560,1666570,1666581,1666759,1666967,1666988,1667553
 
-1667555,1667558,1667617,1667633,1667637,1667747,1667767,1667873,1668028,1668137,1668634,1669432,1669801,1669840,1669895-1669896,1670398,1670435,1670592,1670605-1670607,1670609,1670632,1670720,1670725,1670727,1670731,1671114,1672273,1672285,1673759,1674220,1674295,1675469,1675488,1675595,1675831,1676232,1676367-1676369,1676382,1676394,1676483,1676556,1676635,1678178,1679536,1679988,1680256,1681124,1681182,1681730,1681840,1681864,1681869,1682010,1682034,1682047,1682052-1682053,1682062,1682064,1682070,1682312,1682325,1682331,1682386,1684367,1684385,1685759,1685774,1685827,1685892,1687341,1688904,1689358,1689657,1689921,1692850,1693093,1693108,1693324,1694060,1694115,1694291,1694427,1694431,1694503,1694549,1694789,1694873,1694881,1695356,1695372,1695823-1695825,1696200,1696281,1696379,1696468,1700608,1700871,1700897,1700978,1701094,1701124,1701608,1701668,1701676,1701766,1701944,1702248,1702252,1702314,1702390,1702723,1702725,1702728,1702730,1702733,1702735,1702737,1702739,1702742,1702
 
744,1702748,1702751,1702754,1702758,1702760,1702763,1702766,1708779,1708782,1708806,1709314,1709670,1710347,1710442,1710448,1710490,1710574,1710578,1712226,1712229,1712235,1712255,1712618,1712649,1712655,1712860,1712899,1712903,1712906,1712913,1712926,1712975,1713185,1713262,1713287,1713613,1713621,1713872,1713976,1713994,1713998,1714004,1714013,1714059,1714538,1714580,1715189,1715207,1715544,1715549,1715637,1715639-1715645,1715667,1715683,1715978,1715981,1716216-1716217,1716355,1716414,1716421,1717208-1717209,1717257,1717283,1717288,1717291,1717421,1717517,1717529,1718797,1718840-1718843,1719348,1719357-1719358,1719400,1719491,1719737,1720235,1720396,1720442,1720446,1720450,1720463,1720658-1720660
-/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222329,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1237995,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,1239785-1240046,1240101,1240106,1240109,1240112,1240114
 

svn commit: r1720759 - /tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 11:42:18 2015
New Revision: 1720759

URL: http://svn.apache.org/viewvc?rev=1720759=rev
Log:
Formatting. No functional change.

Modified:
tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1720759=1720758=1720759=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java Fri Dec 
18 11:42:18 2015
@@ -38,12 +38,12 @@ import org.apache.catalina.mbeans.MBeanD
 import org.apache.tomcat.util.modeler.Registry;
 
 /**
- * This servlet will dump JMX attributes in a simple format
- * and implement proxy services for modeler.
+ * This servlet will dump JMX attributes in a simple format and implement proxy
+ * services for modeler.
  *
  * @author Costin Manolache
  */
-public class JMXProxyServlet extends HttpServlet  {
+public class JMXProxyServlet extends HttpServlet {
 
 private static final long serialVersionUID = 1L;
 
@@ -58,6 +58,7 @@ public class JMXProxyServlet extends Htt
 protected transient MBeanServer mBeanServer = null;
 protected transient Registry registry;
 
+
 // - Public Methods
 /**
  * Initialize this servlet.
@@ -80,55 +81,54 @@ public class JMXProxyServlet extends Htt
  * @exception ServletException if a servlet-specified error occurs
  */
 @Override
-public void doGet(HttpServletRequest request,
-  HttpServletResponse response)
-throws IOException, ServletException
-{
+public void doGet(HttpServletRequest request, HttpServletResponse response)
+throws IOException, ServletException {
 response.setContentType("text/plain");
 
 PrintWriter writer = response.getWriter();
 
-if( mBeanServer==null ) {
+if (mBeanServer == null) {
 writer.println("Error - No mbean server");
 return;
 }
 
-String qry=request.getParameter("set");
-if( qry!= null ) {
-String name=request.getParameter("att");
-String val=request.getParameter("val");
+String qry = request.getParameter("set");
+if (qry != null) {
+String name = request.getParameter("att");
+String val = request.getParameter("val");
 
-setAttribute( writer, qry, name, val );
+setAttribute(writer, qry, name, val);
 return;
 }
-qry=request.getParameter("get");
-if( qry!= null ) {
-String name=request.getParameter("att");
-getAttribute( writer, qry, name, request.getParameter("key") );
+qry = request.getParameter("get");
+if (qry != null) {
+String name = request.getParameter("att");
+getAttribute(writer, qry, name, request.getParameter("key"));
 return;
 }
 qry = request.getParameter("invoke");
-if(qry != null) {
-String opName=request.getParameter("op");
+if (qry != null) {
+String opName = request.getParameter("op");
 String[] params = getInvokeParameters(request.getParameter("ps"));
 invokeOperation(writer, qry, opName, params);
 return;
 }
-qry=request.getParameter("qry");
-if( qry == null ) {
+qry = request.getParameter("qry");
+if (qry == null) {
 qry = "*:*";
 }
 
-listBeans( writer, qry );
+listBeans(writer, qry);
 }
 
+
 public void getAttribute(PrintWriter writer, String onameStr, String att, 
String key) {
 try {
 ObjectName oname = new ObjectName(onameStr);
 Object value = mBeanServer.getAttribute(oname, att);
 
-if(null != key && value instanceof CompositeData)
-  value = ((CompositeData)value).get(key);
+if (null != key && value instanceof CompositeData)
+value = ((CompositeData) value).get(key);
 
 String valueStr;
 if (value != null) {
@@ -142,7 +142,7 @@ public class JMXProxyServlet extends Htt
 writer.print("' - ");
 writer.print(att);
 
-if(null != key) {
+if (null != key) {
 writer.print(" - key '");
 writer.print(key);
 writer.print("'");
@@ -157,24 +157,23 @@ public class JMXProxyServlet extends Htt
 }
 }
 
-public void setAttribute( PrintWriter writer,
-  String onameStr, String att, String val )
-{
+
+public void setAttribute(PrintWriter writer, String onameStr, String att, 
String val) {
  

Re: svn commit: r1720759 - /tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java

2015-12-18 Thread Mark Thomas
On 18/12/2015 11:42, ma...@apache.org wrote:
> Author: markt
> Date: Fri Dec 18 11:42:18 2015
> New Revision: 1720759
> 
> URL: http://svn.apache.org/viewvc?rev=1720759=rev
> Log:
> Formatting. No functional change.

I'm looking into some issues reported by Coverity in this class so I
wanted to clean up the formatting first. I used Eclipse's built-in code
formatter with some custom settings so I'd be interested in what folks
think of the result.

I'm not planning on applying the formatter across the whole code base,
rather I'm considering using it as a quick fix to get the format 95%
right when there is a large amount of format clean-up required.

Mark

> 
> Modified:
> tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> 
> Modified: tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1720759=1720758=1720759=diff
> ==
> --- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java Fri 
> Dec 18 11:42:18 2015
> @@ -38,12 +38,12 @@ import org.apache.catalina.mbeans.MBeanD
>  import org.apache.tomcat.util.modeler.Registry;
>  
>  /**
> - * This servlet will dump JMX attributes in a simple format
> - * and implement proxy services for modeler.
> + * This servlet will dump JMX attributes in a simple format and implement 
> proxy
> + * services for modeler.
>   *
>   * @author Costin Manolache
>   */
> -public class JMXProxyServlet extends HttpServlet  {
> +public class JMXProxyServlet extends HttpServlet {
>  
>  private static final long serialVersionUID = 1L;
>  
> @@ -58,6 +58,7 @@ public class JMXProxyServlet extends Htt
>  protected transient MBeanServer mBeanServer = null;
>  protected transient Registry registry;
>  
> +
>  // - Public 
> Methods
>  /**
>   * Initialize this servlet.
> @@ -80,55 +81,54 @@ public class JMXProxyServlet extends Htt
>   * @exception ServletException if a servlet-specified error occurs
>   */
>  @Override
> -public void doGet(HttpServletRequest request,
> -  HttpServletResponse response)
> -throws IOException, ServletException
> -{
> +public void doGet(HttpServletRequest request, HttpServletResponse 
> response)
> +throws IOException, ServletException {
>  response.setContentType("text/plain");
>  
>  PrintWriter writer = response.getWriter();
>  
> -if( mBeanServer==null ) {
> +if (mBeanServer == null) {
>  writer.println("Error - No mbean server");
>  return;
>  }
>  
> -String qry=request.getParameter("set");
> -if( qry!= null ) {
> -String name=request.getParameter("att");
> -String val=request.getParameter("val");
> +String qry = request.getParameter("set");
> +if (qry != null) {
> +String name = request.getParameter("att");
> +String val = request.getParameter("val");
>  
> -setAttribute( writer, qry, name, val );
> +setAttribute(writer, qry, name, val);
>  return;
>  }
> -qry=request.getParameter("get");
> -if( qry!= null ) {
> -String name=request.getParameter("att");
> -getAttribute( writer, qry, name, request.getParameter("key") );
> +qry = request.getParameter("get");
> +if (qry != null) {
> +String name = request.getParameter("att");
> +getAttribute(writer, qry, name, request.getParameter("key"));
>  return;
>  }
>  qry = request.getParameter("invoke");
> -if(qry != null) {
> -String opName=request.getParameter("op");
> +if (qry != null) {
> +String opName = request.getParameter("op");
>  String[] params = 
> getInvokeParameters(request.getParameter("ps"));
>  invokeOperation(writer, qry, opName, params);
>  return;
>  }
> -qry=request.getParameter("qry");
> -if( qry == null ) {
> +qry = request.getParameter("qry");
> +if (qry == null) {
>  qry = "*:*";
>  }
>  
> -listBeans( writer, qry );
> +listBeans(writer, qry);
>  }
>  
> +
>  public void getAttribute(PrintWriter writer, String onameStr, String 
> att, String key) {
>  try {
>  ObjectName oname = new ObjectName(onameStr);
>  Object value = mBeanServer.getAttribute(oname, att);
>  
> -if(null != key && value instanceof CompositeData)
> -  value = ((CompositeData)value).get(key);
> +if (null != key && value instanceof CompositeData)
> +   

svn commit: r1720763 - in /tomcat/trunk/java/org/apache/catalina: realm/mbeans-descriptors.xml session/mbeans-descriptors.xml

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 11:59:29 2015
New Revision: 1720763

URL: http://svn.apache.org/viewvc?rev=1720763=rev
Log:
Remove attribute from MBean descriptions that no longer exist.

Modified:
tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml

Modified: tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml?rev=1720763=1720762=1720763=diff
==
--- tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml 
(original)
+++ tomcat/trunk/java/org/apache/catalina/realm/mbeans-descriptors.xml Fri Dec 
18 11:59:29 2015
@@ -37,14 +37,6 @@
   description="The JNDI named JDBC DataSource for your database"
  type="java.lang.String"/>
 
-
-
-
-
 
@@ -109,14 +101,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
-
-
-
 
@@ -178,14 +162,6 @@
   description="The connection URL to use when trying to connect to the 
database"
  type="java.lang.String"/>
 
-
-
-
-
 
@@ -281,14 +257,6 @@
   description="The JNDI context factory for this Realm"
  type="java.lang.String"/>
 
-
-
-
-
 
@@ -386,14 +354,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
-
-
-
 
@@ -433,14 +393,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
-
-
-
 
@@ -480,14 +432,6 @@
  type="java.lang.String"
 writeable="false"/>
 
-
-
-
-
 
 
-
-
 
@@ -557,10 +497,6 @@
   description="The time (in seconds) a user is locked out for after 
too many authentication failures. Defaults to 300 (5 minutes)."
  type="int" />
 
-
-
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml?rev=1720763=1720762=1720763=diff
==
--- tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml 
(original)
+++ tomcat/trunk/java/org/apache/catalina/session/mbeans-descriptors.xml Fri 
Dec 18 11:59:29 2015
@@ -114,11 +114,6 @@
  type="int"
 writeable="false" />
 
-
-
 
@@ -302,11 +297,6 @@
  type="int"
 writeable="false" />
 
-
-
 



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



Re: svn commit: r1720759 - /tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java

2015-12-18 Thread Violeta Georgieva
Hi,

2015-12-18 13:46 GMT+02:00 Mark Thomas :
>
> On 18/12/2015 11:42, ma...@apache.org wrote:
> > Author: markt
> > Date: Fri Dec 18 11:42:18 2015
> > New Revision: 1720759
> >
> > URL: http://svn.apache.org/viewvc?rev=1720759=rev
> > Log:
> > Formatting. No functional change.
>
> I'm looking into some issues reported by Coverity in this class so I
> wanted to clean up the formatting first. I used Eclipse's built-in code
> formatter with some custom settings so I'd be interested in what folks
> think of the result.
> I'm not planning on applying the formatter across the whole code base,
> rather I'm considering using it as a quick fix to get the format 95%
> right when there is a large amount of format clean-up required.
>
> Mark
>
> >
> > Modified:
> > tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> >
> > Modified:
tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> > URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1720759=1720758=1720759=diff
> >
==
> > --- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
(original)
> > +++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
Fri Dec 18 11:42:18 2015
> > @@ -38,12 +38,12 @@ import org.apache.catalina.mbeans.MBeanD
> >  import org.apache.tomcat.util.modeler.Registry;
> >
> >  /**
> > - * This servlet will dump JMX attributes in a simple format
> > - * and implement proxy services for modeler.
> > + * This servlet will dump JMX attributes in a simple format and
implement proxy
> > + * services for modeler.
> >   *
> >   * @author Costin Manolache
> >   */
> > -public class JMXProxyServlet extends HttpServlet  {
> > +public class JMXProxyServlet extends HttpServlet {
> >
> >  private static final long serialVersionUID = 1L;
> >
> > @@ -58,6 +58,7 @@ public class JMXProxyServlet extends Htt
> >  protected transient MBeanServer mBeanServer = null;
> >  protected transient Registry registry;
> >
> > +
> >  // -
Public Methods
> >  /**
> >   * Initialize this servlet.
> > @@ -80,55 +81,54 @@ public class JMXProxyServlet extends Htt
> >   * @exception ServletException if a servlet-specified error occurs
> >   */
> >  @Override
> > -public void doGet(HttpServletRequest request,
> > -  HttpServletResponse response)
> > -throws IOException, ServletException
> > -{
> > +public void doGet(HttpServletRequest request, HttpServletResponse
response)
> > +throws IOException, ServletException {

Are you using the default line width which is 80?
Or there is special handling of the format for Exceptions that can be
thrown by the method.

Regards,
Violeta

> >  response.setContentType("text/plain");
> >
> >  PrintWriter writer = response.getWriter();
> >
> > -if( mBeanServer==null ) {
> > +if (mBeanServer == null) {
> >  writer.println("Error - No mbean server");
> >  return;
> >  }
> >
> > -String qry=request.getParameter("set");
> > -if( qry!= null ) {
> > -String name=request.getParameter("att");
> > -String val=request.getParameter("val");
> > +String qry = request.getParameter("set");
> > +if (qry != null) {
> > +String name = request.getParameter("att");
> > +String val = request.getParameter("val");
> >
> > -setAttribute( writer, qry, name, val );
> > +setAttribute(writer, qry, name, val);
> >  return;
> >  }
> > -qry=request.getParameter("get");
> > -if( qry!= null ) {
> > -String name=request.getParameter("att");
> > -getAttribute( writer, qry, name,
request.getParameter("key") );
> > +qry = request.getParameter("get");
> > +if (qry != null) {
> > +String name = request.getParameter("att");
> > +getAttribute(writer, qry, name,
request.getParameter("key"));
> >  return;
> >  }
> >  qry = request.getParameter("invoke");
> > -if(qry != null) {
> > -String opName=request.getParameter("op");
> > +if (qry != null) {
> > +String opName = request.getParameter("op");
> >  String[] params =
getInvokeParameters(request.getParameter("ps"));
> >  invokeOperation(writer, qry, opName, params);
> >  return;
> >  }
> > -qry=request.getParameter("qry");
> > -if( qry == null ) {
> > +qry = request.getParameter("qry");
> > +if (qry == null) {
> >  qry = "*:*";
> >  }
> >
> > -listBeans( writer, qry );
> > +listBeans(writer, qry);
> >  }
> >
> > +
> >  public void 

[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread violetagg
Github user violetagg commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165765057
  
Can you provide a sample example that demonstrates the issue?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[Bug 58702] Access log lines are not written if client aborts

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58702

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 OS||All
 Resolution|--- |FIXED

--- Comment #1 from Mark Thomas  ---
Fixed in 9.0.x for 9.0.0.M2, 8.0.x for 8.0.31 and 7.0.x for 7.0.68.

It was not fixed in 6.0.x since 6.0.x does not have the additional access log
infrastructure required.

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



[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread violetagg
Github user violetagg commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165754059
  
Hello,

The encoding specified by the user is provided to the ResponseWrapper.
The ResponseWrapper is provided with the method `doFilter` instead of the 
original Response. Thus after this filter every component will work with this 
ResponseWrapper with the correct encoding.

Why do you need to set the encoding to the original Response?

Regards,
Violeta Georgieva


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread ukari
Github user ukari commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165763957
  
Oh, you are right, sorry I make the mistake.
But why response's encoding not changed after I set 
AddDefaultCharsetFilter?(I mean a HttpServletResponse)
Is the warpper effective?

Thanks



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread wenjiezhang2013
Github user wenjiezhang2013 commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165765309
  
Here is the document for this filter, 
http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Add_Default_Character_Set_Filter,
base on the code, this should work, you might want to debug your code to 
see what's going on there.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
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

2015-12-18 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/245

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
triggered this build
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1720757
Blamelist: markt

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



svn commit: r1720769 - in /tomcat/trunk/java/org/apache: catalina/servlets/ catalina/startup/ jasper/runtime/ jasper/xmlparser/ tomcat/util/http/parser/

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 12:36:35 2015
New Revision: 1720769

URL: http://svn.apache.org/viewvc?rev=1720769=rev
Log:
Fixed findbugs issues:
- Concatenates strings using + in a loop
- Useless condition

Modified:
tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
tomcat/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java
tomcat/trunk/java/org/apache/catalina/startup/RealmRuleSet.java
tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
tomcat/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java

Modified: tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=1720769=1720768=1720769=diff
==
--- tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java Fri Dec 18 
12:36:35 2015
@@ -870,7 +870,6 @@ public final class CGIServlet extends Ht
 String path = null;
 String name = null;
 String scriptname = null;
-String cginame = "";
 
 if ((webAppRootDir != null)
 && (webAppRootDir.lastIndexOf(File.separator) ==
@@ -895,14 +894,16 @@ public final class CGIServlet extends Ht
 if (debug >= 3) {
 log("findCGI: currentLoc=" + currentLocation);
 }
+StringBuilder cginameBuilder = new StringBuilder();
 while (!currentLocation.isFile() && dirWalker.hasMoreElements()) {
 if (debug >= 3) {
 log("findCGI: currentLoc=" + currentLocation);
 }
 String nextElement = (String) dirWalker.nextElement();
 currentLocation = new File(currentLocation, nextElement);
-cginame = cginame + "/" + nextElement;
+cginameBuilder.append("/").append(nextElement);
 }
+String cginame = cginameBuilder.toString();
 if (!currentLocation.isFile()) {
 return new String[] { null, null, null, null };
 }

Modified: 
tomcat/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java?rev=1720769=1720768=1720769=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java 
Fri Dec 18 12:36:35 2015
@@ -80,29 +80,21 @@ public class CredentialHandlerRuleSet ex
  */
 @Override
 public void addRuleInstances(Digester digester) {
-
-String pattern = prefix;
-
+StringBuilder pattern = new StringBuilder(prefix);
 for (int i = 0; i < MAX_NESTED_LEVELS; i++) {
-
 if (i > 0) {
-pattern += "/";
-}
-pattern += "CredentialHandler";
-
-digester.addObjectCreate(pattern,
- null, // MUST be specified in the element,
- "className");
-digester.addSetProperties(pattern);
-if (i == 0) {
-digester.addSetNext(pattern,
-"setCredentialHandler",
-"org.apache.catalina.CredentialHandler");
-} else {
-digester.addSetNext(pattern,
-"addCredentialHandler",
-"org.apache.catalina.CredentialHandler");
+pattern.append("/");
 }
+pattern.append("CredentialHandler");
+addRuleInstances(digester, pattern.toString(), i == 0 ? 
"setCredentialHandler"
+: "addCredentialHandler");
 }
 }
+
+private void addRuleInstances(Digester digester, String pattern, String 
methodName) {
+digester.addObjectCreate(pattern, null /* MUST be specified in the 
element */,
+"className");
+digester.addSetProperties(pattern);
+digester.addSetNext(pattern, methodName, 
"org.apache.catalina.CredentialHandler");
+}
 }

Modified: tomcat/trunk/java/org/apache/catalina/startup/RealmRuleSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/RealmRuleSet.java?rev=1720769=1720768=1720769=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/RealmRuleSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/RealmRuleSet.java Fri Dec 18 
12:36:35 2015
@@ -83,30 

Re: svn commit: r1720759 - /tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java

2015-12-18 Thread Mark Thomas
On 18/12/2015 12:05, Violeta Georgieva wrote:
> Hi,
> 
> 2015-12-18 13:46 GMT+02:00 Mark Thomas :
>>
>> On 18/12/2015 11:42, ma...@apache.org wrote:
>>> Author: markt
>>> Date: Fri Dec 18 11:42:18 2015
>>> New Revision: 1720759
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1720759=rev
>>> Log:
>>> Formatting. No functional change.
>>
>> I'm looking into some issues reported by Coverity in this class so I
>> wanted to clean up the formatting first. I used Eclipse's built-in code
>> formatter with some custom settings so I'd be interested in what folks
>> think of the result.
>> I'm not planning on applying the formatter across the whole code base,
>> rather I'm considering using it as a quick fix to get the format 95%
>> right when there is a large amount of format clean-up required.
>>
>> Mark
>>
>>>
>>> Modified:
>>> tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
>>>
>>> Modified:
> tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
>>> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1720759=1720758=1720759=diff
>>>
> ==
>>> --- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> (original)
>>> +++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
> Fri Dec 18 11:42:18 2015
>>> @@ -38,12 +38,12 @@ import org.apache.catalina.mbeans.MBeanD
>>>  import org.apache.tomcat.util.modeler.Registry;
>>>
>>>  /**
>>> - * This servlet will dump JMX attributes in a simple format
>>> - * and implement proxy services for modeler.
>>> + * This servlet will dump JMX attributes in a simple format and
> implement proxy
>>> + * services for modeler.
>>>   *
>>>   * @author Costin Manolache
>>>   */
>>> -public class JMXProxyServlet extends HttpServlet  {
>>> +public class JMXProxyServlet extends HttpServlet {
>>>
>>>  private static final long serialVersionUID = 1L;
>>>
>>> @@ -58,6 +58,7 @@ public class JMXProxyServlet extends Htt
>>>  protected transient MBeanServer mBeanServer = null;
>>>  protected transient Registry registry;
>>>
>>> +
>>>  // -
> Public Methods
>>>  /**
>>>   * Initialize this servlet.
>>> @@ -80,55 +81,54 @@ public class JMXProxyServlet extends Htt
>>>   * @exception ServletException if a servlet-specified error occurs
>>>   */
>>>  @Override
>>> -public void doGet(HttpServletRequest request,
>>> -  HttpServletResponse response)
>>> -throws IOException, ServletException
>>> -{
>>> +public void doGet(HttpServletRequest request, HttpServletResponse
> response)
>>> +throws IOException, ServletException {
> 
> Are you using the default line width which is 80?

100 for code, 80 for comments

> Or there is special handling of the format for Exceptions that can be
> thrown by the method.

Line wrapping is configured to prefer to keep expressions (which appears
to include throws, implements etc) on a single line if possible.

Mark

> 
> Regards,
> Violeta
> 
>>>  response.setContentType("text/plain");
>>>
>>>  PrintWriter writer = response.getWriter();
>>>
>>> -if( mBeanServer==null ) {
>>> +if (mBeanServer == null) {
>>>  writer.println("Error - No mbean server");
>>>  return;
>>>  }
>>>
>>> -String qry=request.getParameter("set");
>>> -if( qry!= null ) {
>>> -String name=request.getParameter("att");
>>> -String val=request.getParameter("val");
>>> +String qry = request.getParameter("set");
>>> +if (qry != null) {
>>> +String name = request.getParameter("att");
>>> +String val = request.getParameter("val");
>>>
>>> -setAttribute( writer, qry, name, val );
>>> +setAttribute(writer, qry, name, val);
>>>  return;
>>>  }
>>> -qry=request.getParameter("get");
>>> -if( qry!= null ) {
>>> -String name=request.getParameter("att");
>>> -getAttribute( writer, qry, name,
> request.getParameter("key") );
>>> +qry = request.getParameter("get");
>>> +if (qry != null) {
>>> +String name = request.getParameter("att");
>>> +getAttribute(writer, qry, name,
> request.getParameter("key"));
>>>  return;
>>>  }
>>>  qry = request.getParameter("invoke");
>>> -if(qry != null) {
>>> -String opName=request.getParameter("op");
>>> +if (qry != null) {
>>> +String opName = request.getParameter("op");
>>>  String[] params =
> getInvokeParameters(request.getParameter("ps"));
>>>  invokeOperation(writer, qry, opName, params);
>>>  return;
>>>  }
>>> -qry=request.getParameter("qry");
>>> -   

svn commit: r1720776 - in /tomcat/trunk/java/org/apache: catalina/tribes/io/XByteBuffer.java jasper/compiler/JspReader.java

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 13:00:53 2015
New Revision: 1720776

URL: http://svn.apache.org/viewvc?rev=1720776=rev
Log:
More useless conditions

Modified:
tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java
tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java?rev=1720776=1720775=1720776=diff
==
--- tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java Fri Dec 18 
13:00:53 2015
@@ -515,7 +515,7 @@ public class XByteBuffer {
 //assume it does exist
 found = true;
 for (int i = 1; ( (i < findlen) && found); i++)
-found = found && (find[i] == src[pos + i]);
+found = (find[i] == src[pos + i]);
 if (found)
 result = pos;
 else if ( (srclen - pos) < findlen)

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=1720776=1720775=1720776=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Fri Dec 18 
13:00:53 2015
@@ -462,7 +462,7 @@ class JspReader {
 // Move beyond the '{'
 nextChar();
 skipELExpression();
-} else if (ch == firstChar && prev != '\\') {
+} else if (ch == firstChar) {
 for (int i = 1 ; i < limlen ; i++) {
 if (peekChar() == limit.charAt(i))
 nextChar();



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



[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread ukari
Github user ukari commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165782452
  
I put that example in email, so you can't see it in github.

https://drive.google.com/file/d/0BxfFe2h4UJX4OEdMZ2dZMTBvYzBvOEl5Ykx4WUxNVWJiRmpj/view?usp=sharing


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



svn commit: r1720800 - in /tomcat/trunk: java/org/apache/catalina/storeconfig/ java/org/apache/tomcat/util/net/ modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ modules/jdbc-pool/src/main/

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 14:42:01 2015
New Revision: 1720800

URL: http://svn.apache.org/viewvc?rev=1720800=rev
Log:
Various low-level FindBugs warnings
 - use of static
 - mutable constants

Modified:

tomcat/trunk/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java
tomcat/trunk/java/org/apache/catalina/storeconfig/StoreLoader.java
tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Channel.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReport.java

tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/interceptor/InduceSlowQuery.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/interceptor/TestInterceptor.java

tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/CreateTestTable.java
tomcat/trunk/test/javax/el/TesterClass.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
tomcat/trunk/test/org/apache/catalina/tribes/demos/LoadTest.java
tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java

tomcat/trunk/test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java

tomcat/trunk/test/org/apache/catalina/tribes/test/channel/TestMulticastPackages.java

tomcat/trunk/test/org/apache/catalina/tribes/test/channel/TestRemoteProcessException.java

tomcat/trunk/test/org/apache/catalina/tribes/test/channel/TestUdpPackages.java

tomcat/trunk/test/org/apache/catalina/tribes/test/transport/SocketNioReceive.java

tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
tomcat/trunk/test/org/apache/tomcat/util/buf/TestUtf8.java
tomcat/trunk/test/org/apache/tomcat/websocket/TestWsSubprotocols.java
tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java

tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServer.java

Modified: 
tomcat/trunk/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java?rev=1720800=1720799=1720800=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/storeconfig/ConnectorStoreAppender.java 
Fri Dec 18 14:42:01 2015
@@ -41,7 +41,7 @@ import org.apache.tomcat.util.Introspect
  */
 public class ConnectorStoreAppender extends StoreAppender {
 
-protected static HashMap replacements = new HashMap<>();
+protected static final HashMap replacements = new 
HashMap<>();
 static {
 replacements.put("backlog", "acceptCount");
 replacements.put("soLinger", "connectionLinger");

Modified: tomcat/trunk/java/org/apache/catalina/storeconfig/StoreLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/storeconfig/StoreLoader.java?rev=1720800=1720799=1720800=diff
==
--- tomcat/trunk/java/org/apache/catalina/storeconfig/StoreLoader.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/storeconfig/StoreLoader.java Fri Dec 
18 14:42:01 2015
@@ -78,7 +78,7 @@ public class StoreLoader {
 /**
  * The Digester instance used to parse registry descriptors.
  */
-protected static Digester digester = createDigester();
+protected static final Digester digester = createDigester();
 
 private StoreRegistry registry;
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Channel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Channel.java?rev=1720800=1720799=1720800=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Channel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Channel.java Fri Dec 18 
14:42:01 2015
@@ -33,7 +33,7 @@ import java.util.concurrent.TimeoutExcep
  */
 public class Nio2Channel implements AsynchronousByteChannel {
 
-protected static ByteBuffer emptyBuf = ByteBuffer.allocate(0);
+protected static final ByteBuffer emptyBuf = ByteBuffer.allocate(0);
 
 protected AsynchronousSocketChannel sc = null;
 protected SocketWrapperBase socket = null;

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=1720800=1720799=1720800=diff

svn commit: r1720783 - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/catalina/servlets/ java/org/apache/catalina/startup/ java/org/apache/catalina/tribes/io/ java/org/apache/coyote/http11/ java/org/apa

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 13:35:56 2015
New Revision: 1720783

URL: http://svn.apache.org/viewvc?rev=1720783=rev
Log:
Merged revisions 1720769, 1720776 from tomcat/trunk:
Fixed findbugs issues:
- Concatenates strings using + in a loop
- Useless condition

Modified:
tomcat/tc8.0.x/trunk/   (props changed)
tomcat/tc8.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java

tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/CredentialHandlerRuleSet.java
tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/RealmRuleSet.java
tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java

tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
tomcat/tc8.0.x/trunk/java/org/apache/jasper/compiler/JspReader.java
tomcat/tc8.0.x/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java

tomcat/tc8.0.x/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java

Propchange: tomcat/tc8.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 13:35:56 2015
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640083-1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642233,1642280,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1642766,1643002,1643045,1643054-1643055,1643066,1643121,1643128,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643536,1643570,1643634,1643649,1643651,1643654,1643675,1643731,1643733-1643734,1643761,1643766,1643814,1643937,1643963,1644017,1644169,1644201-1644203,1644321,1644323,1644516,1644523,1644529,1644535,1644730,1644768,1644784-1644785,1644790,1644793,1644815,1644884,1644886,1644890,1644892
 
,1644910,1644924,1644929-1644930,1644935,1644989,1645011,1645247,1645355,1645357-1645358,1645455,1645465,1645469,1645471,1645473,1645475,1645486-1645488,1645626,1645641,1645685,1645743,1645763,1645951-1645953,1645955,1645993,1646098-1646106,1646178,1646220,1646302,1646304,1646420,1646470-1646471,1646476,1646559,1646717-1646723,1646773,1647026,1647042,1647530,1647655,1648304,1648815,1648907,1649973,1650081,1650365,1651116,1651120,1651280,1651470,1652938,1652970,1653041,1653471,1653550,1653574,1653797,1653815-1653816,1653819,1653840,1653857,1653888,1653972,1654013,1654030,1654050,1654123,1654148,1654159,1654513,1654515,1654517,1654522,1654524,1654725,1654735,1654766,1654785,1654851-1654852,1654978,1655122-1655124,1655126-1655127,1655129-1655130,1655132-1655133,1655312,1655351,1655438,1655441,1655454,168,1656087,1656299,1656319,1656331,1656345,1656350,1656590,1656648-1656650,1656657,1657041,1657054,1657374,1657492,1657510,1657565,1657580,1657584,1657586,1657589,1657592,1657607,1657
 
609,1657682,1657907,1658207,1658734,1658781,1658790,1658799,1658802,1658804,1658833,1658840,1658966,1659043,1659053,1659059,1659174,1659184,1659188-1659189,1659216,1659263,1659293,1659304,1659306-1659307,1659382,1659384,1659428,1659471,1659486,1659505,1659516,1659521,1659524,1659559,1659562,1659803,1659806,1659814,1659833,1659862,1659905,1659919,1659948,1659967,1659983-1659984,1660060,1660074,1660077,1660133,1660168,1660331-1660332,1660353,1660358,1660924,1661386,1661770,1661867,1661972,1661990,1662200,1662308-1662309,1662548,1662614,1662696,1662736,1662985,1662988-1662989,1663264,1663277,1663298,1663534,1663562,1663676,1663715,1663754,1663768,1663772,1663781,1663893,1663995,1664143,1664163,1664174,1664301,1664317,1664347,1664657,1664659,1664710,1664863-1664864,1664866,1665085,1665292,1665559,1665653,1665661,1665672,1665694,1665697,1665736,1665779,1665976-1665977,1665980-1665981,1665985-1665986,1665989,1665998,1666004,1666008,1666013,1666017,1666024,1666116,1666386-1666387,1666494,1
 

svn commit: r1720807 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/mbeans/ java/org/apache/catalina/startup/ java/org/apache/jasper/compiler/ res/findbugs/

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 15:17:45 2015
New Revision: 1720807

URL: http://svn.apache.org/viewvc?rev=1720807=rev
Log:
Merged revision 1720804 from tomcat/trunk:
Fixed findbugs issues - Comparison of String parameter using == or !=. Update 
false positives filter.

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

tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 15:17:45 2015
@@ -1,2 +1,2 @@
 
/tomcat/tc8.0.x/trunk:1636525,1637336,1637685,1637709,1638726,1640089,1640276,1640349,1640363,1640366,1640642,1640672,1640674,1640689,1640884,1641001,1641065,1641067,1641375,1641638,1641723,1641726,1641729-1641730,1641736,1641988,1642669-1642670,1642698,1642701,1643205,1643215,1643217,1643230,1643232,1643273,1643285,1643329-1643330,1643511,1643513,1643521,1643539,1643571,1643581-1643582,1643635,1643655,1643738,1643964,1644018,1644333,1644954,1644992,1645014,1645360,1645456,1645627,1645642,1645686,1645903-1645904,1645908-1645909,1645913,1645920,1646458,1646460-1646462,1646735,1646738-1646741,1646744,1646746,1646748-1646755,1646757,1646759-1646760,1647043,1648816,1651420-1651422,1651844,1652926,1652939-1652940,1652973,1653798,1653817,1653841,1654042,1654161,1654736,1654767,1654787,1656592,1659907,1662986,1663265,1663278,1663325,1663535,1663567,1663679,1663997,1664175,1664321,1664872,1665061,1665086,1666027,1666395,1666503,1666506,1666560,1666570,1666581,1666759,1666967,1666988,1667553
 
-1667555,1667558,1667617,1667633,1667637,1667747,1667767,1667873,1668028,1668137,1668634,1669432,1669801,1669840,1669895-1669896,1670398,1670435,1670592,1670605-1670607,1670609,1670632,1670720,1670725,1670727,1670731,1671114,1672273,1672285,1673759,1674220,1674295,1675469,1675488,1675595,1675831,1676232,1676367-1676369,1676382,1676394,1676483,1676556,1676635,1678178,1679536,1679988,1680256,1681124,1681182,1681730,1681840,1681864,1681869,1682010,1682034,1682047,1682052-1682053,1682062,1682064,1682070,1682312,1682325,1682331,1682386,1684367,1684385,1685759,1685774,1685827,1685892,1687341,1688904,1689358,1689657,1689921,1692850,1693093,1693108,1693324,1694060,1694115,1694291,1694427,1694431,1694503,1694549,1694789,1694873,1694881,1695356,1695372,1695823-1695825,1696200,1696281,1696379,1696468,1700608,1700871,1700897,1700978,1701094,1701124,1701608,1701668,1701676,1701766,1701944,1702248,1702252,1702314,1702390,1702723,1702725,1702728,1702730,1702733,1702735,1702737,1702739,1702742,1702
 
744,1702748,1702751,1702754,1702758,1702760,1702763,1702766,1708779,1708782,1708806,1709314,1709670,1710347,1710442,1710448,1710490,1710574,1710578,1712226,1712229,1712235,1712255,1712618,1712649,1712655,1712860,1712899,1712903,1712906,1712913,1712926,1712975,1713185,1713262,1713287,1713613,1713621,1713872,1713976,1713994,1713998,1714004,1714013,1714059,1714538,1714580,1715189,1715207,1715544,1715549,1715637,1715639-1715645,1715667,1715683,1715978,1715981,1716216-1716217,1716355,1716414,1716421,1717208-1717209,1717257,1717283,1717288,1717291,1717421,1717517,1717529,1718797,1718840-1718843,1719348,1719357-1719358,1719400,1719491,1719737,1720235,1720396,1720442,1720446,1720450,1720463,1720658-1720660,1720756
-/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222329,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1237995,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,1239785-1240046,1240101,1240106,1240109,1240112,1240114
 

svn commit: r1720788 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/servlets/ java/org/apache/catalina/startup/ java/org/apache/catalina/tribes/io/ java/org/apache/jasper/compiler/ java/org/a

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 14:10:56 2015
New Revision: 1720788

URL: http://svn.apache.org/viewvc?rev=1720788=rev
Log:
Merged revisions 1720769, 1720776 from tomcat/trunk:
Fixed findbugs issues:
- Concatenates strings using + in a loop
- Useless condition

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/CGIServlet.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/RealmRuleSet.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/io/XByteBuffer.java
tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java
tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspReader.java
tomcat/tc7.0.x/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java

tomcat/tc7.0.x/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 14:10:56 2015
@@ -1,2 +1,2 @@
 
/tomcat/tc8.0.x/trunk:1636525,1637336,1637685,1637709,1638726,1640089,1640276,1640349,1640363,1640366,1640642,1640672,1640674,1640689,1640884,1641001,1641065,1641067,1641375,1641638,1641723,1641726,1641729-1641730,1641736,1641988,1642669-1642670,1642698,1642701,1643205,1643215,1643217,1643230,1643232,1643273,1643285,1643329-1643330,1643511,1643513,1643521,1643539,1643571,1643581-1643582,1643635,1643655,1643738,1643964,1644018,1644333,1644954,1644992,1645014,1645360,1645456,1645627,1645642,1645686,1645903-1645904,1645908-1645909,1645913,1645920,1646458,1646460-1646462,1646735,1646738-1646741,1646744,1646746,1646748-1646755,1646757,1646759-1646760,1647043,1648816,1651420-1651422,1651844,1652926,1652939-1652940,1652973,1653798,1653817,1653841,1654042,1654161,1654736,1654767,1654787,1656592,1659907,1662986,1663265,1663278,1663325,1663535,1663567,1663679,1663997,1664175,1664321,1664872,1665061,1665086,1666027,1666395,1666503,1666506,1666560,1666570,1666581,1666759,1666967,1666988,1667553
 
-1667555,1667558,1667617,1667633,1667637,1667747,1667767,1667873,1668028,1668137,1668634,1669432,1669801,1669840,1669895-1669896,1670398,1670435,1670592,1670605-1670607,1670609,1670632,1670720,1670725,1670727,1670731,1671114,1672273,1672285,1673759,1674220,1674295,1675469,1675488,1675595,1675831,1676232,1676367-1676369,1676382,1676394,1676483,1676556,1676635,1678178,1679536,1679988,1680256,1681124,1681182,1681730,1681840,1681864,1681869,1682010,1682034,1682047,1682052-1682053,1682062,1682064,1682070,1682312,1682325,1682331,1682386,1684367,1684385,1685759,1685774,1685827,1685892,1687341,1688904,1689358,1689657,1689921,1692850,1693093,1693108,1693324,1694060,1694115,1694291,1694427,1694431,1694503,1694549,1694789,1694873,1694881,1695356,1695372,1695823-1695825,1696200,1696281,1696379,1696468,1700608,1700871,1700897,1700978,1701094,1701124,1701608,1701668,1701676,1701766,1701944,1702248,1702252,1702314,1702390,1702723,1702725,1702728,1702730,1702733,1702735,1702737,1702739,1702742,1702
 
744,1702748,1702751,1702754,1702758,1702760,1702763,1702766,1708779,1708782,1708806,1709314,1709670,1710347,1710442,1710448,1710490,1710574,1710578,1712226,1712229,1712235,1712255,1712618,1712649,1712655,1712860,1712899,1712903,1712906,1712913,1712926,1712975,1713185,1713262,1713287,1713613,1713621,1713872,1713976,1713994,1713998,1714004,1714013,1714059,1714538,1714580,1715189,1715207,1715544,1715549,1715637,1715639-1715645,1715667,1715683,1715978,1715981,1716216-1716217,1716355,1716414,1716421,1717208-1717209,1717257,1717283,1717288,1717291,1717421,1717517,1717529,1718797,1718840-1718843,1719348,1719357-1719358,1719400,1719491,1719737,1720235,1720396,1720442,1720446,1720450,1720463,1720658-1720660,1720756
-/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222329,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1237995,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,1239785-1240046,1240101,1240106,1240109,1240112,1240114
 

svn commit: r1720804 - in /tomcat/trunk: java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java java/org/apache/catalina/startup/HostConfig.java java/org/apache/jasper/compiler/TagFileProcess

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 15:02:38 2015
New Revision: 1720804

URL: http://svn.apache.org/viewvc?rev=1720804=rev
Log:
Fixed findbugs issues - Comparison of String parameter using == or !=. Update 
false positives filter.

Modified:
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
tomcat/trunk/res/findbugs/filter-false-positives.xml

Modified: 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java?rev=1720804=1720803=1720804=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java 
Fri Dec 18 15:02:38 2015
@@ -203,7 +203,7 @@ public class JmxRemoteLifecycleListener
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
 // When the server starts, configure JMX/RMI
-if (Lifecycle.START_EVENT == event.getType()) {
+if (Lifecycle.START_EVENT.equals(event.getType())) {
 // Configure using standard jmx system properties
 init();
 
@@ -284,7 +284,7 @@ public class JmxRemoteLifecycleListener
 csPlatform = createServer("Platform", rmiBindAddress, 
rmiRegistryPortPlatform,
 rmiServerPortPlatform, env, registryCsf, registrySsf, 
serverCsf, serverSsf);
 
-} else if (Lifecycle.STOP_EVENT == event.getType()) {
+} else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
 destroyServer("Platform", csPlatform);
 }
 }

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1720804=1720803=1720804=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Fri Dec 18 
15:02:38 2015
@@ -1832,7 +1832,7 @@ public class HostConfig implements Lifec
 
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
-if (event.getType() == Lifecycle.AFTER_STOP_EVENT) {
+if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
 // The context has stopped.
 Context context = (Context) event.getLifecycle();
 

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java?rev=1720804=1720803=1720804=diff
==
--- tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java Fri Dec 
18 15:02:38 2015
@@ -423,7 +423,7 @@ class TagFileProcessor {
 private void checkUniqueName(String name, String type, Node n,
 TagAttributeInfo attr) throws JasperException {
 
-HashMap table = (type == VAR_NAME_FROM) ? 
nameFromTable : nameTable;
+HashMap table = (VAR_NAME_FROM.equals(type)) ? 
nameFromTable : nameTable;
 NameEntry nameEntry = table.get(name);
 if (nameEntry != null) {
 if (!TAG_DYNAMIC.equals(type) ||

Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1720804=1720803=1720804=diff
==
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Fri Dec 18 15:02:38 
2015
@@ -350,6 +350,12 @@
 
   
   
+
+
+
+
+  
+  
 
 



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



svn commit: r1720805 - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/catalina/mbeans/ java/org/apache/catalina/startup/ java/org/apache/jasper/compiler/ res/findbugs/

2015-12-18 Thread violetagg
Author: violetagg
Date: Fri Dec 18 15:13:10 2015
New Revision: 1720805

URL: http://svn.apache.org/viewvc?rev=1720805=rev
Log:
Merged revision 1720804 from tomcat/trunk:
Fixed findbugs issues - Comparison of String parameter using == or !=. Update 
false positives filter.

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

tomcat/tc8.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/tc8.0.x/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
tomcat/tc8.0.x/trunk/res/findbugs/filter-false-positives.xml

Propchange: tomcat/tc8.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 15:13:10 2015
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640083-1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642233,1642280,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1642766,1643002,1643045,1643054-1643055,1643066,1643121,1643128,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643536,1643570,1643634,1643649,1643651,1643654,1643675,1643731,1643733-1643734,1643761,1643766,1643814,1643937,1643963,1644017,1644169,1644201-1644203,1644321,1644323,1644516,1644523,1644529,1644535,1644730,1644768,1644784-1644785,1644790,1644793,1644815,1644884,1644886,1644890,1644892
 
,1644910,1644924,1644929-1644930,1644935,1644989,1645011,1645247,1645355,1645357-1645358,1645455,1645465,1645469,1645471,1645473,1645475,1645486-1645488,1645626,1645641,1645685,1645743,1645763,1645951-1645953,1645955,1645993,1646098-1646106,1646178,1646220,1646302,1646304,1646420,1646470-1646471,1646476,1646559,1646717-1646723,1646773,1647026,1647042,1647530,1647655,1648304,1648815,1648907,1649973,1650081,1650365,1651116,1651120,1651280,1651470,1652938,1652970,1653041,1653471,1653550,1653574,1653797,1653815-1653816,1653819,1653840,1653857,1653888,1653972,1654013,1654030,1654050,1654123,1654148,1654159,1654513,1654515,1654517,1654522,1654524,1654725,1654735,1654766,1654785,1654851-1654852,1654978,1655122-1655124,1655126-1655127,1655129-1655130,1655132-1655133,1655312,1655351,1655438,1655441,1655454,168,1656087,1656299,1656319,1656331,1656345,1656350,1656590,1656648-1656650,1656657,1657041,1657054,1657374,1657492,1657510,1657565,1657580,1657584,1657586,1657589,1657592,1657607,1657
 
609,1657682,1657907,1658207,1658734,1658781,1658790,1658799,1658802,1658804,1658833,1658840,1658966,1659043,1659053,1659059,1659174,1659184,1659188-1659189,1659216,1659263,1659293,1659304,1659306-1659307,1659382,1659384,1659428,1659471,1659486,1659505,1659516,1659521,1659524,1659559,1659562,1659803,1659806,1659814,1659833,1659862,1659905,1659919,1659948,1659967,1659983-1659984,1660060,1660074,1660077,1660133,1660168,1660331-1660332,1660353,1660358,1660924,1661386,1661770,1661867,1661972,1661990,1662200,1662308-1662309,1662548,1662614,1662696,1662736,1662985,1662988-1662989,1663264,1663277,1663298,1663534,1663562,1663676,1663715,1663754,1663768,1663772,1663781,1663893,1663995,1664143,1664163,1664174,1664301,1664317,1664347,1664657,1664659,1664710,1664863-1664864,1664866,1665085,1665292,1665559,1665653,1665661,1665672,1665694,1665697,1665736,1665779,1665976-1665977,1665980-1665981,1665985-1665986,1665989,1665998,1666004,1666008,1666013,1666017,1666024,1666116,1666386-1666387,1666494,1
 
666496,1666552,1666569,1666579,137,149,1666757,1666966,1666972,1666985,1666995,1666997,1667292,1667402,1667406,1667546,1667615,1667630,1667636,1667688,1667764,1667871,1668026,1668135,1668193,1668593,1668596,1668630,1668639,1668843,1669353,1669370,1669451,1669800,1669838,1669876,1669882,1670394,1670433,1670591,1670598-1670600,1670610,1670631,1670719,1670724,1670726,1670730,1670940,1671112,1672272,1672284,1673754,1674294,1675461,1675486,1675594,1675830,1676231,1676250-1676251,1676364,1676381,1676393,1676479,1676525,1676552,1676615,1676630,1676634,1676721,1676926,1676943,1677140,1677802,1678011,1678162,1678174,1678339,1678426-1678427,1678694,1678701,1679534,1679708,1679710,1679716,1680034,1680246,1681056,1681123,1681138,1681280,1681283,1681286,1681450,1681697,1681701,1681729,1681770,1681779,1681793,1681807,1681837-1681838,1681854,1681862,1681958,1682028,1682033,1682311,1682315,1682317,1682320,1682324,1682330,1682842,1684172,1684366,1684383,1684526-1684527,1684549-1684550,168555
 

svn commit: r1720817 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/manager/LocalStrings.properties webapps/docs/changelog.xml webapps/docs/manager-howto.xml

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 15:43:02 2015
New Revision: 1720817

URL: http://svn.apache.org/viewvc?rev=1720817=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58723
Clarify documentation and error messages for the text interface of the manager 
to make clear that version must be used with path when referencing contexts 
deployed using parallel deployment.

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

tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc7.0.x/trunk/webapps/docs/manager-howto.xml

Propchange: tomcat/tc7.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 15:43:02 2015
@@ -1,2 +1,2 @@
-/tomcat/tc8.0.x/trunk:1636525,1637336,1637685,1637709,1638726,1640089,1640276,1640349,1640363,1640366,1640642,1640672,1640674,1640689,1640884,1641001,1641065,1641067,1641375,1641638,1641723,1641726,1641729-1641730,1641736,1641988,1642669-1642670,1642698,1642701,1643205,1643215,1643217,1643230,1643232,1643273,1643285,1643329-1643330,1643511,1643513,1643521,1643539,1643571,1643581-1643582,1643635,1643655,1643738,1643964,1644018,1644333,1644954,1644992,1645014,1645360,1645456,1645627,1645642,1645686,1645903-1645904,1645908-1645909,1645913,1645920,1646458,1646460-1646462,1646735,1646738-1646741,1646744,1646746,1646748-1646755,1646757,1646759-1646760,1647043,1648816,1651420-1651422,1651844,1652926,1652939-1652940,1652973,1653798,1653817,1653841,1654042,1654161,1654736,1654767,1654787,1656592,1659907,1662986,1663265,1663278,1663325,1663535,1663567,1663679,1663997,1664175,1664321,1664872,1665061,1665086,1666027,1666395,1666503,1666506,1666560,1666570,1666581,1666759,1666967,1666988,1667553
 
-1667555,1667558,1667617,1667633,1667637,1667747,1667767,1667873,1668028,1668137,1668634,1669432,1669801,1669840,1669895-1669896,1670398,1670435,1670592,1670605-1670607,1670609,1670632,1670720,1670725,1670727,1670731,1671114,1672273,1672285,1673759,1674220,1674295,1675469,1675488,1675595,1675831,1676232,1676367-1676369,1676382,1676394,1676483,1676556,1676635,1678178,1679536,1679988,1680256,1681124,1681182,1681730,1681840,1681864,1681869,1682010,1682034,1682047,1682052-1682053,1682062,1682064,1682070,1682312,1682325,1682331,1682386,1684367,1684385,1685759,1685774,1685827,1685892,1687341,1688904,1689358,1689657,1689921,1692850,1693093,1693108,1693324,1694060,1694115,1694291,1694427,1694431,1694503,1694549,1694789,1694873,1694881,1695356,1695372,1695823-1695825,1696200,1696281,1696379,1696468,1700608,1700871,1700897,1700978,1701094,1701124,1701608,1701668,1701676,1701766,1701944,1702248,1702252,1702314,1702390,1702723,1702725,1702728,1702730,1702733,1702735,1702737,1702739,1702742,1702
 
744,1702748,1702751,1702754,1702758,1702760,1702763,1702766,1708779,1708782,1708806,1709314,1709670,1710347,1710442,1710448,1710490,1710574,1710578,1712226,1712229,1712235,1712255,1712618,1712649,1712655,1712860,1712899,1712903,1712906,1712913,1712926,1712975,1713185,1713262,1713287,1713613,1713621,1713872,1713976,1713994,1713998,1714004,1714013,1714059,1714538,1714580,1715189,1715207,1715544,1715549,1715637,1715639-1715645,1715667,1715683,1715978,1715981,1716216-1716217,1716355,1716414,1716421,1717208-1717209,1717257,1717283,1717288,1717291,1717421,1717517,1717529,1718797,1718840-1718843,1719348,1719357-1719358,1719400,1719491,1719737,1720235,1720396,1720442,1720446,1720450,1720463,1720658-1720660,1720756
-/tomcat/trunk:1156115-1157160,1157162-1157859,1157862-1157942,1157945-1160347,1160349-1163716,1163718-1166689,1166691-1174340,1174342-1175596,1175598-1175611,1175613-1175932,1175934-1177783,1177785-1177980,1178006-1180720,1180722-1183094,1183096-1187753,1187755,1187775,1187801,1187806,1187809,1187826-1188312,1188314-1188401,1188646-1188840,1188842-1190176,1190178-1195223,1195225-1195953,1195955,1195957-1201238,1201240-1203345,1203347-1206623,1206625-1208046,1208073,1208096,1208114,1208145,1208772,1209194-1212125,1212127-1220291,1220293,1220295-1221321,1221323-1222329,1222332-1222401,1222405-1222795,1222850-1222950,1222969-1225326,1225328-1225463,1225465,1225627,1225629-1226534,1226536-1228908,1228911-1228923,1228927-1229532,1229534-1230766,1230768-1231625,1231627-1233414,1233419-1235207,1235209-1237425,1237427,1237429-1237977,1237981,1237985,1237995,1238070,1238073,1239024-1239048,1239050-1239062,1239135,1239256,1239258-1239485,1239785-1240046,1240101,1240106,1240109,1240112,1240114
 

svn commit: r1720785 - /tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java

2015-12-18 Thread remm
Author: remm
Date: Fri Dec 18 13:48:41 2015
New Revision: 1720785

URL: http://svn.apache.org/viewvc?rev=1720785=rev
Log:
Code cleanup.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1720785=1720784=1720785=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Fri Dec 18 
13:48:41 2015
@@ -694,7 +694,7 @@ public class Nio2Endpoint extends Abstra
 } else {
 ioe = new IOException(exc);
 }
-Nio2SocketWrapper.this.setError(ioe);
+setError(ioe);
 if (exc instanceof AsynchronousCloseException) {
 // Release here since there will be no
 // notify/dispatch to do the release.
@@ -713,28 +713,27 @@ public class Nio2Endpoint extends Abstra
 synchronized (writeCompletionHandler) {
 if (nBytes.intValue() < 0) {
 failed(new 
EOFException(sm.getString("iob.failedwrite")), attachment);
-} else if 
(Nio2SocketWrapper.this.bufferedWrites.size() > 0) {
+} else if (bufferedWrites.size() > 0) {
 nestedWriteCompletionCount.get().incrementAndGet();
 // Continue writing data using a gathering write
 ArrayList arrayList = new 
ArrayList<>();
 if (attachment.hasRemaining()) {
 arrayList.add(attachment);
 }
-for (ByteBufferHolder buffer : 
Nio2SocketWrapper.this.bufferedWrites) {
+for (ByteBufferHolder buffer : bufferedWrites) {
 buffer.flip();
 arrayList.add(buffer.getBuf());
 }
-Nio2SocketWrapper.this.bufferedWrites.clear();
+bufferedWrites.clear();
 ByteBuffer[] array = arrayList.toArray(new 
ByteBuffer[arrayList.size()]);
-Nio2SocketWrapper.this.getSocket().write(array, 0, 
array.length,
-
Nio2SocketWrapper.this.getNio2WriteTimeout(), TimeUnit.MILLISECONDS,
+getSocket().write(array, 0, array.length,
+getNio2WriteTimeout(), 
TimeUnit.MILLISECONDS,
 array, gatheringWriteCompletionHandler);
 nestedWriteCompletionCount.get().decrementAndGet();
 } else if (attachment.hasRemaining()) {
 // Regular write
 nestedWriteCompletionCount.get().incrementAndGet();
-
Nio2SocketWrapper.this.getSocket().write(attachment,
-
Nio2SocketWrapper.this.getNio2WriteTimeout(),
+getSocket().write(attachment, 
getNio2WriteTimeout(),
 TimeUnit.MILLISECONDS, attachment, 
writeCompletionHandler);
 nestedWriteCompletionCount.get().decrementAndGet();
 } else {
@@ -759,7 +758,7 @@ public class Nio2Endpoint extends Abstra
 } else {
 ioe = new IOException(exc);
 }
-Nio2SocketWrapper.this.setError(ioe);
+setError(ioe);
 writePending.release();
 endpoint.processSocket(Nio2SocketWrapper.this, 
SocketEvent.OPEN_WRITE, true);
 }
@@ -772,7 +771,7 @@ public class Nio2Endpoint extends Abstra
 synchronized (writeCompletionHandler) {
 if (nBytes.longValue() < 0) {
 failed(new 
EOFException(sm.getString("iob.failedwrite")), attachment);
-} else if 
(Nio2SocketWrapper.this.bufferedWrites.size() > 0 || arrayHasData(attachment)) {
+} else if (bufferedWrites.size() > 0 || 
arrayHasData(attachment)) {
 // Continue writing data
 nestedWriteCompletionCount.get().incrementAndGet();
 ArrayList arrayList = new 
ArrayList<>();
@@ -781,14 +780,14 @@ public class Nio2Endpoint extends Abstra
 arrayList.add(buffer);
 }
 }
-

[GitHub] tomcat pull request: Change response character encoding

2015-12-18 Thread violetagg
Github user violetagg commented on the pull request:

https://github.com/apache/tomcat/pull/25#issuecomment-165781265
  
I meant an example application which we can use to reproduce the issue that 
you are describing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



svn commit: r1720789 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java test/org/apache/catalina/valves/TesterAccessLogValve.java

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 14:13:18 2015
New Revision: 1720789

URL: http://svn.apache.org/viewvc?rev=1720789=rev
Log:
Comet processing in 7.0.x is a little messier than in 8.0.x. Refactor the BZ 
58702 patch to take account of that.

Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1720789=1720788=1720789=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
Fri Dec 18 14:13:18 2015
@@ -319,6 +319,8 @@ public class CoyoteAdapter implements Ad
 if (event(req, res, SocketStatus.OPEN_READ)) {
 comet = true;
 res.action(ActionCode.COMET_BEGIN, null);
+} else {
+return false;
 }
 } else {
 comet = true;
@@ -331,8 +333,23 @@ public class CoyoteAdapter implements Ad
 }
 }
 if (!request.isAsync() && !comet) {
-request.finishRequest();
-response.finishResponse();
+try {
+request.finishRequest();
+response.finishResponse();
+} finally {
+long time = 0;
+if (req.getStartTime() != -1) {
+time = System.currentTimeMillis() - req.getStartTime();
+}
+if (request.getMappingData().context != null) {
+((Context) request.getMappingData().context).logAccess(
+request, response, time, false);
+} else {
+log(req, res, time);
+}
+
+req.action(ActionCode.POST_REQUEST , null);
+}
 }
 
 // Check to see if the processor is in an error state. If it is,
@@ -350,22 +367,6 @@ public class CoyoteAdapter implements Ad
 success = false;
 log.error(sm.getString("coyoteAdapter.service"), t);
 } finally {
-// Access logging
-if (!request.isAsync() && !comet) {
-long time = 0;
-if (req.getStartTime() != -1) {
-time = System.currentTimeMillis() - req.getStartTime();
-}
-if (request.getMappingData().context != null) {
-((Context) request.getMappingData().context).logAccess(
-request, response, time, false);
-} else {
-log(req, res, time);
-}
-
-req.action(ActionCode.POST_REQUEST , null);
-}
-
 req.getRequestProcessor().setWorkerThreadName(null);
 // Recycle the wrapper request and response
 if (!success || (!comet && !request.isAsync())) {
@@ -441,6 +442,8 @@ public class CoyoteAdapter implements Ad
 if (event(req, res, SocketStatus.OPEN_READ)) {
 comet = true;
 res.action(ActionCode.COMET_BEGIN, null);
+} else {
+return;
 }
 } else {
 comet = true;
@@ -458,27 +461,26 @@ public class CoyoteAdapter implements Ad
 if (asyncConImpl != null) {
 async = true;
 } else if (!comet) {
-request.finishRequest();
-response.finishResponse();
+try {
+request.finishRequest();
+response.finishResponse();
+} finally {
+if (postParseSuccess) {
+// Log only if processing was invoked.
+// If postParseRequest() failed, it has already logged 
it.
+// If context is null this was the start of a comet 
request
+// that failed and has already been logged.
+((Context) request.getMappingData().context).logAccess(
+request, response,
+System.currentTimeMillis() - 
req.getStartTime(),
+false);
+}
+req.action(ActionCode.POST_REQUEST , null);
+}
 }
 } catch 

svn commit: r1720796 - /tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 14:19:49 2015
New Revision: 1720796

URL: http://svn.apache.org/viewvc?rev=1720796=rev
Log:
Use of '{' and '}' inside {@code ... } confuses the validation parser

Modified:
tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java

Modified: 
tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=1720796=1720795=1720796=diff
==
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java 
(original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/filters/ExpiresFilter.java 
Fri Dec 18 14:19:49 2015
@@ -218,12 +218,12 @@ import org.apache.juli.logging.LogFactor
  * {@code
  * 
  *ExpiresDefault
- * [plus] { }*
+ * [plus] ( )*
  * 
  *
  * 
  *ExpiresByType type/encoding
- * [plus] { }*
+ * [plus] ( )*
  * 
  * }
  * 



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



svn commit: r1720795 - /tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java

2015-12-18 Thread markt
Author: markt
Date: Fri Dec 18 14:19:34 2015
New Revision: 1720795

URL: http://svn.apache.org/viewvc?rev=1720795=rev
Log:
Use of '{' and '}' inside {@code ... } confuses the validation parser

Modified:
tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java

Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=1720795=1720794=1720795=diff
==
--- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Fri Dec 18 
14:19:34 2015
@@ -218,12 +218,12 @@ import org.apache.juli.logging.LogFactor
  * {@code
  * 
  *ExpiresDefault
- * [plus] { }*
+ * [plus] ( )*
  * 
  *
  * 
  *ExpiresByType type/encoding
- * [plus] { }*
+ * [plus] ( )*
  * 
  * }
  * 



-
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

2015-12-18 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/246

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' 
triggered this build
Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1720789
Blamelist: markt,violetagg

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 58723] Undeploy Versioned Context Fails

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58723

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #1 from Mark Thomas  ---
It is mainly a documentation with the odd change required to error messages.

The manager app will use the context name or base file name when referring to a
context so the message is unambiguous. In the past the path was used and I
found one error message still using path rather than name.

The documentation wasn't fully updated when parallel deployment was introduced.
The short version is whenever the docs say "path" read "path and optional
version" with the version being required if you want to refer to a web
application that has been deployed with a version.

I've updated the docs and error messages. The fixes will be in 9.0.0.M2
onwards, 8.0.31 onwards and 7.0.68 onwards. 6.0.x does not support parallel
deployment.

[1] http://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Naming

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #15 from Mark Thomas  ---
Ignoring the reasoning isn't a red herring. It is part of deciding what the
best solution is. "Because someone wants it" is not, on its own, sufficient
justification.

The patch looks like a good start if we wanted to go that way. It needs some
docs.

However, I'm still leaning towards removing all server header handling from
Tomcat. That gives users - including boot - maximum flexibility. They can
add/remove the header as desired via the Servlet API. We can remove the server
option completely in 9.0.x. In 8.0.x and earlier I think we'd need to set the
header if the option is set to retain backwards compatibility. Essentially that
changes Tomcat's default behaviour from sending the header to not sending it.

In the (unlikely) case of an app setting the header that the system
administrator wants to remove, the sys admin would need to add a filter that
removed the header.

-- 
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 58750] Provide way to disable Server header completely

2015-12-18 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

--- Comment #14 from Phillip Webb  ---
I've been mulling this issue over a little bit more and I think that the
arguments about whether removing the header offers any real world security or
bandwidth benefits are a bit of a red herring. There's clearly some difference
of opinion here, but regardless of why you'd want to remove the header, it
still stands that it's currently not possible.

If we put the argument of why to one side, and just focus on answering the
question "How do I remove the server header?", what are the options? Is the
suggested patch a sensible approach? Is there some other way to do it (a custom
Http11Protocol implementation? some way to post-process headers?).

I'm happy to try and rework the patch as required, or try to find a less
invasive way to solve the problem. My ultimate goal is to just prove the
request Spring Boot feature without needing to add a "but not on Tomcat"
caveat.

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



[GUMP@vmgump]: Project tomcat-tc7.0.x-test-bio (in module tomcat-7.0.x) failed

2015-12-18 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-tc7.0.x-test-bio has an issue affecting its community 
integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-tc7.0.x-test-bio :  Tomcat 7.x, a web server implementing Java 
Servlet 3.0,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-bio/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp-src.jar.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
commons-daemon.native.src.tgz.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
tomcat-native.tar.gz.
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp.home.
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/logs-BIO
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/test-tmp-BIO/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-bio/gump_work/build_tomcat-7.0.x_tomcat-tc7.0.x-test-bio.html
Work Name: build_tomcat-7.0.x_tomcat-tc7.0.x-test-bio (Type: Build)
Work ended in a state of : Failed
Elapsed: 37 mins 46 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x 
-Dtest.temp=output/test-tmp-BIO 
-Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.3-SNAPSHOT.jar
 -Dexamples.sources.skip=true 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20151218.jar
 
-Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-src.jar
 -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps 
-Dtest.excludePerformance=true 
-Dhamcrest.jar=/srv/gump/packages/hamcrest/hamcrest-core-1.3.jar 
-Dcommons-dbcp.home=/srv/gump/public/workspace/commons-dbcp-1.x 
-Dexecute.test.apr=false -Dexecute.test.bio=true 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/wo
 
rkspace/apache-commons/daemon/dist/bin/commons-daemon-20151218-native-src.tar.gz
 -Dtest.reports=output/logs-BIO 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20151218-native-src.tar.gz
 -Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.5-201506032000/ecj-4.5.jar 
-Dexecute.test.nio=false -Dtest.accesslog=true 
-Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-20151218.jar
 
-Deasymock.jar=/srv/gump/public/workspace/easymock/core/target/easymock-3.5-SNAPSHOT.jar
 -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test 
[Working Directory: /srv/gump/public/workspace/tomcat-7.0.x]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-7.0.x/output/testclasses:/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/tomcat-7.0.x/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/servlet-api.ja
 
r:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build