From b5c8ecae344b5697210b9aa9a3ce08b608cea239 Mon Sep 17 00:00:00 2001
From: Kurt Alfred Kluever The package declaration is not line-wrapped. The column limit (Section 4.4,
+ Every source file must have a package declaration.
+Compact source files are not used. (This rule obviously does not apply to
+ The package declaration is not line-wrapped. The column limit (Section 4.4,
Column limit: 100) does not apply to package declarations. Wildcard ("on-demand") imports, static or otherwise, are not
used.
+Module imports are not used. Example: Imports are not line-wrapped. The column limit (Section 4.4,
@@ -855,7 +870,7 @@ package com.example.frozzler;
Exception: A single parameterless annotation
-may instead appear together with the first line of the signature, for example: Exception: If the method or constructor only has a
+single, parameterless annotation, it may appear together with the first
+line of the signature, for example:3.2 Package declaration
-module-info.java files, which have a different syntax that does not include a
+package declaration.)
+
+3.3.1.1 No module imports
+
+import module java.base;
+
+
3.3.2 No line-wrapping
/** This is a module. */
@Deprecated
-@SuppressWarnings("CheckReturnValue")
+@SuppressWarnings("CheckReturnValue") // TODO: b/123 - Fix existing CRV violations.
module com.example.frozzler { ... }
@@ -869,8 +884,9 @@ module com.example.frozzler { ... }
public String getNameIfPresent() { ... }
-@Override public int hashCode() { ... }
@@ -1111,6 +1127,14 @@ be styled as constants.
FooBarT).
+The _ syntax for unnamed variables and parameters is
+allowed wherever it is applicable. For example:
Predicate<String> alwaysTrue = _ -> true; ++
try {
int i = Integer.parseInt(response);
return handleNumericResponse(i);
-} catch (NumberFormatException ok) {
+} catch (NumberFormatException _) {
// it's not numeric; that's fine, just continue
}
return handleTextResponse(response);