Skip to content

Commit 032910f

Browse files
committed
Fix Configuration javadoc. Rem superfluous ctags overrides.
1 parent b690212 commit 032910f

15 files changed

+23
-54
lines changed

src/org/opensolaris/opengrok/configuration/Configuration.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,7 @@ public void setCmds(Map<String, String> cmds) {
513513
}
514514

515515
/**
516-
* Gets the configuration's ctags command. Default is the system property
517-
* for {@code "org.opensolaris.opengrok.analysis.Ctags"} or else the value
518-
* {@code "ctags"}.
516+
* Gets the configuration's ctags command. Default is null.
519517
* @return the configured value
520518
*/
521519
public String getCtags() {
@@ -524,16 +522,14 @@ public String getCtags() {
524522

525523
/**
526524
* Sets the configuration's ctags command.
527-
* @param ctags A program name (full-path if necessary)
525+
* @param ctags A program name (full-path if necessary) or {@code null}
528526
*/
529527
public void setCtags(String ctags) {
530528
this.ctags = ctags;
531529
}
532530

533531
/**
534-
* Gets the configuration's mandoc command. Default is the system property
535-
* for {@code "org.opensolaris.opengrok.analysis.Mandoc"} or else
536-
* {@code null}.
532+
* Gets the configuration's mandoc command. Default is {@code null}.
537533
* @return the configured value
538534
*/
539535
public String getMandoc() {
@@ -542,8 +538,7 @@ public String getMandoc() {
542538

543539
/**
544540
* Sets the configuration's mandoc command.
545-
* @param value A program name (full-path if necessary) or {@code null} to
546-
* disable mandoc rendering.
541+
* @param value A program name (full-path if necessary) or {@code null}
547542
*/
548543
public void setMandoc(String value) {
549544
this.mandoc = value;

test/org/opensolaris/opengrok/analysis/c/CAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.c;
2525

@@ -56,8 +56,6 @@
5656
*/
5757
public class CAnalyzerFactoryTest {
5858

59-
private static final String CTAGS_PROP =
60-
"org.opensolaris.opengrok.analysis.Ctags";
6159
private static Ctags ctags;
6260
private static TestRepository repository;
6361
private static FileAnalyzer analyzer;
@@ -83,7 +81,6 @@ public static void setUpClass() throws Exception {
8381
CAnalyzerFactory analFact = new CAnalyzerFactory();
8482
analyzer = analFact.getAnalyzer();
8583
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
86-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8784
if (env.validateExuberantCtags()) {
8885
analyzer.setCtags(new Ctags());
8986
}

test/org/opensolaris/opengrok/analysis/c/CxxAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.c;
2525

@@ -56,8 +56,6 @@
5656
*/
5757
public class CxxAnalyzerFactoryTest {
5858

59-
private static final String CTAGS_PROP =
60-
"org.opensolaris.opengrok.analysis.Ctags";
6159
private static Ctags ctags;
6260
private static TestRepository repository;
6361
private static FileAnalyzer analyzer;
@@ -83,7 +81,6 @@ public static void setUpClass() throws Exception {
8381
CxxAnalyzerFactory analFact = new CxxAnalyzerFactory();
8482
analyzer = analFact.getAnalyzer();
8583
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
86-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8784
if (env.validateExuberantCtags()) {
8885
analyzer.setCtags(new Ctags());
8986
}

test/org/opensolaris/opengrok/analysis/clojure/ClojureAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.clojure;
2525

@@ -54,8 +54,6 @@
5454
*/
5555
public class ClojureAnalyzerFactoryTest {
5656

57-
private static final String CTAGS_PROP =
58-
"org.opensolaris.opengrok.analysis.Ctags";
5957
private static Ctags ctags;
6058
private static TestRepository repository;
6159
private static FileAnalyzer analyzer;
@@ -81,7 +79,6 @@ public static void setUpClass() throws Exception {
8179
ClojureAnalyzerFactory analFact = new ClojureAnalyzerFactory();
8280
analyzer = analFact.getAnalyzer();
8381
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
84-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8582
if (env.validateExuberantCtags()) {
8683
analyzer.setCtags(new Ctags());
8784
}

test/org/opensolaris/opengrok/analysis/csharp/CSharpAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.csharp;
2525

@@ -51,8 +51,6 @@
5151
*/
5252
public class CSharpAnalyzerFactoryTest {
5353

54-
private static final String CTAGS_PROP =
55-
"org.opensolaris.opengrok.analysis.Ctags";
5654
private static Ctags ctags;
5755
private static TestRepository repository;
5856
private static FileAnalyzer analyzer;
@@ -78,7 +76,6 @@ public static void setUpClass() throws Exception {
7876
CSharpAnalyzerFactory analFact = new CSharpAnalyzerFactory();
7977
analyzer = analFact.getAnalyzer();
8078
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
81-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8279
if (env.validateExuberantCtags()) {
8380
analyzer.setCtags(new Ctags());
8481
}

test/org/opensolaris/opengrok/analysis/java/JavaAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.java;
2525

@@ -56,8 +56,6 @@
5656
*/
5757
public class JavaAnalyzerFactoryTest {
5858

59-
private static final String CTAGS_PROP =
60-
"org.opensolaris.opengrok.analysis.Ctags";
6159
private static Ctags ctags;
6260
private static TestRepository repository;
6361
private static FileAnalyzer analyzer;
@@ -83,7 +81,6 @@ public static void setUpClass() throws Exception {
8381
JavaAnalyzerFactory analFact = new JavaAnalyzerFactory();
8482
analyzer = analFact.getAnalyzer();
8583
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
86-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8784
if (env.validateExuberantCtags()) {
8885
analyzer.setCtags(new Ctags());
8986
}

test/org/opensolaris/opengrok/analysis/pascal/PascalAnalyzerFactoryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.analysis.pascal;
2525

@@ -53,8 +53,6 @@
5353
*/
5454
public class PascalAnalyzerFactoryTest {
5555

56-
private static final String CTAGS_PROP =
57-
"org.opensolaris.opengrok.analysis.Ctags";
5856
private static Ctags ctags;
5957
private static TestRepository repository;
6058
private static FileAnalyzer analyzer;
@@ -80,7 +78,6 @@ public static void setUpClass() throws Exception {
8078
PascalAnalyzerFactory analyzerFactory = new PascalAnalyzerFactory();
8179
analyzer = analyzerFactory.getAnalyzer();
8280
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
83-
env.setCtags(System.getProperty(CTAGS_PROP, "ctags"));
8481
if (env.validateExuberantCtags()) {
8582
analyzer.setCtags(new Ctags());
8683
}

test/org/opensolaris/opengrok/configuration/RuntimeEnvironmentTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ public void testCtags() {
209209
String path = "/usr/bin/ctags";
210210
instance.setCtags(path);
211211
assertEquals(path, instance.getCtags());
212+
213+
instance.setCtags(null);
214+
instanceCtags = instance.getCtags();
215+
assertTrue("instance ctags should equals 'ctags' or the sys property",
216+
instanceCtags.equals("ctags") || instanceCtags.equals(
217+
System.getProperty("org.opensolaris.opengrok.analysis.Ctags")));
212218
}
213219

214220
@Test

test/org/opensolaris/opengrok/configuration/messages/ProjectMessageTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opensolaris.opengrok.configuration.messages;
2525

@@ -65,7 +65,6 @@ public class ProjectMessageTest {
6565
RuntimeEnvironment env;
6666

6767
private static TestRepository repository = new TestRepository();
68-
private final String ctagsProperty = "org.opensolaris.opengrok.analysis.Ctags";
6968

7069
@Before
7170
public void setUp() throws IOException {
@@ -253,8 +252,6 @@ public void testRepositoryRefresh() throws Exception {
253252
public void testDelete() throws Exception {
254253
String projectsToDelete[] = { "git", "svn" };
255254

256-
env.setCtags(System.getProperty(ctagsProperty, "ctags"));
257-
258255
assertTrue("No point in running indexer tests without valid ctags",
259256
RuntimeEnvironment.getInstance().validateExuberantCtags());
260257

test/org/opensolaris/opengrok/index/IndexDatabaseTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
22+
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
2223
*/
2324
package org.opensolaris.opengrok.index;
2425

@@ -48,15 +49,13 @@ public class IndexDatabaseTest {
4849

4950
private static TestRepository repository;
5051
private static IndexerParallelizer parallelizer;
51-
private final static String ctagsProperty = "org.opensolaris.opengrok.analysis.Ctags";
5252

5353
public IndexDatabaseTest() {
5454
}
5555

5656
@BeforeClass
5757
public static void setUpClass() throws Exception {
5858
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
59-
env.setCtags(System.getProperty(ctagsProperty, "ctags"));
6059
assertTrue("No ctags available", env.validateExuberantCtags());
6160

6261
repository = new TestRepository();

0 commit comments

Comments
 (0)