Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help config provides suggester config in every element #4488

Open
naseer-nv opened this issue Nov 28, 2023 · 3 comments
Open

help config provides suggester config in every element #4488

naseer-nv opened this issue Nov 28, 2023 · 3 comments

Comments

@naseer-nv
Copy link

Running opengrok help config provides a lot of repeated suggest config settings which are not relevant to the actualy property

Version

opengrok-indexer  -a opengrok.jar -- --version
Nov 28, 2023 1:22:59 PM org.opengrok.indexer.index.Indexer parseOptions
INFO: Indexer options: [--version]
OpenGrok v1.12.23 rev 774e4ae2f505a4c2a6765feed7ca2782e44f8075
 

Steps to reproduce the behavior:

opengrok-indexer  -a opengrok.jar -- --help config
Nov 28, 2023 1:20:10 PM org.opengrok.indexer.index.Indexer parseOptions
INFO: Indexer options: [--help, config]
Configuration examples:

<!-- Sample empty configuration.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<java version="11.0.20.1" class="java.beans.XMLDecoder">
 <object class="org.opengrok.indexer.configuration.Configuration" id="Configuration0">
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
 </object>
</java>

  <!-- Sample for setAllowedSymlinks. Default is [] -->
  <void property="allowedSymlinks">
   <void method="add">
    <string>user-defined-element</string>
   </void>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  

  <!-- Sample for setHandleHistoryOfRenamedFiles. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="handleHistoryOfRenamedFiles">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryBasedReindex. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="historyBasedReindex">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryCache. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="historyCache">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryCachePerPartesEnabled. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="historyCachePerPartesEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryChunkCount. Default is 0 -->
  <void property="historyChunkCount">
   <int>1</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryEnabled. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="historyEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryFileParallelism. Default is 0 -->
  <void property="historyFileParallelism">
   <int>1</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHistoryParallelism. Default is 0 -->
  <void property="historyParallelism">
   <int>1</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setHitsPerPage. Default is 25 -->
  <void property="hitsPerPage">
   <int>26</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIgnoredNames. Default is OpenGrok's standard set of ignored
       files and directories -->
  <void id="IgnoredNames0" property="ignoredNames">
   <void id="IgnoredDirs0" property="ignoredDirs">
    <void property="items">
     <void method="add">
      <string>user-specified-value</string>
     </void>
    </void>
   </void>
   <void id="IgnoredFiles0" property="ignoredFiles">
    <void property="items">
     <void method="add">
      <string>user-specified-value</string>
     </void>
    </void>
   </void>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIncludedNames. Default is an empty filter -->
  <void id="Filter0" property="includedNames">
   <void property="items">
    <void method="add">
     <string>user-specified-(patterns)*</string>
    </void>
    <void method="add">
     <string>user-specified-filename</string>
    </void>
    <void method="add">
     <string>user/specified/path</string>
    </void>
   </void>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIncludeRoot. Default is null -->
  <void property="includeRoot">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIndexCheckTimeout. Default is 60 -->
  <void property="indexCheckTimeout">
   <int>61</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIndexerAuthenticationToken. Default is null -->
  <void property="indexerAuthenticationToken">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIndexerCommandTimeout. Default is 600 -->
  <void property="indexerCommandTimeout">
   <int>601</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIndexingParallelism. Default is 0 -->
  <void property="indexingParallelism">
   <int>1</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setIndexVersionedFilesOnly. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="indexVersionedFilesOnly">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setInteractiveCommandTimeout. Default is 30 -->
  <void property="interactiveCommandTimeout">
   <int>31</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setLastEditedDisplayMode. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="lastEditedDisplayMode">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setListDirsFirst. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="listDirsFirst">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setLuceneLocking. Default is OFF -->
  <void property="luceneLocking">
   <object class="java.lang.Enum" method="valueOf">
    <class>org.opengrok.indexer.configuration.LuceneLockName</class>
    <string>ON</string>
   </object>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMandoc. Default is null -->
  <void property="mandoc">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMaxDirectoryListingThreadCount. Default is 12 -->
  <void property="maxDirectoryListingThreadCount">
   <int>13</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMaxRevisionThreadCount. Default is 12 -->
  <void property="maxRevisionThreadCount">
   <int>13</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMaxSearchThreadCount. Default is 24 -->
  <void id="Integer0" property="hitsPerPage"/>
  <void property="maxSearchThreadCount">
   <object idref="Integer0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMergeCommitsEnabled. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="mergeCommitsEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setMessageLimit. Default is 500 -->
  <void property="messageLimit">
   <int>501</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setNavigateWindowEnabled. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="navigateWindowEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setNestingMaximum. Default is 1 -->
  <void property="nestingMaximum">
   <int>2</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setObfuscatingEMailAddresses. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="obfuscatingEMailAddresses">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setPluginDirectory. Default is null -->
  <void property="pluginDirectory">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setPluginStack. Default is an empty stack -->
  <void id="AuthorizationStack0" property="pluginStack">
   <void property="name">
    <string>user-specified-value</string>
   </void>
   <void property="stack">
    <void method="add">
     <object class="org.opengrok.indexer.authorization.AuthorizationPlugin">
      <void property="flag">
       <object class="java.lang.Enum" method="valueOf">
        <class>org.opengrok.indexer.authorization.AuthControlFlag</class>
        <string>REQUISITE</string>
       </object>
      </void>
      <void property="name">
       <string>user-specified-value</string>
      </void>
     </object>
    </void>
   </void>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setPrintProgress. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="printProgress">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setProjects. Default is {} -->
  <void property="projects">
   <object class="java.util.TreeMap">
    <void method="put">
     <string>user-defined-key</string>
     <object class="org.opengrok.indexer.configuration.Project">
      <void property="historyBasedReindex">
       <boolean>true</boolean>
      </void>
      <void property="historyEnabled">
       <boolean>true</boolean>
      </void>
      <void property="mergeCommitsEnabled">
       <boolean>true</boolean>
      </void>
      <void property="name">
       <string>user-defined-key</string>
      </void>
      <void property="navigateWindowEnabled">
       <boolean>true</boolean>
      </void>
      <void property="path">
       <string>/user/defined/path</string>
      </void>
      <void property="tabSize">
       <int>8</int>
      </void>
     </object>
    </void>
   </object>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setProjectsEnabled. Default is false -->
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="projectsEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setQuickContextScan. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="quickContextScan">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setRamBufferSize. Default is 16.0 -->
  <void property="ramBufferSize">
   <double>17.0</double>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setRemoteScmSupported. Default is OFF -->
  <void property="remoteScmSupported">
   <object class="java.lang.Enum" method="valueOf">
    <class>org.opengrok.indexer.configuration.Configuration$RemoteSCM</class>
    <string>ON</string>
   </object>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setRepositoryInvalidationParallelism. Default is 0 -->
  <void id="Integer0" property="nestingMaximum"/>
  <void property="repositoryInvalidationParallelism">
   <object idref="Integer0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setRestfulCommandTimeout. Default is 60 -->
  <void property="restfulCommandTimeout">
   <int>61</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setReviewPage. Default is null -->
  <void property="reviewPage">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setReviewPattern. Default is \b(\d{4}/\d{3})\b -->
  <void property="reviewPattern">
   <string>Sample Issue \#(\d+)</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setRevisionMessageCollapseThreshold. Default is 200 -->
  <void property="revisionMessageCollapseThreshold">
   <int>201</int>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setScanningDepth. Default is 3 -->
  <void id="Integer0" property="groupsCollapseThreshold"/>
  <void property="scanningDepth">
   <object idref="Integer0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setScopesEnabled. Default is true -->
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="scopesEnabled">
   <object idref="Boolean0"/>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setServerName. Default is null -->
  <void property="serverName">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setSourceRoot. Default is null -->
  <void property="sourceRoot">
   <string>user-specified-value</string>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setStatsdConfig. Default is
       org.opengrok.indexer.configuration.StatsdConfig@3d6300e8 -->
  <void property="statsdConfig">
   <void property="flavor">
    <object class="java.lang.Enum" method="valueOf">
     <class>io.micrometer.statsd.StatsdFlavor</class>
     <string>ETSY</string>
    </object>
   </void>
   <void property="host">
    <string>foo.bar</string>
   </void>
   <void property="port">
    <int>8125</int>
   </void>
  </void>
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>

  <!-- Sample for setSuggesterConfig. Default is as below but with Boolean
       opposites, non-zeroes decremented by 1, null for allowed-projects, and
       also including "full" in allowed-fields -->
     <void id="Integer0" property="nestingMaximum"/>
     <void id="Boolean1" method="isAllowLeadingWildcard"/>
    </void>
    <object idref="Integer0"/>
   </void>
   <void property="rebuildCronConfig">
    <string>1 0 * * *</string>
   </void>
   <void property="rebuildThreadPoolSizeInNcpuPercent">
    <int>81</int>
   </void>
   <void property="showProjects">
    <object idref="Boolean0"/>
   </void>
   <void property="showScores">
    <object idref="Boolean1"/>
   </void>
   <void property="showTime">
    <object idref="Boolean1"/>
   </void>
   <void property="timeThreshold">
    <int>2001</int>
   </void>
  </void>

  <!-- Sample for setTabSize. Default is 0 -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void id="Integer0" property="nestingMaximum"/>
  <void property="tabSize">
   <object idref="Integer0"/>
  </void>

  <!-- Sample for setTagsEnabled. Default is false -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="tagsEnabled">
   <object idref="Boolean0"/>
  </void>

  <!-- Sample for setUseHistoryCacheForDirectoryListing. Default is true -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void id="Boolean0" method="isAllowInsecureTokens"/>
  <void property="useHistoryCacheForDirectoryListing">
   <object idref="Boolean0"/>
  </void>

  <!-- Sample for setUserPage. Default is null -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void property="userPage">
   <string>user-specified-value</string>
  </void>

  <!-- Sample for setUserPageSuffix. Default is  -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void property="userPageSuffix">
   <string>user-specified-value</string>
  </void>

  <!-- Sample for setWebappCtags. Default is false -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void id="Boolean0" method="isAllowLeadingWildcard"/>
  <void property="webappCtags">
   <object idref="Boolean0"/>
  </void>

  <!-- Sample for setWebappLAF. Default is default -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void property="webappLAF">
   <string>user-specified-value</string>
  </void>

  <!-- Sample for setWebappStartCommandTimeout. Default is 5 -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void property="webappStartCommandTimeout">
   <int>6</int>
  </void>

  <!-- Sample for setXrefTimeout. Default is 30 -->
  <void id="SuggesterConfig0" property="suggesterConfig">
   <void property="allowedFields">
    <void method="clear"/>
    <void method="add">
     <string>defs</string>
    </void>
    <void method="add">
     <string>path</string>
    </void>
    <void method="add">
     <string>hist</string>
    </void>
    <void method="add">
     <string>refs</string>
    </void>
    <void method="add">
     <string>type</string>
    </void>
    <void method="add">
     <string>full</string>
    </void>
   </void>
  </void>
  <void property="xrefTimeout">
   <long>31</long>
  </void>

Expected behavior
XML should have only proper configuration

Additional context
Add any other context about the problem here.

@naseer-nv
Copy link
Author

Reduced the XML size to allow the bug to go through but the issue is apparent from the XML

@naseer-nv naseer-nv changed the title help config provides suggester config in ever element help config provides suggester config in every element Nov 28, 2023
@idodeclare
Copy link
Contributor

We missed that this broke in b13c5a0, since at the time OpenGrok configuration-related serialization had already been afflicted by OpenJDK issue, "Unstable behavior of java.beans.XMLEncoder since Java 9".

Interestingly, it seems there's now a workaround documented in "Unstable behavior of java.beans.XMLEncoder since Java 9". So probably both issues could be fixed together.

@vladak
Copy link
Member

vladak commented Nov 29, 2023

Another reason for using different serialization scheme for configuration (#2329).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants