Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Doesn't work on Linux due to filesystem structure #12

Open
TheKodeToad opened this issue Jun 15, 2022 · 0 comments
Open

Doesn't work on Linux due to filesystem structure #12

TheKodeToad opened this issue Jun 15, 2022 · 0 comments

Comments

@TheKodeToad
Copy link

TheKodeToad commented Jun 15, 2022

If the csv file is visited first by the lambda, a nullpointerexception is thrown.
At least, this seems to be the problem.

I added debug printing.

@@@@@@@@@@@@@@@@@==@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@==-------=@@@@@@@@@@@@@
@@@@@@@@@@=-----@@@@@@=---=@@@@@@@@@
@@@@@@@@= -=@-  @=@@@@@@@@- @@@@@@@@         Lunar Remapper
@@@@@@@@- @@    =@@@@@@@=@= =@@@@@@@         Version: 1.0-SNAPSHOT
@@@@@@@@- @@     -=@=@@@=@= =@@@@@@@         Developed by Decencies
@@@@@@@@- @=@-         -@@= =@@@@@@@
@@@@@@@@- -               - -@@@@@@@
@@@@@@@@@@===---     -=-===@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
./mappings/1.8.9/fields.csv
Exception in thread "main" java.lang.NullPointerException
	at club.decencies.remapper.lunar.Main.lambda$main$0(Main.java:58)
	at club.decencies.remapper.lunar.util.FileUtil.walk(FileUtil.java:24)
	at club.decencies.remapper.lunar.Main.main(Main.java:49)

As you can see, the folder layout is all correct.

image

Personally, I think it's better only to list the directory layout, and create file objects for each of the expected files, that way the order can be guaranteed.

File mappingsDir = new File("mappings");
for (File mappingDir : mappingsDir.listFiles()) {
  File proguardMappings = new File(mappingDir, mappingDir.getName() + ".txt");
  File specialSourceMappings = new File(mappingDir, mappingDir.getName() + ".srg");
  // etc...
}

I also used find in the mappings folder:

.
./1.8.9
./1.8.9/fields.csv
./1.8.9/params.csv
./1.8.9/1.8.9.srg
./1.8.9/methods.csv

The order is not what the program expects, and causes an error. My guess is that Windows does some fancy lexicographical (aka alphabetical but that sounds far more technical) sorting in the filesystem API, which Linux doesn't do, where I believe it's sorted by its actual order in the filesystem.

@TheKodeToad TheKodeToad changed the title NPE due to mappings relying on walk order Doesn't work on Linux due to filesystem structure Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant