Skip to content

Commit

Permalink
Reformatted all Java code and other files
Browse files Browse the repository at this point in the history
- 4 runs of reformatting
- No semantic code changes
- Reformat .java, .html, .md and .yml
  • Loading branch information
asturio committed Mar 9, 2024
1 parent 4e926e5 commit 443d005
Show file tree
Hide file tree
Showing 773 changed files with 69,487 additions and 63,453 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
## Description of the new Feature/Bugfix

Describe here how you fixed the bug, or implemented the new feature.

Related Issue: #

## Unit-Tests for the new Feature/Bugfix

- [ ] Unit-Tests added to reproduce the bug
- [ ] Unit-Tests added to the added feature

## Compatibilities Issues

Is anything broken because of the new code? Any changes in method signatures?

## Testing details

Any other details about how to test the new feature or bugfix?
21 changes: 10 additions & 11 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: OpenPDF checkstyle
on:
push:
Expand All @@ -11,13 +10,13 @@ jobs:
runs-on: ubuntu-latest
name: Checkstyle job
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Run check style
uses: dbelyaev/action-checkstyle@v1.2.1
with:
checkstyle_config: 'checkstyle.xml'
reporter: 'github-pr-check'
filter_mode: nofilter
level: error
fail_on_error: true
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Run check style
uses: dbelyaev/action-checkstyle@v1.2.1
with:
checkstyle_config: 'checkstyle.xml'
reporter: 'github-pr-check'
filter_mode: nofilter
level: error
fail_on_error: true
64 changes: 32 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,44 +47,44 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ include:
Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Expand All @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at
reported by contacting the project team at
[gitter](https://gitter.im/LibrePDF/code_of_conduct).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

- We use the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html) with
some exceptionsu
- Indentation: 4 spaces
- Continuation indent: 8 spaces
- Line length: 120 characters
- Indentation: 4 spaces
- Continuation indent: 8 spaces
- Line length: 120 characters
- Make sure to add tests for your changes
- Fix any checkstyle issues before submitting your pull request (`mvn checkstyle:check`)
- Fix any issues found by the CI build after submitting your pull request
Expand Down
6 changes: 5 additions & 1 deletion Contributors.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Credits ##

