Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move all the loggers to lombok annotations #108

Merged
merged 1 commit into from
Dec 1, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lombok.extern.slf4j.Slf4j;


/**
* Various constants
*/
@Slf4j
public class Constants {

static private final Logger log = LoggerFactory.getLogger(Constants.class);

/** Application name */
public static final String APP_NAME = "PDF-Over";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;


/**
* Localizes string messages for PDFOver GUI
*/
@Slf4j
public class Messages {

/**
* SLF4J Logger instance
**/
static final Logger log = LoggerFactory.getLogger(Messages.class);

private static final String BUNDLE_NAME = "at.asit.pdfover.gui.messages";

private static HashMap<Locale, ResourceBundle> bundles = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.drew.imaging.ImageMetadataReader;
import com.drew.imaging.ImageProcessingException;
import com.drew.metadata.Metadata;
import com.drew.metadata.exif.ExifDirectoryBase;
import com.drew.metadata.exif.ExifIFD0Directory;

import lombok.extern.slf4j.Slf4j;

@Slf4j
class EXIFRotation {
private static final Logger log = LoggerFactory.getLogger(EXIFRotation.class);
/**
* rotate by this times Math.PI / 2
*/
Expand Down
10 changes: 2 additions & 8 deletions pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,14 @@
import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.workflow.StateMachine;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import iaik.security.provider.IAIK;
import lombok.extern.slf4j.Slf4j;

/**
* Main entry point for production
*/
@Slf4j
public class Main {

/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(Main.class);
// private static URL url=null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.composites.StateComposite;
import at.asit.pdfover.gui.controls.Dialog;
Expand All @@ -61,17 +59,14 @@
import at.asit.pdfover.gui.workflow.states.ConfigurationUIState;
import at.asit.pdfover.gui.workflow.states.OpenState;
import at.asit.pdfover.gui.workflow.states.PositioningState;
import lombok.extern.slf4j.Slf4j;

/**
* The Main Window of PDF-Over 4
*/
@Slf4j
public class MainWindow {

/**
* SLF4J Logger instance
**/
static final Logger log = LoggerFactory.getLogger(MainWindow.class);

private Shell shell;
private Composite mainbar;
private FormData mainBarFormData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@
// Imports
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.http.client.config.CookieSpecs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.commons.Constants;

/**
*
*/
public class BKUHelper {
/**
* SLF4J Logger instance
**/
@SuppressWarnings("unused")
private static final Logger log = LoggerFactory.getLogger(BKUHelper.class);

/* public static HttpClient getHttpClient(boolean useProxy) {
HttpClient client = new HttpClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,19 @@
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.utils.FileUploadSource;
import at.asit.pdfover.signer.BkuSlConnector;
import at.asit.pdfover.signer.SignatureException;
import at.asit.pdfover.signer.pdfas.PdfAs4SLRequest;
import lombok.extern.slf4j.Slf4j;

/**
*
*/
@Slf4j
public class LocalBKUConnector implements BkuSlConnector {
/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(LocalBKUConnector.class);

private static boolean isAvailable = false;
public static boolean IsAvailable() { return isAvailable; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.commons.Messages;
Expand All @@ -48,10 +46,10 @@
import at.asit.pdfover.signer.pdfas.PdfAs4SLRequest;
import at.asit.webauthnclient.WebAuthN;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;

public class MobileBKUConnector implements BkuSlConnector {
private static final Logger log = LoggerFactory.getLogger(MobileBKUConnector.class);

@Slf4j
public class MobileBKUConnector implements BkuSlConnector {
private final @NonNull MobileBKUState state;
public MobileBKUConnector(@NonNull MobileBKUState state) {
this.state = state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
import java.util.Set;

import org.jsoup.Jsoup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ATrustParser {
private static final Logger log = LoggerFactory.getLogger(ATrustParser.class);

private static class ComponentParseFailed extends Exception {}

private static class TopLevelFormBlock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,15 @@
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import at.asit.pdfover.gui.workflow.StateMachine;
import lombok.extern.slf4j.Slf4j;

/**
* Handler to process CLI Arguments
*/
@Slf4j
public class ArgumentHandler {
/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(ArgumentHandler.class);

private Map<String, Argument> cliArguments = new LinkedHashMap<String, Argument>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@
package at.asit.pdfover.gui.cliarguments;

// Imports
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import lombok.extern.slf4j.Slf4j;
import at.asit.pdfover.commons.Messages;

/**
* CLI Argument to set the configuration file
*/
@Slf4j
public class ConfigFileArgument extends Argument {
/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(ConfigFileArgument.class);

/**
* Constructor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
import java.io.File;
import java.io.FileNotFoundException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import lombok.extern.slf4j.Slf4j;
import at.asit.pdfover.commons.Messages;

/**
* CLI Argument to set the emblem file to use for signature
*/
@Slf4j
public class EmblemArgument extends Argument {
/**
* Constructor
Expand All @@ -36,11 +35,6 @@ public EmblemArgument() {
super(new String[] {"-e"}, "argument.help.emblem");
}

/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(EmblemArgument.class);

/* (non-Javadoc)
* @see at.asit.pdfover.gui.cliarguments.CLIArgument#handleArgument(java.lang.String[], int, at.asit.pdfover.gui.workflow.StateMachine, at.asit.pdfover.gui.cliarguments.ArgumentHandler)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
import java.io.File;
import java.io.FileNotFoundException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import lombok.extern.slf4j.Slf4j;
import at.asit.pdfover.commons.Messages;

/**
* CLI Argument to set the input document to sign
*/
@Slf4j
public class InputDocumentArgument extends Argument {
/**
* Constructor
Expand All @@ -36,11 +35,6 @@ public InputDocumentArgument() {
super(new String[] {"-i"}, "argument.help.input");
}

/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(InputDocumentArgument.class);

/* (non-Javadoc)
* @see at.asit.pdfovewr.gui.cliarguments.CLIArgument#handleArgument(java.lang.String[], int, at.asit.pdfover.gui.workflow.StateMachine, at.asit.pdfover.gui.cliarguments.ArgumentHandler)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

// Imports

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter;
import lombok.extern.slf4j.Slf4j;

/**
* CLI Argument to set the visibility of signature
*/
@Slf4j
public class InvisibleProfile extends Argument {
/**
* Constructor
Expand All @@ -35,11 +34,6 @@ public InvisibleProfile() {
super(new String[] {"-v"}, "argument.help.vis");
}

/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(InvisibleProfile.class);

/* (non-Javadoc)
* @see at.asit.pdfovewr.gui.cliarguments.CLIArgument#handleArgument(java.lang.String[], int, at.asit.pdfover.gui.workflow.StateMachine, at.asit.pdfover.gui.cliarguments.ArgumentHandler)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
package at.asit.pdfover.gui.cliarguments;

// Imports
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import at.asit.pdfover.gui.exceptions.InitializationException;
import lombok.extern.slf4j.Slf4j;
import at.asit.pdfover.commons.Messages;

/**
* CLI Argument to provide the keystore alias
*/
@Slf4j
public class KeystoreAliasArgument extends Argument {
/**
* Constructor
Expand All @@ -33,11 +32,6 @@ public KeystoreAliasArgument() {
super(new String[] {"-ksalias"}, "argument.help.keystorealias");
}

/**
* SLF4J Logger instance
**/
private static final Logger log = LoggerFactory.getLogger(KeystoreAliasArgument.class);

/* (non-Javadoc)
* @see at.asit.pdfover.gui.cliarguments.CLIArgument#handleArgument(java.lang.String[], int, at.asit.pdfover.gui.workflow.StateMachine, at.asit.pdfover.gui.cliarguments.ArgumentHandler)
*/
Expand Down
Loading