Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Changelog

All notable changes to this project are listed here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Releases before 0.5.0 are described in
[src/changes/changes.xml](src/changes/changes.xml). Numbers like "SourceForge
#3038645" are ids from the old SourceForge tracker.

The 0.5.2 date is the date of its tag and its Maven Central upload;
`changes.xml` says 2011-12-13.

## [Unreleased]

### Security

- Fixed CVE-2022-41404, a denial of service. Option values that refer to each
other, such as `[a] x=${b/y}` and `[b] y=${a/x}`, caused a
`StackOverflowError`. Resolving a variable now stops after 16 levels and
throws the new `CircularReferenceException`. The limit is the new
`maxResolveDepth` setting, which you can change with
`-Dorg.ini4j.config.maxResolveDepth=N` or
`Config.getGlobal().setMaxResolveDepth(int)`. Reported on SourceForge by
bingdian.

### Changed

- **Breaking:** ini4j now needs Java 17 or newer.
- **Breaking:** `Profile.remove(sectionName, optionName)` is now
`Profile.removeOption(sectionName, optionName)`, because the old name clashes
with `Map.remove` on Java 17.
- The project moved from SourceForge (SVN) to GitHub (Git), and the POM was
modernized.
- Source code is formatted with Google Java Style.
- The Javadoc build now fails on a broken reference or tag.

### Fixed

- Replaced APIs that are deprecated in Java 17: `Class.newInstance()` and the
`Character`, `Double` and `Float` constructors.
- Dynamic bean proxies no longer fail when the thread has no context class
loader.
- Fixed how `BasicProfile` handles a bean property prefix together with
`propertyFirstUpper`.
- Fixed the SCM URL in `pom.xml` so deploying to Maven Central works. The old
`changes.xml` lists this as version 0.5.5, but that version was never tagged
and is not on Maven Central.

### Added

- GitHub Actions workflow that runs the build, tests, Spotless, SpotBugs and
PMD on pushes to `main` and on pull requests against `main`, except for
changes that only touch `docs/`.
- Javadoc for the public API of `org.ini4j` and `org.ini4j.spi`.
- Dev container configuration.

## [0.5.4] - 2015-02-16

### Fixed

- Updated the release part of the build for the new Maven Central policy.

## [0.5.3] - 2015-02-13

This version is tagged but was not published to Maven Central.

### Added

- New config option `escapeKeyOnly`. When `escape` is on, `escapeKeyOnly`
turns off escaping of values.

### Fixed

- Operators (`:` or `=`) in property and option names are now escaped by both
the parser and the formatter.

## [0.5.2] - 2011-07-05

### Added