Significant [Contributors to OpenPDF](https://github.com/LibrePDF/OpenPDF/graphs/contributors) on GitHub.

**Please note**: this document won't be updated anymore. If you are a contributor and want to be listed here, simply
update this file and create a pull request. The reason for this is that updating this file is a manual process and
quite an overhead. The GitHub contributor list is always up-to-date and can be used as a reference.

## Maintainers and Members ##

* [@asturio](https://github.com/asturio) - Claudio Clemens
* [@bengolder](https://github.com/bengolder) - Benjamin Golder
* [@daviddurand](https://github.com/daviddurand) - David G. Durand
Expand All @@ -14,11 +16,13 @@ quite an overhead. The GitHub contributor list is always up-to-date and can be u
* [@tlxtellef](https://github.com/tlxtellef) - Tellef

## Contributors ##

In GitHub User alphabetical order.

* [@abdullahcevik](https://github.com/abdullahcevik) - Abdullah Çevik
* [@albfernandez](https://github.com/albfernandez) - Alberto Fernández
* [@andreasrosdal](https://github.com/andreasrosdal) - Andreas Røsdal - Maintainer of OpenPDF from 1.0 to 1.3.15, 1.3.32 to 2.0.0, now retired from OpenPDF development.
* [@andreasrosdal](https://github.com/andreasrosdal) - Andreas Røsdal - Maintainer of OpenPDF from 1.0 to 1.3.15, 1.3.32
to 2.0.0, now retired from OpenPDF development.
* [@AnthonyStevens](https://github.com/AnthonyStevens) - Anthony Stevens
* [@applikationsprogramvara](https://github.com/applikationsprogramvara)
* [@arational](https://github.com/arational) - Ivan Stefanischin
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Add this to your pom.xml file to use the latest version of OpenPDF:
```xml

<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>2.0.1</version>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>2.0.1</version>
</dependency>
```

Expand Down Expand Up @@ -144,9 +144,9 @@ and use the class `org.librepdf.openpdf.fonts.Liberation`.
```xml

<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-fonts-extra</artifactId>
<version>${openpdf.version}</version>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-fonts-extra</artifactId>
<version>${openpdf.version}</version>
</dependency>
```

Expand All @@ -166,9 +166,9 @@ See: [wiki](https://github.com/LibrePDF/OpenPDF/wiki/Accents,-DIN-91379,-non-Lat

- [BouncyCastle](https://www.bouncycastle.org/) (BouncyCastle is used to sign PDF files, so it's a recommended
dependency)
- Provider (`org.bouncycastle:bcprov-jdk18on` or `org.bouncycastle:bcprov-ext-jdk18on` depending
on which algorithm you are using)
- PKIX/CMS (`org.bouncycastle:bcpkix-jdk18on`)
- Provider (`org.bouncycastle:bcprov-jdk18on` or `org.bouncycastle:bcprov-ext-jdk18on` depending
on which algorithm you are using)
- PKIX/CMS (`org.bouncycastle:bcpkix-jdk18on`)
- Apache FOP (`org.apache.xmlgraphics:fop`)
- Please refer to our [pom.xml](pom.xml) to see what version is needed.

Expand Down
3 changes: 2 additions & 1 deletion changelogs/1.3.29.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Document 3rd party lib dep for getTiffImage
- Document tiff requirements for Java < 9
- Fix #620: leading problem
- Fix #633: update ColumnText.java to
- Fix #633: update ColumnText.java to
- Fix #727: for issue
- Fix #729: dictionary casting for issue
- Improve monospaced font mapping on Windows and Linux
Expand All @@ -18,6 +18,7 @@
- Use List for specialContent in HeaderFooter and rename specialcontent with camelcase

## Updated dependencies:

- Bump actions/checkout from 2 to 3
- Bump assertj-core from 3.22.0 to 3.23.1
- Bump checkstyle from 10.2 to 10.3
Expand Down
1 change: 1 addition & 0 deletions changelogs/1.3.30.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Support for embedded images in HTMLWorker

## Updated dependencies:

- Bump bouncycastle from 1.71 to 1.71.1
- Bump checkstyle from 10.3 to 10.3.3
- Bump junit from 5.8.2 to 5.9.0
Expand Down
2 changes: 2 additions & 0 deletions changelogs/1.3.31.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.3.31

## Changes

- Add Bidi example, refactorings
- Add CIDSet for font subset to ensure PDF/A compliance
- Add optional metadata/info update in a sequential revision
Expand All @@ -21,6 +22,7 @@
- Use different versions of mockito

## Updated dependencies:

- Bump assertj-core from 3.23.1 to 3.24.2
- Bump bouncycastle from 1.71.1 to 1.76
- Bump checkstyle from 10.3.3 to 10.12.3
Expand Down
21 changes: 11 additions & 10 deletions changelogs/1.3.32.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# 1.3.32

## Changes

* Speed up loading fonts from JAR (#955 #954)
* Bump commons-io:commons-io from 2.13.0 to 2.15.0 (#967)
* Bump org.apache.maven.plugins:maven-jxr-plugin from 3.3.0 to 3.3.1 (#966)
* Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0
* Bump com.puppycrawl.tools:checkstyle from 10.12.3 to 10.12.4 (#958)
* Nullsafe equals in XfaForm when processing template (#959)
* Fix height calculation for table rows with rowspan @fellmann (#865)
* Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0
* Bump com.puppycrawl.tools:checkstyle from 10.12.3 to 10.12.4 (#958)
* Nullsafe equals in XfaForm when processing template (#959)
* Fix height calculation for table rows with rowspan @fellmann (#865)
* Added AutoCloseable annotations on classes, that already implement the close method @SirLefti (#831)
* Fixing umlauts in form fields @antonleliuk (#847)
* Skipping eliminateSharedStreams() method call. @netmackan (#772)
* Fixing umlauts in form fields @antonleliuk (#847)
* Skipping eliminateSharedStreams() method call. @netmackan (#772)
* Add flag to inhibit FOP glyph substitution @dadza (#904)
* Refactorings by @Lonzak Part I (#853)
* Refactorings by @Lonzak Part I (#853)
* Align /ID entry creation with 14.4 File Identifiers @bsanchezb (#876)
* Bump com.ibm.icu:icu4j from 73.2 to 74.1 (#976)
* Bump org.pitest:pitest-junit5-plugin from 1.2.0 to 1.2.1 (#975)
* Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.1 to 3.3.2
* Bump org.apache.maven.plugins:maven-checkstyle-plugin (#978)
* Bump org.pitest:pitest-junit5-plugin from 1.2.0 to 1.2.1 (#975)
* Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.1 to 3.3.2
* Bump org.apache.maven.plugins:maven-checkstyle-plugin (#978)
3 changes: 2 additions & 1 deletion changelogs/1.3.37.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 1.3.37

## Changes
* OpenPDF 1.3.37 requires Java 11.

* OpenPDF 1.3.37 requires Java 11.
4 changes: 3 additions & 1 deletion changelogs/2.0.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 2.0.0

## Changes
* Removal of 108 deprecated old methods and fields. See JavaDoc for the methods marked as deprecated in 1.3.40 and the new methods to use instead: https://javadoc.io/doc/com.github.librepdf/openpdf/latest/index.html

* Removal of 108 deprecated old methods and fields. See JavaDoc for the methods marked as deprecated in 1.3.40 and the
new methods to use instead: https://javadoc.io/doc/com.github.librepdf/openpdf/latest/index.html
* Java 17 required.
1 change: 1 addition & 0 deletions changelogs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Creating the changelog

## How to create a changelog

- Take a look at all commits since the last release
- Group them into categories
- Create a new file in the `changelogs` folder with the name `x.y.z.md` where `x.y.z` is the version number
Expand Down
6 changes: 3 additions & 3 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Formatter Configuration

You can find in this directory the configuration files for the formatters used in this project. For IntelliJ IDEA
and Eclipse. If you have other IDE, please contribute with a configuration file. OpenPDF has it's own coding style.
You can find in this directory the configuration files for the formatters used in this project. For IntelliJ IDEA
and Eclipse. If you have other IDE, please contribute with a configuration file. OpenPDF has it's own coding style.
It is based in the Google Java Style Guide, but with some modifications:

* Indentation: 4 spaces
* Line length: 120 characters
* Continuation indent: 8 spaces
* Continuation indent: 8 spaces
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
import com.lowagie.text.ExceptionConverter;
import com.lowagie.text.pdf.PdfArray;
import com.lowagie.text.pdf.PdfObject;

import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cms.CMSEnvelopedData;
import org.bouncycastle.cms.Recipient;
import org.bouncycastle.cms.RecipientInformation;
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;

import java.io.IOException;
import java.security.Key;
import java.security.PrivateKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.util.Collection;
import java.util.List;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cms.CMSEnvelopedData;
import org.bouncycastle.cms.Recipient;
import org.bouncycastle.cms.RecipientInformation;
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;

public class BouncyCastleHelper {

public static void checkCertificateEncodingOrThrowException(Certificate certificate) {
// OJO...
try {
Expand All @@ -30,7 +29,8 @@ public static void checkCertificateEncodingOrThrowException(Certificate certific
}

@SuppressWarnings("unchecked")
public static byte[] getEnvelopedData(PdfArray recipients, List<PdfObject> strings, Certificate certificate, Key certificateKey, String certificateKeyProvider) {
public static byte[] getEnvelopedData(PdfArray recipients, List<PdfObject> strings, Certificate certificate,
Key certificateKey, String certificateKeyProvider) {
byte[] envelopedData = null;
for (PdfObject recipient : recipients.getElements()) {
strings.remove(recipient);
Expand Down
Loading

0 comments on commit 443d005

Please sign in to comment.