update code style

This commit is contained in:
huangyuhui
2016-01-01 11:03:09 +08:00
parent 1f7eb04215
commit b82243a9c0
298 changed files with 3902 additions and 3998 deletions

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -50,7 +50,7 @@ public class ConsoleAppender extends OutputStreamAppender {
@Override
public void write(byte[] b, int off, int len)
throws IOException {
throws IOException {
System.out.write(b, off, len);
}
@@ -78,7 +78,7 @@ public class ConsoleAppender extends OutputStreamAppender {
@Override
public void write(byte[] b, int off, int len)
throws IOException {
throws IOException {
System.err.write(b, off, len);
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -22,7 +22,7 @@ package org.jackhuang.hellominecraft.logging.message;
* @author huangyuhui
*/
public abstract class AbstractMessageFactory
implements IMessageFactory {
implements IMessageFactory {
@Override
public IMessage newMessage(Object message) {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -18,7 +18,7 @@
package org.jackhuang.hellominecraft.logging.message;
public class ObjectMessage
implements IMessage {
implements IMessage {
private static final long serialVersionUID = -5903272448334166185L;
private final transient Object obj;
@@ -41,7 +41,7 @@ implements IMessage {
@Override
public Object[] getParameters() {
return new Object[] {this.obj};
return new Object[] { this.obj };
}
@Override

View File

@@ -68,11 +68,11 @@ public class ParameterizedMessage
}
public ParameterizedMessage(String messagePattern, Object arg) {
this(messagePattern, new Object[] {arg});
this(messagePattern, new Object[] { arg });
}
public ParameterizedMessage(String messagePattern, Object arg1, Object arg2) {
this(messagePattern, new Object[] {arg1, arg2});
this(messagePattern, new Object[] { arg1, arg2 });
}
private String[] parseArguments(Object[] arguments) {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -22,7 +22,7 @@ package org.jackhuang.hellominecraft.logging.message;
* @author huangyuhui
*/
public class SimpleMessage
implements IMessage {
implements IMessage {
private static final long serialVersionUID = -8398002534962715992L;
private final String message;

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -21,7 +21,7 @@ import java.util.Arrays;
import java.util.IllegalFormatException;
public class StringFormattedMessage
implements IMessage {
implements IMessage {
private static final long serialVersionUID = -665975803997290697L;
private final String messagePattern;

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -25,7 +25,7 @@ import org.jackhuang.hellominecraft.utils.system.Compressor;
* @author huangyuhui
*/
public class DecompressTask extends Task {
File src, dest;
public DecompressTask(File src, File dest) {
@@ -42,5 +42,5 @@ public class DecompressTask extends Task {
public String getInfo() {
return "Decompress: " + src.getAbsolutePath() + " to " + dest.getAbsolutePath();
}
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -22,22 +22,23 @@ package org.jackhuang.hellominecraft.tasks;
* @author huangyuhui
*/
public class DoubleTask extends Task {
Task a, b;
public DoubleTask(Task a, Task b) {
this.a = a;
this.b = b;
}
@Override
public void executeTask() throws Throwable {
a.executeTask(); b.executeTask();
a.executeTask();
b.executeTask();
}
@Override
public String getInfo() {
return "Double Task";
}
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -101,19 +101,19 @@ public abstract class Task {
ppl = p;
return this;
}
public Task after(Task t) {
return new DoubleTask(this, t);
}
public Task before(Task t) {
return new DoubleTask(t, this);
}
public void run() {
try {
executeTask();
} catch(Throwable t) {
} catch (Throwable t) {
HMCLog.err("Failed to execute task", t);
}
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -38,7 +38,8 @@ public class TaskObservable<T> extends TaskInfo {
@Override
public void executeTask() {
r.subscribe(t->{});
r.subscribe(t -> {
});
}
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -113,15 +113,13 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
connection.connect();
// Make sure response code is in the 200 range.
if (connection.getResponseCode() / 100 != 2) {
if (connection.getResponseCode() / 100 != 2)
throw new NetException(C.i18n("download.not_200") + " " + connection.getResponseCode());
}
// Check for valid content length.
int contentLength = connection.getContentLength();
if (contentLength < 1) {
if (contentLength < 1)
throw new NetException("The content length is invalid.");
}
filePath.getParentFile().mkdirs();
@@ -179,7 +177,8 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
closeFiles();
}
}
if (failReason != null) throw failReason;
if (failReason != null)
throw failReason;
}
public static void download(String url, String file, DownloadListener dl) throws Throwable {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -76,7 +76,8 @@ public class HTTPGetTask extends TaskInfo implements PreviousResult<String> {
t = new NetException("Failed to get " + url, ex);
}
}
if (t != null) throw t;
if (t != null)
throw t;
}
@Override

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -27,29 +27,36 @@ import rx.Observable;
public interface IUpdateChecker {
/**
*
*
*/
void checkOutdate();
/**
* Get the <b>cached</b> newest version number, use "process" method to download!
* Get the <b>cached</b> newest version number, use "process" method to
* download!
*
* @return the newest version number
*
* @see process
*/
VersionNumber getNewVersion();
/**
* Download the version number synchronously.
* When you execute this method first, should leave "showMessage" false.
* @param showMessage If it is requested to warn the user that there is a new version.
* Download the version number synchronously. When you execute this method
* first, should leave "showMessage" false.
*
* @param showMessage If it is requested to warn the user that there is a
* new version.
*
* @return the process observable.
*/
Observable process(boolean showMessage);
/**
* Get the download links.
*
* @return a JSON, which contains the server response.
*/
Observable<Map<String, String>> requestDownloadLink();
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -52,8 +52,9 @@ public final class NetUtils {
}
public static String getStreamContent(InputStream is, String encoding)
throws IOException {
if (is == null) return null;
throws IOException {
if (is == null)
return null;
StringBuilder sb = new StringBuilder();
try (InputStreamReader br = new InputStreamReader(is, encoding)) {
int len;
@@ -136,7 +137,7 @@ public final class NetUtils {
con.disconnect();
return result;
}
private static final String DEFAULT_CHARSET = "UTF-8";
public static URL constantURL(String url) {
@@ -157,12 +158,12 @@ public final class NetUtils {
throw new IllegalArgumentException("Could not concatenate given URL with GET arguments!", ex);
}
}
public static Observable<String> getRx(String url) {
return Observable.createWithEmptySubscription(t1 -> {
try {
t1.onNext(get(url));
} catch(Exception e) {
} catch (Exception e) {
t1.onError(e);
}
});

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -54,10 +54,14 @@ public final class StrUtils {
cmdbuf.append("\\");
cmdbuf.append('"');
} else if (s.endsWith("\""))
/* The argument has already been quoted. */
/*
* The argument has already been quoted.
*/
cmdbuf.append(s);
else
/* Unmatched quote for the argument. */
/*
* Unmatched quote for the argument.
*/
throw new IllegalArgumentException();
else
cmdbuf.append(s);

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -87,7 +87,7 @@ public class Base64 {
return out;
}
private static final char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
.toCharArray();
.toCharArray();
private static final byte[] codes = new byte[256];
static {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -31,7 +31,7 @@ public class DigestUtils {
private static final int STREAM_BUFFER_LENGTH = 1024;
private static byte[] digest(MessageDigest digest, InputStream data)
throws IOException {
throws IOException {
return updateDigest(digest, data).digest();
}
@@ -77,7 +77,7 @@ public class DigestUtils {
}
public static byte[] md2(InputStream data)
throws IOException {
throws IOException {
return digest(getMd2Digest(), data);
}
@@ -90,7 +90,7 @@ public class DigestUtils {
}
public static String md2Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(md2(data));
}
@@ -103,7 +103,7 @@ public class DigestUtils {
}
public static byte[] md5(InputStream data)
throws IOException {
throws IOException {
return digest(getMd5Digest(), data);
}
@@ -116,7 +116,7 @@ public class DigestUtils {
}
public static String md5Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(md5(data));
}
@@ -131,7 +131,7 @@ public class DigestUtils {
@Deprecated
public static byte[] sha(InputStream data)
throws IOException {
throws IOException {
return sha1(data);
}
@@ -145,7 +145,7 @@ public class DigestUtils {
}
public static byte[] sha1(InputStream data)
throws IOException {
throws IOException {
return digest(getSha1Digest(), data);
}
@@ -158,7 +158,7 @@ public class DigestUtils {
}
public static String sha1Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(sha1(data));
}
@@ -171,7 +171,7 @@ public class DigestUtils {
}
public static byte[] sha256(InputStream data)
throws IOException {
throws IOException {
return digest(getSha256Digest(), data);
}
@@ -184,7 +184,7 @@ public class DigestUtils {
}
public static String sha256Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(sha256(data));
}
@@ -197,7 +197,7 @@ public class DigestUtils {
}
public static byte[] sha384(InputStream data)
throws IOException {
throws IOException {
return digest(getSha384Digest(), data);
}
@@ -210,7 +210,7 @@ public class DigestUtils {
}
public static String sha384Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(sha384(data));
}
@@ -223,7 +223,7 @@ public class DigestUtils {
}
public static byte[] sha512(InputStream data)
throws IOException {
throws IOException {
return digest(getSha512Digest(), data);
}
@@ -236,7 +236,7 @@ public class DigestUtils {
}
public static String sha512Hex(InputStream data)
throws IOException {
throws IOException {
return Hex.encodeHexString(sha512(data));
}
@@ -251,7 +251,7 @@ public class DigestUtils {
@Deprecated
public static String shaHex(InputStream data)
throws IOException {
throws IOException {
return sha1Hex(data);
}
@@ -266,7 +266,7 @@ public class DigestUtils {
}
public static MessageDigest updateDigest(MessageDigest digest, InputStream data)
throws IOException {
throws IOException {
byte[] buffer = new byte[STREAM_BUFFER_LENGTH];
int read = data.read(buffer, 0, STREAM_BUFFER_LENGTH);

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -23,9 +23,9 @@ public class Hex {
public static final Charset DEFAULT_CHARSET = Charsets.UTF_8;
public static final String DEFAULT_CHARSET_NAME = "UTF-8";
private static final char[] DIGITS_LOWER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
private static final char[] DIGITS_UPPER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
private final Charset charset;
public static byte[] decodeHex(char[] data) throws Exception {
@@ -109,7 +109,7 @@ public class Hex {
}
public Object encode(Object object)
throws Exception {
throws Exception {
try {
byte[] byteArray = (object instanceof String) ? ((String) object).getBytes(getCharset()) : (byte[]) (byte[]) object;

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -79,7 +79,7 @@ public class Compressor {
files = new File[1];
files[0] = source;
}
String pathName;//存相对路径(相对于待压缩的根目录)
String pathName;//存相对路径(相对于待压缩的根目录)
byte[] buf = new byte[1024];
int length;
for (File file : files)

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -37,7 +37,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
public class FileUtils {
public static void deleteDirectory(File directory)
throws IOException {
throws IOException {
if (!directory.exists())
return;
@@ -72,7 +72,7 @@ public class FileUtils {
}
public static void cleanDirectory(File directory)
throws IOException {
throws IOException {
if (!directory.exists()) {
//String message = directory + " does not exist";
//throw new IllegalArgumentException(message);
@@ -102,7 +102,7 @@ public class FileUtils {
}
public static void forceDelete(File file)
throws IOException {
throws IOException {
if (file.isDirectory())
deleteDirectory(file);
else {
@@ -118,7 +118,7 @@ public class FileUtils {
}
public static boolean isSymlink(File file)
throws IOException {
throws IOException {
if (file == null)
throw new NullPointerException("File must not be null");
if (File.separatorChar == '\\')
@@ -135,22 +135,22 @@ public class FileUtils {
}
public static void copyDirectory(File srcDir, File destDir)
throws IOException {
throws IOException {
copyDirectory(srcDir, destDir, true);
}
public static void copyDirectory(File srcDir, File destDir, boolean preserveFileDate)
throws IOException {
throws IOException {
copyDirectory(srcDir, destDir, null, preserveFileDate);
}
public static void copyDirectory(File srcDir, File destDir, FileFilter filter)
throws IOException {
throws IOException {
copyDirectory(srcDir, destDir, filter, true);
}
public static void copyDirectory(File srcDir, File destDir, FileFilter filter, boolean preserveFileDate)
throws IOException {
throws IOException {
if (srcDir == null)
throw new NullPointerException("Source must not be null");
if (destDir == null)
@@ -177,7 +177,7 @@ public class FileUtils {
}
private static void doCopyDirectory(File srcDir, File destDir, FileFilter filter, boolean preserveFileDate, List<String> exclusionList)
throws IOException {
throws IOException {
File[] srcFiles = filter == null ? srcDir.listFiles() : srcDir.listFiles(filter);
if (srcFiles == null)
throw new IOException("Failed to list contents of " + srcDir);
@@ -204,7 +204,7 @@ public class FileUtils {
}
public static String readFileToString(File file)
throws IOException {
throws IOException {
return NetUtils.getStreamContent(IOUtils.openInputStream(file));
}
@@ -218,7 +218,7 @@ public class FileUtils {
}
public static String readFileToString(File file, String charset)
throws IOException {
throws IOException {
return NetUtils.getStreamContent(IOUtils.openInputStream(file), charset);
}
@@ -239,12 +239,12 @@ public class FileUtils {
}
public static void copyFile(File srcFile, File destFile)
throws IOException {
throws IOException {
copyFile(srcFile, destFile, true);
}
public static void copyFile(File srcFile, File destFile, boolean preserveFileDate)
throws IOException {
throws IOException {
if (srcFile == null)
throw new NullPointerException("Source must not be null");
if (destFile == null)
@@ -266,7 +266,7 @@ public class FileUtils {
}
private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate)
throws IOException {
throws IOException {
if ((destFile.exists()) && (destFile.isDirectory()))
throw new IOException("Destination '" + destFile + "' exists but is a directory");
@@ -356,38 +356,38 @@ public class FileUtils {
}
public static void write(File file, CharSequence data)
throws IOException {
throws IOException {
write(file, data, "UTF-8", false);
}
public static void write(File file, CharSequence data, boolean append)
throws IOException {
throws IOException {
write(file, data, "UTF-8", append);
}
public static void write(File file, CharSequence data, String encoding)
throws IOException {
throws IOException {
write(file, data, encoding, false);
}
public static void write(File file, CharSequence data, String encoding, boolean append)
throws IOException {
throws IOException {
String str = data == null ? null : data.toString();
writeStringToFile(file, str, encoding, append);
}
public static void writeStringToFile(File file, String data)
throws IOException {
throws IOException {
writeStringToFile(file, data, "UTF-8", false);
}
public static void writeStringToFile(File file, String data, String encoding)
throws IOException {
throws IOException {
writeStringToFile(file, data, encoding, false);
}
public static void writeStringToFile(File file, String data, String encoding, boolean append)
throws IOException {
throws IOException {
OutputStream out = null;
try {
out = openOutputStream(file, append);
@@ -399,7 +399,7 @@ public class FileUtils {
}
public static FileInputStream openInputStream(File file)
throws IOException {
throws IOException {
if (file.exists()) {
if (file.isDirectory())
throw new IOException("File '" + file + "' exists but is a directory");
@@ -411,12 +411,12 @@ public class FileUtils {
}
public static FileOutputStream openOutputStream(File file)
throws IOException {
throws IOException {
return openOutputStream(file, false);
}
public static FileOutputStream openOutputStream(File file, boolean append)
throws IOException {
throws IOException {
if (file.exists()) {
if (file.isDirectory())
throw new IOException("File '" + file + "' exists but is a directory");

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -72,9 +72,9 @@ public class Java {
}
/*
-----------------------------------
MAC OS X
-----------------------------------
* -----------------------------------
* MAC OS X
* -----------------------------------
*/
public static List<Java> queryAllJDKInMac() {
List<Java> ans = new ArrayList<>();
@@ -88,9 +88,9 @@ public class Java {
}
/*
-----------------------------------
WINDOWS
-----------------------------------
* -----------------------------------
* WINDOWS
* -----------------------------------
*/
public static List<Java> queryAllJavaHomeInWindowsByReg() {
List<Java> ans = new ArrayList<>();
@@ -126,7 +126,7 @@ public class Java {
}
private static List<String> queryRegSubFolders(String location) throws IOException, InterruptedException {
String[] cmd = new String[] {"cmd", "/c", "reg", "query", location};
String[] cmd = new String[] { "cmd", "/c", "reg", "query", location };
List<String> l = IOUtils.readProcessByInputStream(cmd);
List<String> ans = new ArrayList<>();
for (String line : l)
@@ -136,7 +136,7 @@ public class Java {
}
private static String queryRegValue(String location, String name) throws IOException, InterruptedException {
String[] cmd = new String[] {"cmd", "/c", "reg", "query", location, "/v", name};
String[] cmd = new String[] { "cmd", "/c", "reg", "query", location, "/v", name };
List<String> l = IOUtils.readProcessByInputStream(cmd);
boolean last = false;
for (String s : l) {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -166,7 +166,7 @@ public final class JdkVersion {
private static final Pattern p = Pattern.compile("java version \"[1-9]*\\.[1-9]*\\.[0-9]*(.*?)\"");
public static JdkVersion getJavaVersionFromExecutable(String file) throws IOException {
String[] str = new String[] {file, "-version"};
String[] str = new String[] { file, "-version" };
Platform platform = Platform.BIT_32;
String ver = null;
try {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -32,37 +32,37 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
public class MinecraftVersionRequest {
public static final int UNKOWN = 0, INVALID = 1, INVALID_JAR = 2,
MODIFIED = 3, OK = 4, NOT_FOUND = 5, UNREADABLE = 6, NOT_FILE = 7;
MODIFIED = 3, OK = 4, NOT_FOUND = 5, UNREADABLE = 6, NOT_FILE = 7;
public int type;
public String version;
public static String getResponse(MinecraftVersionRequest minecraftVersion) {
String text = "";
switch (minecraftVersion.type) {
case MinecraftVersionRequest.INVALID:
text = C.i18n("minecraft.invalid");
break;
case MinecraftVersionRequest.INVALID_JAR:
text = C.i18n("minecraft.invalid_jar");
break;
case MinecraftVersionRequest.NOT_FILE:
text = C.i18n("minecraft.not_a_file");
break;
case MinecraftVersionRequest.NOT_FOUND:
text = C.i18n("minecraft.not_found");
break;
case MinecraftVersionRequest.UNREADABLE:
text = C.i18n("minecraft.not_readable");
break;
case MinecraftVersionRequest.MODIFIED:
text = C.i18n("minecraft.modified") + " ";
case MinecraftVersionRequest.OK:
text += minecraftVersion.version;
break;
case MinecraftVersionRequest.UNKOWN:
default:
text = "???";
break;
case MinecraftVersionRequest.INVALID:
text = C.i18n("minecraft.invalid");
break;
case MinecraftVersionRequest.INVALID_JAR:
text = C.i18n("minecraft.invalid_jar");
break;
case MinecraftVersionRequest.NOT_FILE:
text = C.i18n("minecraft.not_a_file");
break;
case MinecraftVersionRequest.NOT_FOUND:
text = C.i18n("minecraft.not_found");
break;
case MinecraftVersionRequest.UNREADABLE:
text = C.i18n("minecraft.not_readable");
break;
case MinecraftVersionRequest.MODIFIED:
text = C.i18n("minecraft.modified") + " ";
case MinecraftVersionRequest.OK:
text += minecraftVersion.version;
break;
case MinecraftVersionRequest.UNKOWN:
default:
text = "???";
break;
}
return text;
}
@@ -167,7 +167,7 @@ public class MinecraftVersionRequest {
try {
localZipFile = new ZipFile(file);
ZipEntry minecraft = localZipFile
.getEntry("net/minecraft/client/Minecraft.class");
.getEntry("net/minecraft/client/Minecraft.class");
if (minecraft != null)
return getVersionOfOldMinecraft(localZipFile, minecraft);
ZipEntry main = localZipFile.getEntry("net/minecraft/client/main/Main.class");

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -28,7 +28,7 @@ import java.awt.image.Raster;
import java.awt.image.WritableRaster;
public abstract class AbstractFilter
implements BufferedImageOp {
implements BufferedImageOp {
@Override
public abstract BufferedImage filter(BufferedImage paramBufferedImage1, BufferedImage paramBufferedImage2);

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -27,9 +27,9 @@ public class BasicColors {
private static Color getWebColor(String c) {
return new Color(
Integer.parseInt(c.substring(0, 2), 16),
Integer.parseInt(c.substring(2, 4), 16),
Integer.parseInt(c.substring(4, 6), 16)
Integer.parseInt(c.substring(0, 2), 16),
Integer.parseInt(c.substring(2, 4), 16),
Integer.parseInt(c.substring(4, 6), 16)
);
}

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -68,7 +68,7 @@ public class DropShadowBorder extends AbstractBorder {
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Pair<Integer, Integer> pair = new Pair<>(width, height);
if (CACHE.containsKey(pair))
if (CACHE.containsKey(pair))
g.drawImage(CACHE.get(pair), x, y, width, height, null);
else {
BufferedImage shadow = new BufferedImage(width, height, 2);

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@@ -33,31 +33,32 @@ public class LogWindowOutputStream extends OutputStream {
private final LogWindow txt;
private final Level sas;
/*
private final CacheTask t = new CacheTask();
private class CacheTask extends TimerTask {
private final Object lock = new Object();
private StringBuilder cachedString = new StringBuilder();
@Override
public void run() {
synchronized(lock) {
SwingUtilities.invokeLater(() -> {
String t = txt.getText() + cachedString.toString().replace("\t", " ");
txt.setText(t);
txt.setCaretPosition(t.length());
cachedString = new StringBuilder();
});
}
}
void cache(String s) {
synchronized(lock) {
cachedString.append(s);
}
}
}*/
* private final CacheTask t = new CacheTask();
* private class CacheTask extends TimerTask {
* private final Object lock = new Object();
* private StringBuilder cachedString = new StringBuilder();
*
* @Override
* public void run() {
* synchronized(lock) {
* SwingUtilities.invokeLater(() -> {
* String t = txt.getText() + cachedString.toString().replace("\t", " ");
* txt.setText(t);
* txt.setCaretPosition(t.length());
* cachedString = new StringBuilder();
* });
* }
* }
*
* void cache(String s) {
* synchronized(lock) {
* cachedString.append(s);
* }
* }
* }
*/
public LogWindowOutputStream(LogWindow logWindow, Level l) {
txt = logWindow;
this.sas = l;
@@ -85,7 +86,7 @@ public class LogWindowOutputStream extends OutputStream {
@Override
public final void write(int paramInt) {
append(new String(new byte[] {(byte) paramInt}));
append(new String(new byte[] { (byte) paramInt }));
}
public static void dispose() {

View File

@@ -50,15 +50,15 @@ public class SwingUtils {
* Make DefaultTableModel by overriding getColumnClass and isCellEditable of
* DefaultTableModel.
*
* @param titleA The title of each column.
* @param typesA The type of each column value.
* @param titleA The title of each column.
* @param typesA The type of each column value.
* @param canEditA Is column editable?
*
* @return
*/
public static DefaultTableModel makeDefaultTableModel(String[] titleA, final Class[] typesA, final boolean[] canEditA) {
return new DefaultTableModel(
new Object[][]{},
new Object[][] {},
titleA) {
Class[] types = typesA;
boolean[] canEdit = canEditA;
@@ -81,7 +81,7 @@ public class SwingUtils {
switch (OS.os()) {
case OSX:
try {
Runtime.getRuntime().exec(new String[]{"/usr/bin/open", path});
Runtime.getRuntime().exec(new String[] { "/usr/bin/open", path });
} catch (IOException ex) {
HMCLog.err("Failed to open " + path + " through /usr/bin/open", ex);
}
@@ -108,7 +108,7 @@ public class SwingUtils {
} catch (Throwable e) {
if (OS.os() == OS.OSX)
try {
Runtime.getRuntime().exec(new String[]{"/usr/bin/open", link});
Runtime.getRuntime().exec(new String[] { "/usr/bin/open", link });
} catch (IOException ex) {
HMCLog.warn("Failed to open link: " + link, ex);
}
@@ -150,7 +150,7 @@ public class SwingUtils {
/**
* Append new element to JList
*
* @param list the JList
* @param list the JList
* @param element the Element
*/
public static void appendLast(JList list, Object element) {

View File

@@ -1,7 +1,7 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or