Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
muriplz committed Jan 17, 2024
1 parent 3699e20 commit 241cb29
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 28 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/kryeit/votifier/LogFilter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kryeit.votifier;

import java.util.logging.*;
import java.util.logging.Filter;
import java.util.logging.LogRecord;

/**
* A custom log filter for prepending plugin identifier on all log messages.
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/kryeit/votifier/Votifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@

package com.kryeit.votifier;

import java.io.*;
import java.nio.file.Path;
import java.security.KeyPair;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.*;

import com.kryeit.votifier.config.ConfigReader;
import net.fabricmc.api.DedicatedServerModInitializer;
import com.kryeit.votifier.crypto.RSAIO;
import com.kryeit.votifier.crypto.RSAKeygen;
import com.kryeit.votifier.model.ListenerLoader;
import com.kryeit.votifier.model.VoteListener;
import com.kryeit.votifier.net.VoteReceiver;
import net.fabricmc.api.DedicatedServerModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.security.KeyPair;
import java.util.ArrayList;
import java.util.List;

/**
* The main Votifier plugin class.
*
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/kryeit/votifier/crypto/RSA.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

package com.kryeit.votifier.crypto;

import javax.crypto.Cipher;
import java.security.PrivateKey;
import java.security.PublicKey;

import javax.crypto.Cipher;

/**
* Static RSA utility methods for encrypting and decrypting blocks of
* information.
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/kryeit/votifier/crypto/RSAIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;

import javax.xml.bind.DatatypeConverter;

/**
* Static utility methods for saving and loading RSA key pairs.
*
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/kryeit/votifier/model/ListenerLoader.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.kryeit.votifier.model;

import java.io.File;
import java.net.*;
import java.util.*;
import java.util.logging.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Loads vote listeners. Listeners that cannot be instantiated will be skipped.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

package com.kryeit.votifier.model.listeners;

import java.util.logging.Logger;

import com.kryeit.votifier.model.Vote;
import com.kryeit.votifier.model.VoteListener;

import java.util.logging.Logger;

/**
* A basic vote listener for demonstration purposes.
*
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/kryeit/votifier/net/VoteReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@

package com.kryeit.votifier.net;

import com.kryeit.votifier.Votifier;
import com.kryeit.votifier.crypto.RSA;
import com.kryeit.votifier.model.Vote;
import com.kryeit.votifier.model.VoteListener;
import com.kryeit.votifier.model.VotifierEvent;

import javax.crypto.BadPaddingException;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import java.util.logging.*;
import javax.crypto.BadPaddingException;

import com.kryeit.votifier.MinecraftServerSupplier;
import org.bukkit.Bukkit;

import com.kryeit.votifier.Votifier;
import com.kryeit.votifier.crypto.RSA;
import com.kryeit.votifier.model.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* The vote receiving server.
Expand Down Expand Up @@ -176,7 +176,7 @@ public void run() {

// Call event
VotifierEvent.EVENT.invoker().onVoteReceived(vote);

// Clean up.
writer.close();
in.close();
Expand Down

0 comments on commit 241cb29

Please sign in to comment.