Skip to content

Commit

Permalink
Updates:
Browse files Browse the repository at this point in the history
- Reordered method parameter descriptors for consistency in `ConfigurationSection#addDefault(String, Object)`
- Updated `YamlConfiguration` to include April 16th 2023 updates
- Changed Jetbrains Annotations scope to `provided` (no longer compiling with the jar)
- Maven source plugin update to 3.3.0 (was 3.2.1)
- Maven gpg plugin updated to 3.1.0 (was 3.0.1)
- Maven shade plugin filtering out dependency MANIFEST.MF files
- Whitespace issues
- Updated dates where missed or inconsistent format
  • Loading branch information
mciolkosz committed Jun 6, 2023
1 parent c856a4b commit 8cb9711
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It is based off of [SpigotMC's Bukkit](https://hub.spigotmc.org/stash/projects/S
## Obtaining YamlConfiguration

You can obtain a copy of YamlConfiguration via the following methods:
- Download a pre-built copy from the [Releases page](https://github.com/bspfsystems/YamlConfiguration/releases/latest/). The latest version is release 1.3.2.
- Download a pre-built copy from the [Releases page](https://github.com/bspfsystems/YamlConfiguration/releases/latest/). The latest version is release 1.3.3.
- Build from source (see below).
- Include it as a dependency in your project (see the Development API section).
-
Expand Down Expand Up @@ -52,7 +52,7 @@ Include the following in your `pom.xml` file:<br />
<dependency>
<groupId>org.bspfsystems</groupId>
<artifactId>yamlconfiguration</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand All @@ -68,7 +68,7 @@ repositories {
}
dependencies {
implementation "org.bspfsystems:yamlconfiguration:1.3.2"
implementation "org.bspfsystems:yamlconfiguration:1.3.3"
}
```

Expand Down
20 changes: 14 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
~ This file is part of YamlConfiguration.
~
~ Implementation of SnakeYAML to be easy to use with files.
~
~
~ Copyright (C) 2010-2014 The Bukkit Project (https://bukkit.org/)
~ Copyright (C) 2014-2023 SpigotMC Pty. Ltd. (https://www.spigotmc.org/)
~ Copyright (C) 2020-2023 BSPF Systems, LLC (https://bspfsystems.org/)
Expand All @@ -12,7 +12,7 @@
~ SpigotMC Pty. Ltd. (https://www.spigotmc.org/). These files can be found
~ at https://github.com/Bukkit/Bukkit/ and https://hub.spigotmc.org/stash/,
~ respectively.
~
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
Expand All @@ -32,7 +32,7 @@

<groupId>org.bspfsystems</groupId>
<artifactId>yamlconfiguration</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<packaging>jar</packaging>

<name>YamlConfiguration</name>
Expand Down Expand Up @@ -107,7 +107,7 @@
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.0.1</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
Expand Down Expand Up @@ -147,7 +147,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -173,7 +173,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -197,6 +197,14 @@
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<minimizeJar>true</minimizeJar>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface Configuration extends ConfigurationSection {
* @throws IllegalArgumentException Thrown if path is {@code null}.
*/
@Override
void addDefault(@NotNull final String path, final @Nullable Object value) throws IllegalArgumentException;
void addDefault(@NotNull final String path, @Nullable final Object value) throws IllegalArgumentException;

/**
* Sets the default values of the given paths as provided.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* An implementation of {@link Configuration} which saves all files in
* {@link Yaml}. Please note that this implementation is not synchronized.
* <p>
* Synchronized with the commit on 14-Mar-2023.
* Synchronized with the commit on 16-April-2023.
*/
public final class YamlConfiguration extends FileConfiguration {

Expand Down Expand Up @@ -165,11 +165,14 @@ public void loadFromString(@NotNull final String data) throws InvalidConfigurati

final MappingNode mappingNode;
try (final Reader reader = new UnicodeReader(new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8)))) {
mappingNode = (MappingNode) this.yaml.compose(reader);
} catch (YAMLException | IOException e) {
final Node rawNode = this.yaml.compose(reader);
try {
mappingNode = (MappingNode) rawNode;
} catch (final ClassCastException e) {
throw new InvalidConfigurationException("Top level is not a Map.", e);
}
} catch (YAMLException | IOException | ClassCastException e) {
throw new InvalidConfigurationException(e);
} catch (ClassCastException e) {
throw new InvalidConfigurationException("Top level is not a Map.", e);
}

this.map.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* Represents a custom {@link SafeConstructor} for use with a
* {@link YamlConfiguration}.
* <p>
* Synchronized with the commit on 08-January-2022.
* Synchronized with the commit on 14-March-2023.
*/
public final class YamlConstructor extends SafeConstructor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* {@link ConfigurationSection ConfigurationSections} and
* {@link ConfigurationSerializable ConfigurationSerializables}.
* <p>
* Synchronized with the commit on 14-Mar-2023.
* Synchronized with the commit on 14-March-2023.
*/
public final class YamlRepresenter extends Representer {

Expand Down

0 comments on commit 8cb9711

Please sign in to comment.