svn commit: r1625469 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 06:20:08 2014
New Revision: 1625469

URL: http://svn.apache.org/r1625469
Log:
Merged revisions 1560817, 1561623, 1606072 from tomcat/trunk:
- Fix some arcane introspection errors.
- Add a TODO to remind me to come back and look at this
- Correct comment

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1560817,1561623,1606072

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java?rev=1625469r1=1625468r2=1625469view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBase.java
 Wed Sep 17 06:20:08 2014
@@ -50,6 +50,14 @@ public abstract class PojoMessageHandler
 int indexSession, long maxMessageSize) {
 this.pojo = pojo;
 this.method = method;
+// TODO: The method should already be accessible here but the following
+// code seems to be necessary in some as yet not fully understood 
cases.
+try {
+this.method.setAccessible(true);
+} catch (Exception e) {
+// It is better to make sure the method is accessible, but
+// ignore exceptions and hope for the best
+}
 this.session = session;
 this.params = params;
 this.indexPayload = indexPayload;



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



svn commit: r1625470 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/ java/org/apache/tomcat/websocket/server/

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 06:31:22 2014
New Revision: 1625470

URL: http://svn.apache.org/r1625470
Log:
Merged revisions 1606103 from tomcat/trunk:
Plumbing to enable transformation / extension processing for outgoing server 
messages.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/Transformation.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsSession.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsFrameServer.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1625470r1=1625469r2=1625470view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
Wed Sep 17 06:31:22 2014
@@ -283,4 +283,15 @@ public class PerMessageDeflate implement
 return next.validateRsvBits(i | RSV_BITMASK);
 }
 }
