clang-format: [Java] Fix more generics formatting.

Before:
  < T extends B > T getInstance(Class<T> type);

After:
  <T extends B> T getInstance(Class<T> type);

llvm-svn: 221124
This commit is contained in:
Daniel Jasper 2014-11-03 02:45:58 +00:00
parent 89a26f012a
commit f056f45b77
2 changed files with 2 additions and 1 deletions

View File

@ -472,7 +472,7 @@ private:
return false;
break;
case tok::less:
if (Tok->Previous && !Tok->Previous->Tok.isLiteral() && parseAngle())
if ((!Tok->Previous || !Tok->Previous->Tok.isLiteral()) && parseAngle())
Tok->Type = TT_TemplateOpener;
else {
Tok->Type = TT_BinaryOperator;

View File

@ -143,6 +143,7 @@ TEST_F(FormatTestJava, Generics) {
"public Map<String, ?> getAll() {\n}");
verifyFormat("public static <R> ArrayList<R> get() {\n}");
verifyFormat("<T extends B> T getInstance(Class<T> type);");
}
TEST_F(FormatTestJava, StringConcatenation) {