Index: cfe/trunk/lib/Format/UnwrappedLineParser.cpp =================================================================== --- cfe/trunk/lib/Format/UnwrappedLineParser.cpp +++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp @@ -1130,6 +1130,10 @@ nextToken(); parseBracedList(); break; + } else if (Style.Language == FormatStyle::LK_Java && + FormatTok->is(Keywords.kw_interface)) { + nextToken(); + break; } switch (FormatTok->Tok.getObjCKeywordID()) { case tok::objc_public: Index: cfe/trunk/unittests/Format/FormatTestJava.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestJava.cpp +++ cfe/trunk/unittests/Format/FormatTestJava.cpp @@ -155,6 +155,15 @@ " void doStuff(int theStuff);\n" " void doMoreStuff(int moreStuff);\n" "}"); + verifyFormat("class A {\n" + " public @interface SomeInterface {\n" + " int stuff;\n" + " void doMoreStuff(int moreStuff);\n" + " }\n" + "}"); + verifyFormat("class A {\n" + " public @interface SomeInterface {}\n" + "}"); } TEST_F(FormatTestJava, AnonymousClasses) {