diff --git a/infer/annotations/Makefile b/infer/annotations/Makefile index 4749f6946..970b2adb7 100644 --- a/infer/annotations/Makefile +++ b/infer/annotations/Makefile @@ -11,9 +11,7 @@ include $(ROOT_DIR)/Makefile.config CWD = $(shell pwd) JSR_JAR = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar ANNOT_SOURCES = $(shell find com/facebook/infer/annotation -name "*.java") -PROCESSOR_SOURCES = $(shell find com/facebook/infer/annotprocess -name "*.java") ANNOT_CLASSES = 'annot_classes' -PROCESSOR_CLASSES = 'processor_classes' ANNOTATIONS_JAR = $(CWD)/annotations.jar @@ -27,4 +25,3 @@ $(ANNOTATIONS_JAR): $(ANNOT_SOURCES) clean: @rm -rf $(ANNOT_CLASSES) @rm -f $(ANNOTATIONS_JAR) - @rm -rf $(PROCESSOR_CLASSES) diff --git a/infer/annotations/com/facebook/infer/annotprocess/JSONOutputUtils.java b/infer/annotations/com/facebook/infer/annotprocess/JSONOutputUtils.java deleted file mode 100644 index 9f50e2cde..000000000 --- a/infer/annotations/com/facebook/infer/annotprocess/JSONOutputUtils.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package com.facebook.infer.annotprocess; - -import java.io.PrintWriter; - -/** Clearly, we should be using an existing JSON output library like Jackson here. However, we can't - * do this because we do not want to add Jackson (or another JSON library) to the classpath of the - * Java program we are building (along with the JAR for this processor). The reason is that if - * there is a different version of the JSON parser library somewhere in the classpath for the - * project, it could cause *very* strange problems. Instead, we rol our own library to avoid - * introducing depencies on code that the projects we analyze might be using. - */ -public class JSONOutputUtils { - - private static final String TAB = " "; - - private JSONOutputUtils() {} - - // print a comma between all JSON objects except for the last one - public static void outputCommaIfNotLast(PrintWriter out, int elemCount, int elemMax) { - if (elemCount == elemMax) { - out.println(""); - } else { - out.println(","); - } - } - - public static void outputTabbed(PrintWriter out, String toWrite, int numTabs) { - for (int i = 0; i < numTabs; i++) { - out.print(TAB); - } - out.print(toWrite); - } - - public static void outputlnTabbed(PrintWriter out, String toWrite, int numTabs) { - outputTabbed(out, toWrite, numTabs); - out.println(); - } - - public static String quote(String raw) { - return "\"" + raw + "\""; - } - - public static void outputMethod(PrintWriter out, String clazz, String method, - int elemCount, int elemMax) { - outputlnTabbed(out, "{", 1); - outputlnTabbed(out, "\"language\": \"Java\",", 2); - outputTabbed(out, "\"class\": \"" + clazz + "\"", 2); - if (method != null) { - out.println(","); - outputlnTabbed(out, "\"method\": \"" + method + "\"", 2); - } else { - out.println(); - } - outputlnTabbed(out, "}", 1); - outputCommaIfNotLast(out, elemCount, elemMax); - } - - public static void outputClass(PrintWriter out, String clazz, int elemCount, int elemMax) { - outputMethod(out, clazz, null, elemCount, elemMax); - } - - public static void outputClassSourcePair(PrintWriter out, String clazz, String source, - int elemCount, int elemMax) { - outputlnTabbed(out, "\"" + clazz + "\": \"" + source + "\"", 1); - outputCommaIfNotLast(out, elemCount, elemMax); - } - -} diff --git a/infer/annotations/com/facebook/infer/annotprocess/Preconditions.java b/infer/annotations/com/facebook/infer/annotprocess/Preconditions.java deleted file mode 100644 index 98a3d1e35..000000000 --- a/infer/annotations/com/facebook/infer/annotprocess/Preconditions.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package com.facebook.infer.annotprocess; - -public class Preconditions { - - public static T checkNotNull(T reference, String errorMessage) { - if (reference == null) { - throw new NullPointerException(errorMessage); - } - return reference; - } - -}