+
+
+@Override
+public ListMessagePart sendMessagePart(ListMessagePart messageParts) {
+// TODO: Implement compression of sent messages
+if (next == null) {
+return messageParts;
+} else {
+return next.sendMessagePart(messageParts);
+}
+}
 }

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/Transformation.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/Transformation.java?rev=1625470r1=1625469r2=1625470view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/Transformation.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/Transformation.java 
Wed Sep 17 06:31:22 2014
@@ -18,18 +18,44 @@ package org.apache.tomcat.websocket;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.util.List;
 
 import javax.websocket.Extension;
 
 /**
  * The internal representation of the transformation that a WebSocket extension
  * performs on a message.
- *
- * TODO Add support for transformation of outgoing data as well as incoming.
  */
 public interface Transformation {
 
 /**
+ * Sets the next transformation in the pipeline.
+ */
+void setNext(Transformation t);
+
+/**
+ * Validate that the RSV bit(s) required by this transformation are not
+ * being used by another extension. The implementation is expected to set
+ * any bits it requires before passing the set of in-use bits to the next
+ * transformation.
+ *
+ * @param i The RSV bits marked as in use so far as an int in the
+ *  range zero to seven with RSV1 as the MSB and RSV3 as 
the
+ *  LSB
+ *
+ * @return codetrue/code if the combination of RSV bits used by the
+ * transformations in the pipeline do not conflict otherwise
+ * codefalse/code
+ */
+boolean validateRsvBits(int i);
+
+/**
+ * Obtain the extension that describes the information to be returned to 
the
+ * client.
+ */
+Extension getExtensionResponse();
+
+/**
  * Obtain more input data.
  *
  * @param opCodeThe opcode for the frame currently being processed
@@ -56,29 +82,16 @@ public interface Transformation {
 boolean validateRsv(int rsv, byte opCode);
 
 /**
- * Obtain the extension that describes the information to be returned to 
the
- * client.
- */
-Extension getExtensionResponse();
-
-/**
- * Sets the next transformation in the pipeline.
- */
-void setNext(Transformation t);
-
-/**
- * Validate that the RSV bit(s) required by this transformation are not
- * being used by another extension. The implementation is expected to set
- * any bits it requires before passing the set of in-use bits to the next
- * transformation.
+ * Takes the provided list of messages, transforms them, passes the
+ * transformed list on to the next transformation (if any) and then returns
+ * 

svn commit: r1625471 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/WsFrameClient.java java/org/apache/tomcat/websocket/WsWebSocketContainer.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 06:36:35 2014
New Revision: 1625471

URL: http://svn.apache.org/r1625471
Log:
Merged revision 1606653 from tomcat/trunk:
Fix root cause of NPE when using WebSocket clients.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java?rev=1625471r1=1625470r2=1625471view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java 
Wed Sep 17 06:36:35 2014
@@ -37,7 +37,10 @@ public class WsFrameClient extends WsFra
 this.response = response;
 this.channel = channel;
 this.handler = new WsFrameClientCompletionHandler();
+}
+
 
+void startInputProcessing() {
 try {
 processSocketRead();
 } catch (IOException e) {

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1625471r1=1625470r2=1625471view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
Wed Sep 17 06:36:35 2014
@@ -344,8 +344,6 @@ public class WsWebSocketContainer
 }
 }
 
-// TODO Add extension/transformation support to the client
-
 // Switch to WebSocket
 WsRemoteEndpointImplClient wsRemoteEndpointClient = new 
WsRemoteEndpointImplClient(channel);
 
@@ -353,13 +351,17 @@ public class WsWebSocketContainer
 this, null, null, null, null, null, subProtocol,
 Collections.String, String emptyMap(), secure,
 clientEndpointConfiguration);
-endpoint.onOpen(wsSession, clientEndpointConfiguration);
-registerSession(endpoint, wsSession);
 
-// Object creation will trigger input processing
-@SuppressWarnings(unused)
 WsFrameClient wsFrameClient = new WsFrameClient(response, channel,
 wsSession);
+// WsFrame adds the necessary final transformations. Copy the
+// completed transformation chain to the remote end point.
+
wsRemoteEndpointClient.setTransformation(wsFrameClient.getTransformation());
+
+endpoint.onOpen(wsSession, clientEndpointConfiguration);
+registerSession(endpoint, wsSession);
+
+wsFrameClient.startInputProcessing();
 
 return wsSession;
 }



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



svn commit: r1625472 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/PerMessageDeflate.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 06:43:50 2014
New Revision: 1625472

URL: http://svn.apache.org/r1625472
Log:
Merged revisions 1618688, 1618704, 1618830 from tomcat/trunk:
- Whitespace
- Add a little plumbing for outgoing messages (no actual compression yet)
- Make a couple of fields volatile that are accessed by multiple threads (in 
succession, not in parallel)
- s/inflator/inflater/

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1618688,1618704,1618830

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1625472r1=1625471r2=1625472view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
Wed Sep 17 06:43:50 2014
@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.zip.DataFormatException;
 import java.util.zip.Inflater;
@@ -45,15 +46,13 @@ public class PerMessageDeflate implement
 private final int serverMaxWindowBits;
 private final boolean clientContextTakeover;
 private final int clientMaxWindowBits;
-private final Inflater inflator = new Inflater(true);
+private final Inflater inflater = new Inflater(true);
 private final ByteBuffer readBuffer = ByteBuffer.allocate(8192);
 
-private Transformation next;
-private boolean skipDecompression = false;
+private volatile Transformation next;
+private volatile boolean skipDecompression = false;
 
 static PerMessageDeflate negotiate(ListListParameter preferences) {
-
-
 // Accept the first preference that the server is able to support
 for (ListParameter preference : preferences) {
 boolean ok = true;
@@ -144,6 +143,7 @@ public class PerMessageDeflate implement
 return null;
 }
 
+
 private PerMessageDeflate(boolean serverContextTakeover, int 
serverMaxWindowBits,
 boolean clientContextTakeover, int clientMaxWindowBits) {
 this.serverContextTakeover = serverContextTakeover;
@@ -156,7 +156,6 @@ public class PerMessageDeflate implement
 @Override
 public TransformationResult getMoreData(byte opCode, boolean fin, int rsv, 
ByteBuffer dest)
 throws IOException {
-
 // Control frames are never compressed and may appear in the middle of
 // a WebSocket method. Pass them straight through.
 if (Util.isControl(opCode)) {
@@ -179,26 +178,26 @@ public class PerMessageDeflate implement
 while (dest.remaining()  0) {
 // Space available in destination. Try and fill it.
 try {
-written = inflator.inflate(
+written = inflater.inflate(
 dest.array(), dest.arrayOffset() + dest.position(), 
dest.remaining());
 } catch (DataFormatException e) {
 throw new 
IOException(sm.getString(perMessageDeflate.deflateFailed), e);
 }
 dest.position(dest.position() + written);
 
-if (inflator.needsInput()  !usedEomBytes ) {
+if (inflater.needsInput()  !usedEomBytes ) {
 if (dest.hasRemaining()) {
 readBuffer.clear();
 TransformationResult nextResult =
 next.getMoreData(opCode, fin, (rsv ^ RSV_BITMASK), 
readBuffer);
-inflator.setInput(
+inflater.setInput(
 readBuffer.array(), readBuffer.arrayOffset(), 
readBuffer.position());
 if (TransformationResult.UNDERFLOW.equals(nextResult)) {
 return nextResult;
 } else if 
(TransformationResult.END_OF_FRAME.equals(nextResult) 
 readBuffer.position() == 0) {
 if (fin) {
-inflator.setInput(EOM_BYTES);
+inflater.setInput(EOM_BYTES);
 usedEomBytes = true;
 } else {
 return TransformationResult.END_OF_FRAME;
@@ -239,6 +238,7 @@ public class PerMessageDeflate implement
 }
 }
 
+
 @Override
 public Extension getExtensionResponse() {
 Extension result = new WsExtension(NAME);
@@ -263,6 +263,7 @@ public class PerMessageDeflate implement
 return result;
 }
 
+
 @Override
 public void 

svn commit: r1625474 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 07:21:28 2014
New Revision: 1625474

URL: http://svn.apache.org/r1625474
Log:
Merged revision 1619585 from tomcat/trunk:
Clear buffers as well as handler once they are no longer needed.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java?rev=1625474r1=1625473r2=1625474view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointImplServer.java
 Wed Sep 17 07:21:28 2014
@@ -190,6 +190,7 @@ public class WsRemoteEndpointImplServer 
 // message.
 SendHandler sh = handler;
 handler = null;
+buffers = null;
 if (sh != null) {
 if (useDispatch) {
 OnResultRunnable r = onResultRunnables.poll();



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



svn commit: r1625475 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/MessagePart.java java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 07:26:14 2014
New Revision: 1625475

URL: http://svn.apache.org/r1625475
Log:
Merged revisions 1618832, 1618833 from tomcat/trunk:
- Reduce visibility
- Rename to align with RFC 6455 terms

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1618832-1618833

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java?rev=1625475r1=1625474r2=1625475view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java Wed 
Sep 17 07:26:14 2014
@@ -20,17 +20,17 @@ import java.nio.ByteBuffer;
 
 import javax.websocket.SendHandler;
 
-public class MessagePart {
+class MessagePart {
 private final byte opCode;
 private final ByteBuffer payload;
-private final boolean last;
+private final boolean fin;
 private final SendHandler handler;
 
-public MessagePart(byte opCode, ByteBuffer payload, boolean last,
+public MessagePart(byte opCode, ByteBuffer payload, boolean fin,
 SendHandler handler) {
 this.opCode = opCode;
 this.payload = payload;
-this.last = last;
+this.fin = fin;
 this.handler = handler;
 }
 
@@ -45,8 +45,8 @@ public class MessagePart {
 }
 
 
-public boolean isLast() {
-return last;
+public boolean isFin() {
+return fin;
 }
 
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1625475r1=1625474r2=1625475view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 Wed Sep 17 07:26:14 2014
@@ -370,11 +370,11 @@ public abstract class WsRemoteEndpointIm
 sm.getString(wsRemoteEndpoint.changeType));
 }
 nextText = text;
-nextFragmented = !mp.isLast();
+nextFragmented = !mp.isFin();
 first = false;
 } else {
 // Wasn't fragmented. Might be now
-if (mp.isLast()) {
+if (mp.isFin()) {
 nextFragmented = false;
 } else {
 nextFragmented = true;
@@ -394,7 +394,7 @@ public abstract class WsRemoteEndpointIm
 
 headerBuffer.clear();
 writeHeader(headerBuffer, mp.getOpCode(), mp.getPayload(), first,
-mp.isLast(), isMasked(), mask);
+mp.isFin(), isMasked(), mask);
 headerBuffer.flip();
 
 if (getBatchingAllowed() || isMasked()) {



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



svn commit: r1625479 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/MessagePart.java java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 08:08:40 2014
New Revision: 1625479

URL: http://svn.apache.org/r1625479
Log:
Merged revision 1618834 from tomcat/trunk:
Add rsv to MessagePart and re-order constructor to match order elements
are used in RFC 6455

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java?rev=1625479r1=1625478r2=1625479view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java Wed 
Sep 17 08:08:40 2014
@@ -21,20 +21,32 @@ import java.nio.ByteBuffer;
 import javax.websocket.SendHandler;
 
 class MessagePart {
+private final boolean fin;
+private final int rsv;
 private final byte opCode;
 private final ByteBuffer payload;
-private final boolean fin;
 private final SendHandler handler;
 
-public MessagePart(byte opCode, ByteBuffer payload, boolean fin,
+public MessagePart( boolean fin, int rsv, byte opCode, ByteBuffer payload,
 SendHandler handler) {
+this.fin = fin;
+this.rsv = rsv;
 this.opCode = opCode;
 this.payload = payload;
-this.fin = fin;
 this.handler = handler;
 }
 
 
+public boolean isFin() {
+return fin;
+}
+
+
+public int getRsv() {
+return rsv;
+}
+
+
 public byte getOpCode() {
 return opCode;
 }
@@ -45,11 +57,6 @@ class MessagePart {
 }
 
 
-public boolean isFin() {
-return fin;
-}
-
-
 public SendHandler getHandler() {
 return handler;
 }

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1625479r1=1625478r2=1625479view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 Wed Sep 17 08:08:40 2014
@@ -260,7 +260,7 @@ public abstract class WsRemoteEndpointIm
 wsSession.updateLastActive();
 
 ListMessagePart messageParts = new ArrayListMessagePart();
-messageParts.add(new MessagePart(opCode, payload, last,
+messageParts.add(new MessagePart(last, 0, opCode, payload,
 new EndMessageHandler(this, handler)));
 
 messageParts = transformation.sendMessagePart(messageParts);



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



Re: Discussion of pluggable password-derivation in Realms [Bug 56403]

2014-09-17 Thread Mark Thomas
On 16/09/2014 22:14, Christopher Schultz wrote:
 Mark,
 
 On 9/16/14 3:39 PM, Mark Thomas wrote:
 Updated patch:
 http://people.apache.org/~markt/patches/2014-09-16-bug56403-tc8-v2.patch
 
 Looks good, but its missing a configuration for the digester to actually
 read the configuration and set-up the CredentialHandler objects at
 runtime. Existing MessageDigest-based configs will work, but explicit
 class references won't.

Ack. The docs need updating as well.

 Speaking of which, I'd like to be able to nest CredentialHandler
 instances. The use case is when switching from one type of
 password-derivation method to another. We have done this at $work twice
 and being able to handle more than one kind of valid credential in the
 database is essential.

OK. That seems like a reasonable requirement.

 Given that we are giving better options to users than standard
 single-pass MessageDigest password-mutators, we should help them
 migrate. The only way to do that would be something like
 CombinedCredentialHandler analogous to the CombinedRealm: you will
 accept either MessageDigestCredentiaHandler{SHA1} /or/, say, PBKDF,
 bcrypt, etc., by checking one CredentialHandler and then the second (or
 third?) if the first one fails.
 
 Use of a CombinedCredentialHandler might result in a lot of spurious
 warnings in the log about invalid credentials. Maybe the
 CombinedCredentialHandler could tell the individual child
 CredentialHandlers that they should not log invalid credentials?

Yes, we'll need to make sure the logs don't fill up with false positives.

 I'd like to get some other opinions on the public mutate() interface. I
 think we might not be able to convince each other ;)

You might be surprised. I was looking at using mutate() from match to
reduce code duplication but if you limit mutate() to just generating new
passwords then I agree there is no need for any other parameters. A
protected method used by both mutate() and match() should work. I'll
take another look.

Regarding thread safety for the SecureRandom, we can do that now. It
doesn't cost us very much and it prevents it tripping us up in the future.

Mark


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



[Bug 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

hzha...@ebay.com changed:

   What|Removed |Added

  Attachment #32008|0   |1
is obsolete||

--- Comment #10 from hzha...@ebay.com ---
Created attachment 32029
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=32029action=edit
change DataInputStream to DataInput

-- 
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 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #11 from hzha...@ebay.com ---
Created attachment 32030
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=32030action=edit
FastDataInputStream implementation

-- 
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 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #12 from hzha...@ebay.com ---
Created attachment 32031
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=32031action=edit
Test case

-- 
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 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #13 from hzha...@ebay.com ---
Sorry for the delay.
New patch applies on TRUNK, and the codes borrowed from GPL has been changed.

Benefit shows bellow(300 jar files involved in this test):
=Call FDIS first=
DataInputStream: 7342
FastDataInputStream: 6967

=reverse call sequency=
DataInputStream: 7369
FastDataInputStream: 6979

The benefit is considerable when there are 200 or more jar files need to be
parse.

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

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



Re: JMX loose ends

2014-09-17 Thread Mark Thomas
On 17/09/2014 02:05, Alarcón Vladimir wrote:
 Hi, this is my first email here.
 
 I was looking at the JMX MBeans through j-console and I found some
 loose ends here and there. It's not much, but I think I can help
 fixing them.
 
 First, things first: Are you interested on help with the bug fixes?

Always. :)

 Second: if you are interested, how should I proceed? I got Tomcat's
 source code today and I'm browsing all around the place now :)

Open a Bugzilla issue and attach a patch in diff -u format against trunk:
http://svn.apache.org/repos/asf/tomcat/trunk/

Alternatively, you can use github and submit a pull request:
https://github.com/apache/tomcat

Mark

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



svn commit: r1625501 - in /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: AnnotationEntry.java Annotations.java ClassParser.java Constant.java ConstantPool.java ConstantUtf8.java ElementValu

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 10:28:19 2014
New Revision: 1625501

URL: http://svn.apache.org/r1625501
Log:
Use the DataInput interface rather than an implementation

Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java

tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=1625501r1=1625500r2=1625501view=diff
==
--- 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java 
Wed Sep 17 10:28:19 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.DataInputStream;
+import java.io.DataInput;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -44,7 +44,7 @@ public class AnnotationEntry implements 
  * @param constant_pool
  * @throws IOException
  */
-AnnotationEntry(DataInputStream file, ConstantPool constant_pool) throws 
IOException {
+AnnotationEntry(DataInput file, ConstantPool constant_pool) throws 
IOException {
 
 this.constant_pool = constant_pool;
 

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=1625501r1=1625500r2=1625501view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java 
Wed Sep 17 10:28:19 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.DataInputStream;
+import java.io.DataInput;
 import java.io.IOException;
 
 /**
@@ -34,7 +34,7 @@ public class Annotations {
  * @param file Input stream
  * @param constant_pool Array of constants
  */
-Annotations(DataInputStream file, ConstantPool constant_pool)
+Annotations(DataInput file, ConstantPool constant_pool)
 throws IOException {
 final int annotation_table_length = (file.readUnsignedShort());
 annotation_table = new AnnotationEntry[annotation_table_length];

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625501r1=1625500r2=1625501view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java 
Wed Sep 17 10:28:19 2014
@@ -18,6 +18,7 @@
 package org.apache.tomcat.util.bcel.classfile;
 
 import java.io.BufferedInputStream;
+import java.io.DataInput;
 import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -42,7 +43,7 @@ public final class ClassParser {
 
 private static final int MAGIC = 0xCAFEBABE;
 
-private final DataInputStream file;
+private final DataInput file;
 private String class_name, superclass_name;
 private int access_flags; // Access rights of parsed class
 private String[] interface_names; // Names of implemented interfaces

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java?rev=1625501r1=1625500r2=1625501view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java Wed 
Sep 17 10:28:19 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.DataInputStream;
+import java.io.DataInput;
 import java.io.IOException;
 
 import org.apache.tomcat.util.bcel.Constants;
@@ -62,7 +62,7 @@ public abstract class Constant {
  * @param file Input stream
  * @return Constant object
  */
-static Constant readConstant( DataInputStream file ) 

svn commit: r1625504 - in /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: ClassParser.java FastDataInputStream.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 10:34:51 2014
New Revision: 1625504

URL: http://svn.apache.org/r1625504
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56953
Further performance improvements to BCEL parser.
Based on a patch by hzhang9

Added:

tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
   (with props)
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625504r1=1625503r2=1625504view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java 
Wed Sep 17 10:34:51 2014
@@ -17,9 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.BufferedInputStream;
 import java.io.DataInput;
-import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -59,7 +57,7 @@ public final class ClassParser {
  * @param file Input stream
  */
 public ClassParser(InputStream file) {
-this.file = new DataInputStream(new BufferedInputStream(file, 
BUFSIZE));
+this.file = new FastDataInputStream(file, BUFSIZE);
 }
 
 

Added: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java?rev=1625504view=auto
==
--- 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 (added)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 Wed Sep 17 10:34:51 2014
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the License); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.util.bcel.classfile;
+
+import java.io.BufferedInputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A FastDataInputStream that get the numbers from buffer and from the target
+ * directly instead of DataInputStream.
+ */
+class FastDataInputStream extends BufferedInputStream implements DataInput {
+
+private final byte readBuffer[] = new byte[8];
+
+
+public FastDataInputStream(InputStream in, int size) {
+super(in, size);
+}
+
+
+@Override
+public final int read(byte b[]) throws IOException {
+return this.read(b, 0, b.length);
+}
+
+
+@Override
+public final void readFully(byte b[]) throws IOException {
+readFully(b, 0, b.length);
+}
+
+
+@Override
+public final void readFully(byte b[], int off, int len) throws IOException 
{
+if (len  0)
+throw new IndexOutOfBoundsException();
+// Total read
+int sum = 0;
+// Current read
+int cur = 0;
+for(; sum  len; sum += cur){
+cur = read(b, off + sum, len - sum);
+if(cur  0)
+throw new EOFException();
+sum += cur;
+}
+}
+
+
+@Override
+public boolean readBoolean() throws IOException {
+if (pos = count) {
+fillNew();
+if (pos = count)
+throw new EOFException();
+}
+int ch = this.buf[pos++]  0xff;
+return (ch != 0);
+}
+
+
+@Override
+public final byte readByte() throws IOException {
+if (pos = count) {
+fillNew();
+if (pos = count)
+throw new EOFException();
+}
+return this.buf[pos++];
+}
+
+
+@Override
+public int readUnsignedByte() throws IOException {
+if (pos = count) {
+fillNew();
+if (pos = count)
+throw new EOFException();
+}
+int ch = this.buf[pos++]  0xff;
+return ch;
+}
+
+
+@Override
+public final short 

[Bug 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #14 from Mark Thomas ma...@apache.org ---
Thanks for the updated patches. I see a 20-25% improvement with the patch so it
has been applied to 8.0.x for 8.0.13 onwards.

I'll look into porting it to 7.0.x.

-- 
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: r1625506 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/MessagePart.java java/org/apache/tomcat/websocket/PerMessageDeflate.java java/org/apache/tomcat/websocket/WsRemoteE

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 10:37:10 2014
New Revision: 1625506

URL: http://svn.apache.org/r1625506
Log:
Merged revision 1619738 from tomcat/trunk:
Extend support for the WebSocket permessage-deflate extension to compression of 
outgoing messages on the server side.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

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

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java?rev=1625506r1=1625505r2=1625506view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/MessagePart.java Wed 
Sep 17 10:37:10 2014
@@ -25,15 +25,17 @@ class MessagePart {
 private final int rsv;
 private final byte opCode;
 private final ByteBuffer payload;
-private final SendHandler handler;
+private final SendHandler intermediateHandler;
+private volatile SendHandler endHandler;
 
 public MessagePart( boolean fin, int rsv, byte opCode, ByteBuffer payload,
-SendHandler handler) {
+SendHandler intermediateHandler, SendHandler endHandler) {
 this.fin = fin;
 this.rsv = rsv;
 this.opCode = opCode;
 this.payload = payload;
-this.handler = handler;
+this.intermediateHandler = intermediateHandler;
+this.endHandler = endHandler;
 }
 
 
@@ -57,8 +59,17 @@ class MessagePart {
 }
 
 
-public SendHandler getHandler() {
-return handler;
+public SendHandler getIntermediateHandler() {
+return intermediateHandler;
+}
+
+
+public SendHandler getEndHandler() {
+return endHandler;
+}
+
+public void setEndHandler(SendHandler endHandler) {
+this.endHandler = endHandler;
 }
 }
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1625506r1=1625505r2=1625506view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
Wed Sep 17 10:37:10 2014
@@ -21,10 +21,12 @@ import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
 import java.util.zip.Inflater;
 
 import javax.websocket.Extension;
 import javax.websocket.Extension.Parameter;
+import javax.websocket.SendHandler;
 
 import org.apache.tomcat.util.res.StringManager;
 
@@ -47,10 +49,15 @@ public class PerMessageDeflate implement
 private final boolean clientContextTakeover;
 private final int clientMaxWindowBits;
 private final Inflater inflater = new Inflater(true);
-private final ByteBuffer readBuffer = ByteBuffer.allocate(8192);
+private final ByteBuffer readBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
+private final Deflater deflater = new 
Deflater(Deflater.DEFAULT_COMPRESSION, true);
 
 private volatile Transformation next;
 private volatile boolean skipDecompression = false;
+private volatile ByteBuffer writeBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
+private volatile boolean deflaterResetRequired = true;
+private volatile boolean firstCompressedFrameWritten = false;
+private volatile byte[] EOM_BUFFER = new byte[EOM_BYTES.length + 1];
 
 static PerMessageDeflate negotiate(ListListParameter preferences) {
 // Accept the first preference that the server is able to support
@@ -288,25 +295,143 @@ public class PerMessageDeflate implement
 
 
 @Override
-public ListMessagePart sendMessagePart(ListMessagePart messageParts) {
-ListMessagePart compressedParts = new 
ArrayListMessagePart(messageParts.size());
+public ListMessagePart sendMessagePart(ListMessagePart 
uncompressedParts) {
+ListMessagePart allCompressedParts = new ArrayListMessagePart();
 
-for (MessagePart messagePart : messageParts) {
-byte opCode = messagePart.getOpCode();
+for (MessagePart uncompressedPart : uncompressedParts) {
+byte opCode = uncompressedPart.getOpCode();
 if (Util.isControl(opCode)) {

buildbot failure in ASF Buildbot on tomcat-7-trunk

2014-09-17 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/296

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

Buildslave for this Build: silvanus_ubuntu

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

BUILD FAILED: failed compile

sincerely,
 -The Buildbot




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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #9 from Mark Thomas ma...@apache.org ---
Thanks for this. I still want to try and create the svn externals as that means
the Maven build would be based directly on svn and folks would be able to
commit / propose patches / merge updates much more easily.

I intended to start on this on Monday but got somewhat side-tracked with other
things.

One issue I did not want to forget. The patch mentions a circular dependency.
That is bad and I thought we had got rid of all of those. I know I could work
out the details for myself but if you have them handy it would be very helpful
if you could add them here.

-- 
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 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #15 from Konstantin Kolinko knst.koli...@gmail.com ---
OK, this is better.

1. Formatting: the code shall not use tab characters

2. In skipBytes(int n):  there is no reason to call fillNew() after calling
in.skip(n - sum) on the underlying stream. If another skip call follows then
there is no point in filling the buffer.

3.  0 shift operation is NOOP and can be removed.

4. I wonder whether ch + ch or ch | ch works better. In theory the latter
should be faster, but I guess there is no measurable difference nowadays.

5. In uninmplemented readLine() method: maybe better throw new
java.lang.UnsupportedOperationException() instead of IOException.

-- 
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: r1625515 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/Constants.java java/org/apache/tomcat/util/bcel/classfile/Attribute.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 11:14:39 2014
New Revision: 1625515

URL: http://svn.apache.org/r1625515
Log:
Simplify.
There is no real need to convert every attribute name into numeric tag via 
lookup table, when there are only two attribute names that we recognize.

In the old code there was an average of (ATTRIBUTE_NAMES.length/2) = 11 
String.equals() calls when looking up a numeric 'tag'.
In the new code there will be two String.equals() calls.

This is a backport of r1624586 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624586

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java?rev=1625515r1=1625514r2=1625515view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/Constants.java Wed 
Sep 17 11:14:39 2014
@@ -90,26 +90,4 @@ public interface Constants {
 CONSTANT_Methodref, CONSTANT_InterfaceMethodref,
 CONSTANT_NameAndType, , , CONSTANT_MethodHandle,
 CONSTANT_MethodType, , CONSTANT_InvokeDynamic };
-  
-
-  /** Attributes and their corresponding names.
-   */
-  public static final byte ATTR_UNKNOWN = -1;
-  public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS = 12;
-  public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS   = 14;
-  public static final byte ATTR_ANNOTATION_DEFAULT  = 16;
-
-  public static final short KNOWN_ATTRIBUTES = 22;
-
-  // TOFO: FIX
-  public static final String[] ATTRIBUTE_NAMES = {
-SourceFile, ConstantValue, Code, Exceptions,
-LineNumberTable, LocalVariableTable,
-InnerClasses, Synthetic, Deprecated,
-PMGClass, Signature, StackMap, 
-RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations,
-RuntimeVisibleParameterAnnotations, 
RuntimeInvisibleParameterAnnotations,
-AnnotationDefault, LocalVariableTypeTable, EnclosingMethod, 
StackMapTable,
-BootstrapMethods, MethodParameters
-  };
 }

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1625515r1=1625514r2=1625515view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
Wed Sep 17 11:14:39 2014
@@ -55,7 +55,6 @@ public abstract class Attribute {
 String name;
 int name_index;
 int length;
-byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
 // Get class name from constant pool via `name_index' indirection
 name_index = file.readUnsignedShort();
 c = (ConstantUtf8) constant_pool.getConstant(name_index,
@@ -63,24 +62,14 @@ public abstract class Attribute {
 name = c.getBytes();
 // Length of data in bytes
 length = file.readInt();
-// Compare strings to find known attribute
-// System.out.println(name);
-for (byte i = 0; i  Constants.KNOWN_ATTRIBUTES; i++)
-{
-if (name.equals(Constants.ATTRIBUTE_NAMES[i]))
-{
-tag = i; // found!
-break;
-}
-}
-// Call proper constructor, depending on `tag'
-switch (tag)
-{
-case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
+
+// Call proper constructor, depending on `name'
+if (name.equals(RuntimeVisibleAnnotations)) {
 return new RuntimeVisibleAnnotations(file, constant_pool);
-case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
+} else if (name.equals(RuntimeVisibleParameterAnnotations)) {
 return new RuntimeVisibleParameterAnnotations(file, constant_pool);
-default: // All other attributes are skipped
+} else {
+// All other attributes are skipped
 Utility.skipFully(file, length);
 return null;
 }




svn commit: r1625516 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 11:15:23 2014
New Revision: 1625516

URL: http://svn.apache.org/r1625516
Log:
Remove constant_pool_count field.
The field is never read, and its value is known from the length of 
constant_pool array created in constructor.
Backport of r1624588 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624588

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java?rev=1625516r1=1625515r2=1625516view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
 Wed Sep 17 11:15:23 2014
@@ -35,8 +35,7 @@ import org.apache.tomcat.util.bcel.Const
  */
 public class ConstantPool {
 
-private int constant_pool_count;
-private Constant[] constant_pool;
+private final Constant[] constant_pool;
 
 
 /**
@@ -47,7 +46,7 @@ public class ConstantPool {
  * @throws ClassFormatException
  */
 ConstantPool(DataInputStream file) throws IOException, 
ClassFormatException {
-constant_pool_count = file.readUnsignedShort();
+int constant_pool_count = file.readUnsignedShort();
 constant_pool = new Constant[constant_pool_count];
 /* constant_pool[0] is unused by the compiler and may be used freely
  * by the implementation.



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



Re: buildbot failure in ASF Buildbot on tomcat-7-trunk

2014-09-17 Thread Konstantin Kolinko
2014-09-17 14:42 GMT+04:00  build...@apache.org:
 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/296

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

 Buildslave for this Build: silvanus_ubuntu


Several notes

1. Tomcat 7 builds have been moved to a different slave, silvanus_ubuntu

2. I tested that I have commit right for buildbot configuration and
was able to fix misconfiguration of Ant.

The symptoms were that ant release command silently failed with exit
code 1 and no output.

I think the cause was that Buildbot configuration for Tomcat 7 used
tildes in the values of variables, e.g. ANT_HOME=~/tools/ant/current
and JAVA_HOME=~/tools/java/latest1.6.
Replacing ~/ with ${HOME}/ helped.

My guess is tilde expansion is a feature of shell and is not supported
in the value of java CLASSPATH. So when Ant built classpath from those
values Java was not able to load those libraries. Though I wonder why
it failed with no error output.

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

 BUILD FAILED: failed compile

3.  Compiling of Tomcat code succeeded.
It fails at extras-commons-logging compiling step.

My guess is that using a relative path as base.path=../basepath is
no good for extras.
E.g. Avalon was downloaded, but then it failed to find it:
[[[
 [echo] *** WARNING ***
 [echo] Avalon-Framework not found: Cannot Build AvalonLogger
]]]

At the same time, Tomcat's own code did build successfully.

So either there is a way to fix extras to build with such paths, or
one needs to update Buildbot configuration to use an absolute path for
base.path.

Best regards,
Konstantin Kolinko

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



svn commit: r1625536 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:03:10 2014
New Revision: 1625536

URL: http://svn.apache.org/r1625536
Log:
Add 'final' modifiers to fields.
Remove several num_xxx fields that accompanied an xxx array.
Port of r1624592 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantClass.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantDouble.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFloat.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInteger.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantLong.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/EnumElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/SimpleElementValue.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624592

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java?rev=1625536r1=1625535r2=1625536view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
 Wed Sep 17 12:03:10 2014
@@ -20,7 +20,7 @@ package org.apache.tomcat.util.bcel.clas
 public class AnnotationElementValue extends ElementValue
 {
 // For annotation element values, this is the annotation
-private AnnotationEntry annotationEntry;
+private final AnnotationEntry annotationEntry;
 
 AnnotationElementValue(int type, AnnotationEntry annotationEntry,
 ConstantPool cpool)

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=1625536r1=1625535r2=1625536view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
 Wed Sep 17 12:03:10 2014
@@ -35,6 +35,7 @@ public class AnnotationEntry implements 
 private final int type_index;
 private final ConstantPool constant_pool;
 
+// FIXME: add 'final'
 private ListElementValuePair element_value_pairs;
 
 /**

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java?rev=1625536r1=1625535r2=1625536view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
 Wed Sep 17 12:03:10 2014
@@ -20,7 +20,7 @@ package org.apache.tomcat.util.bcel.clas
 public class ArrayElementValue extends ElementValue
 {
 // For array types, this is the array
-private ElementValue[] evalues;
+private final ElementValue[] evalues;
 
 ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool)
 {

Modified: 

[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #10 from Pierre Viret pierre.vi...@gmail.com ---
Thank you very much for your feedback.

1) About the circular dependency: the pattern for the tomcat-coyote component
selects the file org/apache/tomcat/util/net/Constants.java.
This class is referenced by
org.apache.tomcat.util.threads.TaskThreadFactory.java which belongs to the
tomcat-util component. Actually only one constant field is used:

This field is defined like this in the Constants class:
public static final boolean IS_SECURITY_ENABLED =
(System.getSecurityManager() != null);

I think we can get rid of the circular dependency simply by modifying the
TaskThreadFactory class: replace the two lines which use the constant:
if (Constants.IS_SECURITY_ENABLED) {

With following: if (System.getSecurityManager() != null) {
and we should get the same result.


2) About the svn externals: this would be great! I don't know this feature so I
will study the svn documentation to understand how this would work. For
instance, is it possible to reuse the ant patterns defined in the build.xml
for selecting the right sources for each component?


3) I have started the implementation of a new maven project: apache-tomcat
which would create the distributions (as we can download them from
http://tomcat.apache.org/download-80.cgi). I will upload the new version of the
maven project files and the patch for the build.xml in this bug as soon as I
have a working base which would show how this can be implemented.

-- 
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: r1625546 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:19:45 2014
New Revision: 1625546

URL: http://svn.apache.org/r1625546
Log:
Remove RuntimeVisibleParameterAnnotations and its supporting classes.
The fields in these classes have no getters (especially 
ParameterAnnotationEntry.annotation_table).
As such, information stored in those classes was never read by Tomcat.
Port of r1624598 from trunk

Removed:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotationEntry.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ParameterAnnotations.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleParameterAnnotations.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624598

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1625546r1=1625545r2=1625546view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
Wed Sep 17 12:19:45 2014
@@ -66,8 +66,6 @@ public abstract class Attribute {
 // Call proper constructor, depending on `name'
 if (name.equals(RuntimeVisibleAnnotations)) {
 return new RuntimeVisibleAnnotations(file, constant_pool);
-} else if (name.equals(RuntimeVisibleParameterAnnotations)) {
-return new RuntimeVisibleParameterAnnotations(file, constant_pool);
 } else {
 // All other attributes are skipped
 Utility.skipFully(file, length);



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



svn commit: r1625547 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:21:05 2014
New Revision: 1625547

URL: http://svn.apache.org/r1625547
Log:
Flatten class hierarchy.  The only subtype of Annotations class is 
RuntimeVisibleAnnotations.
Port of r1624605 from trunk

Removed:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeVisibleAnnotations.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624605

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=1625547r1=1625546r2=1625547view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
 Wed Sep 17 12:21:05 2014
@@ -26,7 +26,7 @@ import java.io.IOException;
  * @author  A HREF=mailto:dbros...@qis.net;D. Brosius/A
  * @since 6.0
  */
-public abstract class Annotations extends Attribute {
+public class Annotations extends Attribute {
 
 private final AnnotationEntry[] annotation_table;
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1625547r1=1625546r2=1625547view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
Wed Sep 17 12:21:05 2014
@@ -65,7 +65,7 @@ public abstract class Attribute {
 
 // Call proper constructor, depending on `name'
 if (name.equals(RuntimeVisibleAnnotations)) {
-return new RuntimeVisibleAnnotations(file, constant_pool);
+return new Annotations(file, constant_pool);
 } else {
 // All other attributes are skipped
 Utility.skipFully(file, length);



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



svn commit: r1625551 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:24:28 2014
New Revision: 1625551

URL: http://svn.apache.org/r1625551
Log:
Get rid of ArrayList arithmetics in JavaClass.getAnnotationEntries()
Note that this changes return value of getAnnotationEntries() to be null 
instead of zero-length array by default.

This is based on the following:
- All annotation entries come from a RuntimeVisibleAnnotations attribute on a 
class file
- According to JVM specification, ch.4.7.16
Each ClassFile, field_info, and method_info structure may contain at most one 
RuntimeVisibleAnnotations attribute

Thus there is no need to create an array of attributes and enumerate all those, 
as there is either zero or one such attribute.
Port of r1624614 from trunk

Removed:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1625551r1=1625550r2=1625551view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
Wed Sep 17 12:24:28 2014
@@ -2078,17 +2078,18 @@ public class ContextConfig implements Li
 String className = clazz.getClassName();
 
 AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries();
-
-for (AnnotationEntry ae : annotationsEntries) {
-String type = ae.getAnnotationType();
-if (Ljavax/servlet/annotation/WebServlet;.equals(type)) {
-processAnnotationWebServlet(className, ae, fragment);
-}else if (Ljavax/servlet/annotation/WebFilter;.equals(type)) {
-processAnnotationWebFilter(className, ae, fragment);
-}else if (Ljavax/servlet/annotation/WebListener;.equals(type)) {
-fragment.addListener(className);
-} else {
-// Unknown annotation - ignore
+if (annotationsEntries != null) {
+for (AnnotationEntry ae : annotationsEntries) {
+String type = ae.getAnnotationType();
+if (Ljavax/servlet/annotation/WebServlet;.equals(type)) {
+processAnnotationWebServlet(className, ae, fragment);
+}else if (Ljavax/servlet/annotation/WebFilter;.equals(type)) 
{
+processAnnotationWebFilter(className, ae, fragment);
+}else if 
(Ljavax/servlet/annotation/WebListener;.equals(type)) {
+fragment.addListener(className);
+} else {
+// Unknown annotation - ignore
+}
 }
 }
 }
@@ -2151,24 +2152,25 @@ public class ContextConfig implements Li
 for (Map.EntryClass?, SetServletContainerInitializer entry :
 typeInitializerMap.entrySet()) {
 if (entry.getKey().isAnnotation()) {
-AnnotationEntry[] annotationEntries =
-javaClass.getAnnotationEntries();
-for (AnnotationEntry annotationEntry : annotationEntries) {
-if (entry.getKey().getName().equals(
-
getClassName(annotationEntry.getAnnotationType( {
-if (clazz == null) {
-clazz = Introspection.loadClass(
-context, className);
+AnnotationEntry[] annotationEntries = 
javaClass.getAnnotationEntries();
+if (annotationEntries != null) {
+for (AnnotationEntry annotationEntry : 
annotationEntries) {
+if (entry.getKey().getName().equals(
+
getClassName(annotationEntry.getAnnotationType( {
 if (clazz == null) {
-// Can't load the class so no point
-// continuing
-return;
+clazz = Introspection.loadClass(
+context, className);
+  

svn commit: r1625552 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ClassParser.java java/org/apache/tomcat/util/bcel/classfile/JavaClass.j

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:25:43 2014
New Revision: 1625552

URL: http://svn.apache.org/r1625552
Log:
Do not create an empty arrays when Class has no interfaces.
Skip creation of int[] indexes array and share the same empty String[] names 
array.
Port of r1624636 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624636

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625552r1=1625551r2=1625552view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 Wed Sep 17 12:25:43 2014
@@ -209,9 +209,11 @@ public final class ClassParser {
 private void readInterfaces() throws IOException, ClassFormatException {
 int interfaces_count;
 interfaces_count = file.readUnsignedShort();
-interfaces = new int[interfaces_count];
-for (int i = 0; i  interfaces_count; i++) {
-interfaces[i] = file.readUnsignedShort();
+if (interfaces_count  0) {
+interfaces = new int[interfaces_count];
+for (int i = 0; i  interfaces_count; i++) {
+interfaces[i] = file.readUnsignedShort();
+}
 }
 }
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=1625552r1=1625551r2=1625552view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
Wed Sep 17 12:25:43 2014
@@ -36,6 +36,7 @@ public class JavaClass extends AccessFla
 private String[] interface_names;
 private Annotations runtimeVisibleAnnotations; // 
RuntimeVisibleAnnotations attribute defined in the class
 
+private static final String[] INTERFACES_EMPTY_ARRAY = new String[0];
 
 /**
  * Constructor gets all contents as arguments.
@@ -52,9 +53,6 @@ public class JavaClass extends AccessFla
 JavaClass(int class_name_index, int superclass_name_index,
 int access_flags, ConstantPool constant_pool, int[] interfaces,
 Annotations runtimeVisibleAnnotations) {
-if (interfaces == null) {
-interfaces = new int[0];
-}
 this.access_flags = access_flags;
 this.runtimeVisibleAnnotations = runtimeVisibleAnnotations;
 
@@ -72,10 +70,15 @@ public class JavaClass extends AccessFla
 } else {
 superclass_name = java.lang.Object;
 }
-interface_names = new String[interfaces.length];
-for (int i = 0; i  interfaces.length; i++) {
-String str = constant_pool.getConstantString(interfaces[i], 
Constants.CONSTANT_Class);
-interface_names[i] = Utility.compactClassName(str);
+
+if (interfaces == null) {
+interface_names = INTERFACES_EMPTY_ARRAY;
+} else {
+interface_names = new String[interfaces.length];
+for (int i = 0; i  interfaces.length; i++) {
+String str = constant_pool.getConstantString(interfaces[i], 
Constants.CONSTANT_Class);
+interface_names[i] = Utility.compactClassName(str);
+}
 }
 }
 



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



svn commit: r1625553 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:26:53 2014
New Revision: 1625553

URL: http://svn.apache.org/r1625553
Log:
Move int - String mapping for class and interface names from JavaClass to 
ClassParser.
This avoids an intermediary int[] array.
Move commons classname lookup and compact code into a helper method.
Port of r1624642 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624642

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625553r1=1625552r2=1625553view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 Wed Sep 17 12:26:53 2014
@@ -44,13 +44,14 @@ public final class ClassParser {
 
 private final DataInputStream file;
 private final String file_name;
-private int class_name_index, superclass_name_index;
+private String class_name, superclass_name;
 private int access_flags; // Access rights of parsed class
-private int[] interfaces; // Names of implemented interfaces
+private String[] interface_names; // Names of implemented interfaces
 private ConstantPool constant_pool; // collection of constants
 private Annotations runtimeVisibleAnnotations; // 
RuntimeVisibleAnnotations attribute defined in the class
 private static final int BUFSIZE = 8192;
 
+private static final String[] INTERFACES_EMPTY_ARRAY = new String[0];
 
 /**
  * Parse class from the given stream.
@@ -101,8 +102,8 @@ public final class ClassParser {
 readAttributes();
 
 // Return the information we have gathered in a new object
-return new JavaClass(class_name_index, superclass_name_index,
-access_flags, constant_pool, interfaces,
+return new JavaClass(class_name, superclass_name,
+access_flags, constant_pool, interface_names,
 runtimeVisibleAnnotations);
 }
 
@@ -159,8 +160,17 @@ public final class ClassParser {
  ((access_flags  Constants.ACC_FINAL) != 0)) {
 throw new ClassFormatException(Class  + file_name +  can't be 
both final and abstract);
 }
-class_name_index = file.readUnsignedShort();
-superclass_name_index = file.readUnsignedShort();
+
+int class_name_index = file.readUnsignedShort();
+class_name = Utility.getClassName(constant_pool, class_name_index);
+
+int superclass_name_index = file.readUnsignedShort();
+if (superclass_name_index  0) {
+// May be zero - class is java.lang.Object
+superclass_name = Utility.getClassName(constant_pool, 
superclass_name_index);
+} else {
+superclass_name = java.lang.Object;
+}
 }
 
 
@@ -210,10 +220,13 @@ public final class ClassParser {
 int interfaces_count;
 interfaces_count = file.readUnsignedShort();
 if (interfaces_count  0) {
-interfaces = new int[interfaces_count];
+interface_names = new String[interfaces_count];
 for (int i = 0; i  interfaces_count; i++) {
-interfaces[i] = file.readUnsignedShort();
+int index = file.readUnsignedShort();
+interface_names[i] = Utility.getClassName(constant_pool, 
index);
 }
+} else {
+interface_names = INTERFACES_EMPTY_ARRAY;
 }
 }
 

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=1625553r1=1625552r2=1625553view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
Wed Sep 17 12:26:53 2014
@@ -17,8 +17,6 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import org.apache.tomcat.util.bcel.Constants;

[Bug 56988] New: Allow to use relative paths in base.path setting when building Tomcat, e.g. base.path=../libraries

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56988

Bug ID: 56988
   Summary: Allow to use relative paths in base.path setting when
building Tomcat, e.g. base.path=../libraries
   Product: Tomcat 7
   Version: 7.0.55
  Hardware: PC
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Packaging
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com

Someone has configured ASF Buildbot for Tomcat with
'echo base.path=../basepath  build.properties'

It resulted in failure at step extras-commons-logging,
http://ci.apache.org/builders/tomcat-7-trunk/builds/296

Some log file snippets:

[[[
testexist:
 [echo] Testing  for
../basepath/avalon-framework-4.1.5/avalon-framework-4.1.5.jar

downloadfile:

]]]

[[[
extras-commons-logging:
   [gunzip] Expanding
/home/buildslave32/slave32/tomcat-7-trunk/basepath/commons-logging-1.1.3/commons-logging-1.1.3-src.tar.gz
to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-src.tar
[untar] Expanding:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-src.tar
into /home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging
[mkdir] Created dir:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/src/main/java/org/apache/juli
 [move] Moving 16 files to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/src/main/java/org/apache/juli
 [copy] Copying 1 file to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src
 [copy] Copying 4 files to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src

init:
 [echo]  Logging Wrapper Library 1.1.3 

prepare:
 [echo] 
 [echo] Log4j12: log4j-1.2.17.jar
 [echo] 
 [echo] 
 [echo] LogKit: ../basepath/logkit-1.0.1/logkit-1.0.1.jar
 [echo] Avalon-Framework:
../basepath/avalon-framework-4.1.5/avalon-framework-4.1.5.jar
 [echo] 
[mkdir] Created dir:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target
[mkdir] Created dir:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target/classes
[mkdir] Created dir:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target/conf
[mkdir] Created dir:
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target/tests

static:
 [copy] Copying 1 file to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target/conf

discovery:

log4j12-warning:

log4j13-warning:

logkit-warning:
 [echo] 
 [echo] *** WARNING ***
 [echo] LogKit not found: Cannot Build LogKitLogger
 [echo] 

jdk1.4-warning:

avalon-framework-warning:
 [echo] 
 [echo] *** WARNING ***
 [echo] Avalon-Framework not found: Cannot Build AvalonLogger
 [echo] 

compile-non-log4j:
[javac]
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/build2.xml:362:
warning: 'includeantruntime' was not set, defaulting to
build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 11 source files to
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/target/classes
[javac]
/home/buildslave32/slave32/tomcat-7-trunk/build/output/extras/logging/commons-logging-1.1.3-src/src/main/java/org/apache/juli/logging/impl/ServletContextCleaner.java:23:
package javax.servlet does not exist
[javac] import javax.servlet.ServletContextEvent;
[javac] ^
]]]

So,
1. avalon-framework-4.1.5.jar was present and has not been downloaded
2. commons-logging build script failed to detect it,
with Avalon-Framework not found: Cannot Build AvalonLogger

Compilation is performed by 

ant
antfile=${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build2.xml

dir=${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src
 target=compile /

So dir is a different directory.


Fix

I was able to fix this issue by adding inheritAll=false to the above ant
command.

-- 
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: r1625554 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java java/org/apache/tomcat/util/bcel/classfile/Utility.ja

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:27:52 2014
New Revision: 1625554

URL: http://svn.apache.org/r1625554
Log:
Inline ConstantPool.getConstantString() method.
Port of r1624645 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624645

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java?rev=1625554r1=1625553r2=1625554view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
 Wed Sep 17 12:27:52 2014
@@ -108,31 +108,4 @@ public class ConstantPool {
 }
 return c;
 }
-
-
-/**
- * Get string from constant pool and bypass the indirection of 
- * `ConstantClass' and `ConstantString' objects. I.e. these classes have
- * an index field that points to another entry of the constant pool of
- * type `ConstantUtf8' which contains the real data.
- *
- * @param  index Index in constant pool
- * @param  tag Tag of expected constant, either ConstantClass or 
ConstantString
- * @return Contents of string reference
- * @seeConstantClass
- * @throws  ClassFormatException
- */
-public String getConstantString( int index, byte tag ) throws 
ClassFormatException {
-Constant c = getConstant(index, tag);
-
-if (Constants.CONSTANT_Class != tag) {
-throw new RuntimeException(getConstantString called with illegal 
tag  + tag);
-}
-
-int i = ((ConstantClass) c).getNameIndex();
-
-// Finally get the string from the constant pool
-c = getConstant(i, Constants.CONSTANT_Utf8);
-return ((ConstantUtf8) c).getBytes();
-}
 }

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1625554r1=1625553r2=1625554view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java 
Wed Sep 17 12:27:52 2014
@@ -48,7 +48,13 @@ final class Utility {
 }
 
 static String getClassName(ConstantPool constant_pool, int index) {
-String name = constant_pool.getConstantString(index, 
Constants.CONSTANT_Class);
+Constant c = constant_pool.getConstant(index, 
Constants.CONSTANT_Class);
+int i = ((ConstantClass) c).getNameIndex();
+
+// Finally get the string from the constant pool
+c = constant_pool.getConstant(i, Constants.CONSTANT_Utf8);
+String name = ((ConstantUtf8) c).getBytes();
+
 return compactClassName(name);
 }
 



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



svn commit: r1625555 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ContextConfig.java java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ClassParser.java te

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:30:32 2014
New Revision: 162

URL: http://svn.apache.org/r162
Log:
Remove class_name argument from constructor, as Tomcat does not provide the 
name.
Port of r1624647 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=162r1=1625554r2=162view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
Wed Sep 17 12:30:32 2014
@@ -2067,7 +2067,7 @@ public class ContextConfig implements Li
 boolean handlesTypesOnly)
 throws ClassFormatException, IOException {
 
-ClassParser parser = new ClassParser(is, null);
+ClassParser parser = new ClassParser(is);
 JavaClass clazz = parser.parse();
 checkHandlesTypes(clazz);
 
@@ -2226,7 +2226,7 @@ public class ContextConfig implements Li
 if (is == null) {
 return;
 }
-ClassParser parser = new ClassParser(is, null);
+ClassParser parser = new ClassParser(is);
 try {
 JavaClass clazz = parser.parse();
 populateJavaClassCache(clazz.getClassName(), clazz);

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624647

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=162r1=1625554r2=162view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 Wed Sep 17 12:30:32 2014
@@ -43,7 +43,6 @@ public final class ClassParser {
 private static final int MAGIC = 0xCAFEBABE;
 
 private final DataInputStream file;
-private final String file_name;
 private String class_name, superclass_name;
 private int access_flags; // Access rights of parsed class
 private String[] interface_names; // Names of implemented interfaces
@@ -57,10 +56,8 @@ public final class ClassParser {
  * Parse class from the given stream.
  *
  * @param file Input stream
- * @param file_name File name
  */
-public ClassParser(InputStream file, String file_name) {
-this.file_name = file_name;
+public ClassParser(InputStream file) {
 if (file instanceof DataInputStream) {
 this.file = (DataInputStream) file;
 } else {
@@ -158,7 +155,7 @@ public final class ClassParser {
 }
 if (((access_flags  Constants.ACC_ABSTRACT) != 0)
  ((access_flags  Constants.ACC_FINAL) != 0)) {
-throw new ClassFormatException(Class  + file_name +  can't be 
both final and abstract);
+throw new ClassFormatException(Class can't be both final and 
abstract);
 }
 
 int class_name_index = file.readUnsignedShort();
@@ -206,7 +203,7 @@ public final class ClassParser {
  */
 private void readID() throws IOException, ClassFormatException {
 if (file.readInt() != MAGIC) {
-throw new ClassFormatException(file_name +  is not a Java .class 
file);
+throw new ClassFormatException(It is not a Java .class file);
 }
 }
 

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java?rev=162r1=1625554r2=162view=diff
==
--- 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java 
Wed Sep 17 12:30:32 2014
@@ -58,7 +58,7 @@ public class TesterPerformance {
 if (jarEntryName.endsWith(.class)) {
 

svn commit: r1625556 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:34:03 2014
New Revision: 1625556

URL: http://svn.apache.org/r1625556
Log:
Remove branch that is not used by Tomcat. Thanks to Cobertura coverage report.
Port of r1624648 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624648

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625556r1=162r2=1625556view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 Wed Sep 17 12:34:03 2014
@@ -58,11 +58,7 @@ public final class ClassParser {
  * @param file Input stream
  */
 public ClassParser(InputStream file) {
-if (file instanceof DataInputStream) {
-this.file = (DataInputStream) file;
-} else {
-this.file = new DataInputStream(new BufferedInputStream(file, 
BUFSIZE));
-}
+this.file = new DataInputStream(new BufferedInputStream(file, 
BUFSIZE));
 }
 
 



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



svn commit: r1625557 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java java/org/apache/tomcat/util/bcel/classfile/JavaClass.j

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:35:00 2014
New Revision: 1625557

URL: http://svn.apache.org/r1625557
Log:
Merge AccessFlags and JavaClass as the other sub-classes of
AccessFlags have been removed.
Port of r1624959 from trunk

Removed:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AccessFlags.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1624959

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java?rev=1625557r1=1625556r2=1625557view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
Wed Sep 17 12:35:00 2014
@@ -27,12 +27,13 @@ package org.apache.tomcat.util.bcel.clas
 
  * @author  A HREF=mailto:m.d...@gmx.de;M. Dahm/A
  */
-public class JavaClass extends AccessFlags {
+public class JavaClass {
 
-private String class_name;
-private String superclass_name;
-private String[] interface_names;
-private Annotations runtimeVisibleAnnotations; // 
RuntimeVisibleAnnotations attribute defined in the class
+private final int access_flags;
+private final String class_name;
+private final String superclass_name;
+private final String[] interface_names;
+private final Annotations runtimeVisibleAnnotations; // 
RuntimeVisibleAnnotations attribute defined in the class
 
 /**
  * Constructor gets all contents as arguments.
@@ -55,6 +56,13 @@ public class JavaClass extends AccessFla
 }
 
 /**
+ * @return Access flags of the object aka. modifiers.
+ */
+public final int getAccessFlags() {
+return access_flags;
+}
+
+/**
  * Return annotations entries from RuntimeVisibleAnnotations attribute on
  * the class, if there is any.
  *



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



svn commit: r1625558 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:42:29 2014
New Revision: 1625558

URL: http://svn.apache.org/r1625558
Log:
Use the DataInput interface rather than an implementation.
Port of r1625501 from trunk

Also Align 7.0.x with trunk after comparing the two

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantUtf8.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValue.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ElementValuePair.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1625501

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java?rev=1625558r1=1625557r2=1625558view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/AnnotationEntry.java
 Wed Sep 17 12:42:29 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.DataInputStream;
+import java.io.DataInput;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -35,32 +35,26 @@ public class AnnotationEntry implements 
 private final int type_index;
 private final ConstantPool constant_pool;
 
-// FIXME: add 'final'
-private ListElementValuePair element_value_pairs;
+private final ListElementValuePair element_value_pairs;
 
 /**
- * Factory method to create an AnnotionEntry from a DataInputStream
+ * Creates an AnnotationEntry from a DataInputStream
  * 
  * @param file
  * @param constant_pool
- * @return the entry
  * @throws IOException
  */
-public static AnnotationEntry read(DataInputStream file, ConstantPool 
constant_pool) throws IOException {
-
-final AnnotationEntry annotationEntry = new 
AnnotationEntry(file.readUnsignedShort(), constant_pool);
-final int num_element_value_pairs = (file.readUnsignedShort());
-annotationEntry.element_value_pairs = new 
ArrayListElementValuePair();
-for (int i = 0; i  num_element_value_pairs; i++) {
-annotationEntry.element_value_pairs.add(new 
ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, 
constant_pool),
-constant_pool));
-}
-return annotationEntry;
-}
+AnnotationEntry(DataInput file, ConstantPool constant_pool) throws 
IOException {
 
-AnnotationEntry(int type_index, ConstantPool constant_pool) {
-this.type_index = type_index;
 this.constant_pool = constant_pool;
+
+type_index = file.readUnsignedShort();
+int num_element_value_pairs = file.readUnsignedShort();
+
+element_value_pairs = new 
ArrayListElementValuePair(num_element_value_pairs);
+for (int i = 0; i  num_element_value_pairs; i++) {
+element_value_pairs.add(new ElementValuePair(file, constant_pool));
+}
 }
 
 /**

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java?rev=1625558r1=1625557r2=1625558view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Annotations.java
 Wed Sep 17 12:42:29 2014
@@ -17,7 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.DataInputStream;
+import java.io.DataInput;
 import java.io.IOException;
 
 /**
@@ -34,12 +34,12 @@ public class Annotations {
  * @param file Input stream
  * @param constant_pool Array of constants
  */
-Annotations(DataInputStream file, ConstantPool constant_pool)
+

svn commit: r1625559 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/ClassParser.java java/org/apache/tomcat/util/bcel/classfile/FastDataInp

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:43:09 2014
New Revision: 1625559

URL: http://svn.apache.org/r1625559
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56953
Further performance improvements to BCEL parser.
Based on a patch by hzhang9
POrt of r1625504 from trunk

Added:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
  - copied unchanged from r1625504, 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1625504

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1625559r1=1625558r2=1625559view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
 Wed Sep 17 12:43:09 2014
@@ -17,9 +17,7 @@
  */
 package org.apache.tomcat.util.bcel.classfile;
 
-import java.io.BufferedInputStream;
 import java.io.DataInput;
-import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -59,7 +57,7 @@ public final class ClassParser {
  * @param file Input stream
  */
 public ClassParser(InputStream file) {
-this.file = new DataInputStream(new BufferedInputStream(file, 
BUFSIZE));
+this.file = new FastDataInputStream(file, BUFSIZE);
 }
 
 



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



svn commit: r1625562 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/PerMessageDeflate.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 12:44:09 2014
New Revision: 1625562

URL: http://svn.apache.org/r1625562
Log:
Merged revision 1619742 from tomcat/trunk:
WebSocket permessage-deflate. Implement no_context_takeover parameters.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1625562r1=1625561r2=1625562view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
Wed Sep 17 12:44:09 2014
@@ -55,7 +55,6 @@ public class PerMessageDeflate implement
 private volatile Transformation next;
 private volatile boolean skipDecompression = false;
 private volatile ByteBuffer writeBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
-private volatile boolean deflaterResetRequired = true;
 private volatile boolean firstCompressedFrameWritten = false;
 private volatile byte[] EOM_BUFFER = new byte[EOM_BYTES.length + 1];
 
@@ -212,6 +211,9 @@ public class PerMessageDeflate implement
 }
 }
 } else if (written == 0) {
+if (fin  !serverContextTakeover) {
+inflater.reset();
+}
 return TransformationResult.END_OF_FRAME;
 }
 }
@@ -310,13 +312,6 @@ public class PerMessageDeflate implement
 SendHandler uncompressedIntermediateHandler =
 uncompressedPart.getIntermediateHandler();
 
-// Need to reset the deflater at the start of every message
-if (deflaterResetRequired) {
-deflater.reset();
-deflaterResetRequired = false;
-firstCompressedFrameWritten = false;
-}
-
 deflater.setInput(uncompressedPayload.array(),
 uncompressedPayload.arrayOffset() + 
uncompressedPayload.position(),
 uncompressedPayload.remaining());
@@ -359,8 +354,8 @@ public class PerMessageDeflate implement
 compressedPart = new MessagePart(true, 
getRsv(uncompressedPart),
 opCode, compressedPayload, 
uncompressedIntermediateHandler,
 uncompressedIntermediateHandler);
-deflaterResetRequired = true;
 deflateRequired = false;
+startNewMessage();
 } else if (full  !needsInput) {
 // Write buffer full and input message not fully read.
 // Output and start new compressed part.
@@ -389,8 +384,8 @@ public class PerMessageDeflate implement
 compressedPart = new MessagePart(true,
 getRsv(uncompressedPart), opCode, 
compressedPayload,
 uncompressedIntermediateHandler, 
uncompressedIntermediateHandler);
-deflaterResetRequired = true;
 deflateRequired = false;
+startNewMessage();
 } else {
 // More data to write
 // Copy bytes to new write buffer
@@ -426,6 +421,13 @@ public class PerMessageDeflate implement
 }
 
 
+private void startNewMessage() {
+firstCompressedFrameWritten = false;
+if (!clientContextTakeover) {
+deflater.reset();
+}
+}
+
 private int getRsv(MessagePart uncompressedMessagePart) {
 int result = uncompressedMessagePart.getRsv();
 if (!firstCompressedFrameWritten) {



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



[Bug 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

--- Comment #16 from Mark Thomas ma...@apache.org ---
Patch has been applied to 7.0.x for 7.0.56 onwards.

-- 
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: r1625563 - /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 12:59:55 2014
New Revision: 1625563

URL: http://svn.apache.org/r1625563
Log:
Review comments from kkolinko

Modified:

tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java?rev=1625563r1=1625562r2=1625563view=diff
==
--- 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 (original)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 Wed Sep 17 12:59:55 2014
@@ -109,7 +109,7 @@ class FastDataInputStream extends Buffer
 }
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (short)((ch1  8) + (ch2  0));
+return (short)((ch1  8) + ch2);
 }
 
 
@@ -122,7 +122,7 @@ class FastDataInputStream extends Buffer
 
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (ch1  8) + (ch2  0);
+return (ch1  8) + ch2;
 }
 
 
@@ -134,7 +134,7 @@ class FastDataInputStream extends Buffer
 }
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (char)((ch1  8) + (ch2  0));
+return (char)((ch1  8) + ch2);
 }
 
 
@@ -148,7 +148,7 @@ class FastDataInputStream extends Buffer
 int ch2 = this.buf[pos++]  0xff;
 int ch3 = this.buf[pos++]  0xff;
 int ch4 = this.buf[pos++]  0xff;
-return ((ch1  24) + (ch2  16) + (ch3  8) + (ch4  0));
+return ((ch1  24) + (ch2  16) + (ch3  8) + ch4);
 }
 
 
@@ -162,7 +162,7 @@ class FastDataInputStream extends Buffer
 ((long)(readBuffer[4]  255)  24) +
 ((readBuffer[5]  255)  16) +
 ((readBuffer[6]  255)   8) +
-((readBuffer[7]  255)   0));
+(readBuffer[7]  255));
 }
 
 
@@ -208,7 +208,6 @@ class FastDataInputStream extends Buffer
 while (sum  n  (cur = (int) in.skip(n - sum))  0) {
 sum += cur;
 }
-fillNew();
 return sum;
 }
 // Data in the buffer is not enough
@@ -220,7 +219,6 @@ class FastDataInputStream extends Buffer
 while (sum  n  (cur = (int) in.skip(n - sum))  0) {
 sum += cur;
 }
-fillNew();
 return sum;
 }
 pos += n;
@@ -231,6 +229,6 @@ class FastDataInputStream extends Buffer
 @Override
 public String readLine() throws IOException {
 // Unimplemented
-throw new IOException();
+throw new UnsupportedOperationException();
 }
 }
\ No newline at end of file



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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #11 from Pierre Viret pierre.vi...@gmail.com ---
Sorry about the circular dependency I forgot to mention that tomcat-coyote
needs tomcat-util to compile, so tomcat-util may not depend on the
tomcat-coyote.

-- 
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: r1625564 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 13:00:41 2014
New Revision: 1625564

URL: http://svn.apache.org/r1625564
Log:
Review comments from kkolinko
Port of 1625563 from trunk

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java

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

Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
--
  Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1625563

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java?rev=1625564r1=1625563r2=1625564view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/FastDataInputStream.java
 Wed Sep 17 13:00:41 2014
@@ -109,7 +109,7 @@ class FastDataInputStream extends Buffer
 }
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (short)((ch1  8) + (ch2  0));
+return (short)((ch1  8) + ch2);
 }
 
 
@@ -122,7 +122,7 @@ class FastDataInputStream extends Buffer
 
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (ch1  8) + (ch2  0);
+return (ch1  8) + ch2;
 }
 
 
@@ -134,7 +134,7 @@ class FastDataInputStream extends Buffer
 }
 int ch1 = this.buf[pos++]  0xff;
 int ch2 = this.buf[pos++]  0xff;
-return (char)((ch1  8) + (ch2  0));
+return (char)((ch1  8) + ch2);
 }
 
 
@@ -148,7 +148,7 @@ class FastDataInputStream extends Buffer
 int ch2 = this.buf[pos++]  0xff;
 int ch3 = this.buf[pos++]  0xff;
 int ch4 = this.buf[pos++]  0xff;
-return ((ch1  24) + (ch2  16) + (ch3  8) + (ch4  0));
+return ((ch1  24) + (ch2  16) + (ch3  8) + ch4);
 }
 
 
@@ -162,7 +162,7 @@ class FastDataInputStream extends Buffer
 ((long)(readBuffer[4]  255)  24) +
 ((readBuffer[5]  255)  16) +
 ((readBuffer[6]  255)   8) +
-((readBuffer[7]  255)   0));
+(readBuffer[7]  255));
 }
 
 
@@ -208,7 +208,6 @@ class FastDataInputStream extends Buffer
 while (sum  n  (cur = (int) in.skip(n - sum))  0) {
 sum += cur;
 }
-fillNew();
 return sum;
 }
 // Data in the buffer is not enough
@@ -220,7 +219,6 @@ class FastDataInputStream extends Buffer
 while (sum  n  (cur = (int) in.skip(n - sum))  0) {
 sum += cur;
 }
-fillNew();
 return sum;
 }
 pos += n;
@@ -231,6 +229,6 @@ class FastDataInputStream extends Buffer
 @Override
 public String readLine() throws IOException {
 // Unimplemented
-throw new IOException();
+throw new UnsupportedOperationException();
 }
 }
\ No newline at end of file



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



[Bug 56955] Skip some useless information in the class when parsing

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56955
Bug 56955 depends on bug 56953, which changed state.

Bug 56953 Summary: A improvement for DataInputStream
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

   What|Removed |Added

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

-- 
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 56953] A improvement for DataInputStream

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56953

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

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

--- Comment #17 from Mark Thomas ma...@apache.org ---
Review comments applied.

-- 
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 56923] Symlinks under WEB-INF/lib trigger a NullPointerException in StandardJarScanner

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56923

Emmanuel Bourg ebo...@apache.org changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
Version|8.0.9   |8.0.12
 Resolution|INVALID |---
Summary|NullPointerException when   |Symlinks under WEB-INF/lib
   |starting tomcat8-examples   |trigger a
   |in Tomcat Web Application   |NullPointerException in
   |Manager |StandardJarScanner

--- Comment #2 from Emmanuel Bourg ebo...@apache.org ---
It looks like this issue is caused by the symlinks to /usr/share/java/jstl.jar
and /usr/share/java/standard.jar installed in the WEB-INF/lib directory of the
examples application. Replacing the links with the actual files no longer
triggers the error.

This error doesn't appear with the tomcat7-examples package which also uses
symlinks (Tomcat 7.0.55).

-- 
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: r1625578 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/PerMessageDeflate.java java/org/apache/tomcat/websocket/server/WsServerContainer.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 13:22:42 2014
New Revision: 1625578

URL: http://svn.apache.org/r1625578
Log:
Merged revisions 1621698, 1622259 from tomcat/trunk:
- Correct typo in a comment
- No need for volatile. Can be final. Reported by FindBugs.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1621698,1622259

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1625578r1=1625577r2=1625578view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java 
Wed Sep 17 13:22:42 2014
@@ -51,12 +51,12 @@ public class PerMessageDeflate implement
 private final Inflater inflater = new Inflater(true);
 private final ByteBuffer readBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
 private final Deflater deflater = new 
Deflater(Deflater.DEFAULT_COMPRESSION, true);
+private final byte[] EOM_BUFFER = new byte[EOM_BYTES.length + 1];
 
 private volatile Transformation next;
 private volatile boolean skipDecompression = false;
 private volatile ByteBuffer writeBuffer = 
ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE);
 private volatile boolean firstCompressedFrameWritten = false;
-private volatile byte[] EOM_BUFFER = new byte[EOM_BYTES.length + 1];
 
 static PerMessageDeflate negotiate(ListListParameter preferences) {
 // Accept the first preference that the server is able to support

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1625578r1=1625577r2=1625578view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
 Wed Sep 17 13:22:42 2014
@@ -140,7 +140,7 @@ public class WsServerContainer extends W
 
 fr.addMappingForUrlPatterns(types, true, /*);
 
-// Use a per web application executor for any threads the the WebSocket
+// Use a per web application executor for any threads that the 
WebSocket
 // server code needs to create. Group all of the threads under a single
 // ThreadGroup.
 StringBuffer threadGroupName = new StringBuffer(WebSocketServer-);



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



[Bug 56923] Symlinks under WEB-INF/lib trigger a NullPointerException in StandardJarScanner

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56923

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Mark Thomas ma...@apache.org ---
Then that is a packaging issue for Debian to solve. A default Tomcat install
from the ASF doesn't use symlinks. It looks like the Debian folks have failed
to read the migration guide, particularly the section on Web application
resources.

-- 
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: r1625580 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/ java/org/apache/tomcat/websocket/pojo/ java/org/apache/tomcat/websocket/server/ test/org/apache/tomcat/websocket/

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 13:27:37 2014
New Revision: 1625580

URL: http://svn.apache.org/r1625580
Log:
Merged revision 1623236 from tomcat/trunk:
Fix some checkstyle GenericWhitespace issues.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointClient.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialBinary.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialText.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/TestUtil.java

tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1625580r1=1625579r2=1625580view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
Wed Sep 17 13:27:37 2014
@@ -349,7 +349,7 @@ public class WsWebSocketContainer
 
 WsSession wsSession = new WsSession(endpoint, wsRemoteEndpointClient,
 this, null, null, null, null, null, subProtocol,
-Collections.String, String emptyMap(), secure,
+Collections.String,StringemptyMap(), secure,
 clientEndpointConfiguration);
 
 WsFrameClient wsFrameClient = new WsFrameClient(response, channel,

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointClient.java?rev=1625580r1=1625579r2=1625580view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointClient.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointClient.java
 Wed Sep 17 13:27:37 2014
@@ -36,7 +36,7 @@ public class PojoEndpointClient extends 
 setPojo(pojo);
 setMethodMapping(
 new PojoMethodMapping(pojo.getClass(), decoders, null));
-setPathParameters(Collections.String, String emptyMap());
+setPathParameters(Collections.String,StringemptyMap());
 }
 
 @Override

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialBinary.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialBinary.java?rev=1625580r1=1625579r2=1625580view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialBinary.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialBinary.java
 Wed Sep 17 13:27:37 2014
@@ -25,7 +25,7 @@ import javax.websocket.Session;
  * ByteBuffer specific concrete implementation for handling partial messages.
  */
 public class PojoMessageHandlerPartialBinary
-extends PojoMessageHandlerPartialBaseByteBuffer{
+extends PojoMessageHandlerPartialBaseByteBuffer {
 
 public PojoMessageHandlerPartialBinary(Object pojo, Method method,
 Session session, Object[] params, int indexPayload, boolean 
convert,

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialText.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialText.java?rev=1625580r1=1625579r2=1625580view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialText.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerPartialText.java
 Wed Sep 17 13:27:37 2014
@@ -24,7 +24,7 @@ import javax.websocket.Session;
  * Text specific concrete implementation for handling partial messages.
  */
 public class PojoMessageHandlerPartialText
-extends PojoMessageHandlerPartialBaseString{
+extends PojoMessageHandlerPartialBaseString {
 
 public PojoMessageHandlerPartialText(Object pojo, Method method,
 Session session, Object[] params, int indexPayload, boolean 
convert,

Modified: 

svn commit: r1625595 - in /tomcat/sandbox/trunk-maven-layout: ./ catalina/ tomcat-annotations-api/ tomcat-api/ tomcat-catalina-ant/ tomcat-catalina-ha/ tomcat-catalina-jmx-remote/ tomcat-catalina-ws/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:00:48 2014
New Revision: 1625595

URL: http://svn.apache.org/r1625595
Log:
Start to look at https://issues.apache.org/bugzilla/show_bug.cgi?id=56397
Use the provided directory structure and POMs.
No svn externals to pull in source have been added at this point.

Added:
tomcat/sandbox/trunk-maven-layout/
tomcat/sandbox/trunk-maven-layout/catalina/
tomcat/sandbox/trunk-maven-layout/catalina/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-annotations-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-annotations-api/pom.xml   (with 
props)
tomcat/sandbox/trunk-maven-layout/tomcat-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ant/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ant/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ha/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ha/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-jmx-remote/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-jmx-remote/pom.xml   
(with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ws/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina-ws/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-catalina/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-coyote/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-coyote/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-dbcp/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-dbcp/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-el-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-el-api/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-extras-juli/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-extras-juli-adapters/   (with 
props)
tomcat/sandbox/trunk-maven-layout/tomcat-extras-juli-adapters/pom.xml   
(with props)
tomcat/sandbox/trunk-maven-layout/tomcat-extras-juli/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jasper/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jasper-el/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jasper-el/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jasper/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jdbc/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jdbc/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jni/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jni/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jsp-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-jsp-api/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-juli/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-mail-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-mail-api/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-spdy/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-spdy/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-tribes/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-tribes/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-util/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-util-scan/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-util-scan/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-websocket/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-websocket-api/   (with props)
tomcat/sandbox/trunk-maven-layout/tomcat-websocket-api/pom.xml   (with 
props)
tomcat/sandbox/trunk-maven-layout/tomcat-websocket/pom.xml   (with props)

Added: tomcat/sandbox/trunk-maven-layout/catalina/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/catalina/pom.xml?rev=1625595view=auto
==
--- tomcat/sandbox/trunk-maven-layout/catalina/pom.xml (added)
+++ tomcat/sandbox/trunk-maven-layout/catalina/pom.xml Wed Sep 17 14:00:48 2014
@@ -0,0 +1,98 @@
+project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
+ 

svn commit: r1625596 - in /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:06:12 2014
New Revision: 1625596

URL: http://svn.apache.org/r1625596
Log:
Start populating JULI as it should have no dependencies

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/   
(with props)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 14:06:12 2014
@@ -0,0 +1 @@
+../../../../../../../trunk/java/org/apache/juli juli



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



[Bug 56923] Symlinks under WEB-INF/lib trigger a NullPointerException in StandardJarScanner

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56923

--- Comment #4 from Emmanuel Bourg ebo...@apache.org ---
Adding Resources allowLinking=true/ to the context solved the issue, thank
you for the help Mark.

-- 
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: r1625606 - in /tomcat/tc7.0.x/trunk: ./ build.xml webapps/docs/changelog.xml

2014-09-17 Thread kkolinko
Author: kkolinko
Date: Wed Sep 17 14:17:04 2014
New Revision: 1625606

URL: http://svn.apache.org/r1625606
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56988
Allow to use relative paths in base.path setting when building Tomcat, e.g. 
base.path=../libraries
Use consistent naming for inheritAll property: Ant manual uses camelCase for 
that name.
It is port of r1625599 from tomcat/trunk.

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

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

Modified: tomcat/tc7.0.x/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/build.xml?rev=1625606r1=1625605r2=1625606view=diff
==
--- tomcat/tc7.0.x/trunk/build.xml (original)
+++ tomcat/tc7.0.x/trunk/build.xml Wed Sep 17 14:17:04 2014
@@ -1018,7 +1018,7 @@
 !-- build the jdbc-pool jar and source jar--
 echo message=Building Tomcat JDBC pool libraries/
 ant antfile=${tomcat.jdbc.dir}/build.xml dir=${tomcat.jdbc.dir}
- inheritall=false target=build
+ inheritAll=false target=build
   property name=tomcat.pool value=${tomcat.pool} /
   property name=tomcat.juli.jar value=${tomcat-juli.jar} /
   property name=skip.download value=set/
@@ -1058,7 +1058,7 @@
 !-- build the jdbc-pool source jar--
 echo message=Building Tomcat JDBC pool src JAR/
 ant antfile=${tomcat.jdbc.dir}/build.xml dir=${tomcat.jdbc.dir}
- inheritall=false target=build-src
+ inheritAll=false target=build-src
   property name=tomcat.pool value=${tomcat.pool} /
   property name=tomcat.juli.jar value=${tomcat-juli.jar} /
   property name=skip.download value=set/
@@ -1534,7 +1534,7 @@
 
 ant 
antfile=${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build2.xml
  
dir=${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src
- target=compile /
+ inheritAll=false target=compile /
 
 jar jarfile=${tomcat-juli-extras.jar}
  manifest=${tomcat.manifests}/default.manifest
@@ -2628,7 +2628,7 @@ Apache Tomcat ${version} native binaries
 delete dir=${tomcat.output} /
 !-- Remove the copied catalina.properties --
 delete file=java/org/apache/catalina/startup/catalina.properties /
-ant antfile=${tomcat.jdbc.dir}/build.xml dir=${tomcat.jdbc.dir} 
inheritall=false target=clean
+ant antfile=${tomcat.jdbc.dir}/build.xml dir=${tomcat.jdbc.dir} 
inheritAll=false target=clean
   property name=tomcat.pool value=${tomcat.pool} /
 /ant
 !-- remove jdbc-pool documentation --

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1625606r1=1625605r2=1625606view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep 17 14:17:04 2014
@@ -284,6 +284,10 @@
 codecatalina.bat/code so that escape sequences are preserved. Patch
 by Lucas Theisen. (markt)
   /fix
+  update
+bug56988/bug: Allow to use relative path in codebase.path/code
+setting when building Tomcat. (kkolinko)
+  /update
 /changelog
   /subsection
 /section



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



[Bug 56988] Allow to use relative paths in base.path setting when building Tomcat, e.g. base.path=../libraries

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56988

Konstantin Kolinko knst.koli...@gmail.com changed:

   What|Removed |Added

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

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
Fixed by r1625599 and r1625606. The fix will be in 8.0.12, 7.0.56 onwards.

-- 
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 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #12 from Mark Thomas ma...@apache.org ---
I am making progress. The structure is in svn, the sources for JULI are hooked
up via externals and the tomcat-juli-8.0.13-SNAPSHOT.jar that is created looks
reasonable (I haven't tested it).

If we want this to be a way folks familiar with Maven can work with the source,
that is one thing (and I think we have most of whet we need once the svn
externals are finished).

If we want users to be able to use this to build a working Tomcat distribution,
that is is more complex.

If we want to be able to use this to build a release that is more complex
again.

Working with the source:
1. How do you propose to update the version number after a release? Updating
every POM by hand is not viable.
2. The JARs need to contain the right LICENSE and NOTICE file. Even if they
aren't meant to be released, someone will distribute them somewhere, somehow.

Working instance:
3. How do we get to this point?

Distribution:
4. Can source JARs are be created?
5. Windows installer, signing etc.

For this to be useful I think it has to be possible to create a working Tomcat
instance. I'm far less concerned about being able to release.

-- 
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: r1625609 - /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:27:03 2014
New Revision: 1625609

URL: http://svn.apache.org/r1625609
Log:
Fix the external

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/   
(props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/
--
--- svn:externals (original)
+++ svn:externals Wed Sep 17 14:27:03 2014
@@ -1 +1 @@
-../../../../../../../trunk/java/org/apache/juli juli
+../../../../../../../../trunk/java/org/apache/juli juli



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



Re: svn commit: r1625596 - in /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/

2014-09-17 Thread Konstantin Kolinko
2014-09-17 18:06 GMT+04:00  ma...@apache.org:
 Author: markt
 Date: Wed Sep 17 14:06:12 2014
 New Revision: 1625596

 URL: http://svn.apache.org/r1625596
 Log:
 Start populating JULI as it should have no dependencies

 Added:
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/   
 (with props)

 Propchange: 
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/
 --
 --- svn:externals (added)
 +++ svn:externals Wed Sep 17 14:06:12 2014
 @@ -0,0 +1 @@
 +../../../../../../../trunk/java/org/apache/juli juli

Maybe use path relative to svn repository root? That will look like
the following:
^/tomcat/trunk/java/org/apache/juli juli

Just reminding that such syntax exists. If we are going to move this
project elsewhere we would have to exit the externals anyway.

Also POM files need a license header.


Best regards,
Konstantin Kolinko

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



svn commit: r1625612 - in /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test: ./ java/ java/org/ java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:33:08 2014
New Revision: 1625612

URL: http://svn.apache.org/r1625612
Log:
Link in JULI test resources

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/org/apache/   
(with props)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/org/apache/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 14:33:08 2014
@@ -0,0 +1 @@
+../../../../../../../../trunk/test/org/apache/juli juli



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



svn commit: r1625616 - in /tomcat/sandbox/trunk-maven-layout: pom.xml tomcat-juli/pom.xml

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:45:59 2014
New Revision: 1625616

URL: http://svn.apache.org/r1625616
Log:
Add junit dependency required to run unit tests

Modified:
tomcat/sandbox/trunk-maven-layout/pom.xml
tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml

Modified: tomcat/sandbox/trunk-maven-layout/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/pom.xml?rev=1625616r1=1625615r2=1625616view=diff
==
--- tomcat/sandbox/trunk-maven-layout/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/pom.xml Wed Sep 17 14:45:59 2014
@@ -169,6 +169,14 @@
 artifactIdtomcat-extras-juli/artifactId
 version${project.version}/version
 /dependency
+
+dependency
+groupIdjunit/groupId
+artifactIdjunit/artifactId
+version4.11/version
+scopetest/scope
+/dependency
+
 /dependencies
 /dependencyManagement
 

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml?rev=1625616r1=1625615r2=1625616view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-juli/pom.xml Wed Sep 17 14:45:59 
2014
@@ -29,6 +29,12 @@
 descriptionTomcat Core Logging Package/description
 urlhttp://tomcat.apache.org//url
 
-
+dependencies
+dependency
+groupIdjunit/groupId
+artifactIdjunit/artifactId
+scopetest/scope
+/dependency
+/dependencies
 
 /project



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



Re: svn commit: r1625596 - in /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/

2014-09-17 Thread Mark Thomas
On 17/09/2014 15:29, Konstantin Kolinko wrote:
 2014-09-17 18:06 GMT+04:00  ma...@apache.org:
 Author: markt
 Date: Wed Sep 17 14:06:12 2014
 New Revision: 1625596

 URL: http://svn.apache.org/r1625596
 Log:
 Start populating JULI as it should have no dependencies

 Added:
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/  
  (with props)

 Propchange: 
 tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/
 --
 --- svn:externals (added)
 +++ svn:externals Wed Sep 17 14:06:12 2014
 @@ -0,0 +1 @@
 +../../../../../../../trunk/java/org/apache/juli juli
 
 Maybe use path relative to svn repository root? That will look like
 the following:
 ^/tomcat/trunk/java/org/apache/juli juli
 
 Just reminding that such syntax exists. If we are going to move this
 project elsewhere we would have to exit the externals anyway.

That is cleaner and allows us to move tomcat-maven-layout around without
breaking the externals. I'll switch them.

 Also POM files need a license header.

Groan. I'll add those as I go along.

Mark


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



svn commit: r1625618 - /tomcat/sandbox/trunk-maven-layout/pom.xml

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:52:06 2014
New Revision: 1625618

URL: http://svn.apache.org/r1625618
Log:
Add AL2 header

Modified:
tomcat/sandbox/trunk-maven-layout/pom.xml

Modified: tomcat/sandbox/trunk-maven-layout/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/pom.xml?rev=1625618r1=1625617r2=1625618view=diff
==
--- tomcat/sandbox/trunk-maven-layout/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/pom.xml Wed Sep 17 14:52:06 2014
@@ -1,3 +1,20 @@
+?xml version=1.0 encoding=UTF-8?
+!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the License); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an AS IS BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--
 project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
 modelVersion4.0.0/modelVersion



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



svn commit: r1625619 - in /tomcat/sandbox/trunk-maven-layout/tomcat-juli/src: main/java/org/apache/ test/java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 14:53:32 2014
New Revision: 1625619

URL: http://svn.apache.org/r1625619
Log:
Switch to externals relative to repository root as suggested by kkolinko

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/   
(props changed)
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/org/apache/   
(props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/main/java/org/apache/
--
--- svn:externals (original)
+++ svn:externals Wed Sep 17 14:53:32 2014
@@ -1 +1 @@
-../../../../../../../../trunk/java/org/apache/juli juli
+^/tomcat/trunk/java/org/apache/juli juli

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-juli/src/test/java/org/apache/
--
--- svn:externals (original)
+++ svn:externals Wed Sep 17 14:53:32 2014
@@ -1 +1 @@
-../../../../../../../../trunk/test/org/apache/juli juli
+^/tomcat/trunk/test/org/apache/juli juli



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



svn commit: r1625623 - in /tomcat/tc7.0.x/trunk: ./ BUILDING.txt

2014-09-17 Thread kkolinko
Author: kkolinko
Date: Wed Sep 17 15:03:45 2014
New Revision: 1625623

URL: http://svn.apache.org/r1625623
Log:
Add a note about creating release builds on non-Windows platforms.
It is merge of r1553126 from tomcat/trunk.

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

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

Modified: tomcat/tc7.0.x/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/BUILDING.txt?rev=1625623r1=1625622r2=1625623view=diff
==
--- tomcat/tc7.0.x/trunk/BUILDING.txt (original)
+++ tomcat/tc7.0.x/trunk/BUILDING.txt Wed Sep 17 15:03:45 2014
@@ -265,6 +265,12 @@ You can build them by using the followin
 
 (6) Building a full release (as provided via the ASF download pages)
 
+A full release includes the Windows installer which requires a Windows
+environment to be available to create it. If not building in a Windows
+environment, the build scripts assume that WINE is available. If this is 
not
+the case, the skip.installer property may be set to skip the creation of 
the
+Windows installer.
+
  1. Configure GPG, if needed
 
 If the released artifacts have to be cryptographically signed with a



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



[Bug 56989] New: Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

Bug ID: 56989
   Summary: Classes being loaded from wrong web app.
   Product: Tomcat 7
   Version: 7.0.55
  Hardware: All
OS: All
Status: NEW
  Severity: critical
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: m.marti...@ll.mit.edu

Actually a more correct description might be Classes NOT being reloaded from
correct web app.   The following scenario results in classes loaded from one
web app showing up in another web app, in place of the correct classes that
should have been loaded from the latter.  The example uses Spring Security to
demonstrate the problem, but after examining the Spring code I don't believe it
is the problem at all and the problem can be produced in other code.

Scenario:

Two web apps deployed into the same Tomcat container, war1 and war2.  The
server.xml is configured to use mutual SSL on the connector so requests must
have an acceptable x509 certificate to get through.

Inside each war is a copy of the Spring security framework (though this can be
produced with other classes, this is easy to reproduce).  The exact version
probably doesn't matter, but in this case it was:

..tomcat/webapps/war1/WEB-INF/lib/spring-security-core-3.1.4.RELEASE.jar
..tomcat/webapps/war1/WEB-INF/lib/spring-security-web-3.1.4.RELEASE.jar

and

..tomcat/webapps/war2/WEB-INF/lib/spring-security-core-3.1.4.RELEASE.jar
..tomcat/webapps/war2/WEB-INF/lib/spring-security-web-3.1.4.RELEASE.jar

(along with associated dependencies in each case).

There are no other copies of the Spring libraries anywhere.

Both web apps declare a Spring FilterChain which, naturally, starts with the 
org.springframework.security.web.context.SecurityContextPersistenceFilter
class.

   bean id=filterChainProxy
 class=org.springframework.security.web.FilterChainProxy
  constructor-arg
 list
 security:filter-chain pattern=/resources/** filters=none /
 security:filter-chain pattern=/login** filters=none/
 !--  All authenticated requests must go through this chain --
 security:filter-chain request-matcher-ref=httpsRequestMatcher
   filters=  
  securityContextPersistenceFilter,  
   securityContextHolderAwareRequestFilter,  
   myAuthenticationFilter  
   /  

 /list
  /constructor-arg
   /bean

The securityContextPersistenceFilter is fairly simple, if you have not looked
at their source code. All it is doing is asserting that a Spring
SecurityContext object exists at the start of the request, putting it into a
ThreadLocal and then, at the end of the request, clearing it from the
ThreadLocal and saving the object in the session.

The securityContextHolderAwareRequestFilter is another standard Spring filter
that simply wraps the request in a wrapper that knows how to get some standard
security pieces out of the SecurityContext, if it exists and is setup.

The myAuthenticationFilter bean is a our own Filter that simply confirms
whether the DN of the user certificate is acceptable and if so, creates an
appropriate org.springframework.security.core.Authentication object that the
following servlet application will understand and places it into the
SecurityContextHolder.  Pretty standard stuff:

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) 
throws IOException, ServletException{
//...
Authentication myAuth = //... create authentication.
SecurityContext context = SecurityContextHolder.getContext();
context.setAuthentication(myAuth);
//...
chain.doFilter(request,response);   
}

Pretty simple.

When either of the web apps is deployed alone, this works perfect.

However, when both are deployed into the same tomcat, it only works perfect for
the first web app you access with a request.

Upon sending a request to the second war, the above code will fail because the
SecurityContext object is built from classes loaded from the first war1!

Upon debugging this problem, and very carefully and using the
Class.getProtectionDomain().getCodeSource() API to printout the exact source of
each of the relevant classes involved, the following are true:

 When making the first request against war1 all classes properly load from
war1.

 When making the next request against war2:

SecurityContextHolder - properly loaded from war2
Authentication - properly loaded from war2
ThreadLocalSecurityContextHolderStrategy -- LOADED FROM WAR1!!!
SecurityContextImpl - LOADED FROM WAR1!


This is bizarre and seems like an explicit violation of the specified class
loader violation.

If you flip the problem around and access war2 first after startup, then the
problem instead shows up when you subsequently try to access 

[Bug 56989] Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

Mel Martinez m.marti...@ll.mit.edu changed:

   What|Removed |Added

 CC||m.marti...@ll.mit.edu

-- 
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 56989] Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

Konstantin Kolinko knst.koli...@gmail.com changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
Please provide a small sample web application that would reproduce the
behaviour that you are observing on a clean Tomcat installation,  so that
another person could reproduce and debug the issue.

Remember that Bugzilla is not a support forum. If you need help, you would
better ask on the users mailing list. Its audience is wider and it is more
likely to find people familiar with your configuration.


Even if both war1 and war2 create a ThreadLocal, they are different thread
locals. As far as I know, when ThreadLocals are stored in a Thread, they are
keyed by Class instance.

As war1 and war2 have different class instances, those are different
ThreadLocals, and cannot interfere with each other, nor can they store a class
loaded from different web application (it cannot be class-casted to
SecurityContext interface loaded from different web application).

 the above code will fail

The word fail can mean a lot of different things. What is the actual
behaviour that is observed? (The actual messages, stack traces etc.)

-- 
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: r1625719 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 18:06:28 2014
New Revision: 1625719

URL: http://svn.apache.org/r1625719
Log:
Merged revision 1618835 from tomcat/trunk:
Add plumbing to write reserved bits as set in the MessagePart rather
than hard-coding them to 0.
Re-order method parameters for writing header to align with RFC 6455.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1625719r1=1625718r2=1625719view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
 Wed Sep 17 18:06:28 2014
@@ -408,8 +408,8 @@ public abstract class WsRemoteEndpointIm
 }
 
 headerBuffer.clear();
-writeHeader(headerBuffer, mp.getOpCode(), mp.getPayload(), first,
-mp.isFin(), isMasked(), mask);
+writeHeader(headerBuffer, mp.isFin(), mp.getRsv(), mp.getOpCode(),
+isMasked(), mp.getPayload(), mask, first);
 headerBuffer.flip();
 
 if (getBatchingAllowed() || isMasked()) {
@@ -620,20 +620,22 @@ public abstract class WsRemoteEndpointIm
 protected abstract boolean isMasked();
 protected abstract void doClose();
 
-private static void writeHeader(ByteBuffer headerBuffer, byte opCode,
-ByteBuffer payload, boolean first, boolean last, boolean masked,
-byte[] mask) {
+private static void writeHeader(ByteBuffer headerBuffer, boolean fin,
+int rsv, byte opCode, boolean masked, ByteBuffer payload,
+byte[] mask, boolean first) {
 
 byte b = 0;
 
-if (last) {
+if (fin) {
 // Set the fin bit
-b = -128;
+b -= 128;
 }
 
+b += (rsv  4);
+
 if (first) {
 // This is the first fragment of this message
-b = (byte) (b + opCode);
+b += opCode;
 }
 // If not the first fragment, it is a continuation with opCode of zero
 



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



svn commit: r1625727 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/ main/java/org/apache/tomcat/ main/java/org/apache/tomcat/util/ te

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 18:35:00 2014
New Revision: 1625727

URL: http://svn.apache.org/r1625727
Log:
Start on tomcat-util module

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/  
 (with props)

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/util/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/util/

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 18:35:00 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Diagnostics.java



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



svn commit: r1625733 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/authenticator/ java/org/apache/catalina/realm/ java/org/apache/catalina/servlets/ java/org/apache/catalina/util/ java/org/a

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 18:38:05 2014
New Revision: 1625733

URL: http://svn.apache.org/r1625733
Log:
Merged revision 1623685 from tomcat/trunk:
Move MessageDigest utility classes from o.a.catalina.util to 
o.a.tomcat.util.security so they are more widely available.

Added:

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
  - copied, changed from r1623685, 
tomcat/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/MD5Encoder.java
  - copied, changed from r1623685, 
tomcat/trunk/java/org/apache/tomcat/util/security/MD5Encoder.java
Removed:

tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/ConcurrentMessageDigest.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/util/MD5Encoder.java
Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java

tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java

tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java

tomcat/tc7.0.x/trunk/test/org/apache/catalina/authenticator/TesterDigestAuthenticatorPerformance.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=1625733r1=1625732r2=1625733view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
 Wed Sep 17 18:38:05 2014
@@ -35,12 +35,12 @@ import org.apache.catalina.LifecycleExce
 import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.deploy.LoginConfig;
-import org.apache.catalina.util.ConcurrentMessageDigest;
-import org.apache.catalina.util.MD5Encoder;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.http.parser.HttpParser;
+import org.apache.tomcat.util.security.ConcurrentMessageDigest;
+import org.apache.tomcat.util.security.MD5Encoder;
 
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=1625733r1=1625732r2=1625733view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java Wed Sep 
17 18:38:05 2014
@@ -47,7 +47,6 @@ import org.apache.catalina.deploy.Securi
 import org.apache.catalina.deploy.SecurityConstraint;
 import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
-import org.apache.catalina.util.MD5Encoder;
 import org.apache.catalina.util.SessionConfig;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -55,6 +54,7 @@ import org.apache.tomcat.util.buf.B2CCon
 import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.codec.binary.Base64;
 import org.apache.tomcat.util.res.StringManager;
+import org.apache.tomcat.util.security.MD5Encoder;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1625733r1=1625732r2=1625733view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java 
Wed Sep 17 18:38:05 2014
@@ -51,13 +51,13 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.catalina.util.DOMWriter;
-import org.apache.catalina.util.MD5Encoder;
 import org.apache.catalina.util.XMLWriter;
 import org.apache.naming.resources.CacheEntry;
 import org.apache.naming.resources.Resource;
 import org.apache.naming.resources.ResourceAttributes;
 import org.apache.tomcat.util.http.FastHttpDateFormat;
 import 

svn commit: r1625734 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 18:41:26 2014
New Revision: 1625734

URL: http://svn.apache.org/r1625734
Log:
Merged revision 1623693 from tomcat/trunk:
Add SHA-1 support
Add support for input consisting of multiply byte arrays
(both changes are prep for switching WebSocket to use this utility class)

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java?rev=1625734r1=1625733r2=1625734view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/security/ConcurrentMessageDigest.java
 Wed Sep 17 18:41:26 2014
@@ -31,6 +31,7 @@ import java.util.concurrent.ConcurrentLi
 public class ConcurrentMessageDigest {
 
 private static final String MD5 = MD5;
+private static final String SHA1 = SHA-1;
 
 private static final MapString,QueueMessageDigest queues =
 new HashMapString,QueueMessageDigest();
@@ -44,16 +45,21 @@ public class ConcurrentMessageDigest {
 try {
 // Init commonly used algorithms
 init(MD5);
+init(SHA1);
 } catch (NoSuchAlgorithmException e) {
 throw new IllegalArgumentException(e);
 }
 }
 
-public static byte[] digestMD5(byte[] input) {
+public static byte[] digestMD5(byte[]... input) {
 return digest(MD5, input);
 }
 
-public static byte[] digest(String algorithm, byte[] input) {
+public static byte[] digestSHA1(byte[]... input) {
+return digest(SHA1, input);
+}
+
+public static byte[] digest(String algorithm, byte[]... input) {
 
 QueueMessageDigest queue = queues.get(algorithm);
 if (queue == null) {
@@ -71,7 +77,10 @@ public class ConcurrentMessageDigest {
 }
 }
 
-byte[] result = md.digest(input);
+for (byte[] bytes : input) {
+md.update(bytes);
+}
+byte[] result = md.digest();
 
 queue.add(md);
 



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



svn commit: r1625735 - in /tomcat/trunk/java/org/apache/tomcat/util/threads: Constants.java TaskThreadFactory.java

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 18:43:21 2014
New Revision: 1625735

URL: http://svn.apache.org/r1625735
Log:
Fix cyclic dependency

Modified:
tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java
tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java?rev=1625735r1=1625734r2=1625735view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/threads/Constants.java Wed Sep 17 
18:43:21 2014
@@ -24,4 +24,9 @@ public final class Constants {
 public static final String Package = org.apache.tomcat.util.threads;
 
 public static final long DEFAULT_THREAD_RENEWAL_DELAY = 1000L;
+
+/**
+ * Has security been turned on?
+ */
+public static final boolean IS_SECURITY_ENABLED = 
(System.getSecurityManager() != null);
 }

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java?rev=1625735r1=1625734r2=1625735view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/threads/TaskThreadFactory.java Wed 
Sep 17 18:43:21 2014
@@ -21,8 +21,8 @@ import java.security.PrivilegedAction;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.tomcat.util.net.Constants;
 import org.apache.tomcat.util.security.PrivilegedSetTccl;
+
 /**
  * Simple task thread factory to use to create threads for an executor
  * implementation.



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



svn commit: r1625737 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/websocket/server/UpgradeUtil.java

2014-09-17 Thread violetagg
Author: violetagg
Date: Wed Sep 17 18:46:38 2014
New Revision: 1625737

URL: http://svn.apache.org/r1625737
Log:
Merged revision 1623695 from tomcat/trunk:
Switch creation of the SHA-1 digest required to generate a WebSocket upgrade to 
use the ConcurrentMessageDigest rather than using a dedicated Queue.

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

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java

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

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java?rev=1625737r1=1625736r2=1625737view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 
Wed Sep 17 18:46:38 2014
@@ -18,16 +18,12 @@ package org.apache.tomcat.websocket.serv
 
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
 
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
@@ -42,6 +38,7 @@ import javax.websocket.server.ServerEndp
 
 import org.apache.catalina.connector.RequestFacade;
 import org.apache.tomcat.util.codec.binary.Base64;
+import org.apache.tomcat.util.security.ConcurrentMessageDigest;
 import org.apache.tomcat.websocket.Constants;
 import org.apache.tomcat.websocket.Transformation;
 import org.apache.tomcat.websocket.TransformationFactory;
@@ -54,8 +51,6 @@ public class UpgradeUtil {
 private static final byte[] WS_ACCEPT =
 258EAFA5-E914-47DA-95CA-C5AB0DC85B11.getBytes(
 StandardCharsets.ISO_8859_1);
-private static final QueueMessageDigest sha1Helpers =
-new ConcurrentLinkedQueueMessageDigest();
 
 private UpgradeUtil() {
 // Utility class. Hide default constructor.
@@ -310,19 +305,9 @@ public class UpgradeUtil {
 }
 
 
-private static String getWebSocketAccept(String key) throws 
ServletException {
-MessageDigest sha1Helper = sha1Helpers.poll();
-if (sha1Helper == null) {
-try {
-sha1Helper = MessageDigest.getInstance(SHA1);
-} catch (NoSuchAlgorithmException e) {
-throw new ServletException(e);
-}
-}
-sha1Helper.reset();
-sha1Helper.update(key.getBytes(StandardCharsets.ISO_8859_1));
-String result = 
Base64.encodeBase64String(sha1Helper.digest(WS_ACCEPT));
-sha1Helpers.add(sha1Helper);
-return result;
+private static String getWebSocketAccept(String key) {
+byte[] digest = ConcurrentMessageDigest.digestSHA1(
+key.getBytes(StandardCharsets.ISO_8859_1), WS_ACCEPT);
+return Base64.encodeBase64String(digest);
 }
 }



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



svn commit: r1625744 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util: pom.xml src/main/java/org/apache/tomcat/ src/test/java/org/apache/tomcat/util/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 18:51:15 2014
New Revision: 1625744

URL: http://svn.apache.org/r1625744
Log:
Complete tomcat-util including tests

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/  
 (props changed)

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/util/
   (props changed)

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml?rev=1625744r1=1625743r2=1625744view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml Wed Sep 17 18:51:15 
2014
@@ -28,16 +28,18 @@
   descriptionCommon code shared by multiple Tomcat components/description
 
   dependencies
+
 dependency
   groupIdorg.apache.tomcat/groupId
   artifactIdtomcat-juli/artifactId
 /dependency
-!-- cyclic dependency! net.Constants is needed
+
 dependency
-  groupIdorg.apache.tomcat/groupId
-  artifactIdtomcat-coyote/artifactId
+  groupIdjunit/groupId
+  artifactIdjunit/artifactId
+  scopetest/scope
 /dependency
---
+
   /dependencies
 
 /project

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
--
--- svn:externals (original)
+++ svn:externals Wed Sep 17 18:51:15 2014
@@ -1 +1,10 @@
 ^/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Diagnostics.java
+^/tomcat/trunk/java/org/apache/tomcat/util/ExceptionUtils.java 
ExceptionUtils.java
+^/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java 
IntrospectionUtils.java
+^/tomcat/trunk/java/org/apache/tomcat/util/LocalStrings.properties 
LocalStrings.properties
+^/tomcat/trunk/java/org/apache/tomcat/util/buf buf
+^/tomcat/trunk/java/org/apache/tomcat/util/codec codec
+^/tomcat/trunk/java/org/apache/tomcat/util/file file
+^/tomcat/trunk/java/org/apache/tomcat/util/res res
+^/tomcat/trunk/java/org/apache/tomcat/util/security security
+^/tomcat/trunk/java/org/apache/tomcat/util/threads threads

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/util/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 18:51:15 2014
@@ -0,0 +1,3 @@
+^/tomcat/trunk/test/org/apache/tomcat/util/buf buf
+^/tomcat/trunk/test/org/apache/tomcat/util/res res
+^/tomcat/trunk/test/org/apache/tomcat/util/threads threads



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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #13 from Mark Thomas ma...@apache.org ---
Mmm. Because of what needs to be filtered, the use of externals is going to get
painful for some modules. I'm wondering if there is a better solution.

The modules aspect of this is good. Is it possible to point a module at
standard Tomcat checkout (i.e. the full source tree) and then tell Maven to
filter that to only include the classes we want for that module? If yes, would
this work (including in an IDE) if the source tree was outside of the modules
or would you need a complete Tomcat checkout in each module?

-- 
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 56989] Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

--- Comment #2 from Mel Martinez m.marti...@ll.mit.edu ---
Hi Konstantin,

Thanks for your quick response on this topic.

I will try to find the time to throw together a pair of sample web apps that
will reproduce the problem (I cannot provide our actual project code).  That
may not happen for a day or two.

I am not expecting support at all and I would hope that would be clear from the
details I have provided. I have a workaround for the problem already as
indicated in my report.  I am posting this bug report so that the Tomcat
committers are aware that they have a very serious bug in the class loader
implementation.

The use of a ThreadLocal by the Spring code is not the issue.  The ThreadLocal
is being properly cleared at the termination of each request during the
execution of the finally clause in the SecurityContextPersistenceFilter.  This
is a class loader isolation issue.

The issue is that

a) the SecurityContextHolder class has a static reference to a 'strategy'
object.
b) When a request goes to war1 the SecurityContext class is loaded from war1,
initialized and the strategy object is created out of the classes in war1.
c) When a request next goes to war2, the SecurityContext class for war2 is
loaded from the war2 (correctly) but it's static field STILL points to the
strategy object created in (b), from war1!
d) Because the strategy object was loaded from war1, when it's
createEmptyContext() method is called, it creates a SecurityContextImpl
instance using the class for that from war1.
e) Finally, this will fail when you attempt to use this object within war2
because assigning it to a reference of type SecurityContext will throw a
ClassCastException.

It will throw the ClassCastException because the object implements the
SecurityContext interface from war1, not war2.

The core problem is in step c :  Why is the static field for the
SecurityContextHolder class in war2 pointing to the strategy object from war1?

A static field should belong to a class.  The SecurityContextHolder class in
each war are, as we both agree, supposed to be separate classes.  So they are
supposed to have completely separate static fields.

Thanks again for your attention to this.

-- 
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 56989] Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

--- Comment #3 from Mel Martinez m.marti...@ll.mit.edu ---
Sigh.  Some typos.  I wish Bugzilla allowed us to edit comments.
- should be

The issue is that

a) the SecurityContextHolder class has a static reference to a 'strategy'
object.
b) When a request goes to war1 the SecurityContextHolder class is loaded from
war1, initialized and the strategy object is created out of the classes in
war1.
c) When a request next goes to war2, the SecurityContextHolder class for war2
is loaded from the war2 (correctly) but it's static field STILL points to the
strategy object created in (b), from war1!
d) Because the strategy object was loaded from war1, when it's
createEmptyContext() method is called, it creates a SecurityContextImpl
instance using the class for that from war1.
e) Finally, this will fail when you attempt to use this object within war2
because assigning it to a reference of type SecurityContext will throw a
ClassCastException.

-- 
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: r1625769 - /tomcat/trunk/build.xml

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:17:28 2014
New Revision: 1625769

URL: http://svn.apache.org/r1625769
Log:
Avoid creating empty package in JAR

Modified:
tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1625769r1=1625768r2=1625769view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Wed Sep 17 19:17:28 2014
@@ -338,6 +338,7 @@
   patternset id=files.tomcat-api
 include name=org/apache/tomcat/* /
 exclude name=org/apache/tomcat/buildutil /
+exclude name=org/apache/tomcat/dbcp /
 exclude name=org/apache/tomcat/jni /
 exclude name=org/apache/tomcat/spdy /
 exclude name=org/apache/tomcat/util /



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



svn commit: r1625773 - in /tomcat/sandbox/trunk-maven-layout/tomcat-api/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:18:57 2014
New Revision: 1625773

URL: http://svn.apache.org/r1625773
Log:
Start work on tomcat-api module

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/java/
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/java/org/apache/


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



svn commit: r1625774 - in /tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src: ./ main/ main/java/ main/java/javax/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:22:55 2014
New Revision: 1625774

URL: http://svn.apache.org/r1625774
Log:
Start work on sevrlet-api

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/main/
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/main/java/
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/main/java/javax/


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



svn commit: r1625775 - in /tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api: pom.xml src/main/java/javax/ src/test/ src/test/javax/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:29:11 2014
New Revision: 1625775

URL: http://svn.apache.org/r1625775
Log:
Complete tomcat-servlet-api module with a combination of a simple external and 
a filter in the POM

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/javax/   
(with props)
Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/main/java/javax/   
(props changed)

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml?rev=1625775r1=1625774r2=1625775view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml Wed Sep 17 
19:29:11 2014
@@ -62,4 +62,17 @@
 /license
   /licenses
 
+  build
+plugins
+  plugin
+artifactIdmaven-compiler-plugin/artifactId
+configuration
+  excludes
+excludejavax/servlet/jsp/**/exclude
+  /excludes
+/configuration
+  /plugin
+/plugins
+  /build
+
 /project

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/main/java/javax/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 19:29:11 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/java/javax/servlet servlet

Propchange: tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/javax/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 19:29:11 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/test/javax/servlet test



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



[Bug 56989] Classes being loaded from wrong web app.

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56989

--- Comment #4 from Konstantin Kolinko knst.koli...@gmail.com ---
You may try running with a debugger
http://wiki.apache.org/tomcat/FAQ/Developing#Debugging

With a breakpoint in static method SecurityContextHolder.initialize(). It may
be interesting to know what stack trace will be at that point and what class
loaders will be invoked.

 c) When a request next goes to war2, the SecurityContextHolder class for
 war2 is loaded from the war2 (correctly) but it's static field STILL
 points to the strategy object created in (b), from war1!

That would mean that the interface (the class used to declare the static field)
were also loaded from war1.

There is no reflection API in use here (neither when declaring field, nor when
creating strategy instance - it is created with Java new operator), so it
will be loaded from the same class loader that loaded the calling class. So how
can it be loaded from different war? What jars are in this classloader's class
path?

-- 
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: r1625781 - in /tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api: pom.xml src/test/java/ src/test/java/javax/ src/test/javax/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:47:19 2014
New Revision: 1625781

URL: http://svn.apache.org/r1625781
Log:
Fix test path
Tests have circular dependencies so skip the for this module

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/java/
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/java/javax/   
(props changed)
  - copied from r1625775, 
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/javax/
Removed:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/javax/
Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml?rev=1625781r1=1625780r2=1625781view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/pom.xml Wed Sep 17 
19:47:19 2014
@@ -70,9 +70,23 @@
   excludes
 excludejavax/servlet/jsp/**/exclude
   /excludes
+  !-- Skip the tests as there are circular dependencies --
+  testExcludes
+testExcludejavax/servlet/**/testExclude
+  /testExcludes
 /configuration
   /plugin
 /plugins
   /build
-
+
+  dependencies
+
+dependency
+  groupIdjunit/groupId
+  artifactIdjunit/artifactId
+  scopetest/scope
+/dependency
+
+  /dependencies
+
 /project

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-servlet-api/src/test/java/javax/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 19:47:19 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/test/javax/servlet servlet



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



svn commit: r1625785 - in /tomcat/sandbox/trunk-maven-layout/tomcat-api: pom.xml src/main/java/org/apache/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 19:48:22 2014
New Revision: 1625785

URL: http://svn.apache.org/r1625785
Log:
CComplete tomcat-api module with a combination of a simple external and a 
filter in the POM

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/java/org/apache/   
(props changed)

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml?rev=1625785r1=1625784r2=1625785view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-api/pom.xml Wed Sep 17 19:48:22 
2014
@@ -29,11 +29,24 @@
 descriptionDefinition of interfaces shared by Catalina and 
Jasper/description
 urlhttp://tomcat.apache.org//url
 
-  dependencies
-dependency
-  groupIdorg.apache.tomcat/groupId
-  artifactIdtomcat-servlet-api/artifactId
-/dependency
-  /dependencies
+build
+plugins
+plugin
+artifactIdmaven-compiler-plugin/artifactId
+configuration
+includes
+includeorg/apache/tomcat/*.java/include
+/includes
+/configuration
+/plugin
+/plugins
+/build
+
+dependencies
+dependency
+groupIdorg.apache.tomcat/groupId
+artifactIdtomcat-servlet-api/artifactId
+/dependency
+/dependencies
 
 /project

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-api/src/main/java/org/apache/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 19:48:22 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/java/org/apache/tomcat tomcat



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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #14 from Mark Thomas ma...@apache.org ---
For the record a narrow as possible single external combined with
include/exclude filters in the POM looks like a good solution. I'll update the
existing modules that use multiple externals to use this approach.

A new problem has emerged. The unit tests (which in many cases are more like
integration tests) have all sorts of circular dependencies. Suggestions on how
to handle this welcome.

-- 
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: r1625794 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util: pom.xml src/main/java/org/apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:03:26 2014
New Revision: 1625794

URL: http://svn.apache.org/r1625794
Log:
Simplify externals

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/  
 (props changed)

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml?rev=1625794r1=1625793r2=1625794view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml Wed Sep 17 20:03:26 
2014
@@ -27,6 +27,27 @@
   artifactIdtomcat-util/artifactId
   descriptionCommon code shared by multiple Tomcat components/description
 
+  build
+plugins
+  plugin
+artifactIdmaven-compiler-plugin/artifactId
+configuration
+  excludes
+excludeorg/apache/tomcat/util/bcel/**/exclude
+excludeorg/apache/tomcat/util/collections/**/exclude
+excludeorg/apache/tomcat/util/descriptor/**/exclude
+excludeorg/apache/tomcat/util/digester/**/exclude
+excludeorg/apache/tomcat/util/http/**/exclude
+excludeorg/apache/tomcat/util/log/**/exclude
+excludeorg/apache/tomcat/util/modeler/**/exclude
+excludeorg/apache/tomcat/util/net/**/exclude
+excludeorg/apache/tomcat/util/scan/**/exclude
+  /excludes
+/configuration
+  /plugin
+/plugins
+  /build
+
   dependencies
 
 dependency

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
--
--- svn:externals (original)
+++ svn:externals Wed Sep 17 20:03:26 2014
@@ -1,10 +1 @@
-^/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Diagnostics.java
-^/tomcat/trunk/java/org/apache/tomcat/util/ExceptionUtils.java 
ExceptionUtils.java
-^/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java 
IntrospectionUtils.java
-^/tomcat/trunk/java/org/apache/tomcat/util/LocalStrings.properties 
LocalStrings.properties
-^/tomcat/trunk/java/org/apache/tomcat/util/buf buf
-^/tomcat/trunk/java/org/apache/tomcat/util/codec codec
-^/tomcat/trunk/java/org/apache/tomcat/util/file file
-^/tomcat/trunk/java/org/apache/tomcat/util/res res
-^/tomcat/trunk/java/org/apache/tomcat/util/security security
-^/tomcat/trunk/java/org/apache/tomcat/util/threads threads
+^/tomcat/trunk/java/org/apache/tomcat/util util



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



Re: svn commit: r1625794 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util: pom.xml src/main/java/org/apache/tomcat/

2014-09-17 Thread Konstantin Kolinko
2014-09-18 0:03 GMT+04:00  ma...@apache.org:
 Author: markt
 Date: Wed Sep 17 20:03:26 2014
 New Revision: 1625794

 URL: http://svn.apache.org/r1625794
 Log:
 Simplify externals

 Modified:
 tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
 
 tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
(props changed)

 Modified: tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
 URL: 
 http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml?rev=1625794r1=1625793r2=1625794view=diff
 ==
 --- tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml (original)
 +++ tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml Wed Sep 17 20:03:26 
 2014
 @@ -27,6 +27,27 @@
artifactIdtomcat-util/artifactId
descriptionCommon code shared by multiple Tomcat components/description

 +  build
 +plugins
 +  plugin
 +artifactIdmaven-compiler-plugin/artifactId
 +configuration
 +  excludes
 +excludeorg/apache/tomcat/util/bcel/**/exclude
 +excludeorg/apache/tomcat/util/collections/**/exclude
 +excludeorg/apache/tomcat/util/descriptor/**/exclude
 +excludeorg/apache/tomcat/util/digester/**/exclude
 +excludeorg/apache/tomcat/util/http/**/exclude
 +excludeorg/apache/tomcat/util/log/**/exclude
 +excludeorg/apache/tomcat/util/modeler/**/exclude
 +excludeorg/apache/tomcat/util/net/**/exclude
 +excludeorg/apache/tomcat/util/scan/**/exclude
 +  /excludes
 +/configuration
 +  /plugin
 +/plugins
 +  /build

Just using excludes seems fragile.
In build.xml we have both includes and excludes

  patternset id=files.tomcat-util
include name=org/apache/tomcat/util/buf/** /
include name=org/apache/tomcat/util/codec/** /
include name=org/apache/tomcat/util/file/** /
include name=org/apache/tomcat/util/res/** /
include name=org/apache/tomcat/util/security/** /
include name=org/apache/tomcat/util/threads/** /
include name=org/apache/tomcat/util/* /
exclude name=org/apache/tomcat/util/bcel /
exclude name=org/apache/tomcat/util/collections /
exclude name=org/apache/tomcat/util/descriptor /
exclude name=org/apache/tomcat/util/digester /
exclude name=org/apache/tomcat/util/http /
exclude name=org/apache/tomcat/util/log /
exclude name=org/apache/tomcat/util/modeler /
exclude name=org/apache/tomcat/util/net /
exclude name=org/apache/tomcat/util/scan /
  /patternset



dependencies

  dependency

 Propchange: 
 tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
 --
 --- svn:externals (original)
 +++ svn:externals Wed Sep 17 20:03:26 2014
 @@ -1,10 +1 @@
 -^/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Diagnostics.java
 -^/tomcat/trunk/java/org/apache/tomcat/util/ExceptionUtils.java 
 ExceptionUtils.java
 -^/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java 
 IntrospectionUtils.java
 -^/tomcat/trunk/java/org/apache/tomcat/util/LocalStrings.properties 
 LocalStrings.properties
 -^/tomcat/trunk/java/org/apache/tomcat/util/buf buf
 -^/tomcat/trunk/java/org/apache/tomcat/util/codec codec
 -^/tomcat/trunk/java/org/apache/tomcat/util/file file
 -^/tomcat/trunk/java/org/apache/tomcat/util/res res
 -^/tomcat/trunk/java/org/apache/tomcat/util/security security
 -^/tomcat/trunk/java/org/apache/tomcat/util/threads threads
 +^/tomcat/trunk/java/org/apache/tomcat/util util



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


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



svn commit: r1625797 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util: pom.xml src/test/java/org/apache/tomcat/ src/test/java/org/apache/tomcat/util/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:10:59 2014
New Revision: 1625797

URL: http://svn.apache.org/r1625797
Log:
Simplify externals

Removed:

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/util/
Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/  
 (props changed)

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml?rev=1625797r1=1625796r2=1625797view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml Wed Sep 17 20:10:59 
2014
@@ -43,6 +43,17 @@
 excludeorg/apache/tomcat/util/net/**/exclude
 excludeorg/apache/tomcat/util/scan/**/exclude
   /excludes
+  textExcludes
+textExcludeorg/apache/tomcat/util/bcel/**/textExclude
+textExcludeorg/apache/tomcat/util/collections/**/textExclude
+textExcludeorg/apache/tomcat/util/descriptor/**/textExclude
+textExcludeorg/apache/tomcat/util/digester/**/textExclude
+textExcludeorg/apache/tomcat/util/http/**/textExclude
+textExcludeorg/apache/tomcat/util/log/**/textExclude
+textExcludeorg/apache/tomcat/util/modeler/**/textExclude
+textExcludeorg/apache/tomcat/util/net/**/textExclude
+textExcludeorg/apache/tomcat/util/scan/**/textExclude
+  /textExcludes
 /configuration
   /plugin
 /plugins

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 20:10:59 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/test/org/apache/tomcat/util util



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



svn commit: r1625804 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util/src: main/java/org/apache/tomcat/ test/java/org/apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:28:07 2014
New Revision: 1625804

URL: http://svn.apache.org/r1625804
Log:
Remove externals while I try and figure out strange svn errors

Modified:

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/  
 (props changed)

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/  
 (props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
('svn:externals' removed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/
('svn:externals' removed)



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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #15 from Pierre Viret pierre.vi...@gmail.com ---
Here my answers to the first comment:

Working with the source:
1. How do you propose to update the version number after a release? Updating
every POM by hand is not viable.

-- I use the maven-versions-plugin with several big projects for this
(http://mojo.codehaus.org/versions-maven-plugin). The goal versions:set is
exactly what we need and this works very well. But if you have some
inconsistency in the versions of your project hierarchy you have to fix them by
hand.

2. The JARs need to contain the right LICENSE and NOTICE file. Even if they
aren't meant to be released, someone will distribute them somewhere, somehow.

-- this should not be a big issue. There are several ays to achieve this, I
think that one good solution is too define a component containing global
ressources, each component needing these files depends on this one and can pull
the files using dependency-plugin in the generate-resources phase. Another
solution would be to add the files as ressource in each component using svn
externals, into src/main/resources dir of the component then the files are
added to the jar. But on my opinion the first solution is easier.

Working instance:
3. How do we get to this point?

-- Is the working instance what the ant build generates under output/build ?
Actually what I have begun to implement for generating the distributions is
quite the same as the working instance I think.

Distribution:
4. Can source JARs are be created?

-- yes this is easy

5. Windows installer, signing etc.

-- I have no experience with Windows installer. Signing should not be a
problem. 
It is possible to perform some steps in the maven build using ant targets so
everything we can do with ant should be possible with maven. I have used this
(the maven-antrun-plugin) for a project where we call some ant tasks of
Weblogic Server to generate Security Providers.


I will have again time to work on this Friday afternoon. Are you working on
some branch in svn for the svn externals ? How should I checkout the sources to
get what you have implemented for JULI ? I have checkout the trunk but I didn't
see anything about externals references.

-- 
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: r1625807 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:36:17 2014
New Revision: 1625807

URL: http://svn.apache.org/r1625807
Log:
Still not sure what is going on. Try deleting more stuff to clean things up.

Removed:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/


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



svn commit: r1625808 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org: ./ apache/ apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:37:06 2014
New Revision: 1625808

URL: http://svn.apache.org/r1625808
Log:
Restore packages

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/


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



svn commit: r1625810 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:37:37 2014
New Revision: 1625810

URL: http://svn.apache.org/r1625810
Log:
Add an external for util

Modified:

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/  
 (props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/main/java/org/apache/tomcat/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 20:37:37 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/java/org/apache/tomcat/util util



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



svn commit: r1625811 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:39:04 2014
New Revision: 1625811

URL: http://svn.apache.org/r1625811
Log:
Add an external for util

Modified:

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/  
 (props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 20:39:04 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/test/org/apache/tomcat/util util



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



[Bug 56397] Establish parallel Maven-based build process

2014-09-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56397

--- Comment #16 from Pierre Viret pierre.vi...@gmail.com ---
I've just figured out where you have performed the changes
(tomcat/sandbox/trunk-maven-layout/) so I will be able to check this out on
Friday.

Regarding the tests: I have not tried to integrate the tests in the maven
components yet. A good practice in maven is to split the integration tests in
separate components which are built  tested late in the build cycle, when all
base components are already built and can be referenced. Only the real unit
tests, which run quickly (if they last more than a couple of seconds then we
risk that the developers skip them...) should be integrated in the
corresponding component and so the developer get at once a feedback if
something is broken at this level.
If some test classes are widely used then a solution is to create a
common-test component containing all these utility classes which is then
added as dependency (with scope test) in the other components.
One other (quick  dirty) solution would be to create one single test component
and put all the tests there, but I think this should only be used in a first
throw and that we should integrate the real unit-tests in the corresponding
components as soon as possible.

-- 
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: r1625818 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:50:45 2014
New Revision: 1625818

URL: http://svn.apache.org/r1625818
Log:
Still not sure what is going on. Try deleting more stuff to clean things up.

Removed:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/


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



svn commit: r1625823 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:54:53 2014
New Revision: 1625823

URL: http://svn.apache.org/r1625823
Log:
Re-add org packag

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/


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



svn commit: r1625824 - in /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache: ./ tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:56:12 2014
New Revision: 1625824

URL: http://svn.apache.org/r1625824
Log:
Restore packages

Added:
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/


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



svn commit: r1625825 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 20:57:12 2014
New Revision: 1625825

URL: http://svn.apache.org/r1625825
Log:
Add an external for util

Modified:

tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/  
 (props changed)

Propchange: 
tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/
--
--- svn:externals (added)
+++ svn:externals Wed Sep 17 20:57:12 2014
@@ -0,0 +1 @@
+^/tomcat/trunk/test/org/apache/tomcat/util util



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



Re: svn commit: r1625825 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/src/test/java/org/apache/tomcat/

2014-09-17 Thread Mark Thomas
On 17/09/2014 21:57, ma...@apache.org wrote:
 Author: markt
 Date: Wed Sep 17 20:57:12 2014
 New Revision: 1625825
 
 URL: http://svn.apache.org/r1625825
 Log:
 Add an external for util

All,

Sorry for the noise. It looks like my working copy is corrupted. A fresh
checkout is fine.

Mark


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



svn commit: r1625827 - /tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml

2014-09-17 Thread markt
Author: markt
Date: Wed Sep 17 21:12:33 2014
New Revision: 1625827

URL: http://svn.apache.org/r1625827
Log:
Fix typo

Modified:
tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml

Modified: tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml?rev=1625827r1=1625826r2=1625827view=diff
==
--- tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml (original)
+++ tomcat/sandbox/trunk-maven-layout/tomcat-util/pom.xml Wed Sep 17 21:12:33 
2014
@@ -43,17 +43,17 @@
 excludeorg/apache/tomcat/util/net/**/exclude
 excludeorg/apache/tomcat/util/scan/**/exclude
   /excludes
-  textExcludes
-textExcludeorg/apache/tomcat/util/bcel/**/textExclude
-textExcludeorg/apache/tomcat/util/collections/**/textExclude
-textExcludeorg/apache/tomcat/util/descriptor/**/textExclude
-textExcludeorg/apache/tomcat/util/digester/**/textExclude
-textExcludeorg/apache/tomcat/util/http/**/textExclude
-textExcludeorg/apache/tomcat/util/log/**/textExclude
-textExcludeorg/apache/tomcat/util/modeler/**/textExclude
-textExcludeorg/apache/tomcat/util/net/**/textExclude
-textExcludeorg/apache/tomcat/util/scan/**/textExclude
-  /textExcludes
+  testExcludes
+testExcludeorg/apache/tomcat/util/bcel/**/testExclude
+testExcludeorg/apache/tomcat/util/collections/**/testExclude
+testExcludeorg/apache/tomcat/util/descriptor/**/testExclude
+testExcludeorg/apache/tomcat/util/digester/**/testExclude
+testExcludeorg/apache/tomcat/util/http/**/testExclude
+testExcludeorg/apache/tomcat/util/log/**/testExclude
+testExcludeorg/apache/tomcat/util/modeler/**/testExclude
+testExcludeorg/apache/tomcat/util/net/**/testExclude
+testExcludeorg/apache/tomcat/util/scan/**/testExclude
+  /testExcludes
 /configuration
   /plugin
 /plugins



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



svn commit: r1625837 - /tomcat/tc6.0.x/trunk/BUILDING.txt

2014-09-17 Thread kkolinko
Author: kkolinko
Date: Wed Sep 17 22:17:28 2014
New Revision: 1625837

URL: http://svn.apache.org/r1625837
Log:
CTR: Documentation
Add a note about creating release builds on non-Windows platforms.
It is port of r1553126.

Modified:
tomcat/tc6.0.x/trunk/BUILDING.txt

Modified: tomcat/tc6.0.x/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/BUILDING.txt?rev=1625837r1=1625836r2=1625837view=diff
==
--- tomcat/tc6.0.x/trunk/BUILDING.txt (original)
+++ tomcat/tc6.0.x/trunk/BUILDING.txt Wed Sep 17 22:17:28 2014
@@ -164,5 +164,11 @@ For a quick rebuild of only modified cod
 
 (7) Building a release:
 
+A full release includes the Windows installer which requires a Windows
+environment to be available to create it. If not building in a Windows
+environment, the build scripts assume that WINE is available. If this is 
not
+the case, the skip.installer property may be set to skip the creation of 
the
+Windows installer.
+
 cd ${tomcat.source}
 ant -f dist.xml release



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



  1   2   >