|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | /*
|
21 |
| - * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. |
| 21 | + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. |
22 | 22 | * Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected]>.
|
23 | 23 | */
|
24 | 24 | package org.opengrok.indexer.configuration;
|
@@ -628,8 +628,7 @@ public String getCtags() {
|
628 | 628 | }
|
629 | 629 |
|
630 | 630 | String value = syncReadConfiguration(Configuration::getCtags);
|
631 |
| - return value != null ? value : |
632 |
| - System.getProperty(CtagsUtil.SYSTEM_CTAGS_PROPERTY, "ctags"); |
| 631 | + return value != null ? value : System.getProperty(CtagsUtil.SYSTEM_CTAGS_PROPERTY, "ctags"); |
633 | 632 | }
|
634 | 633 |
|
635 | 634 | /**
|
@@ -699,26 +698,20 @@ public void setHitsPerPage(int hitsPerPage) {
|
699 | 698 | * Validate that there is a Universal ctags program that can actually process input files
|
700 | 699 | * under source root.
|
701 | 700 | * <br>
|
702 |
| - * As a side effect, this sets the set of ctags languages that is used by the ctags program. |
| 701 | + * As a side effect, this sets the set of ctags languages that is used by the <code>ctags</code> program. |
703 | 702 | *
|
704 | 703 | * @return true if success, false otherwise
|
705 | 704 | */
|
706 |
| - public boolean validateUniversalCtags() { |
| 705 | + public synchronized boolean validateUniversalCtags() { |
707 | 706 | if (ctagsFound == null) {
|
708 |
| - try (ResourceLock resourceLock = configLock.writeLockAsResource()) { |
709 |
| - //noinspection ConstantConditions to avoid warning of no reference to auto-closeable |
710 |
| - assert resourceLock != null; |
711 |
| - if (ctagsFound == null) { |
712 |
| - String ctagsBinary = getCtags(); |
713 |
| - if (ctagsLanguages.isEmpty()) { |
714 |
| - // The ctagsLanguages are necessary for the call to validate() below. |
715 |
| - Set<String> languages = CtagsUtil.getLanguages(ctagsBinary); |
716 |
| - ctagsLanguages.addAll(languages); |
717 |
| - } |
718 |
| - |
719 |
| - ctagsFound = CtagsUtil.validate(ctagsBinary); |
720 |
| - } |
| 707 | + String ctagsBinary = getCtags(); |
| 708 | + if (ctagsLanguages.isEmpty()) { |
| 709 | + // The ctagsLanguages are necessary for the call to validate() below. |
| 710 | + Set<String> languages = CtagsUtil.getLanguages(ctagsBinary); |
| 711 | + ctagsLanguages.addAll(languages); |
721 | 712 | }
|
| 713 | + |
| 714 | + ctagsFound = CtagsUtil.validate(ctagsBinary); |
722 | 715 | }
|
723 | 716 |
|
724 | 717 | if (ctagsFound) {
|
|
0 commit comments