From 5dd8795a10f553eb3616a27f2ecee6cebb353b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20Anderse=CC=81n?= Date: Thu, 10 Sep 2015 19:56:50 +0300 Subject: [PATCH] Add @SuppressWarnings("unused") to generated Java classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usually generators add @SuppressWarnings("all") to generated Java classes to prevent IDEs from complaining about unused imports, etc. Solving used imports seems pretty hard with current generator logic so IMO this is the next best thing. Yes, it’s appended to import block but that is the block that gives these warnings in the first place. --- src/idl_gen_general.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 3b597cf7a..fdb6df795 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -118,7 +118,7 @@ LanguageParameters language_parameters[] = { "position()", "offset()", "import java.nio.*;\nimport java.lang.*;\nimport java.util.*;\n" - "import com.google.flatbuffers.*;\n\n", + "import com.google.flatbuffers.*;\n\n@SuppressWarnings(\"unused\")\n", { "/**", " *",