summaryrefslogtreecommitdiffstats
path: root/tools/android
diff options
context:
space:
mode:
authornewt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 17:18:20 +0000
committernewt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 17:18:20 +0000
commitf0355bde4fb23065760098f36aa71bce0655955a (patch)
tree8d43b1dbfa0b4d7b6b0b08370136ea20ab8292a5 /tools/android
parent69aa91ae3f86c865b909c0539cae56e329363216 (diff)
downloadchromium_src-f0355bde4fb23065760098f36aa71bce0655955a.zip
chromium_src-f0355bde4fb23065760098f36aa71bce0655955a.tar.gz
chromium_src-f0355bde4fb23065760098f36aa71bce0655955a.tar.bz2
Update Java checkstyle naming convention for static final fields.
Static final fields can either be "true" constants, e.g. static final int HEIGHT_PX = 30; static final String TAG = "MyClass" or can have mutable state or not "feel" like a constant, e.g. static final AtomicInteger sNextId; static final Runnable sSuspendTask; This allows either naming convention, FIELD_NAME or sFieldName, at the programmer's discretion. NOTRY=true Review URL: https://codereview.chromium.org/112023009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/android')
-rw-r--r--tools/android/checkstyle/chromium-style-5.0.xml3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml
index 63c869e..dda0772 100644
--- a/tools/android/checkstyle/chromium-style-5.0.xml
+++ b/tools/android/checkstyle/chromium-style-5.0.xml
@@ -46,7 +46,8 @@
</module>
<module name="ConstantName">
<property name="severity" value="warning"/>
- <message key="name.invalidPattern" value="Variable ''{0}'' is a constant and thus should be in ALL_CAPS."/>
+ <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(s[A-Z][a-zA-Z0-9]*)$"/>
+ <message key="name.invalidPattern" value="Static final field names must either be all caps (e.g. int HEIGHT_PX) for 'true' constants, or start with s (e.g. AtomicInteger sNextId or Runnable sSuspendTask) for fields with mutable state or that don't 'feel' like constants."/>
</module>
<!-- Non-public, non-static field names start with m. -->
<module name="MemberName">