Skip to content

Commit

Permalink
[MRESOLVER-632][MRESOLVER-640] Remove unneded error cases (#620)
Browse files Browse the repository at this point in the history
Remove unneded error cases, as this is only about
"beutify". Remove running numbers from web page
as well.

---

https://issues.apache.org/jira/browse/MRESOLVER-632
https://issues.apache.org/jira/browse/MRESOLVER-640
  • Loading branch information
cstamas authored Dec 12, 2024
1 parent 77e9b91 commit c4ca019
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -71,7 +70,7 @@ public static void main(String[] args) {

protected static final String KEY = "key";

enum Mode {
public enum Mode {
maven,
resolver
}
Expand Down Expand Up @@ -125,7 +124,7 @@ public Integer call() {
}
}

Collections.sort(discoveredKeys, Comparator.comparing(e -> e.get(KEY)));
discoveredKeys.sort(Comparator.comparing(e -> e.get(KEY)));

Properties properties = new Properties();
properties.setProperty("resource.loaders", "classpath");
Expand Down Expand Up @@ -194,24 +193,22 @@ public void visitEnd() {
.getFullText()
.replace("*", "\\*");
String since = getSince(f);
String source =
switch ((values.get("source") != null
? (String) values.get("source")
: "USER_PROPERTIES") // TODO: enum
.toLowerCase()) {
case "model" -> "Model properties";
case "user_properties" -> "User properties";
default -> throw new IllegalStateException();
};
String type =
switch ((values.get("type") != null
? (String) values.get("type")
: "java.lang.String")) {
case "java.lang.String" -> "String";
case "java.lang.Integer" -> "Integer";
case "java.lang.Boolean" -> "Boolean";
default -> throw new IllegalStateException();
};
String source = (values.get("source") != null
? (String) values.get("source")
: "USER_PROPERTIES") // TODO: enum
.toLowerCase();
source = switch (source) {
case "model" -> "Model properties";
case "user_properties" -> "User properties";
default -> source;};
String type = (values.get("type") != null
? (String) values.get("type")
: "java.lang.String");
if (type.startsWith("java.lang.")) {
type = type.substring("java.lang.".length());
} else if (type.startsWith("java.util.")) {
type = type.substring("java.util.".length());
}
discoveredKeys.add(Map.of(
KEY,
fieldValue.toString(),
Expand Down
6 changes: 3 additions & 3 deletions maven-resolver-tools/src/main/resources/configuration.md.vm
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ under the License.
#if ($val) `$val` #else - #end
#end

| No | Key | Type | Description | Default Value | Since | Supports Repo ID suffix | Source |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Key | Type | Description | Default Value | Since | Supports Repo ID suffix | Source |
| --- | --- | --- | --- | --- | --- | --- |
#foreach($key in $keys)
| $foreach.count. | `$key.key` | `$key.configurationType` | $key.description | #value( $key.defaultValue ) | $key.since | $key.supportRepoIdSuffix | $key.configurationSource |
| `$key.key` | `$key.configurationType` | $key.description | #value( $key.defaultValue ) | $key.since | $key.supportRepoIdSuffix | $key.configurationSource |
#end

#[[
Expand Down
Loading

0 comments on commit c4ca019

Please sign in to comment.