This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 1ee4fe4ac8a0cee8fc3ef68b308d8fe60ff0a599 Author: Josh Tynjala <[email protected]> AuthorDate: Thu Jun 20 10:14:15 2024 -0700 fix use of deprecated constructors for primitive types like Integer/Double/etc. Replace with Integer.valueOf() and similar functions Deprecation warning says that they are deprecated as of Java 9 (we're targeting 11), and they may be removed in the future. Docs say that the valueOf() functions are significantly faster. Double win! --- .../compiler/config/ConfigurationBuffer.java | 2 +- .../royale/compiler/config/Configurator.java | 4 +- .../src/main/java/jburg/burg/JBurgGenerator.java | 2 +- .../codegen/mxml/royale/MXMLRoyaleEmitter.java | 2 +- .../codegen/mxml/royale/MXMLRoyalePublisher.java | 2 +- .../driver/js/royale/JSCSSCompilationSession.java | 24 ++-- .../PeepholeOptimizerMethodBodyVisitor.java | 4 +- .../internal/as/codegen/ABCGeneratingReducer.java | 4 +- .../databinding/BindingDestinationMaker.java | 2 +- .../compiler/internal/css/codegen/CSSReducer.java | 8 +- .../compiler/internal/parsing/FakingReader.java | 8 +- .../compiler/internal/projects/RoyaleProject.java | 8 +- compiler/src/test/java/as/ASDateTests.java | 8 +- .../internal/css/CSSArrayPropertyValueTests.java | 2 +- .../internal/css/CSSNumberPropertyValueTests.java | 18 +-- .../flash/tools/debugger/concrete/DManager.java | 8 +- .../flash/tools/debugger/concrete/DModule.java | 6 +- .../java/flash/tools/debugger/concrete/DValue.java | 2 +- .../tools/debugger/concrete/PlayerSession.java | 16 +-- .../debugger/concrete/PlayerSessionManager.java | 2 +- .../debugger/expression/AS3DebuggerReducer.java | 54 +++---- .../java/flash/tools/debugger/expression/ECMA.java | 8 +- .../java/royale/tools/debugger/cli/DebugCLI.java | 156 ++++++++++----------- .../royale/tools/debugger/cli/FaultActions.java | 6 +- .../royale/tools/debugger/cli/IntProperties.java | 2 +- .../royale/tools/debugger/cli/StringIntArray.java | 2 +- .../flex2/compiler/config/ConfigurationBuffer.java | 2 +- .../flex2/tools/oem/internal/OEMConfiguration.java | 12 +- .../formatter/config/ConfigurationBuffer.java | 2 +- .../royale/linter/config/ConfigurationBuffer.java | 2 +- .../org/apache/royale/test/ant/report/Report.java | 8 +- .../org/apache/royale/test/ant/report/Reports.java | 10 +- .../src/main/java/flash/swf/ActionFactory.java | 18 +-- swfutils/src/main/java/flash/swf/DebugDecoder.java | 4 +- swfutils/src/main/java/flash/swf/Dictionary.java | 8 +- .../src/main/java/flash/swf/MovieMetaData.java | 20 +-- swfutils/src/main/java/flash/util/IntMap.java | 2 +- 37 files changed, 224 insertions(+), 224 deletions(-) diff --git a/compiler-common/src/main/java/org/apache/royale/compiler/config/ConfigurationBuffer.java b/compiler-common/src/main/java/org/apache/royale/compiler/config/ConfigurationBuffer.java index cd4566298..c9ed7c1f2 100644 --- a/compiler-common/src/main/java/org/apache/royale/compiler/config/ConfigurationBuffer.java +++ b/compiler-common/src/main/java/org/apache/royale/compiler/config/ConfigurationBuffer.java @@ -1160,7 +1160,7 @@ public final class ConfigurationBuffer public void addPosition(String var, int iStart, int iEnd) { - positions.add(new Object[] {var, new Integer(iStart), new Integer(iEnd)}); + positions.add(new Object[] {var, Integer.valueOf(iStart), Integer.valueOf(iEnd)}); } public List<Object[]> getPositions() diff --git a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java index bb90ae692..e8fd19566 100644 --- a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java +++ b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java @@ -2480,7 +2480,7 @@ public class Configurator implements ICompilerSettings, IConfigurator, ICompiler */ public void setDefaultBackgroundColor(int color) { - args.put(DEFAULT_BACKGROUND_COLOR, new Integer(color)); + args.put(DEFAULT_BACKGROUND_COLOR, Integer.valueOf(color)); isConfigurationDirty = true; } @@ -2494,7 +2494,7 @@ public class Configurator implements ICompilerSettings, IConfigurator, ICompiler */ public void setDefaultFrameRate(int rate) { - args.put(DEFAULT_FRAME_RATE, new Integer(rate)); + args.put(DEFAULT_FRAME_RATE, Integer.valueOf(rate)); isConfigurationDirty = true; } diff --git a/compiler-jburg-types/src/main/java/jburg/burg/JBurgGenerator.java b/compiler-jburg-types/src/main/java/jburg/burg/JBurgGenerator.java index a20c056bf..d7b75a6a8 100644 --- a/compiler-jburg-types/src/main/java/jburg/burg/JBurgGenerator.java +++ b/compiler-jburg-types/src/main/java/jburg/burg/JBurgGenerator.java @@ -1279,7 +1279,7 @@ public class JBurgGenerator implements JBurgTokenTypes if ( cost_spec.getType() == LITERAL_COST_SPEC ) { - return new Integer(costText); + return Integer.valueOf(costText); } else if ( JBurgGenerator.this.manifestConstants.containsKey(costText) ) { diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java index 46c1b5e9b..55c3e0200 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java @@ -1938,7 +1938,7 @@ public class MXMLRoyaleEmitter extends MXMLEmitter implements break; } assert i < n; - sb.append("[" + new Integer(i).toString() + "]" ); + sb.append("[" + Integer.valueOf(i).toString() + "]" ); parentNode = childNode; } if (isXML) diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java index c59511637..ed9f7bdb6 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java @@ -84,7 +84,7 @@ public class MXMLRoyalePublisher extends JSPublisher implements IJSRoyalePublish @Override public int compare(DependencyRecord o1, DependencyRecord o2) { - return new Integer(o1.lineNumber).compareTo(o2.lineNumber); + return Integer.valueOf(o1.lineNumber).compareTo(o2.lineNumber); } } diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java index fa81af2f2..7df593e7b 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java @@ -454,16 +454,16 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (val instanceof CSSColorPropertyValue) { - line.append(new Integer(((CSSColorPropertyValue)val).getColorAsInt())); + line.append(Integer.valueOf(((CSSColorPropertyValue)val).getColorAsInt())); } else if (val instanceof CSSRgbColorPropertyValue) { - line.append(new Integer(((CSSRgbColorPropertyValue)val).getColorAsInt())); + line.append(Integer.valueOf(((CSSRgbColorPropertyValue)val).getColorAsInt())); } else if (value instanceof CSSRgbaColorPropertyValue) { //todo: handle alpha in the RGBA ? - line.append(new Long(((CSSRgbaColorPropertyValue)value).getColorAsLong())); + line.append(Long.valueOf(((CSSRgbaColorPropertyValue)value).getColorAsLong())); } else if (val instanceof CSSKeywordPropertyValue) { @@ -478,7 +478,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (val instanceof CSSNumberPropertyValue) { - line.append(new Double(((CSSNumberPropertyValue)val).getNumber().doubleValue())); + line.append(Double.valueOf(((CSSNumberPropertyValue)val).getNumber().doubleValue())); } else if (val instanceof CSSURLAndFormatPropertyValue) { @@ -512,16 +512,16 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (val instanceof CSSColorPropertyValue) { - line.append(new Integer(((CSSColorPropertyValue)val).getColorAsInt())); + line.append(Integer.valueOf(((CSSColorPropertyValue)val).getColorAsInt())); } else if (val instanceof CSSRgbColorPropertyValue) { - line.append(new Integer(((CSSRgbColorPropertyValue)val).getColorAsInt())); + line.append(Integer.valueOf(((CSSRgbColorPropertyValue)val).getColorAsInt())); } else if (val instanceof CSSRgbaColorPropertyValue) { //todo: handle alpha in the RGBA ? - line.append(new Long(((CSSRgbaColorPropertyValue)val).getColorAsLong())); + line.append(Long.valueOf(((CSSRgbaColorPropertyValue)val).getColorAsLong())); } else if (val instanceof CSSKeywordPropertyValue) { @@ -536,7 +536,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (val instanceof CSSNumberPropertyValue) { - line.append(new Double(((CSSNumberPropertyValue)val).getNumber().doubleValue())); + line.append(Double.valueOf(((CSSNumberPropertyValue)val).getNumber().doubleValue())); } else if (val instanceof CSSURLAndFormatPropertyValue) { @@ -559,16 +559,16 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (value instanceof CSSColorPropertyValue) { - line.append(new Integer(((CSSColorPropertyValue)value).getColorAsInt())); + line.append(Integer.valueOf(((CSSColorPropertyValue)value).getColorAsInt())); } else if (value instanceof CSSRgbColorPropertyValue) { - line.append(new Integer(((CSSRgbColorPropertyValue)value).getColorAsInt())); + line.append(Integer.valueOf(((CSSRgbColorPropertyValue)value).getColorAsInt())); } else if (value instanceof CSSRgbaColorPropertyValue) { //todo: handle alpha in the RGBA ? - line.append(new Long(((CSSRgbaColorPropertyValue)value).getColorAsLong())); + line.append(Long.valueOf(((CSSRgbaColorPropertyValue)value).getColorAsLong())); } else if (value instanceof CSSKeywordPropertyValue) { @@ -583,7 +583,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession } else if (value instanceof CSSNumberPropertyValue) { - line.append(new Double(((CSSNumberPropertyValue)value).getNumber().doubleValue())); + line.append(Double.valueOf(((CSSNumberPropertyValue)value).getNumber().doubleValue())); } else if (value instanceof CSSFunctionCallPropertyValue) { diff --git a/compiler/src/main/java/org/apache/royale/abc/optimize/PeepholeOptimizerMethodBodyVisitor.java b/compiler/src/main/java/org/apache/royale/abc/optimize/PeepholeOptimizerMethodBodyVisitor.java index 40449745b..718755bdc 100644 --- a/compiler/src/main/java/org/apache/royale/abc/optimize/PeepholeOptimizerMethodBodyVisitor.java +++ b/compiler/src/main/java/org/apache/royale/abc/optimize/PeepholeOptimizerMethodBodyVisitor.java @@ -715,14 +715,14 @@ public class PeepholeOptimizerMethodBodyVisitor extends DelegatingMethodBodyVisi case OP_pushbyte: { // replace pushbyte, convert d with pushdouble - should be faster - replace(1, InstructionFactory.getInstruction(OP_pushdouble, new Double(convertByteImmediateToDouble(prev.getImmediate())))); + replace(1, InstructionFactory.getInstruction(OP_pushdouble, Double.valueOf(convertByteImmediateToDouble(prev.getImmediate())))); break; } case OP_pushint: case OP_pushuint: { // replace pushint , convert d with pushdouble - should be faster - replace(1, InstructionFactory.getInstruction(OP_pushdouble, new Double(((Number)prev.getOperand(0)).doubleValue()))); + replace(1, InstructionFactory.getInstruction(OP_pushdouble, Double.valueOf(((Number)prev.getOperand(0)).doubleValue()))); break; } case OP_pushdouble: diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java index e488cfa78..e07c50d1c 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java @@ -5735,7 +5735,7 @@ public class ABCGeneratingReducer caseOffset = lookupSwitchInfo.minCase; lookupSwitchInfo.minCase = 0; lookupSwitchInfo.maxCase = lookupSwitchInfo.maxCase - caseOffset; - result.addInstruction(OP_pushint, new Integer(lookupSwitchInfo.minCase + 1)); + result.addInstruction(OP_pushint, Integer.valueOf(lookupSwitchInfo.minCase + 1)); result.addInstruction(OP_add_i); } @@ -5764,7 +5764,7 @@ public class ABCGeneratingReducer // a constant of value 90000 was in a SWC as a double even though // the type of the constant was int if (caseValue instanceof Double) - caseValue = new Integer(((Double)caseValue).intValue()); + caseValue = Integer.valueOf(((Double)caseValue).intValue()); assert (caseValue instanceof Integer) : "reduce_lookup_switchStmt called on non integer case value"; final int index = (Integer)caseValue - caseOffset; // if there is already a non-default value for this diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingDestinationMaker.java b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingDestinationMaker.java index 6ffc3fa3b..9b87c7186 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingDestinationMaker.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/BindingDestinationMaker.java @@ -175,7 +175,7 @@ public class BindingDestinationMaker arrayNode.setSourcePath(parent.getSourcePath()); arrayNode.setColumn(parent.getColumn()); arrayNode.setLine(parent.getLine()); - NumericLiteralNode indexNode = new NumericLiteralNode(new Integer(index).toString()); + NumericLiteralNode indexNode = new NumericLiteralNode(Integer.valueOf(index).toString()); indexNode.setSourcePath(parent.getSourcePath()); indexNode.setColumn(parent.getColumn()); indexNode.setLine(parent.getLine()); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSReducer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSReducer.java index 4f266849a..5e928f757 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSReducer.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/css/codegen/CSSReducer.java @@ -454,15 +454,15 @@ public class CSSReducer implements ICSSCodeGenResult } else if (value instanceof CSSColorPropertyValue) { - valueInstructions.addInstruction(ABCConstants.OP_pushint, new Integer(((CSSColorPropertyValue)value).getColorAsInt())); + valueInstructions.addInstruction(ABCConstants.OP_pushint, Integer.valueOf(((CSSColorPropertyValue)value).getColorAsInt())); } else if (value instanceof CSSRgbColorPropertyValue) { - valueInstructions.addInstruction(ABCConstants.OP_pushint, new Integer(((CSSRgbColorPropertyValue)value).getColorAsInt())); + valueInstructions.addInstruction(ABCConstants.OP_pushint, Integer.valueOf(((CSSRgbColorPropertyValue)value).getColorAsInt())); } else if (value instanceof CSSRgbaColorPropertyValue) { - valueInstructions.addInstruction(ABCConstants.OP_pushuint, new Long(((CSSRgbaColorPropertyValue)value).getColorAsLong())); + valueInstructions.addInstruction(ABCConstants.OP_pushuint, Long.valueOf(((CSSRgbaColorPropertyValue)value).getColorAsLong())); } else if (value instanceof CSSKeywordPropertyValue) { @@ -481,7 +481,7 @@ public class CSSReducer implements ICSSCodeGenResult if (numValue.getUnit().equals("%")) valueInstructions.addInstruction(ABCConstants.OP_pushstring, numValue.toString()); else - valueInstructions.addInstruction(ABCConstants.OP_pushdouble, new Double(numValue.getNumber().doubleValue())); + valueInstructions.addInstruction(ABCConstants.OP_pushdouble, Double.valueOf(numValue.getNumber().doubleValue())); } else if (value instanceof CSSFunctionCallPropertyValue) { diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/FakingReader.java b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/FakingReader.java index fd670016a..09df0ebc4 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/FakingReader.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/FakingReader.java @@ -133,8 +133,8 @@ public class FakingReader extends Reader // { // // This is a valid starting character for an identifier, so // // "a" is a suitable equivalent -// fDifficultCharacterOffsets.add(new Integer(fOffset + i - off)); -// fDifficultCharacters.add(new Character(cbuf[i])); +// fDifficultCharacterOffsets.add(Integer.valueOf(fOffset + i - off)); +// fDifficultCharacters.add(Character.valueOf(cbuf[i])); // cbuf[i] = 'a'; // } // else if (cbuf[i] != '_' && @@ -145,8 +145,8 @@ public class FakingReader extends Reader // // This is not a valid starting character for an identifier, but // // is a valid following character for an identifier, so "0" is a // // suitable equivalent -// fDifficultCharacterOffsets.add(new Integer(fOffset + i - off)); -// fDifficultCharacters.add(new Character(cbuf[i])); +// fDifficultCharacterOffsets.add(Integer.valueOf(fOffset + i - off)); +// fDifficultCharacters.add(Character.valueOf(cbuf[i])); // cbuf[i] = '0'; // } // } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java index 287b8ddcb..638f35bc1 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java @@ -2628,14 +2628,14 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile String qname = cqname + ":" + def.getQualifiedName(); if (!apiMap.containsKey(qname)) { - apiMap.put(qname, new Integer(1)); + apiMap.put(qname, Integer.valueOf(1)); return; } else { Integer counter = apiMap.get(qname); int newCounter = counter.intValue() + 1; - apiMap.put(qname, new Integer(newCounter)); + apiMap.put(qname, Integer.valueOf(newCounter)); } } @@ -2653,14 +2653,14 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile String qname = def.getQualifiedName(); if (!apiMap.containsKey(qname)) { - apiMap.put(qname, new Integer(1)); + apiMap.put(qname, Integer.valueOf(1)); return; } else { Integer counter = apiMap.get(qname); int newCounter = counter.intValue() + 1; - apiMap.put(qname, new Integer(newCounter)); + apiMap.put(qname, Integer.valueOf(newCounter)); } } } diff --git a/compiler/src/test/java/as/ASDateTests.java b/compiler/src/test/java/as/ASDateTests.java index a4efd718f..44ade5ced 100644 --- a/compiler/src/test/java/as/ASDateTests.java +++ b/compiler/src/test/java/as/ASDateTests.java @@ -34,8 +34,8 @@ public class ASDateTests extends ASFeatureTestsBase private String setTimeZone(String s) { TimeZone tz = TimeZone.getDefault(); - System.out.println("tzoffset is " + new Integer(tz.getOffset(new Date().getTime()) / 3600000).toString()); - String offsetString = new Integer(tz.getOffset(new Date().getTime()) / 3600000).toString(); + System.out.println("tzoffset is " + Integer.valueOf(tz.getOffset(new Date().getTime()) / 3600000).toString()); + String offsetString = Integer.valueOf(tz.getOffset(new Date().getTime()) / 3600000).toString(); if (offsetString.length() == 2) offsetString = offsetString.substring(0,1) + 0 + offsetString.substring(1, 2); if(offsetString.charAt(0) != '-') @@ -50,8 +50,8 @@ public class ASDateTests extends ASFeatureTestsBase private String setTimeZoneOffsetMinutes(String s) { TimeZone tz = TimeZone.getDefault(); - System.out.println("tzoffset is " + new Integer(tz.getOffset(new Date().getTime()) / 3600000).toString()); - String offsetString = new Integer(tz.getOffset(new Date().getTime()) / -60000).toString(); + System.out.println("tzoffset is " + Integer.valueOf(tz.getOffset(new Date().getTime()) / 3600000).toString()); + String offsetString = Integer.valueOf(tz.getOffset(new Date().getTime()) / -60000).toString(); if (!hasFlashPlayerGlobal) offsetString = "-480"; System.out.println("offset in minutes is " + offsetString); diff --git a/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSArrayPropertyValueTests.java b/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSArrayPropertyValueTests.java index 8844881a2..906efc8eb 100644 --- a/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSArrayPropertyValueTests.java +++ b/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSArrayPropertyValueTests.java @@ -82,7 +82,7 @@ public class CSSArrayPropertyValueTests extends CSSPropertyValueTests { assertThat("element 0" , ((CSSColorPropertyValue)elements.get(0)).getText() , is( "#FFFFFF" ) ); assertThat("element 1" , ((CSSStringPropertyValue)elements.get(1)).getValue() , is( "String" ) ); assertThat("element 2" , ((CSSColorPropertyValue)elements.get(2)).getText() , is( "Red" ) ); - assertThat("element 3" , ((CSSNumberPropertyValue)elements.get(3)).getNumber() , is( (Number) new Float(0) ) ); + assertThat("element 3" , ((CSSNumberPropertyValue)elements.get(3)).getNumber() , is( (Number) Float.valueOf(0) ) ); assertThat("element 4" , ((CSSFunctionCallPropertyValue)elements.get(4)).name , is( CSSFunctionCallPropertyValue.EMBED ) ); assertThat("element 5" , ((CSSKeywordPropertyValue)elements.get(5)).getKeyword() , is( "bold" ) ); diff --git a/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSNumberPropertyValueTests.java b/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSNumberPropertyValueTests.java index ac5d93bfd..471632433 100644 --- a/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSNumberPropertyValueTests.java +++ b/compiler/src/test/java/org/apache/royale/compiler/internal/css/CSSNumberPropertyValueTests.java @@ -56,7 +56,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10) ) ); } @Test @@ -70,7 +70,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "px" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10) ) ); } @Test @@ -84,7 +84,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "em" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10) ) ); } @Test @@ -98,7 +98,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "%" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10) ) ); } @Test @@ -112,7 +112,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(-10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(-10) ) ); } @Test @@ -126,7 +126,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10) ) ); } @Test @@ -140,7 +140,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()()" , numberPropertyValue.getNumber(), is( (Number) new Float(.31) ) ); + assertThat("numberPropertyValue.getNumber()()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(.31f) ) ); } @Test @@ -154,7 +154,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(10.31) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(10.31f) ) ); } @Test @@ -168,7 +168,7 @@ public class CSSNumberPropertyValueTests extends CSSPropertyValueTests { CSSNumberPropertyValue numberPropertyValue = numberProperties.get(0); assertThat("numberPropertyValue.getOperator()" , numberPropertyValue.getOperator(), is( CSSModelTreeType.PROPERTY_VALUE ) ); assertThat("numberPropertyValue.getUnit()" , numberPropertyValue.getUnit(), is( "" ) ); - assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) new Float(-10.31) ) ); + assertThat("numberPropertyValue.getNumber()" , numberPropertyValue.getNumber(), is( (Number) Float.valueOf(-10.31f) ) ); } diff --git a/debugger/src/main/java/flash/tools/debugger/concrete/DManager.java b/debugger/src/main/java/flash/tools/debugger/concrete/DManager.java index a8b1c8a7b..31da288b1 100644 --- a/debugger/src/main/java/flash/tools/debugger/concrete/DManager.java +++ b/debugger/src/main/java/flash/tools/debugger/concrete/DManager.java @@ -2310,14 +2310,14 @@ public class DManager implements DProtocolNotifierIF, SourceLocator { } catch (NumberFormatException nfe) { } - value = new Double(dval); + value = Double.valueOf(dval); isPrimitive = true; break; } case DMessage.kBooleanType: { int bval = msg.getByte(); - value = new Boolean((bval == 0) ? false : true); + value = Boolean.valueOf((bval == 0) ? false : true); isPrimitive = true; break; } @@ -2369,7 +2369,7 @@ public class DManager implements DProtocolNotifierIF, SourceLocator { } className = DVariable.classNameFor(cType, false); - value = new Long(oid); + value = Long.valueOf(oid); vType = (isFnc == 0) ? VariableType.OBJECT : VariableType.FUNCTION; break; } @@ -2381,7 +2381,7 @@ public class DManager implements DProtocolNotifierIF, SourceLocator { typeName = (oid == -1) ? "" : msg.getString(); //$NON-NLS-1$ className = DVariable.classNameFor(cType, true); - value = new Long(oid); + value = Long.valueOf(oid); vType = VariableType.MOVIECLIP; break; } diff --git a/debugger/src/main/java/flash/tools/debugger/concrete/DModule.java b/debugger/src/main/java/flash/tools/debugger/concrete/DModule.java index d2577cb6a..1b531db29 100644 --- a/debugger/src/main/java/flash/tools/debugger/concrete/DModule.java +++ b/debugger/src/main/java/flash/tools/debugger/concrete/DModule.java @@ -402,7 +402,7 @@ public class DModule implements SourceFile m_line2Offset.add(null); // add the offset mapping - m_line2Offset.set(firstLine, new Integer(offset)); + m_line2Offset.set(firstLine, Integer.valueOf(offset)); // make sure m_line2Func is big enough for the lines we're about to se m_line2Func.ensureCapacity(lastLine+1); @@ -442,8 +442,8 @@ public class DModule implements SourceFile // add to our function name list if (m_func2FirstLine.get(funcName) == null) { - m_func2FirstLine.put(funcName, new Integer(firstLine)); - m_func2LastLine.put(funcName, new Integer(lastLine)); + m_func2FirstLine.put(funcName, Integer.valueOf(firstLine)); + m_func2LastLine.put(funcName, Integer.valueOf(lastLine)); } } diff --git a/debugger/src/main/java/flash/tools/debugger/concrete/DValue.java b/debugger/src/main/java/flash/tools/debugger/concrete/DValue.java index 2652ba1a1..0c6c4c9df 100644 --- a/debugger/src/main/java/flash/tools/debugger/concrete/DValue.java +++ b/debugger/src/main/java/flash/tools/debugger/concrete/DValue.java @@ -107,7 +107,7 @@ public class DValue implements Value */ public DValue(long id, int isolateId) { - init(VariableType.UNKNOWN, null, null, 0, new Long(id)); + init(VariableType.UNKNOWN, null, null, 0, Long.valueOf(id)); setIsolateId(isolateId); } diff --git a/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSession.java b/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSession.java index 7e26f7e37..37779a81d 100644 --- a/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSession.java +++ b/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSession.java @@ -240,7 +240,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is */ public void setPreference(String pref, int value) { - m_prefs.put(pref, new Integer(value)); + m_prefs.put(pref, Integer.valueOf(value)); mapBack(); // change in console messages? @@ -1991,7 +1991,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is public boolean supportsWatchpoints(int isolateId) { if (m_playerSupportsWatchpoints == null) - m_playerSupportsWatchpoints = new Boolean(getOption("can_set_watchpoints", false, isolateId)); //$NON-NLS-1$ + m_playerSupportsWatchpoints = Boolean.valueOf(getOption("can_set_watchpoints", false, isolateId)); //$NON-NLS-1$ return m_playerSupportsWatchpoints.booleanValue(); } @@ -2003,14 +2003,14 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is public boolean playerCanBreakOnAllExceptions(int isolateId) { if (m_playerCanBreakOnAllExceptions == null) - m_playerCanBreakOnAllExceptions = new Boolean(getOption("can_break_on_all_exceptions", false, isolateId)); //$NON-NLS-1$ + m_playerCanBreakOnAllExceptions = Boolean.valueOf(getOption("can_break_on_all_exceptions", false, isolateId)); //$NON-NLS-1$ return m_playerCanBreakOnAllExceptions.booleanValue(); } public boolean supportsConcurrency(int isolateId) { if (m_playerSupportsConcurrency == null) - m_playerSupportsConcurrency = new Boolean(getOption("concurrent_player", false, isolateId)); //$NON-NLS-1$ + m_playerSupportsConcurrency = Boolean.valueOf(getOption("concurrent_player", false, isolateId)); //$NON-NLS-1$ return m_playerSupportsConcurrency.booleanValue(); } @@ -2027,7 +2027,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is public boolean supportsWideLineNumbers(int isolateId) { if (m_playerSupportsWideLine == null) - m_playerSupportsWideLine = new Boolean(getOption("wide_line_player", false, isolateId)); //$NON-NLS-1$ + m_playerSupportsWideLine = Boolean.valueOf(getOption("wide_line_player", false, isolateId)); //$NON-NLS-1$ return m_playerSupportsWideLine.booleanValue(); } @@ -2044,7 +2044,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is public boolean playerCanCallFunctions(int isolateId) { if (m_playerCanCallFunctions == null) - m_playerCanCallFunctions = new Boolean(getOption("can_call_functions", false, isolateId)); //$NON-NLS-1$ + m_playerCanCallFunctions = Boolean.valueOf(getOption("can_call_functions", false, isolateId)); //$NON-NLS-1$ return m_playerCanCallFunctions.booleanValue(); } @@ -2669,7 +2669,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is Boolean retval = m_evalIsAndInstanceofCache.get(key); if (retval == null) { - retval = new Boolean(ECMA.toBoolean(evalBinaryOp(op, value, type, isolateId))); + retval = Boolean.valueOf(ECMA.toBoolean(evalBinaryOp(op, value, type, isolateId))); m_evalIsAndInstanceofCache.put(key, retval); } @@ -2686,7 +2686,7 @@ public class PlayerSession implements Session, DProtocolNotifierIF, Runnable, Is if (typeval == null) retval = Boolean.FALSE; else - retval = new Boolean(ECMA.toBoolean(evalBinaryOp(op, value, typeval, isolateId))); + retval = Boolean.valueOf(ECMA.toBoolean(evalBinaryOp(op, value, typeval, isolateId))); m_evalIsAndInstanceofCache.put(key, retval); } diff --git a/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSessionManager.java b/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSessionManager.java index a014449a9..fbacc5e14 100644 --- a/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSessionManager.java +++ b/debugger/src/main/java/flash/tools/debugger/concrete/PlayerSessionManager.java @@ -106,7 +106,7 @@ public class PlayerSessionManager implements SessionManager2 * Set preference * If an invalid preference is passed, it will be silently ignored. */ - public void setPreference(String pref, int value) { m_prefs.put(pref, new Integer(value)); } + public void setPreference(String pref, int value) { m_prefs.put(pref, Integer.valueOf(value)); } public void setPreference(String pref, String value){ m_prefs.put(pref, value); } public Set<String> keySet() { return m_prefs.keySet(); } public Object getPreferenceAsObject(String pref) { return m_prefs.get(pref); } diff --git a/debugger/src/main/java/flash/tools/debugger/expression/AS3DebuggerReducer.java b/debugger/src/main/java/flash/tools/debugger/expression/AS3DebuggerReducer.java index d112f7349..1b2b1af4c 100644 --- a/debugger/src/main/java/flash/tools/debugger/expression/AS3DebuggerReducer.java +++ b/debugger/src/main/java/flash/tools/debugger/expression/AS3DebuggerReducer.java @@ -209,7 +209,7 @@ public class AS3DebuggerReducer { eeContext.toValue(lhs.debuggerValue)); double d2 = ECMA.toNumber(session, eeContext.toValue(rhs.debuggerValue)); - return new DebuggerValue(new Double(d1 * d2)); + return new DebuggerValue(Double.valueOf(d1 * d2)); } case ABCConstants.OP_divide: { // ECMA 11.5 @@ -217,7 +217,7 @@ public class AS3DebuggerReducer { eeContext.toValue(lhs.debuggerValue)); double d2 = ECMA.toNumber(session, eeContext.toValue(rhs.debuggerValue)); - return new DebuggerValue(new Double(d1 / d2)); + return new DebuggerValue(Double.valueOf(d1 / d2)); } case ABCConstants.OP_modulo: { // ECMA 11.5 @@ -225,7 +225,7 @@ public class AS3DebuggerReducer { eeContext.toValue(lhs.debuggerValue)); double d2 = ECMA.toNumber(session, eeContext.toValue(rhs.debuggerValue)); - return new DebuggerValue(new Double(d1 % d2)); + return new DebuggerValue(Double.valueOf(d1 % d2)); } case ABCConstants.OP_add: { // E4X 11.4.1 and ECMA 11.6.1 @@ -285,7 +285,7 @@ public class AS3DebuggerReducer { return new DebuggerValue(ECMA.toString(session, v1) + ECMA.toString(session, v2)); } else { - return new DebuggerValue(new Double(ECMA.toNumber(session, + return new DebuggerValue(Double.valueOf(ECMA.toNumber(session, v1) + ECMA.toNumber(session, v2))); } } @@ -296,7 +296,7 @@ public class AS3DebuggerReducer { eeContext.toValue(lhs.debuggerValue)); double d2 = ECMA.toNumber(session, eeContext.toValue(rhs.debuggerValue)); - return new DebuggerValue(new Double(d1 - d2)); + return new DebuggerValue(Double.valueOf(d1 - d2)); } case ABCConstants.OP_lshift: { // ECMA 11.7.1 @@ -304,7 +304,7 @@ public class AS3DebuggerReducer { .toInt32(session, eeContext.toValue(lhs.debuggerValue)); int n2 = (int) (ECMA.toUint32(session, eeContext.toValue(rhs.debuggerValue)) & 0x1F); - return new DebuggerValue(new Double(n1 << n2)); + return new DebuggerValue(Double.valueOf(n1 << n2)); } case ABCConstants.OP_rshift: { // ECMA 11.7.1 @@ -312,7 +312,7 @@ public class AS3DebuggerReducer { .toInt32(session, eeContext.toValue(lhs.debuggerValue)); int n2 = (int) (ECMA.toUint32(session, eeContext.toValue(rhs.debuggerValue)) & 0x1F); - return new DebuggerValue(new Double(n1 >> n2)); + return new DebuggerValue(Double.valueOf(n1 >> n2)); } case ABCConstants.OP_urshift: { // ECMA 11.7.1 @@ -320,7 +320,7 @@ public class AS3DebuggerReducer { eeContext.toValue(lhs.debuggerValue)); long n2 = (ECMA.toUint32(session, eeContext.toValue(rhs.debuggerValue)) & 0x1F); - return new DebuggerValue(new Double(n1 >>> n2)); + return new DebuggerValue(Double.valueOf(n1 >>> n2)); } case ABCConstants.OP_lessthan: { // ECMA 11.8.1 @@ -424,7 +424,7 @@ public class AS3DebuggerReducer { } case ABCConstants.OP_equals: { // ECMA 11.9.1 - return new DebuggerValue(new Boolean(ECMA.equals(session, + return new DebuggerValue(Boolean.valueOf(ECMA.equals(session, eeContext.toValue(lhs.debuggerValue), eeContext.toValue(rhs.debuggerValue)))); } @@ -432,13 +432,13 @@ public class AS3DebuggerReducer { // case ABCConstants.op_Tokens.NOTEQUALS_TOKEN: // { // // ECMA 11.9.2 - // return new DebuggerValue(new Boolean(!ECMA.equals(session, + // return new DebuggerValue(Boolean.valueOf(!ECMA.equals(session, // eeContext.toValue(lhs.debuggerValue), eeContext // .toValue(rhs.debuggerValue)))); // } case ABCConstants.OP_strictequals: { // ECMA 11.9.4 - return new DebuggerValue(new Boolean(ECMA.strictEquals( + return new DebuggerValue(Boolean.valueOf(ECMA.strictEquals( eeContext.toValue(lhs.debuggerValue), eeContext.toValue(rhs.debuggerValue)))); } @@ -451,21 +451,21 @@ public class AS3DebuggerReducer { */ case ABCConstants.OP_bitand: { // ECMA 11.10 - return new DebuggerValue(new Double(ECMA.toInt32(session, + return new DebuggerValue(Double.valueOf(ECMA.toInt32(session, eeContext.toValue(lhs.debuggerValue)) & ECMA.toInt32(session, eeContext.toValue(rhs.debuggerValue)))); } case ABCConstants.OP_bitxor: { // ECMA 11.10 - return new DebuggerValue(new Double(ECMA.toInt32(session, + return new DebuggerValue(Double.valueOf(ECMA.toInt32(session, eeContext.toValue(lhs.debuggerValue)) ^ ECMA.toInt32(session, eeContext.toValue(rhs.debuggerValue)))); } case ABCConstants.OP_bitor: { // ECMA 11.10 - return new DebuggerValue(new Double(ECMA.toInt32(session, + return new DebuggerValue(Double.valueOf(ECMA.toInt32(session, eeContext.toValue(lhs.debuggerValue)) | ECMA.toInt32(session, eeContext.toValue(rhs.debuggerValue)))); @@ -1234,7 +1234,7 @@ public class AS3DebuggerReducer { Context eeContext = contextStack.scope(); DebuggerValue arg = (DebuggerValue) expr; // ECMA 11.4.9 - return new DebuggerValue(new Boolean(!ECMA.toBoolean(eeContext + return new DebuggerValue(Boolean.valueOf(!ECMA.toBoolean(eeContext .toValue(arg.debuggerValue)))); } @@ -1674,13 +1674,13 @@ public class AS3DebuggerReducer { after = before - 1; } debuggerContext.assign(memberName, - debuggerContext.toValue(new Double(after))); + debuggerContext.toValue(Double.valueOf(after))); Object result; if (isPostFix) { - result = new Double(before); + result = Double.valueOf(before); } else { - result = new Double(after); + result = Double.valueOf(after); } return new DebuggerValue(result); @@ -1749,7 +1749,7 @@ public class AS3DebuggerReducer { DebuggerValue lhs = (DebuggerValue) l; DebuggerValue rhs = (DebuggerValue) r; // ECMA 11.9.5 - return new DebuggerValue(new Boolean(!ECMA.strictEquals( + return new DebuggerValue(Boolean.valueOf(!ECMA.strictEquals( eeContext.toValue(lhs.debuggerValue), eeContext.toValue(rhs.debuggerValue)))); } @@ -2005,9 +2005,9 @@ public class AS3DebuggerReducer { if (hookallreducercalls) hookforreducercalls("transform_numeric_constant_to_constant"); if (numeric_constant instanceof Float) { - return new DebuggerValue(new Double((Float) numeric_constant)); + return new DebuggerValue(Double.valueOf((Float) numeric_constant)); } else { - return new DebuggerValue(new Double((Double) numeric_constant)); + return new DebuggerValue(Double.valueOf((Double) numeric_constant)); } } @@ -2025,7 +2025,7 @@ public class AS3DebuggerReducer { Integer integer_constant) { if (hookallreducercalls) hookforreducercalls("transform_integer_constant"); - DebuggerValue result = new DebuggerValue(new Double(integer_constant)); + DebuggerValue result = new DebuggerValue(Double.valueOf(integer_constant)); return result; } @@ -2095,7 +2095,7 @@ public class AS3DebuggerReducer { && ((DebuggerValue) name).debuggerValue.equals("length")) //$NON-NLS-1$ { String valuestr = contextValue.getValueAsString(); - return new DebuggerValue(new Double(valuestr.length())); + return new DebuggerValue(Double.valueOf(valuestr.length())); } else { Object lookupResult; try { @@ -2170,25 +2170,25 @@ public class AS3DebuggerReducer { case ABCConstants.OP_convert_d: case ABCConstants.OP_unplus: { // ECMA 11.4.6 - return new DebuggerValue(new Double(ECMA.toNumber( + return new DebuggerValue(Double.valueOf(ECMA.toNumber( eeContext.getSession(), eeContext.toValue(arg.debuggerValue)))); } case ABCConstants.OP_negate: { // ECMA 11.4.7 - return new DebuggerValue(new Double(-ECMA.toNumber( + return new DebuggerValue(Double.valueOf(-ECMA.toNumber( eeContext.getSession(), eeContext.toValue(arg.debuggerValue)))); } case ABCConstants.OP_bitnot: { // ECMA 11.4.8 - return new DebuggerValue(new Double(~ECMA.toInt32( + return new DebuggerValue(Double.valueOf(~ECMA.toInt32( eeContext.getSession(), eeContext.toValue(arg.debuggerValue)))); } case ABCConstants.OP_not: { // ECMA 11.4.9 - return new DebuggerValue(new Boolean(!ECMA.toBoolean(eeContext + return new DebuggerValue(Boolean.valueOf(!ECMA.toBoolean(eeContext .toValue(arg.debuggerValue)))); } default: diff --git a/debugger/src/main/java/flash/tools/debugger/expression/ECMA.java b/debugger/src/main/java/flash/tools/debugger/expression/ECMA.java index 39c330840..197423a9b 100644 --- a/debugger/src/main/java/flash/tools/debugger/expression/ECMA.java +++ b/debugger/src/main/java/flash/tools/debugger/expression/ECMA.java @@ -299,7 +299,7 @@ public class ECMA { String sx = px.getValueAsString(); String sy = py.getValueAsString(); - return DValue.forPrimitive(new Boolean(sx.compareTo(sy) < 0), x.getIsolateId()); + return DValue.forPrimitive(Boolean.valueOf(sx.compareTo(sy) < 0), x.getIsolateId()); } else { @@ -307,7 +307,7 @@ public class ECMA double dy = toNumber(session, py); if (Double.isNaN(dx) || Double.isNaN(dy)) return DValue.forPrimitive(Value.UNDEFINED, x.getIsolateId()); - return DValue.forPrimitive(new Boolean(dx < dy), x.getIsolateId()); + return DValue.forPrimitive(Boolean.valueOf(dx < dy), x.getIsolateId()); } } @@ -359,9 +359,9 @@ public class ECMA return dx == dy; } if (x instanceof Boolean) - return equals(session, DValue.forPrimitive(new Double(toNumber(session, xv)), xv.getIsolateId()), yv); + return equals(session, DValue.forPrimitive(Double.valueOf(toNumber(session, xv)), xv.getIsolateId()), yv); if (y instanceof Boolean) - return equals(session, xv, DValue.forPrimitive(new Double(toNumber(session, yv)), xv.getIsolateId())); + return equals(session, xv, DValue.forPrimitive(Double.valueOf(toNumber(session, yv)), xv.getIsolateId())); if ((x instanceof String || x instanceof Double) && yv.getType() == VariableType.OBJECT) { return equals(session, xv, toPrimitive(session, yv, null, yv.getIsolateId())); diff --git a/debugger/src/main/java/royale/tools/debugger/cli/DebugCLI.java b/debugger/src/main/java/royale/tools/debugger/cli/DebugCLI.java index d6d13bf5b..877182ac1 100644 --- a/debugger/src/main/java/royale/tools/debugger/cli/DebugCLI.java +++ b/debugger/src/main/java/royale/tools/debugger/cli/DebugCLI.java @@ -6661,54 +6661,54 @@ public class DebugCLI implements Runnable, SourceLocator { */ static StringIntArray g_commandArray = new StringIntArray(new Object[][] { - {"awatch", new Integer(CMD_AWATCH)}, //$NON-NLS-1$ - {"break", new Integer(CMD_BREAK)}, //$NON-NLS-1$ - {"bt", new Integer(INFO_STACK_CMD)}, //$NON-NLS-1$ - {"continue", new Integer(CMD_CONTINUE)}, //$NON-NLS-1$ - {"catch", new Integer(CMD_CATCH)}, //$NON-NLS-1$ - {"cf", new Integer(CMD_CF)}, //$NON-NLS-1$ - {"clear", new Integer(CMD_CLEAR)}, //$NON-NLS-1$ - {"commands", new Integer(CMD_COMMANDS)}, //$NON-NLS-1$ - {"condition", new Integer(CMD_CONDITION)}, //$NON-NLS-1$ - {"connect", new Integer(CMD_CONNECT)}, //$NON-NLS-1$ - {"delete", new Integer(CMD_DELETE)}, //$NON-NLS-1$ - {"disable", new Integer(CMD_DISABLE)}, //$NON-NLS-1$ - {"disassemble", new Integer(CMD_DISASSEMBLE)}, //$NON-NLS-1$ - {"display", new Integer(CMD_DISPLAY)}, //$NON-NLS-1$ - {"directory", new Integer(CMD_DIRECTORY)}, //$NON-NLS-1$ - {"down", new Integer(CMD_DOWN)}, //$NON-NLS-1$ - {"enable", new Integer(CMD_ENABLE)}, //$NON-NLS-1$ - {"finish", new Integer(CMD_FINISH)}, //$NON-NLS-1$ - {"file", new Integer(CMD_FILE)}, //$NON-NLS-1$ - {"frame", new Integer(CMD_FRAME)}, //$NON-NLS-1$ - {"help", new Integer(CMD_HELP)}, //$NON-NLS-1$ - {"halt", new Integer(CMD_HALT)}, //$NON-NLS-1$ - {"handle", new Integer(CMD_HANDLE)}, //$NON-NLS-1$ - {"home", new Integer(CMD_HOME)}, //$NON-NLS-1$ - {"info", new Integer(CMD_INFO)}, //$NON-NLS-1$ - {"kill", new Integer(CMD_KILL)}, //$NON-NLS-1$ - {"list", new Integer(CMD_LIST)}, //$NON-NLS-1$ - {"next", new Integer(CMD_NEXT)}, //$NON-NLS-1$ - {"nexti", new Integer(CMD_NEXT)}, //$NON-NLS-1$ - {"mctree", new Integer(CMD_MCTREE)}, //$NON-NLS-1$ - {"print", new Integer(CMD_PRINT)}, //$NON-NLS-1$ - {"pwd", new Integer(CMD_PWD)}, //$NON-NLS-1$ - {"quit", new Integer(CMD_QUIT)}, //$NON-NLS-1$ - {"run", new Integer(CMD_RUN)}, //$NON-NLS-1$ - {"rwatch", new Integer(CMD_RWATCH)}, //$NON-NLS-1$ - {"step", new Integer(CMD_STEP)}, //$NON-NLS-1$ - {"stepi", new Integer(CMD_STEP)}, //$NON-NLS-1$ - {"set", new Integer(CMD_SET)}, //$NON-NLS-1$ - {"show", new Integer(CMD_SHOW)}, //$NON-NLS-1$ - {"source", new Integer(CMD_SOURCE)}, //$NON-NLS-1$ - {"tutorial", new Integer(CMD_TUTORIAL)}, //$NON-NLS-1$ - {"undisplay", new Integer(CMD_UNDISPLAY)}, //$NON-NLS-1$ - {"up", new Integer(CMD_UP)}, //$NON-NLS-1$ - {"where", new Integer(INFO_STACK_CMD)}, //$NON-NLS-1$ - {"watch", new Integer(CMD_WATCH)}, //$NON-NLS-1$ - {"what", new Integer(CMD_WHAT)}, //$NON-NLS-1$ - {"viewswf", new Integer(CMD_VIEW_SWF)}, //$NON-NLS-1$ - {"worker", new Integer(CMD_WORKER)}, //$NON-NLS-1$ + {"awatch", Integer.valueOf(CMD_AWATCH)}, //$NON-NLS-1$ + {"break", Integer.valueOf(CMD_BREAK)}, //$NON-NLS-1$ + {"bt", Integer.valueOf(INFO_STACK_CMD)}, //$NON-NLS-1$ + {"continue", Integer.valueOf(CMD_CONTINUE)}, //$NON-NLS-1$ + {"catch", Integer.valueOf(CMD_CATCH)}, //$NON-NLS-1$ + {"cf", Integer.valueOf(CMD_CF)}, //$NON-NLS-1$ + {"clear", Integer.valueOf(CMD_CLEAR)}, //$NON-NLS-1$ + {"commands", Integer.valueOf(CMD_COMMANDS)}, //$NON-NLS-1$ + {"condition", Integer.valueOf(CMD_CONDITION)}, //$NON-NLS-1$ + {"connect", Integer.valueOf(CMD_CONNECT)}, //$NON-NLS-1$ + {"delete", Integer.valueOf(CMD_DELETE)}, //$NON-NLS-1$ + {"disable", Integer.valueOf(CMD_DISABLE)}, //$NON-NLS-1$ + {"disassemble", Integer.valueOf(CMD_DISASSEMBLE)}, //$NON-NLS-1$ + {"display", Integer.valueOf(CMD_DISPLAY)}, //$NON-NLS-1$ + {"directory", Integer.valueOf(CMD_DIRECTORY)}, //$NON-NLS-1$ + {"down", Integer.valueOf(CMD_DOWN)}, //$NON-NLS-1$ + {"enable", Integer.valueOf(CMD_ENABLE)}, //$NON-NLS-1$ + {"finish", Integer.valueOf(CMD_FINISH)}, //$NON-NLS-1$ + {"file", Integer.valueOf(CMD_FILE)}, //$NON-NLS-1$ + {"frame", Integer.valueOf(CMD_FRAME)}, //$NON-NLS-1$ + {"help", Integer.valueOf(CMD_HELP)}, //$NON-NLS-1$ + {"halt", Integer.valueOf(CMD_HALT)}, //$NON-NLS-1$ + {"handle", Integer.valueOf(CMD_HANDLE)}, //$NON-NLS-1$ + {"home", Integer.valueOf(CMD_HOME)}, //$NON-NLS-1$ + {"info", Integer.valueOf(CMD_INFO)}, //$NON-NLS-1$ + {"kill", Integer.valueOf(CMD_KILL)}, //$NON-NLS-1$ + {"list", Integer.valueOf(CMD_LIST)}, //$NON-NLS-1$ + {"next", Integer.valueOf(CMD_NEXT)}, //$NON-NLS-1$ + {"nexti", Integer.valueOf(CMD_NEXT)}, //$NON-NLS-1$ + {"mctree", Integer.valueOf(CMD_MCTREE)}, //$NON-NLS-1$ + {"print", Integer.valueOf(CMD_PRINT)}, //$NON-NLS-1$ + {"pwd", Integer.valueOf(CMD_PWD)}, //$NON-NLS-1$ + {"quit", Integer.valueOf(CMD_QUIT)}, //$NON-NLS-1$ + {"run", Integer.valueOf(CMD_RUN)}, //$NON-NLS-1$ + {"rwatch", Integer.valueOf(CMD_RWATCH)}, //$NON-NLS-1$ + {"step", Integer.valueOf(CMD_STEP)}, //$NON-NLS-1$ + {"stepi", Integer.valueOf(CMD_STEP)}, //$NON-NLS-1$ + {"set", Integer.valueOf(CMD_SET)}, //$NON-NLS-1$ + {"show", Integer.valueOf(CMD_SHOW)}, //$NON-NLS-1$ + {"source", Integer.valueOf(CMD_SOURCE)}, //$NON-NLS-1$ + {"tutorial", Integer.valueOf(CMD_TUTORIAL)}, //$NON-NLS-1$ + {"undisplay", Integer.valueOf(CMD_UNDISPLAY)}, //$NON-NLS-1$ + {"up", Integer.valueOf(CMD_UP)}, //$NON-NLS-1$ + {"where", Integer.valueOf(INFO_STACK_CMD)}, //$NON-NLS-1$ + {"watch", Integer.valueOf(CMD_WATCH)}, //$NON-NLS-1$ + {"what", Integer.valueOf(CMD_WHAT)}, //$NON-NLS-1$ + {"viewswf", Integer.valueOf(CMD_VIEW_SWF)}, //$NON-NLS-1$ + {"worker", Integer.valueOf(CMD_WORKER)}, //$NON-NLS-1$ }); @@ -6717,20 +6717,20 @@ public class DebugCLI implements Runnable, SourceLocator { */ static StringIntArray g_infoCommandArray = new StringIntArray(new Object[][] { - {"arguments", new Integer(INFO_ARGS_CMD)}, //$NON-NLS-1$ - {"breakpoints", new Integer(INFO_BREAK_CMD)}, //$NON-NLS-1$ - {"display", new Integer(INFO_DISPLAY_CMD)}, //$NON-NLS-1$ - {"files", new Integer(INFO_FILES_CMD)}, //$NON-NLS-1$ - {"functions", new Integer(INFO_FUNCTIONS_CMD)}, //$NON-NLS-1$ - {"handle", new Integer(INFO_HANDLE_CMD)}, //$NON-NLS-1$ - {"locals", new Integer(INFO_LOCALS_CMD)}, //$NON-NLS-1$ - {"stack", new Integer(INFO_STACK_CMD)}, //$NON-NLS-1$ - {"scopechain", new Integer(INFO_SCOPECHAIN_CMD)}, //$NON-NLS-1$ - {"sources", new Integer(INFO_SOURCES_CMD)}, //$NON-NLS-1$ - {"swfs", new Integer(INFO_SWFS_CMD)}, //$NON-NLS-1$ - {"targets", new Integer(INFO_TARGETS_CMD)}, //$NON-NLS-1$ - {"variables", new Integer(INFO_VARIABLES_CMD)}, //$NON-NLS-1$ - {"workers", new Integer(INFO_WORKERS_CMD)}, //$NON-NLS-1$ + {"arguments", Integer.valueOf(INFO_ARGS_CMD)}, //$NON-NLS-1$ + {"breakpoints", Integer.valueOf(INFO_BREAK_CMD)}, //$NON-NLS-1$ + {"display", Integer.valueOf(INFO_DISPLAY_CMD)}, //$NON-NLS-1$ + {"files", Integer.valueOf(INFO_FILES_CMD)}, //$NON-NLS-1$ + {"functions", Integer.valueOf(INFO_FUNCTIONS_CMD)}, //$NON-NLS-1$ + {"handle", Integer.valueOf(INFO_HANDLE_CMD)}, //$NON-NLS-1$ + {"locals", Integer.valueOf(INFO_LOCALS_CMD)}, //$NON-NLS-1$ + {"stack", Integer.valueOf(INFO_STACK_CMD)}, //$NON-NLS-1$ + {"scopechain", Integer.valueOf(INFO_SCOPECHAIN_CMD)}, //$NON-NLS-1$ + {"sources", Integer.valueOf(INFO_SOURCES_CMD)}, //$NON-NLS-1$ + {"swfs", Integer.valueOf(INFO_SWFS_CMD)}, //$NON-NLS-1$ + {"targets", Integer.valueOf(INFO_TARGETS_CMD)}, //$NON-NLS-1$ + {"variables", Integer.valueOf(INFO_VARIABLES_CMD)}, //$NON-NLS-1$ + {"workers", Integer.valueOf(INFO_WORKERS_CMD)}, //$NON-NLS-1$ }); /** @@ -6738,16 +6738,16 @@ public class DebugCLI implements Runnable, SourceLocator { */ static StringIntArray g_showCommandArray = new StringIntArray(new Object[][] { - {"break", new Integer(SHOW_BREAK_CMD)}, //$NON-NLS-1$ - {"directories", new Integer(SHOW_DIRS_CMD)}, //$NON-NLS-1$ - {"files", new Integer(SHOW_FILES_CMD)}, //$NON-NLS-1$ - {"functions", new Integer(SHOW_FUNC_CMD)}, //$NON-NLS-1$ - {"locations", new Integer(SHOW_LOC_CMD)}, //$NON-NLS-1$ - {"memory", new Integer(SHOW_MEM_CMD)}, //$NON-NLS-1$ - {"net", new Integer(SHOW_NET_CMD)}, //$NON-NLS-1$ - {"properties", new Integer(SHOW_PROPERTIES_CMD)}, //$NON-NLS-1$ - {"uri", new Integer(SHOW_URI_CMD)}, //$NON-NLS-1$ - {"variable", new Integer(SHOW_VAR_CMD)}, //$NON-NLS-1$ + {"break", Integer.valueOf(SHOW_BREAK_CMD)}, //$NON-NLS-1$ + {"directories", Integer.valueOf(SHOW_DIRS_CMD)}, //$NON-NLS-1$ + {"files", Integer.valueOf(SHOW_FILES_CMD)}, //$NON-NLS-1$ + {"functions", Integer.valueOf(SHOW_FUNC_CMD)}, //$NON-NLS-1$ + {"locations", Integer.valueOf(SHOW_LOC_CMD)}, //$NON-NLS-1$ + {"memory", Integer.valueOf(SHOW_MEM_CMD)}, //$NON-NLS-1$ + {"net", Integer.valueOf(SHOW_NET_CMD)}, //$NON-NLS-1$ + {"properties", Integer.valueOf(SHOW_PROPERTIES_CMD)}, //$NON-NLS-1$ + {"uri", Integer.valueOf(SHOW_URI_CMD)}, //$NON-NLS-1$ + {"variable", Integer.valueOf(SHOW_VAR_CMD)}, //$NON-NLS-1$ }); /** @@ -6755,10 +6755,10 @@ public class DebugCLI implements Runnable, SourceLocator { */ static StringIntArray g_enableCommandArray = new StringIntArray(new Object[][] { - {"breakpoints", new Integer(CMD_BREAK)}, //$NON-NLS-1$ - {"display", new Integer(CMD_DISPLAY)}, //$NON-NLS-1$ - {"delete", new Integer(CMD_DELETE)}, //$NON-NLS-1$ - {"once", new Integer(ENABLE_ONCE_CMD)}, //$NON-NLS-1$ + {"breakpoints", Integer.valueOf(CMD_BREAK)}, //$NON-NLS-1$ + {"display", Integer.valueOf(CMD_DISPLAY)}, //$NON-NLS-1$ + {"delete", Integer.valueOf(CMD_DELETE)}, //$NON-NLS-1$ + {"once", Integer.valueOf(ENABLE_ONCE_CMD)}, //$NON-NLS-1$ }); /** @@ -6766,8 +6766,8 @@ public class DebugCLI implements Runnable, SourceLocator { */ static StringIntArray g_disableCommandArray = new StringIntArray(new Object[][] { - {"display", new Integer(CMD_DISPLAY)}, //$NON-NLS-1$ - {"breakpoints", new Integer(CMD_BREAK)}, //$NON-NLS-1$ + {"display", Integer.valueOf(CMD_DISPLAY)}, //$NON-NLS-1$ + {"breakpoints", Integer.valueOf(CMD_BREAK)}, //$NON-NLS-1$ }); diff --git a/debugger/src/main/java/royale/tools/debugger/cli/FaultActions.java b/debugger/src/main/java/royale/tools/debugger/cli/FaultActions.java index 73bc07444..83a3a25ad 100644 --- a/debugger/src/main/java/royale/tools/debugger/cli/FaultActions.java +++ b/debugger/src/main/java/royale/tools/debugger/cli/FaultActions.java @@ -69,7 +69,7 @@ public class FaultActions */ public void add(String k) { - put(k, new Integer(0)); + put(k, Integer.valueOf(0)); } /** @@ -77,7 +77,7 @@ public class FaultActions */ public void addAction(String k) { - Integer v = new Integer(m_nextBitForAction++); + Integer v = Integer.valueOf(m_nextBitForAction++); m_actions.put(k,v); } @@ -121,7 +121,7 @@ public class FaultActions int n = (old & (~mask)); // turn it off n = (no) ? n : (n | mask); // leave it off or turn it on - put(fault, new Integer(n)); + put(fault, Integer.valueOf(n)); return n; } diff --git a/debugger/src/main/java/royale/tools/debugger/cli/IntProperties.java b/debugger/src/main/java/royale/tools/debugger/cli/IntProperties.java index a5b3ee04d..ea912c14e 100644 --- a/debugger/src/main/java/royale/tools/debugger/cli/IntProperties.java +++ b/debugger/src/main/java/royale/tools/debugger/cli/IntProperties.java @@ -31,6 +31,6 @@ public class IntProperties public HashMap<String, Integer> map() { return m_map; } /* setters */ - public void put(String s, int value) { m_map.put(s, new Integer(value)); } + public void put(String s, int value) { m_map.put(s, Integer.valueOf(value)); } } diff --git a/debugger/src/main/java/royale/tools/debugger/cli/StringIntArray.java b/debugger/src/main/java/royale/tools/debugger/cli/StringIntArray.java index 76db5076c..b13cec847 100644 --- a/debugger/src/main/java/royale/tools/debugger/cli/StringIntArray.java +++ b/debugger/src/main/java/royale/tools/debugger/cli/StringIntArray.java @@ -68,7 +68,7 @@ public class StringIntArray extends AbstractList<Object> ArrayList<Integer> alist = new ArrayList<Integer>(); for(int i=0; i<m_size; i++) if ( getString(i).startsWith(s) ) - alist.add( new Integer(i) ); + alist.add( Integer.valueOf(i) ); return alist; } diff --git a/flex-compiler-oem/src/main/java/flex2/compiler/config/ConfigurationBuffer.java b/flex-compiler-oem/src/main/java/flex2/compiler/config/ConfigurationBuffer.java index 7069e116f..a6c3a4e23 100644 --- a/flex-compiler-oem/src/main/java/flex2/compiler/config/ConfigurationBuffer.java +++ b/flex-compiler-oem/src/main/java/flex2/compiler/config/ConfigurationBuffer.java @@ -1104,7 +1104,7 @@ public final class ConfigurationBuffer public void addPosition(String var, int iStart, int iEnd) { - positions.add(new Object[] { var, new Integer(iStart), new Integer(iEnd) }); + positions.add(new Object[] { var, Integer.valueOf(iStart), Integer.valueOf(iEnd) }); } public List<Object[]> getPositions() diff --git a/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMConfiguration.java b/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMConfiguration.java index 824ed3863..5c412e211 100644 --- a/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMConfiguration.java +++ b/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMConfiguration.java @@ -779,7 +779,7 @@ public class OEMConfiguration implements Configuration, ConfigurationConstants, { if (size > 0) { - args.put(COMPILER_FONTS_MAX_CACHED_FONTS, new Integer(size)); + args.put(COMPILER_FONTS_MAX_CACHED_FONTS, Integer.valueOf(size)); } } @@ -794,7 +794,7 @@ public class OEMConfiguration implements Configuration, ConfigurationConstants, { if (size > 0) { - args.put(COMPILER_FONTS_MAX_GLYPHS_PER_FACE, new Integer(size)); + args.put(COMPILER_FONTS_MAX_GLYPHS_PER_FACE, Integer.valueOf(size)); } } @@ -1511,8 +1511,8 @@ public class OEMConfiguration implements Configuration, ConfigurationConstants, */ public void setDefaultBackgroundColor(int color) { - args.put(DEFAULT_BACKGROUND_COLOR, new Integer(color)); - linker_args.put(DEFAULT_BACKGROUND_COLOR, new Integer(color)); + args.put(DEFAULT_BACKGROUND_COLOR, Integer.valueOf(color)); + linker_args.put(DEFAULT_BACKGROUND_COLOR, Integer.valueOf(color)); newLinkerOptionsAfterCompile.add(DEFAULT_BACKGROUND_COLOR); } @@ -1525,8 +1525,8 @@ public class OEMConfiguration implements Configuration, ConfigurationConstants, */ public void setDefaultFrameRate(int rate) { - args.put(DEFAULT_FRAME_RATE, new Integer(rate)); - linker_args.put(DEFAULT_FRAME_RATE, new Integer(rate)); + args.put(DEFAULT_FRAME_RATE, Integer.valueOf(rate)); + linker_args.put(DEFAULT_FRAME_RATE, Integer.valueOf(rate)); newLinkerOptionsAfterCompile.add(DEFAULT_FRAME_RATE); } diff --git a/formatter/src/main/java/org/apache/royale/formatter/config/ConfigurationBuffer.java b/formatter/src/main/java/org/apache/royale/formatter/config/ConfigurationBuffer.java index 35a6e37ad..917d9858d 100644 --- a/formatter/src/main/java/org/apache/royale/formatter/config/ConfigurationBuffer.java +++ b/formatter/src/main/java/org/apache/royale/formatter/config/ConfigurationBuffer.java @@ -1160,7 +1160,7 @@ public final class ConfigurationBuffer public void addPosition(String var, int iStart, int iEnd) { - positions.add(new Object[] {var, new Integer(iStart), new Integer(iEnd)}); + positions.add(new Object[] {var, Integer.valueOf(iStart), Integer.valueOf(iEnd)}); } public List<Object[]> getPositions() diff --git a/linter/src/main/java/org/apache/royale/linter/config/ConfigurationBuffer.java b/linter/src/main/java/org/apache/royale/linter/config/ConfigurationBuffer.java index fd1dda28e..557b60a97 100644 --- a/linter/src/main/java/org/apache/royale/linter/config/ConfigurationBuffer.java +++ b/linter/src/main/java/org/apache/royale/linter/config/ConfigurationBuffer.java @@ -1160,7 +1160,7 @@ public final class ConfigurationBuffer public void addPosition(String var, int iStart, int iEnd) { - positions.add(new Object[] {var, new Integer(iStart), new Integer(iEnd)}); + positions.add(new Object[] {var, Integer.valueOf(iStart), Integer.valueOf(iEnd)}); } public List<Object[]> getPositions() diff --git a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Report.java b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Report.java index a6080724b..76986aba1 100644 --- a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Report.java +++ b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Report.java @@ -131,7 +131,7 @@ public class Report private String formatTime(long time) { - return String.format("%.3f", new Double(time / 1000.0000)); + return String.format("%.3f", Double.valueOf(time / 1000.0000)); } /** @@ -238,9 +238,9 @@ public class Report try { summary = MessageFormat.format(TEST_INFO, new Object[] - { new String(suite.getName()), new Integer(suite.getTests()), - new Integer(suite.getFailures()), - new Integer(suite.getErrors()), new Integer(suite.getSkips()), + { new String(suite.getName()), Integer.valueOf(suite.getTests()), + Integer.valueOf(suite.getFailures()), + Integer.valueOf(suite.getErrors()), Integer.valueOf(suite.getSkips()), formatTime(suite.getTime()) }); } catch (Exception e) { diff --git a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Reports.java b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Reports.java index 318409741..4e69eb06c 100644 --- a/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Reports.java +++ b/royaleunit-ant-tasks/src/main/java/org/apache/royale/test/ant/report/Reports.java @@ -60,10 +60,10 @@ public class Reports extends HashMap<String, Report> try { summary += MessageFormat.format(TEST_INFO, new Object[] { - new Integer(runs), - new Integer(failures), - new Integer(errors), - new Integer(skips), + Integer.valueOf(runs), + Integer.valueOf(failures), + Integer.valueOf(errors), + Integer.valueOf(skips), formatTime(time) }); } @@ -79,7 +79,7 @@ public class Reports extends HashMap<String, Report> private String formatTime(long time) { - return String.format("%.3f", new Double(time / 1000.0000)); + return String.format("%.3f", Double.valueOf(time / 1000.0000)); } /** diff --git a/swfutils/src/main/java/flash/swf/ActionFactory.java b/swfutils/src/main/java/flash/swf/ActionFactory.java index c8808a366..61e9ca160 100644 --- a/swfutils/src/main/java/flash/swf/ActionFactory.java +++ b/swfutils/src/main/java/flash/swf/ActionFactory.java @@ -64,9 +64,9 @@ final public class ActionFactory private static final Push pushFalseFlyweight = new Push(Boolean.FALSE); private static final Push pushUndefinedFlyweight = new Push(UNDEFINED); private static final Push pushNullFlyweight = new Push(null); - private static final Push pushFloat0Flyweight = new Push(new Float(0)); - private static final Push pushInteger0Flyweight = new Push(new Integer(0)); - private static final Push pushDouble0Flyweight = new Push(new Double(0)); + private static final Push pushFloat0Flyweight = new Push(Float.valueOf(0)); + private static final Push pushInteger0Flyweight = new Push(Integer.valueOf(0)); + private static final Push pushDouble0Flyweight = new Push(Double.valueOf(0)); private static final Action callFlyweight = new Action(ActionConstants.sactionCall); private static final StrictMode strictTrueFlyweight = new StrictMode(true); private static final StrictMode strictFalseFlyweight = new StrictMode(false); @@ -80,8 +80,8 @@ final public class ActionFactory for (int i=0; i < 256; i++) { - ActionFactory.pushRegisterFlyweights[i] = new Push(new Byte((byte)i)); - ActionFactory.pushCpoolFlyweights[i] = new Push(new Short((short)i)); + ActionFactory.pushRegisterFlyweights[i] = new Push(Byte.valueOf((byte)i)); + ActionFactory.pushCpoolFlyweights[i] = new Push(Short.valueOf((short)i)); ActionFactory.storeRegisterFlyweights[i] = new StoreRegister(i); } } @@ -95,7 +95,7 @@ final public class ActionFactory { return (index < pushCpoolFlyweights.length) ? pushCpoolFlyweights[index] - : new Push(new Short((short)index)); + : new Push(Short.valueOf((short)index)); } public static Push createPush(String s) @@ -107,7 +107,7 @@ final public class ActionFactory { return fvalue == 0 ? pushFloat0Flyweight - : new Push(new Float(fvalue)); + : new Push(Float.valueOf(fvalue)); } public static Push createPushNull() @@ -134,14 +134,14 @@ final public class ActionFactory { return dvalue == 0 ? pushDouble0Flyweight - : new Push(new Double(dvalue)); + : new Push(Double.valueOf(dvalue)); } public static Push createPush(int ivalue) { return ivalue == 0 ? pushInteger0Flyweight - : new Push(new Integer(ivalue)); + : new Push(Integer.valueOf(ivalue)); } public static StoreRegister createStoreRegister(int register) diff --git a/swfutils/src/main/java/flash/swf/DebugDecoder.java b/swfutils/src/main/java/flash/swf/DebugDecoder.java index 00ee1557d..2c240e5c3 100644 --- a/swfutils/src/main/java/flash/swf/DebugDecoder.java +++ b/swfutils/src/main/java/flash/swf/DebugDecoder.java @@ -145,9 +145,9 @@ public class DebugDecoder } else { - lineRecords.add(new Integer(id)); + lineRecords.add(Integer.valueOf(id)); lineRecords.add(lr); - lineRecords.add(new Integer(offset)); + lineRecords.add(Integer.valueOf(offset)); } break; case kDebugBreakpoint: diff --git a/swfutils/src/main/java/flash/swf/Dictionary.java b/swfutils/src/main/java/flash/swf/Dictionary.java index 2937d5e36..82553ad94 100644 --- a/swfutils/src/main/java/flash/swf/Dictionary.java +++ b/swfutils/src/main/java/flash/swf/Dictionary.java @@ -41,7 +41,7 @@ public class Dictionary public boolean contains(int id) { - return ids.containsKey(new Integer(id)); + return ids.containsKey(Integer.valueOf(id)); } public boolean contains(DefineTag tag) @@ -110,7 +110,7 @@ public class Dictionary } else { - Integer key = new Integer(nextId++); + Integer key = Integer.valueOf(nextId++); tags.put(tag, key); ids.put(key, tag); return key.intValue(); @@ -127,7 +127,7 @@ public class Dictionary public void add(int id, DefineTag s) throws IllegalArgumentException { - Integer key = new Integer(id); + Integer key = Integer.valueOf(id); Tag t = ids.get(key); if (t == null) { @@ -181,7 +181,7 @@ public class Dictionary public DefineTag getTag(int idref) throws IllegalArgumentException { - Integer key = new Integer(idref); + Integer key = Integer.valueOf(idref); DefineTag t = ids.get(key); if (t == null) { diff --git a/swfutils/src/main/java/flash/swf/MovieMetaData.java b/swfutils/src/main/java/flash/swf/MovieMetaData.java index 534c9f803..8067a507e 100644 --- a/swfutils/src/main/java/flash/swf/MovieMetaData.java +++ b/swfutils/src/main/java/flash/swf/MovieMetaData.java @@ -433,7 +433,7 @@ public final class MovieMetaData extends TagHandler { for (int i=0; i < 256; i++) { - codes[i] = new Integer(i); + codes[i] = Integer.valueOf(i); } } @@ -493,7 +493,7 @@ public final class MovieMetaData extends TagHandler case ActionConstants.sactionDefineFunction: case ActionConstants.sactionDefineFunction2: DefineFunction f = (DefineFunction) a; - Integer size = new Integer(f.codeSize); + Integer size = Integer.valueOf(f.codeSize); if (f.actionList.size() == 0) { @@ -512,9 +512,9 @@ public final class MovieMetaData extends TagHandler { // also find out the first line number of this function if (lineno == null) - lineno = new Integer(((LineRecord)child).lineno); + lineno = Integer.valueOf(((LineRecord)child).lineno); - preciseLines.put(o, new Integer( ((LineRecord)child).lineno )); + preciseLines.put(o, Integer.valueOf( ((LineRecord)child).lineno )); } functionNames.put(o, f.name); functionSizes.put(o, size); @@ -854,10 +854,10 @@ public final class MovieMetaData extends TagHandler Object function = pop(evalStack); if (profileOffsets != null && "profile".equals(function)) { - profileOffsets.add(new Integer(offset - 13)); // Push 1 - profileOffsets.add(new Integer(offset - 5)); // Push 'profile' - profileOffsets.add(new Integer(offset)); // CallFunction - profileOffsets.add(new Integer(offset + 1)); // Pop + profileOffsets.add(Integer.valueOf(offset - 13)); // Push 1 + profileOffsets.add(Integer.valueOf(offset - 5)); // Push 'profile' + profileOffsets.add(Integer.valueOf(offset)); // CallFunction + profileOffsets.add(Integer.valueOf(offset + 1)); // Pop } int n = ((Number) pop(evalStack)).intValue(); for (int k = 0; k < n; k++) @@ -1070,9 +1070,9 @@ class MFUCache Integer count = cache.get(m); if (count == null) { - count = new Integer(0); + count = Integer.valueOf(0); } - count = new Integer(count.intValue() + 1); + count = Integer.valueOf(count.intValue() + 1); cache.put(m, count); if (count.intValue() > topCount) diff --git a/swfutils/src/main/java/flash/util/IntMap.java b/swfutils/src/main/java/flash/util/IntMap.java index 3e2d01bf1..cb6b87827 100644 --- a/swfutils/src/main/java/flash/util/IntMap.java +++ b/swfutils/src/main/java/flash/util/IntMap.java @@ -179,7 +179,7 @@ public class IntMap { public Object getKey() { - return new Integer(keys[j]); + return Integer.valueOf(keys[j]); } public Object getValue()
