@@ -32,6 +32,7 @@ public class MiningConfig {
3232 private List <RepoEntry > repositories = Collections .emptyList ();
3333 private int maxFilesPerRepo = 5000 ;
3434 private int timeoutPerRepoMinutes = 10 ;
35+ private String sourceVersion = "1.8" ; //$NON-NLS-1$
3536
3637 public MiningConfig () {
3738 }
@@ -72,29 +73,29 @@ private static MiningConfig fromMap(Map<String, Object> root) {
7273 return config ;
7374 }
7475
75- Map <String , Object > mining = (Map <String , Object >) root .get ("mining" );
76+ Map <String , Object > mining = (Map <String , Object >) root .get ("mining" ); //$NON-NLS-1$
7677 if (mining == null ) {
7778 return config ;
7879 }
7980
8081 // Parse hints
81- Object hintsObj = mining .get ("hints" );
82+ Object hintsObj = mining .get ("hints" ); //$NON-NLS-1$
8283 if (hintsObj instanceof List <?> hintsList ) {
8384 config .hints = hintsList .stream ().map (Object ::toString ).toList ();
8485 }
8586
8687 // Parse repositories
87- Object reposObj = mining .get ("repositories" );
88+ Object reposObj = mining .get ("repositories" ); //$NON-NLS-1$
8889 if (reposObj instanceof List <?> reposList ) {
8990 config .repositories = reposList .stream ().map (obj -> {
9091 if (obj instanceof Map <?, ?> map ) {
9192 RepoEntry entry = new RepoEntry ();
92- entry .setUrl ((String ) map .get ("url" ));
93- Object branchObj = map .get ("branch" );
93+ entry .setUrl ((String ) map .get ("url" )); //$NON-NLS-1$
94+ Object branchObj = map .get ("branch" ); //$NON-NLS-1$
9495 if (branchObj != null ) {
9596 entry .setBranch (branchObj .toString ());
9697 }
97- Object pathsObj = map .get ("paths" );
98+ Object pathsObj = map .get ("paths" ); //$NON-NLS-1$
9899 if (pathsObj instanceof List <?> pathsList ) {
99100 entry .setPaths (pathsList .stream ().map (Object ::toString ).toList ());
100101 }
@@ -105,16 +106,20 @@ private static MiningConfig fromMap(Map<String, Object> root) {
105106 }
106107
107108 // Parse settings
108- Object settingsObj = mining .get ("settings" );
109+ Object settingsObj = mining .get ("settings" ); //$NON-NLS-1$
109110 if (settingsObj instanceof Map <?, ?> settings ) {
110- Object maxFiles = settings .get ("max-files-per-repo" );
111+ Object maxFiles = settings .get ("max-files-per-repo" ); //$NON-NLS-1$
111112 if (maxFiles instanceof Number n ) {
112113 config .maxFilesPerRepo = n .intValue ();
113114 }
114- Object timeout = settings .get ("timeout-per-repo-minutes" );
115+ Object timeout = settings .get ("timeout-per-repo-minutes" ); //$NON-NLS-1$
115116 if (timeout instanceof Number n ) {
116117 config .timeoutPerRepoMinutes = n .intValue ();
117118 }
119+ Object source = settings .get ("source-version" ); //$NON-NLS-1$
120+ if (source != null && !source .toString ().isBlank ()) {
121+ config .sourceVersion = source .toString ();
122+ }
118123 }
119124
120125 return config ;
@@ -151,4 +156,12 @@ public int getTimeoutPerRepoMinutes() {
151156 public void setTimeoutPerRepoMinutes (int timeoutPerRepoMinutes ) {
152157 this .timeoutPerRepoMinutes = timeoutPerRepoMinutes ;
153158 }
159+
160+ public String getSourceVersion () {
161+ return sourceVersion ;
162+ }
163+
164+ public void setSourceVersion (String sourceVersion ) {
165+ this .sourceVersion = sourceVersion != null && !sourceVersion .isBlank () ? sourceVersion : "1.8" ; //$NON-NLS-1$
166+ }
154167}
0 commit comments