Skip to content

Commit 0ec550c

Browse files
ahornacevladak
authored andcommitted
Add ParameterName checkstyle check
1 parent fa055da commit 0ec550c

File tree

12 files changed

+49
-51
lines changed

12 files changed

+49
-51
lines changed

dev/checkstyle/style.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<module name="AnonInnerLength">
3636
<property name="max" value="60"/>
3737
</module>
38+
<module name="ParameterName"/>
3839
<module name="ParameterNumber"/>
3940
<module name="EmptyBlock"/>
4041
<module name="LeftCurly"/>

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public void setTabSize(int tabSize) {
106106
this.tabSize = tabSize;
107107
}
108108

109-
public void setCTagsExtraOptionsFile(String CTagsExtraOptionsFile) {
110-
this.CTagsExtraOptionsFile = CTagsExtraOptionsFile;
109+
public void setCTagsExtraOptionsFile(String ctagsExtraOptionsFile) {
110+
this.CTagsExtraOptionsFile = ctagsExtraOptionsFile;
111111
}
112112

113113
public void setTimeout(long timeout) {

opengrok-indexer/src/main/java/org/opengrok/indexer/history/MercurialRepository.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,23 +310,21 @@ private HistoryRevResult getHistoryRev(BufferSink sink, String fullpath, String
310310
* of a file in historical revision.
311311
*
312312
* @param fullpath file path
313-
* @param full_rev_to_find revision number (in the form of
313+
* @param fullRevToFind revision number (in the form of
314314
* {rev}:{node|short})
315315
* @return original filename
316316
*/
317-
private String findOriginalName(String fullpath, String full_rev_to_find)
318-
throws IOException {
317+
private String findOriginalName(String fullpath, String fullRevToFind) throws IOException {
319318
Matcher matcher = LOG_COPIES_PATTERN.matcher("");
320319
String file = fullpath.substring(getDirectoryName().length() + 1);
321320
ArrayList<String> argv = new ArrayList<>();
322321
File directory = new File(getDirectoryName());
323322

324323
// Extract {rev} from the full revision specification string.
325-
String[] rev_array = full_rev_to_find.split(":");
326-
String rev_to_find = rev_array[0];
327-
if (rev_to_find.isEmpty()) {
328-
LOGGER.log(Level.SEVERE,
329-
"Invalid revision string: {0}", full_rev_to_find);
324+
String[] revArray = fullRevToFind.split(":");
325+
String revToFind = revArray[0];
326+
if (revToFind.isEmpty()) {
327+
LOGGER.log(Level.SEVERE, "Invalid revision string: {0}", fullRevToFind);
330328
return null;
331329
}
332330

@@ -369,7 +367,7 @@ private String findOriginalName(String fullpath, String full_rev_to_find)
369367
String rev = matcher.group(1);
370368
String content = matcher.group(2);
371369

372-
if (rev.equals(rev_to_find)) {
370+
if (rev.equals(revToFind)) {
373371
break;
374372
}
375373

@@ -396,7 +394,7 @@ private String findOriginalName(String fullpath, String full_rev_to_find)
396394
if (status != 0) {
397395
LOGGER.log(Level.WARNING,
398396
"Failed to get original name in revision {2} for: \"{0}\" Exit code: {1}",
399-
new Object[]{fullpath, String.valueOf(status), full_rev_to_find});
397+
new Object[]{fullpath, String.valueOf(status), fullRevToFind});
400398
return null;
401399
}
402400

@@ -494,8 +492,8 @@ public Annotation annotate(File file, String revision) throws IOException {
494492
}
495493

496494
@Override
497-
protected String getRevisionForAnnotate(String history_revision) {
498-
String[] brev = history_revision.split(":");
495+
protected String getRevisionForAnnotate(String historyRevision) {
496+
String[] brev = historyRevision.split(":");
499497

500498
return brev[0];
501499
}

opengrok-indexer/src/main/java/org/opengrok/indexer/history/RCSHistoryParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RCSHistoryParser {
4545

4646
private static final Logger LOGGER = LoggerFactory.getLogger(RCSHistoryParser.class);
4747

48-
private static File readCVSRoot(File root, File CVSdir, String name) throws IOException {
48+
private static File readCVSRoot(File root, File cvsDir, String name) throws IOException {
4949
String cvsroot = readFirstLine(root);
5050

5151
if (cvsroot == null) {
@@ -55,7 +55,7 @@ private static File readCVSRoot(File root, File CVSdir, String name) throws IOEx
5555
return null;
5656
}
5757

58-
File repository = new File(CVSdir, "Repository");
58+
File repository = new File(cvsDir, "Repository");
5959
String repo = readFirstLine(repository);
6060
String dir = cvsroot + File.separatorChar + repo;
6161
String filename = name + ",v";

opengrok-indexer/src/main/java/org/opengrok/indexer/history/Repository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,11 @@ protected void buildTagList(File directory, CommandTimeoutType cmdType) {
374374
/**
375375
* Return revision for annotate view.
376376
*
377-
* @param history_revision full revision
377+
* @param historyRevision full revision
378378
* @return revision string suitable for matching into annotation
379379
*/
380-
protected String getRevisionForAnnotate(String history_revision) {
381-
return history_revision;
380+
protected String getRevisionForAnnotate(String historyRevision) {
381+
return historyRevision;
382382
}
383383

384384
protected void doCreateCache(HistoryCache cache, String sinceRevision, File directory) throws HistoryException {

opengrok-indexer/src/main/java/org/opengrok/indexer/util/Executor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ public Executor(List<String> cmdList, File workingDirectory, int timeout) {
113113
* @param cmdList A list containing the command to execute
114114
* @param workingDirectory The directory the process should have as the
115115
* working directory
116-
* @param UseTimeout terminate the process after default timeout or not
116+
* @param useTimeout terminate the process after default timeout or not
117117
*/
118-
public Executor(List<String> cmdList, File workingDirectory, boolean UseTimeout) {
118+
public Executor(List<String> cmdList, File workingDirectory, boolean useTimeout) {
119119
this(cmdList, workingDirectory);
120-
if (!UseTimeout) {
120+
if (!useTimeout) {
121121
this.timeout = 0;
122122
}
123123
}

opengrok-indexer/src/main/java/org/opengrok/indexer/util/StringUtils.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,21 @@ public static boolean isPossiblyJavaClass(String s) {
8484

8585
/**
8686
* Convert value in milliseconds to readable time.
87-
* @param time_ms delta in milliseconds
87+
* @param timeMs delta in milliseconds
8888
* @return human readable string
8989
*/
90-
public static String getReadableTime(long time_ms) {
90+
public static String getReadableTime(long timeMs) {
9191
StringBuilder output = new StringBuilder();
92-
long time_delta = time_ms;
93-
94-
int milliseconds = (int) (time_delta % 1000);
95-
time_delta /= 1000;
96-
int seconds = (int) (time_delta % 60);
97-
time_delta /= 60;
98-
int minutes = (int) (time_delta % 60);
99-
time_delta /= 60;
100-
int hours = (int) (time_delta % 24);
101-
int days = (int) (time_delta / 24);
92+
long timeDelta = timeMs;
93+
94+
int milliseconds = (int) (timeDelta % 1000);
95+
timeDelta /= 1000;
96+
int seconds = (int) (timeDelta % 60);
97+
timeDelta /= 60;
98+
int minutes = (int) (timeDelta % 60);
99+
timeDelta /= 60;
100+
int hours = (int) (timeDelta % 24);
101+
int days = (int) (timeDelta / 24);
102102

103103
if (days != 0) {
104104
output.append(days);

opengrok-indexer/src/main/java/org/opengrok/indexer/web/Util.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,11 +865,10 @@ public static String fixPathIfWindows(String path) {
865865
* @param out writer for producing output
866866
* @param ctxE URI encoded prefix
867867
* @param entry file/directory name to write
868-
* @param is_dir is directory
868+
* @param isDir is directory
869869
* @throws IOException depends on the destination (<var>out</var>).
870870
*/
871-
public static void writeHAD(Writer out, String ctxE, String entry,
872-
boolean is_dir) throws IOException {
871+
public static void writeHAD(Writer out, String ctxE, String entry, boolean isDir) throws IOException {
873872

874873
String downloadPrefixE = ctxE + Prefix.DOWNLOAD_P;
875874
String xrefPrefixE = ctxE + Prefix.XREF_P;
@@ -887,7 +886,7 @@ public static void writeHAD(Writer out, String ctxE, String entry,
887886
out.write("\" title=\"History\">H</a>");
888887
}
889888

890-
if (!is_dir) {
889+
if (!isDir) {
891890
out.write(" <a href=\"");
892891
out.write(xrefPrefixE);
893892
out.write(entry);

plugins/src/main/java/opengrok/auth/plugin/util/RestfulClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
2323
*/
2424
package opengrok.auth.plugin.util;
@@ -45,17 +45,17 @@ private RestfulClient() {
4545

4646
/**
4747
* Perform HTTP PUT request.
48-
* @param URI URI
48+
* @param uri URI
4949
* @param input JSON string contents
5050
* @return HTTP status or -1
5151
*/
52-
public static int postIt(String URI, String input) {
52+
public static int postIt(String uri, String input) {
5353
try {
5454
Client client = ClientBuilder.newClient();
5555

5656
LOGGER.log(Level.FINEST, "sending REST POST request to {0}: {1}",
57-
new Object[]{URI, input});
58-
Response response = client.target(URI)
57+
new Object[]{uri, input});
58+
Response response = client.target(uri)
5959
.request(MediaType.APPLICATION_JSON)
6060
.post(Entity.entity(input, MediaType.APPLICATION_JSON));
6161

plugins/src/main/java/opengrok/auth/plugin/util/WebHook.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin.util;
2424

@@ -36,13 +36,13 @@ public class WebHook implements Serializable {
3636
public WebHook() {
3737
}
3838

39-
WebHook(String URI, String content) {
40-
this.URI = URI;
39+
WebHook(String uri, String content) {
40+
this.URI = uri;
4141
this.content = content;
4242
}
4343

44-
public void setURI(String URI) {
45-
this.URI = URI;
44+
public void setURI(String uri) {
45+
this.URI = uri;
4646
}
4747
public String getURI() {
4848
return URI;

0 commit comments

Comments
 (0)