- Default value support in `get` and `fetch`: pass the default as the last
argument and it is returned for a missing option (SourceForge #3047041).
- Configurable comment handling: `Config.setHeaderComment(boolean)` switches
the header comment on or off, and `Config.setComment(boolean)` does the same
for all comments (SourceForge #2971952).
- Byte order mark (BOM) support, as a workaround for the Java BOM and UTF-8
problem (SourceForge #2866427).

### Changed

- The `UnicodeLittle` and `UnicodeBig` charset references were removed because
they broke the Java 1.4 backport (SourceForge #2778337).

### Fixed

- A backslash at the end of a line joined it with the next line even when
escaping was off. The new `escapeNewline` option turns line joining off. It
is on by default for `Wini` (SourceForge #3038645).
- Using more than one `${...}` macro in one option value did not work
(SourceForge #2817403).
- Fixes for the Java 1.4 backport. The tests now also run on a Java 1.4 JVM
(SourceForge #2908623).
- Typo in the Options tutorial (SourceForge #2817399).

## [0.5.1] - 2009-04-08

### Added

- Applet support, and a small demo applet on the project site.

### Fixed

- Removed a `java.util.NavigableMap` reference that broke Java 1.5
compatibility.

## [0.5.0] - 2009-04-02

### Added

- `Reg` class that reads and writes the Windows registry and `.reg` files. It
has the same data model as `Ini`.
- Sections form a tree with subsections, based on the section name and a
separator (`/` or `\`), like in `.reg` files.
- Comment support in `Ini` and `Options`: a header comment, section comments and
option comments.
- Bean property mapping with an upper case first letter in key names, as in
Mozilla `.ini` files (SourceForge #2706511).
- More convenient access methods in `OptionBundle` and `OptionMap`.

### Changed

- `Ini` was refactored into the `Profile` interface and the `BasicProfile`
superclass.
- A backslash at the end of a line joins the line with the next one.
- Removed deprecated methods and classes.

[Unreleased]: https://github.com/ini4j/ini4j/compare/ini4j-0.5.4...main
[0.5.4]: https://github.com/ini4j/ini4j/compare/ini4j-0.5.3...ini4j-0.5.4
[0.5.3]: https://github.com/ini4j/ini4j/compare/ini4j-0.5.2...ini4j-0.5.3
[0.5.2]: https://github.com/ini4j/ini4j/compare/ini4j-0.5.1...ini4j-0.5.2
[0.5.1]: https://github.com/ini4j/ini4j/compare/ini4j-0.5.0...ini4j-0.5.1
[0.5.0]: https://github.com/ini4j/ini4j/releases/tag/ini4j-0.5.0
86 changes: 86 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement through GitHub's private reporting form at <https://github.com/ini4j/ini4j/security/advisories/new>. The form is built for security reports, so use it for conduct reports too and start the title with "Code of conduct". The community leader responsible for enforcement is the maintainer, Ivan Szkiba. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

The Contributor Covenant is licensed under [CC BY 4.0][license]. This copy changes only how to report: the contact method in the Enforcement section is filled in for this project.

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[license]: https://creativecommons.org/licenses/by/4.0/
68 changes: 68 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Contributing to ini4j

Bug reports, questions, ideas and pull requests are welcome. This project follows the [Code of Conduct](CODE_OF_CONDUCT.md).

## Reporting bugs and asking questions

Use [GitHub issues](https://github.com/ini4j/ini4j/issues). The old
SourceForge trackers are no longer used. For a bug, include the ini4j version,
your Java version, a minimal `.ini` file or code sample that shows the problem,
what you expected and what happened.

If you found a security problem, do not open an issue. Follow
[SECURITY.md](SECURITY.md).

## Setting up

You need JDK 17 and Maven. The repository also has a dev container in
`.devcontainer` with both installed.

```sh
git clone https://github.com/ini4j/ini4j.git
cd ini4j
mvn -B clean verify
```

`verify` compiles the code, runs the tests, builds the Javadoc and checks
formatting. To run one test class while you work:

```sh
mvn -Dtest=IniTest test
```

CI runs `mvn -B clean verify -Pci`, which adds SpotBugs and PMD. Run that
before you open a pull request, because a failing check fails the build.

## Code style

Java code follows Google Java Style, and XML files (including `pom.xml`) are
formatted by Spotless. If the build reports a formatting problem, fix it with:

```sh
mvn spotless:apply
```

Tests use JUnit 4 and live in `src/test/java`. Add a test for every bug fix and
every change in behavior. Keep public API changes small and call them out in
your pull request.

## Pull requests

Work from the `main` branch and open the pull request against `main`. Small,
focused pull requests are easier to review than large ones.

Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/),
for example `fix(java): handle empty option names` or `docs: fix typo in
README`. Common scopes are `java`, `docs`, `website` and `release`. Mark
breaking changes with `!` or a `BREAKING CHANGE:` footer. Describe why the
change is needed in the commit message and the pull request, not only what it
does.

Add a line to the `Unreleased` section of [CHANGELOG.md](CHANGELOG.md) when
your change is visible to users.

## License

ini4j is licensed under the [Apache License, Version 2.0](LICENSE.txt). By
contributing, you agree that your contribution is licensed under the same
terms.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2005,2009 Ivan SZKIBA
Copyright 2005-2026 Ivan SZKIBA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading
Loading