JDK-8020641 : Clean up some code style in recent BigInteger contributions
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.math
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-07-16
  • Updated: 2013-08-10
  • Resolved: 2013-07-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b102Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Some minor cleanup to adhere better to Java coding conventions.
Comments
In particular, the three-way branch in the method below was misleading indentation: 1369 /** 1370 * Returns a BigInteger whose value is {@code (this * val)}. 1371 * 1372 * @param val value to be multiplied by this BigInteger. 1373 * @return {@code this * val} 1374 */ 1375 public BigInteger multiply(BigInteger val) { 1376 if (val.signum == 0 || signum == 0) 1377 return ZERO; 1378 1379 int xlen = mag.length; 1380 int ylen = val.mag.length; 1381 1382 if ((xlen < KARATSUBA_THRESHOLD) || (ylen < KARATSUBA_THRESHOLD)) 1383 { 1384 int resultSign = signum == val.signum ? 1 : -1; 1385 if (val.mag.length == 1) { 1386 return multiplyByInt(mag,val.mag[0], resultSign); 1387 } 1388 if(mag.length == 1) { 1389 return multiplyByInt(val.mag,mag[0], resultSign); 1390 } 1391 int[] result = multiplyToLen(mag, xlen, 1392 val.mag, ylen, null); 1393 result = trustedStripLeadingZeroInts(result); 1394 return new BigInteger(result, resultSign); 1395 } 1396 else 1397 if ((xlen < TOOM_COOK_THRESHOLD) && (ylen < TOOM_COOK_THRESHOLD)) 1398 return multiplyKaratsuba(this, val); 1399 else 1400 return multiplyToomCook3(this, val); 1401 }
16-07-2013