Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasikanth Bharadwaj2015-07-02 06:27:06 +0000
committerSasikanth Bharadwaj2015-07-02 08:10:43 +0000
commit3fa398907bc325a632b9517a054fc223461325fb (patch)
treecf36734dcd2687607bde0280387c3b1fa405e5b6
parent7484e25e299b8203b28cf436ac2de883b2f5dd8e (diff)
downloadeclipse.jdt.core-3fa398907bc325a632b9517a054fc223461325fb.tar.gz
eclipse.jdt.core-3fa398907bc325a632b9517a054fc223461325fb.tar.xz
eclipse.jdt.core-3fa398907bc325a632b9517a054fc223461325fb.zip
Fixed bug 464570 [compiler][codegen] race condition on static field
CodeStream.noVisibleLocals in method CodeStream.init() Change-Id: I22762ca6034a147206a1541a7f2eb3f5e64fb774
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java26
1 files changed, 1 insertions, 25 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index 8a1c987a0b..85da064da3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -65,10 +65,6 @@ public class CodeStream {
public static final int LABELS_INCREMENT = 5;
// local variable attributes output
public static final int LOCALS_INCREMENT = 10;
- static ExceptionLabel[] noExceptionHandlers = new ExceptionLabel[LABELS_INCREMENT];
- static BranchLabel[] noLabels = new BranchLabel[LABELS_INCREMENT];
- static LocalVariableBinding[] noLocals = new LocalVariableBinding[LOCALS_INCREMENT];
- static LocalVariableBinding[] noVisibleLocals = new LocalVariableBinding[LOCALS_INCREMENT];
public static final CompilationResult RESTART_IN_WIDE_MODE = new CompilationResult((char[])null, 0, 0, 0);
public static final CompilationResult RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE = new CompilationResult((char[])null, 0, 0, 0);
@@ -4107,32 +4103,12 @@ public void init(ClassFile targetClassFile) {
this.startingClassFileOffset = this.classFileOffset;
this.pcToSourceMapSize = 0;
this.lastEntryPC = 0;
- int length = this.visibleLocals.length;
- if (noVisibleLocals.length < length) {
- noVisibleLocals = new LocalVariableBinding[length];
- }
- System.arraycopy(noVisibleLocals, 0, this.visibleLocals, 0, length);
this.visibleLocalsCount = 0;
- length = this.locals.length;
- if (noLocals.length < length) {
- noLocals = new LocalVariableBinding[length];
- }
- System.arraycopy(noLocals, 0, this.locals, 0, length);
this.allLocalsCounter = 0;
- length = this.exceptionLabels.length;
- if (noExceptionHandlers.length < length) {
- noExceptionHandlers = new ExceptionLabel[length];
- }
- System.arraycopy(noExceptionHandlers, 0, this.exceptionLabels, 0, length);
this.exceptionLabelsCounter = 0;
- length = this.labels.length;
- if (noLabels.length < length) {
- noLabels = new BranchLabel[length];
- }
- System.arraycopy(noLabels, 0, this.labels, 0, length);
this.countLabels = 0;
this.lastAbruptCompletion = -1;

Back to the top