Skip to content

Commit 1878218

Browse files
committed
warning removal
1 parent 7c547c0 commit 1878218

28 files changed

+1704
-1710
lines changed

sources/net.sf.j2s.java.core/src/java/text/ParseException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
* @see java.text.FieldPosition
5050
* @author Mark Davis
5151
*/
52+
@SuppressWarnings("serial")
5253
public
5354
class ParseException extends Exception {
5455

sources/net.sf.j2s.java.core/src/java/util/Calendar.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -881,28 +881,6 @@ public abstract class Calendar implements Cloneable, Comparable<Calendar> {
881881
// removed. In JDK 1.1.6 we write a format compatible with version 2.
882882
static final int currentSerialVersion = 1;
883883

884-
/**
885-
* The version of the serialized data on the stream. Possible values:
886-
* <dl>
887-
* <dt><b>0</b> or not present on stream</dt>
888-
* <dd>
889-
* JDK 1.1.5 or earlier.
890-
* </dd>
891-
* <dt><b>1</b></dt>
892-
* <dd>
893-
* JDK 1.1.6 or later. Writes a correct 'time' value
894-
* as well as compatible values for other fields. This is a
895-
* transitional format.
896-
* </dd>
897-
* </dl>
898-
* When streaming out this class, the most recent format
899-
* and the highest allowable <code>serialVersionOnStream</code>
900-
* is written.
901-
* @serial
902-
* @since JDK1.1.6
903-
*/
904-
private int serialVersionOnStream = currentSerialVersion;
905-
906884
// Proclaim serialization compatibility with JDK 1.1
907885
static final long serialVersionUID = -1807547505821590642L;
908886

sources/net.sf.j2s.java.core/src/java/util/Collections.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,7 @@ public static <E> SortedSet<E> checkedSortedSet(SortedSet<E> s, Class<E> type) {
25032503
* when c or elements is null, or elements contains one or more
25042504
* null elements and c doesn't support null elements
25052505
*/
2506+
@SuppressWarnings("unchecked")
25062507
public static <T> boolean addAll(Collection<? super T> c, T... a) {
25072508
boolean modified = false;
25082509
for (int i = 0; i < a.length; i++) {

sources/net.sf.j2s.java.core/src/java/util/Formatter.java

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@
18231823
* @author Iris Clark
18241824
* @since 1.5
18251825
*/
1826+
@SuppressWarnings({"rawtypes", "unchecked", "unused"})
18261827
public final class Formatter implements Flushable {
18271828
Appendable a;
18281829
private Locale l;
@@ -4210,35 +4211,14 @@ private void getString(int type, double value, int prec) {
42104211

42114212
String sNoRound = ""; // d
42124213
String sRound = ""; // e
4213-
boolean j2sCompilerOK = true;
4214-
// a prec of 3 in scientific is "1.234e3" in Java and JavaScript
4215-
/**
4216-
* @j2sNative
4217-
*
4218-
* if (typeof j2sCompilerOK != "undefined") {
4219-
* sNoRound= value.toExponential(); sRound =
4220-
* value.toExponential(prec);
4221-
*
4222-
* } else {
4223-
* d = b.toExponential();
4224-
* e = b.toExponential(c);
4225-
* }
4226-
*
4227-
*/
4228-
{
4229-
}
42304214
exp = getExp(sNoRound);
42314215
expr = getExp(sRound);
42324216
if (type == GENERAL) {
42334217
// use scientific(x, prec - 1);
42344218
/**
42354219
* @j2sNative
42364220
*
4237-
* if (typeof j2sCompilerOK != "undefined") {
42384221
* sRound = value.toExponential(prec-1);
4239-
* } else {
4240-
* e = b.toExponential(c-1);
4241-
* }
42424222
*
42434223
*/
42444224
{
@@ -4250,12 +4230,7 @@ private void getString(int type, double value, int prec) {
42504230
/**
42514231
* @j2sNative
42524232
*
4253-
* if (typeof j2sCompilerOK != "undefined") {
42544233
* sRound = value.toFixed(); sNoRound = value.toFixed(prec);
4255-
* } else {
4256-
* e = b.toFixed();
4257-
* d = b.toFixed(c);
4258-
* }
42594234
*
42604235
*/
42614236
{
@@ -4269,7 +4244,7 @@ private void getString(int type, double value, int prec) {
42694244
switch (type) {
42704245
case SCIENTIFIC:
42714246
// check for 1.2e3 -> 1.2e+3
4272-
if (sRound.indexOf("e-") < 0)
4247+
if (sRound.indexOf("e-") < 0 && sRound.indexOf("e") >= 0)
42734248
sRound = sRound.substring(0, pt + 1) + "+" + sRound.substring(pt + 1);
42744249
// check for 1.2e+3 or 1.2e-3 --> 1.2e+03 1.2e-03
42754250
if (pt == sRound.length() - 2)
@@ -4289,11 +4264,7 @@ private void getString(int type, double value, int prec) {
42894264
/**
42904265
* @j2sNative
42914266
*
4292-
* if (typeof j2sCompilerOK != "undefined") {
4293-
* sRound = ParseFloat(sRound).toFixed(ndig);
4294-
* } else {
4295-
* e = ParseFloat(e).toFixed(g);
4296-
* }
4267+
* sRound = parseFloat(sRound).toFixed(ndig);
42974268
*
42984269
*/
42994270
{

sources/net.sf.j2s.java.core/src/java/util/ListResourceBundle.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public Enumeration<String> getKeys() {
6161
return new Enumeration<String>() {
6262
Enumeration<String> local = table.keys();
6363

64-
@SuppressWarnings("unchecked")
6564
Enumeration<String> pEnum = (Enumeration<String>) parent.getKeys();
6665

6766
String nextElement;

sources/net.sf.j2s.java.core/src/java/util/Properties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
* @author Xueming Shen
113113
* @since JDK1.0
114114
*/
115+
@SuppressWarnings({"rawtypes", "unchecked"})
115116
public
116117
class Properties extends Hashtable<Object,Object> {
117118
/**

sources/net.sf.j2s.java.core/src/java/util/PropertyResourceBundle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
* @see Properties
123123
* @since JDK1.1
124124
*/
125+
@SuppressWarnings({"rawtypes", "unchecked"})
125126
public class PropertyResourceBundle extends ResourceBundle {
126127

127128

sources/net.sf.j2s.java.core/src/java/util/ResourceBundle.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
import java.util.MissingResourceException;
7272
import java.util.Set;
7373

74-
import javajs.J2SRequireImport;
7574
//import swingjs.JSToolkit;
7675
import swingjs.api.Interface;
7776

@@ -2513,8 +2512,6 @@ public ResourceBundle newBundle(String baseName, Locale locale,
25132512

25142513

25152514
InputStream stream = null;
2516-
// SwingJS - we just get the resource as a string here
2517-
// J2S compiler bug converts these variables to a b c d e
25182515
stream = (data == null ? null : new BufferedInputStream(
25192516
new ByteArrayInputStream(data.getBytes())));
25202517
// // try {
@@ -2542,13 +2539,13 @@ public ResourceBundle newBundle(String baseName, Locale locale,
25422539
// // } catch (IOException e) {
25432540
// // throw (IOException) e.getException();
25442541
// // }
2545-
if (stream != null) {
2542+
// if (stream != null) {
25462543
try {
25472544
bundle = newPropertyBundle(stream);
25482545
} finally {
25492546
stream.close();
25502547
}
2551-
}
2548+
// }
25522549
} else {
25532550
throw new IllegalArgumentException("unknown format: " + format);
25542551
}

0 commit comments

Comments
 (0)