summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-05-06 11:48:25 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-05-07 09:55:15 (EDT)
commit3918f48f32995190960af36203ee8d76048bb1a1 (patch)
treef68d37a22c02191f0ccc75875ba2d8aae7379c32
parent1867f3c9a772f1c1394c185355445f4e77e3498e (diff)
downloadeclipse.pde.ui-3918f48f32995190960af36203ee8d76048bb1a1.zip
eclipse.pde.ui-3918f48f32995190960af36203ee8d76048bb1a1.tar.gz
eclipse.pde.ui-3918f48f32995190960af36203ee8d76048bb1a1.tar.bz2
Bug 406990 - AIOOBE from ASM - can I disable API tools?refs/changes/38/12538/3
Amending to fix copyright and use better NLS message Change-Id: I68eb33f1148c488c66ecdabf4e4af136941c6186
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.properties3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java14
3 files changed, 16 insertions, 4 deletions
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.java
index 094f8fd..6e06b8a 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 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
@@ -24,6 +24,7 @@ public class Messages extends NLS {
public static String BundleComponent_failed_to_lookup_fragment;
public static String configuring_baseline;
public static String resolving_target_definition;
+ public static String TypeStructureBuilder_badClassFileEncountered;
static {
// initialize resource bundle
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.properties
index a4a9bd2..52463fd 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/Messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2010 IBM Corporation and others.
+# Copyright (c) 2008, 2013 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
@@ -18,3 +18,4 @@ BundleApiComponent_baseline_disposed=Baseline ''{0}'' is disposed
BundleComponent_failed_to_lookup_fragment=Failed to look up resolved fragment: {0}
configuring_baseline=Configuring baseline
resolving_target_definition=resolving target definition...
+TypeStructureBuilder_badClassFileEncountered=API tools encountered a bad class file while building the type structure for: {0}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
index 4ce6263..8275598 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 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
@@ -20,7 +20,10 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.api.tools.internal.model.StubArchiveApiTypeContainer.ArchiveApiTypeRoot;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
@@ -199,7 +202,14 @@ public class TypeStructureBuilder extends ClassAdapter {
ClassReader classReader = new ClassReader(bytes);
classReader.accept(visitor, ClassReader.SKIP_CODE | ClassReader.SKIP_FRAMES);
} catch (ArrayIndexOutOfBoundsException e) {
- ApiPlugin.log(e);
+ if(ApiPlugin.DEBUG_BUILDER) {
+ IStatus status = new Status(IStatus.ERROR,
+ ApiPlugin.PLUGIN_ID,
+ NLS.bind(Messages.TypeStructureBuilder_badClassFileEncountered, file.getTypeName()),
+ e);
+ ApiPlugin.log(status);
+ }
+ return null;
}
return visitor.fType;
}