<div dir="ltr">Yes, of course, thanks. Done in r222011.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 14, 2014 at 5:29 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Fri, Nov 14, 2014 at 1:05 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: djasper<br>
Date: Fri Nov 14 03:05:32 2014<br>
New Revision: 221979<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221979&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221979&view=rev</a><br>
Log:<br>
clang-format: [Java] Improve generic return type formatting.<br>
<br>
Before:<br>
public<R> ArrayList<R> get() {<br>
<br>
After:<br>
public <R> ArrayList<R> get() {<br>
<br>
Modified:<br>
cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
cfe/trunk/unittests/Format/FormatTestJava.cpp<br>
<br>
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=221979&r1=221978&r2=221979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=221979&r1=221978&r2=221979&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)<br>
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Fri Nov 14 03:05:32 2014<br>
@@ -<a href="tel:1684" value="+491684" target="_blank">1684</a>,7 +1684,8 @@ bool TokenAnnotator::spaceRequiredBefore<br>
} else if (Style.Language == FormatStyle::LK_Java) {<br>
if (Left.is(Keywords.kw_synchronized) && Right.is(tok::l_paren))<br>
return Style.SpaceBeforeParens != FormatStyle::SBPO_Never;<br>
- if (Left.is(tok::kw_static) && Right.Type == TT_TemplateOpener)<br>
+ if (Left.isOneOf(tok::kw_static, tok::kw_public) &&<br></blockquote><div><br></div></div></div><div>Don't you want this for private and protected as well?</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ Right.Type == TT_TemplateOpener)<br>
return true;<br>
}<br>
if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo())<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTestJava.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestJava.cpp?rev=221979&r1=221978&r2=221979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestJava.cpp?rev=221979&r1=221978&r2=221979&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTestJava.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTestJava.cpp Fri Nov 14 03:05:32 2014<br>
@@ -205,6 +205,7 @@ TEST_F(FormatTestJava, Generics) {<br>
verifyFormat("@Override\n"<br>
"public Map<String, ?> getAll() {\n}");<br>
<br>
+ verifyFormat("public <R> ArrayList<R> get() {\n}");<br>
verifyFormat("public static <R> ArrayList<R> get() {\n}");<br>
verifyFormat("<T extends B> T getInstance(Class<T> type);");<br>
verifyFormat("Function<F, ? extends T> function;");<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div>