#ref thrown
null.thrown.quickfix=Replace with 'new NullPointerException()'
+element.only.used.from.test.code.display.name=Symbol only used from test code
+class.only.used.from.test.code.problem.descriptor=class #ref only used from test code #loc
+method.only.used.from.test.code.problem.descriptor=method #ref only called from test code #loc
+field.only.used.from.test.code.problem.descriptor=field #ref only accessed from test code #loc
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/InspectionGadgetsPlugin.java b/plugins/InspectionGadgets/src/com/siyeh/ig/InspectionGadgetsPlugin.java
index bd2f826922e4..b193d10f99b9 100644
--- a/plugins/InspectionGadgets/src/com/siyeh/ig/InspectionGadgetsPlugin.java
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/InspectionGadgetsPlugin.java
@@ -74,6 +74,7 @@ import com.siyeh.ig.numeric.*;
import com.siyeh.ig.packaging.*;
import com.siyeh.ig.performance.*;
import com.siyeh.ig.portability.*;
+import com.siyeh.ig.redundancy.ElementOnlyUsedFromTestCodeInspection;
import com.siyeh.ig.redundancy.UnusedLabelInspection;
import com.siyeh.ig.resources.*;
import com.siyeh.ig.security.*;
@@ -985,6 +986,7 @@ public class InspectionGadgetsPlugin implements ApplicationComponent,
}
private void registerRedundancyInspections() {
+ m_inspectionClasses.add(ElementOnlyUsedFromTestCodeInspection.class);
m_inspectionClasses.add(UnusedLabelInspection.class);
}
diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/ElementOnlyUsedFromTestCodeInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/ElementOnlyUsedFromTestCodeInspection.java
new file mode 100644
index 000000000000..1a4ff58e143a
--- /dev/null
+++ b/plugins/InspectionGadgets/src/com/siyeh/ig/redundancy/ElementOnlyUsedFromTestCodeInspection.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2011 Bas Leijdekkers
+ *
+ * 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 the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.siyeh.ig.redundancy;
+
+import com.intellij.analysis.AnalysisScope;
+import com.intellij.codeInsight.TestUtil;
+import com.intellij.codeInspection.*;
+import com.intellij.codeInspection.reference.*;
+import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.siyeh.InspectionGadgetsBundle;
+import com.siyeh.ig.BaseGlobalInspection;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class ElementOnlyUsedFromTestCodeInspection
+ extends BaseGlobalInspection {
+
+ private static final Key+New in 11, Powered by InspectionGadgets + + \ No newline at end of file