Skip to content

Commit 842427e

Browse files
committed
Fix IntelliJ warnings, update .gitignore
1 parent 692e9c8 commit 842427e

File tree

4 files changed

+108
-22
lines changed

4 files changed

+108
-22
lines changed

.gitignore

+99-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Created by https://www.gitignore.io/api/java,gradle,eclipse
2-
# Edit at https://www.gitignore.io/?templates=java,gradle,eclipse
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/java,gradle,eclipse,intellij+all
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle,eclipse,intellij+all
34

45
### Eclipse ###
56
.metadata
@@ -52,23 +53,109 @@ local.properties
5253

5354
# Annotation Processing
5455
.apt_generated/
56+
.apt_generated_test/
5557

5658
# Scala IDE specific (Scala & Java development for Eclipse)
5759
.cache-main
5860
.scala_dependencies
5961
.worksheet
6062

61-
### Eclipse Patch ###
62-
# Eclipse Core
63+
# Uncomment this line if you wish to ignore the project description file.
64+
# Typically, this file would be tracked if it contains build/dependency configurations:
6365
.project
6466

65-
# JDT-specific (Eclipse Java Development Tools)
66-
.classpath
67+
### Eclipse Patch ###
68+
# Spring Boot Tooling
69+
.sts4-cache/
6770

68-
# Annotation Processing
69-
.apt_generated
71+
### Intellij+all ###
72+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
73+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7074

71-
.sts4-cache/
75+
# User-specific stuff
76+
.idea/**/workspace.xml
77+
.idea/**/tasks.xml
78+
.idea/**/usage.statistics.xml
79+
.idea/**/dictionaries
80+
.idea/**/shelf
81+
82+
# Generated files
83+
.idea/**/contentModel.xml
84+
85+
# Sensitive or high-churn files
86+
.idea/**/dataSources/
87+
.idea/**/dataSources.ids
88+
.idea/**/dataSources.local.xml
89+
.idea/**/sqlDataSources.xml
90+
.idea/**/dynamic.xml
91+
.idea/**/uiDesigner.xml
92+
.idea/**/dbnavigator.xml
93+
94+
# Gradle
95+
.idea/**/gradle.xml
96+
.idea/**/libraries
97+
98+
# Gradle and Maven with auto-import
99+
# When using Gradle or Maven with auto-import, you should exclude module files,
100+
# since they will be recreated, and may cause churn. Uncomment if using
101+
# auto-import.
102+
# .idea/artifacts
103+
# .idea/compiler.xml
104+
# .idea/jarRepositories.xml
105+
# .idea/modules.xml
106+
# .idea/*.iml
107+
# .idea/modules
108+
# *.iml
109+
# *.ipr
110+
111+
# CMake
112+
cmake-build-*/
113+
114+
# Mongo Explorer plugin
115+
.idea/**/mongoSettings.xml
116+
117+
# File-based project format
118+
*.iws
119+
120+
# IntelliJ
121+
out/
122+
123+
# mpeltonen/sbt-idea plugin
124+
.idea_modules/
125+
126+
# JIRA plugin
127+
atlassian-ide-plugin.xml
128+
129+
# Cursive Clojure plugin
130+
.idea/replstate.xml
131+
132+
# Crashlytics plugin (for Android Studio and IntelliJ)
133+
com_crashlytics_export_strings.xml
134+
crashlytics.properties
135+
crashlytics-build.properties
136+
fabric.properties
137+
138+
# Editor-based Rest Client
139+
.idea/httpRequests
140+
141+
# Android studio 3.1+ serialized cache file
142+
.idea/caches/build_file_checksums.ser
143+
144+
### Intellij+all Patch ###
145+
# Ignores the whole .idea folder and all .iml files
146+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
147+
148+
.idea/
149+
150+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
151+
152+
*.iml
153+
modules.xml
154+
.idea/misc.xml
155+
*.ipr
156+
157+
# Sonarlint plugin
158+
.idea/sonarlint
72159

73160
### Java ###
74161
# Compiled class file
@@ -114,7 +201,8 @@ gradle-app.setting
114201
### Gradle Patch ###
115202
**/build/
116203

117-
# End of https://www.gitignore.io/api/java,gradle,eclipse
204+
# End of https://www.toptal.com/developers/gitignore/api/java,gradle,eclipse,intellij+all
118205

119206
/.vscode/
120-
/packwiz.json
207+
/packwiz.json
208+
.classpath

src/main/java/link/infra/packwiz/installer/bootstrap/LoadJAR.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static boolean addOptions(Options options, String path) {
4444
return true;
4545
}
4646

47-
public static void start(String[] args, String path) throws ClassNotFoundException, Exception {
47+
public static void start(String[] args, String path) throws Exception {
4848
loadClass(path);
4949

5050
// Must be casted to Object (not array) because varargs
@@ -63,12 +63,12 @@ public static String getVersion(String path) {
6363
try {
6464
Manifest mf = jarStream.getManifest();
6565
version = mf.getMainAttributes().getValue("Implementation-Version");
66-
} catch (Exception e) {}
66+
} catch (Exception ignored) {}
6767

6868
// Clean up
6969
try {
7070
jarStream.close();
71-
} catch (IOException e) {}
71+
} catch (IOException ignored) {}
7272
return version;
7373
}
7474
}

src/main/java/link/infra/packwiz/installer/bootstrap/Main.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ private void doUpdate() throws IOException, GithubException {
128128
}
129129
return;
130130
}
131-
132-
// Assist with GC a bit, probably not necessary
133-
backup = null;
131+
134132
System.out.println("Update successful!");
135133
} else {
136134
System.out.println("Already up to date!");
@@ -201,7 +199,7 @@ private void parseOptions(String[] args) throws ParseException {
201199
// Remove invalid arguments, because Commons CLI chokes on invalid arguments
202200
// (that should be passed to packwiz-installer)
203201
private String[] filterArgs(String[] args, Options options) {
204-
List<String> argsList = new ArrayList<String>(args.length);
202+
List<String> argsList = new ArrayList<>(args.length);
205203
boolean prevOptWasArg = false;
206204
for (String arg : args) {
207205
if (arg.charAt(0) == '-' && options.hasOption(arg)) {
@@ -221,13 +219,13 @@ private String[] filterArgs(String[] args, Options options) {
221219
return argsList.toArray(new String[0]);
222220
}
223221

224-
private class Release {
222+
private static class Release {
225223
String tagName = null;
226224
String downloadURL = null;
227225
String assetURL = null;
228226
}
229227

230-
private class GithubException extends Exception {
228+
private static class GithubException extends Exception {
231229
private static final long serialVersionUID = 3843811090801607241L;
232230

233231
public GithubException() {
@@ -239,7 +237,7 @@ public GithubException(String message) {
239237
}
240238
}
241239

242-
class ConnMonitorInputStream extends InputStream {
240+
static class ConnMonitorInputStream extends InputStream {
243241
private InputStream in = null;
244242
private int size = -1;
245243
private int bytesRead = 0;

src/main/java/link/infra/packwiz/installer/bootstrap/RollbackHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public RollbackHandler(String path) {
1717
storage = Files.readAllBytes(rollbackPath);
1818
hasRollback = true;
1919
// Ignore errors, it probably doesn't exist!
20-
} catch (IOException e) {}
20+
} catch (IOException ignored) {}
2121
}
2222

2323
public void rollback() throws IOException {

0 commit comments

Comments
 (0)