On 18/08/2015 12:58, Konstantin Kolinko wrote:
> 2015-08-18 14:44 GMT+03:00 <[email protected]>:
>> Author: markt
>> Date: Tue Aug 18 11:44:43 2015
>> New Revision: 1696404
>>
>> URL: http://svn.apache.org/r1696404
>> Log:
>> Remove unused code
>>
>> Modified:
>>
>> tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawMessage.java
>>
>> Modified:
>> tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawMessage.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawMessage.java?rev=1696404&r1=1696403&r2=1696404&view=diff
>> ==============================================================================
>> ---
>> tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawMessage.java
>> (original)
>> +++
>> tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawMessage.java
>> Tue Aug 18 11:44:43 2015
>> @@ -37,7 +37,6 @@ public final class DrawMessage {
>> private byte colorR, colorG, colorB, colorA;
>> private double thickness;
>> private double x1, y1, x2, y2;
>> - private boolean lastInChain;
>>
>> /**
>> * The type.
>> @@ -108,23 +107,10 @@ public final class DrawMessage {
>> this.y2 = y2;
>> }
>>
>> - /**
>> - * Specifies if this DrawMessage is the last one in a chain
>> - * (e.g. a chain of brush paths).<br>
>> - * Currently it is unused.
>> - */
>> - public boolean isLastInChain() {
>> - return lastInChain;
>> - }
>> - public void setLastInChain(boolean lastInChain) {
>> - this.lastInChain = lastInChain;
>> - }
>> -
>> -
>>
>> public DrawMessage(int type, byte colorR, byte colorG, byte colorB,
>> byte colorA, double thickness, double x1, double x2, double y1,
>> - double y2, boolean lastInChain) {
>> + double y2) {
>>
>> this.type = type;
>> this.colorR = colorR;
>> @@ -136,7 +122,6 @@ public final class DrawMessage {
>> this.x2 = x2;
>> this.y1 = y1;
>> this.y2 = y2;
>> - this.lastInChain = lastInChain;
>> }
>>
>>
>> @@ -203,8 +188,7 @@ public final class DrawMessage {
>>
>> return type + "," + (colorR & 0xFF) + "," + (colorG & 0xFF) + ","
>> + (colorB & 0xFF) + "," + (colorA & 0xFF) + "," + thickness
>> - + "," + x1 + "," + y1 + "," + x2 + "," + y2 + ","
>> - + (lastInChain ? "1" : "0");
>> + + "," + x1 + "," + y1 + "," + x2 + "," + y2;
>> }
>>
>> public static DrawMessage parseFromString(String str)
>> @@ -214,7 +198,6 @@ public final class DrawMessage {
>> byte[] colors = new byte[4];
>> double thickness;
>> double[] coords = new double[4];
>> - boolean last;
>>
>> try {
>> String[] elements = str.split(",");
>> @@ -238,15 +221,13 @@ public final class DrawMessage {
>> + coords[i]);
>> }
>>
>> - last = !"0".equals(elements[10]);
>> -
>
> I think the above condition can have either value. It is not always
> false. As such, I think removing the "last" flag below is wrong.
>
> You can remove getter/setter in DrawMessage, but DrawMessage
> constructor argument (as passed below) is used.
>
> The value of that property is used (directly, without calling a
> getter) in the following fragment above:
It is only ever used to construct the wire representation from a
DrawMessage and when constructing a DrawMessage from the wire
representation.
I don't see it being used outside of those two uses so I see no
requirement to keep it.
Mark
>>> - + "," + x1 + "," + y1 + "," + x2 + "," + y2 + ","
>>> - + (lastInChain ? "1" : "0");
>>> + + "," + x1 + "," + y1 + "," + x2 + "," + y2;
>
>
>> } catch (RuntimeException ex) {
>> throw new ParseException(ex);
>> }
>>
>> DrawMessage m = new DrawMessage(type, colors[0], colors[1],
>> colors[2], colors[3], thickness, coords[0], coords[2],
>> - coords[1], coords[3], last);
>> + coords[1], coords[3]);
>>
>> return m;
>> }
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]