tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1820781 - in /tomcat/trunk/java/org/apache: catalina/mapper/Mapper.java jasper/compiler/ELParser.java jasper/compiler/JspUtil.java
Date Wed, 10 Jan 2018 20:17:13 GMT
Author: markt
Date: Wed Jan 10 20:17:12 2018
New Revision: 1820781

URL: http://svn.apache.org/viewvc?rev=1820781&view=rev
Log:
SpotBugs
Potential overflow in averaging (v. unlikely but an easy fix...)

Modified:
    tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java
    tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java

Modified: tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java?rev=1820781&r1=1820780&r2=1820781&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mapper/Mapper.java Wed Jan 10 20:17:12 2018
@@ -1207,7 +1207,7 @@ public final class Mapper {
 
         int i = 0;
         while (true) {
-            i = (b + a) / 2;
+            i = (b + a) >>> 1;
             int result = compare(name, start, end, map[i].name);
             if (result == 1) {
                 a = i;
@@ -1262,7 +1262,7 @@ public final class Mapper {
 
         int i = 0;
         while (true) {
-            i = (b + a) / 2;
+            i = (b + a) >>> 1;
             int result = compareIgnoreCase(name, start, end, map[i].name);
             if (result == 1) {
                 a = i;
@@ -1309,7 +1309,7 @@ public final class Mapper {
 
         int i = 0;
         while (true) {
-            i = (b + a) / 2;
+            i = (b + a) >>> 1;
             int result = name.compareTo(map[i].name);
             if (result > 0) {
                 a = i;

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=1820781&r1=1820780&r2=1820781&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java Wed Jan 10 20:17:12 2018
@@ -186,7 +186,7 @@ public class ELParser {
         int i = 0;
         int j = reservedWords.length;
         while (i < j) {
-            int k = (i + j) / 2;
+            int k = (i + j) >>> 1;
             int result = reservedWords[k].compareTo(id);
             if (result == 0) {
                 return true;

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=1820781&r1=1820780&r2=1820781&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Wed Jan 10 20:17:12 2018
@@ -864,7 +864,7 @@ public class JspUtil {
         int i = 0;
         int j = javaKeywords.length;
         while (i < j) {
-            int k = (i + j) / 2;
+            int k = (i + j) >>> 1;
             int result = javaKeywords[k].compareTo(key);
             if (result == 0) {
                 return true;



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


Mime
View raw message