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

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

@TheKodeToad

Description

@TheKodeToad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions