### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v retrieving revision 1.360 diff -u -r1.360 Main.java --- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 16 Jan 2011 22:43:21 -0000 1.360 +++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 28 Feb 2011 17:51:08 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -274,10 +274,11 @@ } } } - int length = unitSource == null ? 0 : unitSource.length; + int length; if ((startPosition > endPosition) || ((startPosition < 0) && (endPosition < 0)) - || length == 0) + || (unitSource == null) + || (length = unitSource.length) == 0) return Messages.problem_noSourceInformation; StringBuffer errorBuffer = new StringBuffer(); @@ -337,10 +338,11 @@ } } } - int length = unitSource== null ? 0 : unitSource.length; + int length; if ((startPosition > endPosition) || ((startPosition < 0) && (endPosition < 0)) - || (length <= 0) + || (unitSource == null) + || ((length = unitSource.length) <= 0) || (endPosition > length)) { this.parameters.put(Logger.VALUE, Messages.problem_noSourceInformation); this.parameters.put(Logger.SOURCE_START, "-1"); //$NON-NLS-1$ @@ -2947,8 +2949,10 @@ * External API */ protected ArrayList handleBootclasspath(ArrayList bootclasspaths, String customEncoding) { - final int bootclasspathsSize = bootclasspaths == null ? 0 : bootclasspaths.size(); - if (bootclasspathsSize != 0) { + final int bootclasspathsSize; + if ((bootclasspaths != null) + && ((bootclasspathsSize = bootclasspaths.size()) != 0)) + { String[] paths = new String[bootclasspathsSize]; bootclasspaths.toArray(paths); bootclasspaths.clear(); @@ -2973,8 +2977,10 @@ * External API */ protected ArrayList handleClasspath(ArrayList classpaths, String customEncoding) { - final int classpathsSize = classpaths == null ? 0 : classpaths.size(); - if (classpathsSize != 0) { + final int classpathsSize; + if ((classpaths != null) + && ((classpathsSize = classpaths.size()) != 0)) + { String[] paths = new String[classpathsSize]; classpaths.toArray(paths); classpaths.clear(); Index: compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java,v retrieving revision 1.112 diff -u -r1.112 ConstructorDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 9 Nov 2010 19:59:19 -0000 1.112 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 28 Feb 2011 17:51:09 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -255,21 +255,25 @@ NestedTypeBinding nestedType = (NestedTypeBinding) declaringClass; SyntheticArgumentBinding[] syntheticArgs = nestedType.syntheticEnclosingInstances(); - for (int i = 0, max = syntheticArgs == null ? 0 : syntheticArgs.length; i < max; i++) { - SyntheticArgumentBinding syntheticArg; - if ((syntheticArg = syntheticArgs[i]).matchingField != null) { - codeStream.aload_0(); - codeStream.load(syntheticArg); - codeStream.fieldAccess(Opcodes.OPC_putfield, syntheticArg.matchingField, null /* default declaringClass */); + if (syntheticArgs != null) { + for (int i = 0, max = syntheticArgs.length; i < max; i++) { + SyntheticArgumentBinding syntheticArg; + if ((syntheticArg = syntheticArgs[i]).matchingField != null) { + codeStream.aload_0(); + codeStream.load(syntheticArg); + codeStream.fieldAccess(Opcodes.OPC_putfield, syntheticArg.matchingField, null /* default declaringClass */); + } } } syntheticArgs = nestedType.syntheticOuterLocalVariables(); - for (int i = 0, max = syntheticArgs == null ? 0 : syntheticArgs.length; i < max; i++) { - SyntheticArgumentBinding syntheticArg; - if ((syntheticArg = syntheticArgs[i]).matchingField != null) { - codeStream.aload_0(); - codeStream.load(syntheticArg); - codeStream.fieldAccess(Opcodes.OPC_putfield, syntheticArg.matchingField, null /* default declaringClass */); + if (syntheticArgs != null) { + for (int i = 0, max = syntheticArgs.length; i < max; i++) { + SyntheticArgumentBinding syntheticArg; + if ((syntheticArg = syntheticArgs[i]).matchingField != null) { + codeStream.aload_0(); + codeStream.load(syntheticArg); + codeStream.fieldAccess(Opcodes.OPC_putfield, syntheticArg.matchingField, null /* default declaringClass */); + } } } }