Fixed previous patch for empty switch statements by removing unused import,
and adds test case to check for the failure.
Patch by: jat
Review by: scottb
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1803 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jdt/FindDeferredBindingSitesVisitor.java b/dev/core/src/com/google/gwt/dev/jdt/FindDeferredBindingSitesVisitor.java
index ed3c0fb..e13b083 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/FindDeferredBindingSitesVisitor.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/FindDeferredBindingSitesVisitor.java
@@ -26,7 +26,6 @@
import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblem;
import org.eclipse.jdt.internal.compiler.problem.ProblemHandler;
-import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import java.util.Map;
diff --git a/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java b/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java
index 9449f5f..6640fd0 100644
--- a/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/CompilerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Google Inc.
+ * Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -27,6 +27,12 @@
*/
public class CompilerTest extends GWTTestCase {
+ public static class Foo {
+ public int bar(int i) {
+ return 0;
+ }
+ }
+
private abstract static class Apple implements Fruit {
}
@@ -734,6 +740,12 @@
assertEquals(3, i);
}
+ public void testSwitchStatementEmpty() {
+ Foo foo = new Foo();
+ switch (foo.bar(0)) {
+ }
+ }
+
public void testSwitchStatementFallthroughs() {
int i = 1;
switch (i) {