Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Jan 7, 2025
2 parents f4d09f0 + 89184a4 commit ed6b546
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Made `OuterClassNamePropagator` configurable
- Added a simplified `MappingNsCompleter` constructor for completing all destination names with the source names

## [0.7.1] - 2025-01-07
- Restored the ability to read source-namespace-only mapping files, even if not spec-compliant

## [0.7.0] - 2025-01-01
- Added IntelliJ IDEA migration map reader and writer
- Added `MappingFormat#features()` to allow for more fine-grained programmatic querying of format capabilities
Expand All @@ -21,10 +24,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added missing visit calls to multiple readers
- Added safeguards to `MemoryMappingTree` preventing external data modification during an ongoing visitation pass
- Clearly defined tree-API contracts regarding returned collections' mutability
- Fixed `MemoryMappingTree#reset` to actually reset all its internal state related to the current visitation pass
- Fixed `MemoryMappingTree#reset()` to actually reset all its internal state related to the current visitation pass
- Fixed and improved `MemoryMappingTree`'s merging capabilities:
- Fixed broken member mapping merging via tree-API in `MemoryMappingTree`
- Fixed existing entries' data not getting overridden when merging elements into `MemoryMappingTree` via tree-API
- Fixed broken tree-API member mapping merging
- Fixed existing entries' data not getting overridden when merging elements via tree-API
- Fixed NPE when visiting with flipped namespaces ([issue 68](https://github.com/FabricMC/mapping-io/issues/68))
- Made merging with flipped namespaces actually work and handle both names and descriptors
- Fixed potentially incorrect descriptor computation by delaying until all classes are present and merged
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For further information, please consult the project's Javadocs.


### Maven
Mapping-IO is available from the [FabricMC Maven](https://maven.fabricmc.net/net/fabricmc/mapping-io), version 0.4.2 and onwards can also be found on Maven Central.
Mapping-IO is available from the [FabricMC Maven](https://maven.fabricmc.net/net/fabricmc/mapping-io). Version 0.4.2 and onward can also be found on Maven Central.

Gradle snippet:
```gradle
Expand All @@ -42,6 +42,6 @@ repositories {
}
dependencies {
api 'net.fabricmc:mapping-io:${mappingio_version}'
implementation "net.fabricmc:mapping-io:${mappingio_version}"
}
```
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ remotesign_version = 0.4.0
checkstyle_tool_version = 10.21.1

# Project properties
version = 0.7.0
version = 0.7.1

# Dependencies
asm_version = 9.7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ private static void read(ColumnFileReader reader, String sourceNs, String target
dstNamespaces = new ArrayList<>();
String dstNamespace;

while ((dstNamespace = reader.nextCol()) != null) {
if (dstNamespace.isEmpty()) throw new IOException("empty destination namespace in TSRG v2 header");
while (!reader.isAtEol()) {
dstNamespace = reader.nextCol();
if (dstNamespace == null || dstNamespace.isEmpty()) throw new IOException("empty destination namespace in TSRG v2 header");
dstNamespaces.add(dstNamespace);
}

if (dstNamespaces.isEmpty()) throw new IOException("no destination namespaces in TSRG v2 header");
reader.nextLine(0);
} else {
if (sourceNs == null || sourceNs.isEmpty()) throw new IllegalArgumentException("provided source namespace must not be null or empty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ private static void read(ColumnFileReader reader, MappingVisitor visitor) throws
List<String> dstNamespaces = new ArrayList<>();
String dstNamespace;

while ((dstNamespace = reader.nextCol()) != null) {
if (dstNamespace.isEmpty()) throw new IOException("empty destination namespace in Tiny v1 header");
while (!reader.isAtEol()) {
dstNamespace = reader.nextCol();
if (dstNamespace == null || dstNamespace.isEmpty()) throw new IOException("empty destination namespace in Tiny v1 header");
dstNamespaces.add(dstNamespace);
}

int dstNsCount = dstNamespaces.size();
if (dstNsCount == 0) throw new IOException("no destination namespaces in Tiny v1 header");

Set<MappingFlag> flags = visitor.getFlags();
MappingVisitor parentVisitor = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ private static void read(ColumnFileReader reader, MappingVisitor visitor) throws
List<String> dstNamespaces = new ArrayList<>();
String dstNamespace;

while ((dstNamespace = reader.nextCol()) != null) {
if (dstNamespace.isEmpty()) throw new IOException("empty destination namespace in Tiny v2 header");
while (!reader.isAtEol()) {
dstNamespace = reader.nextCol();
if (dstNamespace == null || dstNamespace.isEmpty()) throw new IOException("empty destination namespace in Tiny v2 header");
dstNamespaces.add(dstNamespace);
}

int dstNsCount = dstNamespaces.size();
if (dstNsCount == 0) throw new IOException("no destination namespaces in Tiny v2 header");
boolean readerMarked = false;

if (visitor.getFlags().contains(MappingFlag.NEEDS_MULTIPLE_PASSES)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void emptyTinyFile() throws Exception {
assertThrows(IOException.class, () -> Tiny1FileReader.read(new StringReader(header0), target));
assertThrows(IOException.class, () -> Tiny1FileReader.read(new StringReader(header1), target));
assertThrows(IOException.class, () -> Tiny1FileReader.read(new StringReader(header2), target));
assertThrows(IOException.class, () -> Tiny1FileReader.read(new StringReader(header3), target));
Tiny1FileReader.read(new StringReader(header3), target);
assertThrows(IOException.class, () -> Tiny1FileReader.read(new StringReader(header4), target));
Tiny1FileReader.read(new StringReader(header5), target);
}
Expand All @@ -75,7 +75,7 @@ public void emptyTinyV2File() throws Exception {
assertThrows(IOException.class, () -> Tiny2FileReader.read(new StringReader(header0), target));
assertThrows(IOException.class, () -> Tiny2FileReader.read(new StringReader(header1), target));
assertThrows(IOException.class, () -> Tiny2FileReader.read(new StringReader(header2), target));
assertThrows(IOException.class, () -> Tiny2FileReader.read(new StringReader(header3), target));
Tiny2FileReader.read(new StringReader(header3), target);
assertThrows(IOException.class, () -> Tiny2FileReader.read(new StringReader(header4), target));
Tiny2FileReader.read(new StringReader(header5), target);
}
Expand Down Expand Up @@ -113,7 +113,7 @@ public void emptyCsrgOrTsrgFile() throws Exception {
instantiateTree();
assertThrows(IOException.class, () -> TsrgFileReader.read(new StringReader(header1), target));
assertThrows(IOException.class, () -> TsrgFileReader.read(new StringReader(header2), target));
assertThrows(IOException.class, () -> TsrgFileReader.read(new StringReader(header3), target));
TsrgFileReader.read(new StringReader(header3), target);
assertThrows(IOException.class, () -> TsrgFileReader.read(new StringReader(header4), target));
TsrgFileReader.read(new StringReader(header5), target);
}
Expand Down

0 comments on commit ed6b546

Please sign in to comment.