Skip to content

Commit 901b555

Browse files
change loaderRef to loader
1 parent b168afe commit 901b555

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/main/java/me/itzg/helpers/modrinth/ModrinthCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ private Version pickVersion(List<Version> versions, VersionType versionType) {
229229
return null;
230230
}
231231

232-
private Path download(Loader loaderRef, VersionFile versionFile) {
232+
private Path download(Loader loader, VersionFile versionFile) {
233233
final Path outPath;
234234
try {
235-
final Loader effectiveLoader = loaderRef != null ? loaderRef : loader;
235+
final Loader effectiveLoader = loader != null ? loader : loader;
236236
final String outputType = effectiveLoader.getType();
237237

238238
if (outputType == null) {
@@ -298,7 +298,7 @@ private Stream<Path> processProject(ModrinthApiClient modrinthApiClient, Project
298298
log.debug("Starting with project='{}' slug={}", project.getTitle(), project.getSlug());
299299

300300
if (projectsProcessed.add(project.getId())) {
301-
final Loader effectiveLoader = projectRef.getLoaderRef() != null ? projectRef.getLoaderRef() : loader;
301+
final Loader effectiveLoader = projectRef.getLoader() != null ? projectRef.getLoader() : loader;
302302

303303
final Version version;
304304
try {

src/main/java/me/itzg/helpers/modrinth/ProjectRef.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class ProjectRef {
3131
.collect(Collectors.toSet());
3232

3333
private final String idOrSlug;
34-
private final Loader loaderRef;
34+
private final Loader loader;
3535

3636
/**
3737
* Either a remote URI or a file URI for a locally provided file
@@ -44,13 +44,13 @@ public class ProjectRef {
4444
public static ProjectRef parse(String projectRef) {
4545
// First, try to split into potential loader prefix and the rest
4646
final int firstColon = projectRef.indexOf(':');
47-
Loader loaderRef = null;
47+
Loader loader = null;
4848
String rest = projectRef;
4949

5050
if (firstColon > 0) {
5151
final String prefix = projectRef.substring(0, firstColon);
5252
if (VALID_LOADERS.contains(prefix.toLowerCase())) {
53-
loaderRef = Loader.valueOf(prefix);
53+
loader = Loader.valueOf(prefix);
5454
rest = projectRef.substring(firstColon + 1);
5555
}
5656
}
@@ -67,7 +67,7 @@ public static ProjectRef parse(String projectRef) {
6767
idSlug = rest;
6868
}
6969

70-
return new ProjectRef(idSlug, version, loaderRef);
70+
return new ProjectRef(idSlug, version, loader);
7171
}
7272

7373
/**
@@ -81,9 +81,9 @@ public ProjectRef(String projectSlug, String version) {
8181
/**
8282
* @param version can be a {@link VersionType}, ID, or name/number
8383
*/
84-
public ProjectRef(String projectSlug, @Nullable String version, Loader loaderRef) {
84+
public ProjectRef(String projectSlug, @Nullable String version, Loader loader) {
8585
this.idOrSlug = projectSlug;
86-
this.loaderRef = loaderRef;
86+
this.loader = loader;
8787
this.projectUri = null;
8888
this.versionType = parseVersionType(version);
8989
if (this.versionType == null) {
@@ -103,7 +103,7 @@ public ProjectRef(String projectSlug, @Nullable String version, Loader loaderRef
103103
}
104104

105105
public ProjectRef(URI projectUri, String versionId) {
106-
this.loaderRef = null;
106+
this.loader = null;
107107
this.projectUri = projectUri;
108108

109109
final String filename = extractFilename(projectUri);

src/test/java/me/itzg/helpers/modrinth/ProjectRefTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ void constructorPullsProjectSlugFromFileURI(String input) {
139139

140140
@ParameterizedTest
141141
@MethodSource("parseProjectRef_parameters")
142-
void parseProjectRef(String input, String slugId, VersionType versionType, String versionId, String versionName, Loader loaderRef) {
142+
void parseProjectRef(String input, String slugId, VersionType versionType, String versionId, String versionName, Loader loader) {
143143
final ProjectRef result = ProjectRef.parse(input);
144144
assertThat(result.getIdOrSlug()).isEqualTo(slugId);
145145
assertThat(result.getVersionType()).isEqualTo(versionType);
146146
assertThat(result.getVersionId()).isEqualTo(versionId);
147147
assertThat(result.getVersionNumber()).isEqualTo(versionName);
148-
assertThat(result.getLoaderRef()).isEqualTo(loaderRef);
148+
assertThat(result.getLoader()).isEqualTo(loader);
149149
}
150150

151151
public static Stream<Arguments> parseProjectRef_parameters() {

0 commit comments

Comments
 (0)