Author: markt Date: Mon Jan 15 21:49:15 2018 New Revision: 1821197 URL: http://svn.apache.org/viewvc?rev=1821197&view=rev Log: Add a base class with a view to aligning and pulling up the common code where possible.
Added: tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java (with props) Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java Added: tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java?rev=1821197&view=auto ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java (added) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java Mon Jan 15 21:49:15 2018 @@ -0,0 +1,28 @@ +/* + * 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.buf; + +import java.io.Serializable; + +/** + * Base class for the *Chunk implementation to reduce duplication. + */ +public abstract class AbstractChunk implements Cloneable, Serializable { + + private static final long serialVersionUID = 1L; + +} Propchange: tomcat/trunk/java/org/apache/tomcat/util/buf/AbstractChunk.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=1821197&r1=1821196&r2=1821197&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java Mon Jan 15 21:49:15 2018 @@ -19,7 +19,6 @@ package org.apache.tomcat.util.buf; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.Serializable; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -66,7 +65,7 @@ import java.nio.charset.StandardCharsets * @author Costin Manolache * @author Remy Maucherat */ -public final class ByteChunk implements Cloneable, Serializable { +public final class ByteChunk extends AbstractChunk { private static final long serialVersionUID = 1L; Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java?rev=1821197&r1=1821196&r2=1821197&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java Mon Jan 15 21:49:15 2018 @@ -17,7 +17,6 @@ package org.apache.tomcat.util.buf; import java.io.IOException; -import java.io.Serializable; /** * Utilities to manipulate char chunks. While String is the easiest way to @@ -29,7 +28,7 @@ import java.io.Serializable; * @author Costin Manolache * @author Remy Maucherat */ -public final class CharChunk implements Cloneable, Serializable, CharSequence { +public final class CharChunk extends AbstractChunk implements CharSequence { private static final long serialVersionUID = 1L; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org