reconstruct code && add advice for out of memory error.

This commit is contained in:
huanghongxun
2015-07-06 12:50:02 +08:00
parent d398de5d4e
commit 244b646225
183 changed files with 381 additions and 346 deletions

View File

@@ -22,7 +22,7 @@ import java.util.ResourceBundle;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class C {
public static final Gson gsonPrettyPrinting = new GsonBuilder().setPrettyPrinting().create();

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.logger.Logger;
/**
*
* @author hyh
* @author huangyuhui
*/
public class HMCLog {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.logging.layout.DefaultLayout;
/**
*
* @author hyh
* @author huangyuhui
*/
public class Configuration {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging;
/**
*
* @author hyh
* @author huangyuhui
*/
public enum Level {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.logging.message.IMessage;
/**
*
* @author hyh
* @author huangyuhui
*/
public class LogEvent {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging;
/**
*
* @author hyh
* @author huangyuhui
*/
public class LoggingException extends RuntimeException {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class AbstractAppender implements IAppender {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ConsoleAppender extends OutputStreamAppender {

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface IAppender {

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class OutputStreamAppender extends AbstractAppender {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class AbstractStringLayout implements ILayout<String> {

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/**
*
* @author hyh
* @author huangyuhui
*/
public class DefaultLayout extends AbstractStringLayout {
private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/**
*
* @author hyh
* @author huangyuhui
* @param <T>
*/
public interface ILayout<T extends Serializable> {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.message.IMessage;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface ILogger {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class AbstractMessageFactory
implements IMessageFactory {

View File

@@ -20,7 +20,7 @@ import java.io.Serializable;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface IMessage extends Serializable {
String getFormattedMessage();

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract interface IMessageFactory {

View File

@@ -27,7 +27,7 @@ import java.util.Set;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ParameterizedMessage
implements IMessage {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class ParameterizedMessageFactory extends AbstractMessageFactory {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/**
*
* @author hyh
* @author huangyuhui
*/
public class SimpleMessage
implements IMessage {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface DoingDoneListener<K> {
/**

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class ProgressProvider {
protected ProgressProviderListener ppl;

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface ProgressProviderListener {
void setProgress(int prog, int max);

View File

@@ -20,7 +20,7 @@ import java.util.Collection;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class Task extends ProgressProvider {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/**
*
* @author hyh
* @author huangyuhui
*/
public abstract class TaskInfo extends Task {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.HMCLog;
/**
*
* @author hyh
* @author huangyuhui
*/
public class TaskList extends Thread {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/**
*
* @author hyh
* @author huangyuhui
*/
public class TaskRunnable extends TaskInfo {
private final Runnable r;

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.utils.functions.Consumer;
/**
*
* @author hyh
* @author huangyuhui
* @param <T> Runnable&lt;T&gt;
*/
public class TaskRunnableArg1<T> extends TaskInfo implements PreviousResultRegistrator<T> {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.SwingUtils;
/**
*
* @author hyh
* @author huangyuhui
*/
public class TaskWindow extends javax.swing.JDialog
implements ProgressProviderListener, NonConsumer, DoingDoneListener<Task> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks.communication;
/**
*
* @author hyh
* @author huangyuhui
* @param <T> Task result type
*/
public interface PreviousResult<T> {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.tasks.Task;
/**
*
* @author hyh
* @author huangyuhui
* @param <T> Previous task result type
*/
public interface PreviousResultRegistrator<T> {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.views.LogWindow;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ContentGetAndShowTask extends HTTPGetTask implements Event<String> {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.tasks.ProgressProviderListener;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface DownloadListener extends ProgressProviderListener {

View File

@@ -38,7 +38,7 @@ import org.jackhuang.hellominecraft.utils.system.IOUtils;
/**
*
* @author hyh
* @author huangyuhui
*/
// This class downloads a file from a URL.
public class FileDownloadTask extends Task implements PreviousResult<File>, PreviousResultRegistrator<String> {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.EventHandler;
/**
*
* @author hyh
* @author huangyuhui
*/
public class HTTPGetTask extends TaskInfo implements PreviousResult<String> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks.download;
/**
*
* @author hyh
* @author huangyuhui
*/
public class NetException extends RuntimeException {

View File

@@ -22,7 +22,7 @@ import java.util.Map;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ArrayUtils {

View File

@@ -24,7 +24,7 @@ import java.util.Iterator;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class CollectionUtils {
public static <T> void forEach(Collection<T> coll, Consumer<T> p) {

View File

@@ -21,7 +21,7 @@ import java.io.OutputStream;
/**
*
* @author hyh
* @author huangyuhui
*/
public class DoubleOutputStream extends OutputStream {

View File

@@ -23,7 +23,7 @@ import java.util.ArrayList;
/**
*
* @author hyh
* @author huangyuhui
*/
public class LauncherPrintStream extends PrintStream {

View File

@@ -20,7 +20,7 @@ import java.util.Map;
/**
*
* @author hyh
* @author huangyuhui
* @param <K> K Type
* @param <V> V Type
*/

View File

@@ -22,7 +22,7 @@ import java.util.Set;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ReflectUtils {

View File

@@ -22,7 +22,7 @@ import javax.swing.text.JTextComponent;
/**
*
* @author hyh
* @author huangyuhui
*/
public class TextComponentOutputStream extends OutputStream {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.HMCLog;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class UpdateChecker extends Thread {
public static boolean OUT_DATED = false;

View File

@@ -41,7 +41,7 @@ import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
/**
* @author hyh
* @author huangyuhui
*/
public final class Utils {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.HMCLog;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class VersionNumber implements Comparable<VersionNumber> {

View File

@@ -20,7 +20,7 @@ import java.io.UnsupportedEncodingException;
/**
*
* @author hyh
* @author huangyuhui
*/
public class Base64 {

View File

@@ -24,7 +24,7 @@ import java.security.NoSuchAlgorithmException;
/**
*
* @author hyh
* @author huangyuhui
*/
public class DigestUtils {

View File

@@ -17,7 +17,7 @@
package org.jackhuang.hellominecraft.utils.functions;
/**
* @author hyh
* @author huangyuhui
*/
public interface BiConsumer<V, V2> {
void onDone(V value, V2 value2);

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public class FalseFunction implements NonFunction<Boolean> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface NonConsumer {
void onDone();

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface NonFunction<T> {
T onDone();

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface Predicate<T> {
boolean apply(T t);

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public interface TriConsumer<V1, V2, V3> {
void onDone(V1 v1, V2 v2, V3 v3);

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.utils.functions;
/**
*
* @author hyh
* @author huangyuhui
*/
public class TrueFunction implements NonFunction<Boolean> {

View File

@@ -31,7 +31,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/**
* 文件压缩/解压类
*
* @author hyh
* @author huangyuhui
*/
public class Compressor {

View File

@@ -31,7 +31,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
/**
*
* @author hyh
* @author huangyuhui
*/
public class FileUtils {

View File

@@ -23,7 +23,7 @@ import java.util.List;
/**
*
* @author hyh
* @author huangyuhui
*/
public class JavaProcess {

View File

@@ -16,7 +16,6 @@
*/
package org.jackhuang.hellominecraft.utils.system;
import org.jackhuang.hellominecraft.utils.system.Platform;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -29,7 +28,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/**
*
* @author hyh
* @author huangyuhui
*/
public final class JdkVersion {

View File

@@ -20,7 +20,7 @@ import javax.swing.JOptionPane;
import org.jackhuang.hellominecraft.C;
/**
* @author hyh
* @author huangyuhui
*/
public class MessageBox
{

View File

@@ -21,7 +21,7 @@ import java.lang.management.ManagementFactory;
import org.jackhuang.hellominecraft.HMCLog;
/**
* @author hyh
* @author huangyuhui
*/
public enum OS {

View File

@@ -25,7 +25,7 @@ import org.jackhuang.hellominecraft.utils.EventHandler;
/**
*
* @author hyh
* @author huangyuhui
*/
public class ProcessThread extends Thread {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.version;
/**
*
* @author hyh
* @author huangyuhui
*/
public class MinecraftRemoteLatestVersion {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.version;
/**
*
* @author hyh
* @author huangyuhui
*/
public class MinecraftRemoteVersion {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.C;
/**
*
* @author hyh
* @author huangyuhui
*/
public class MinecraftRemoteVersions {

View File

@@ -19,7 +19,7 @@ package org.jackhuang.hellominecraft.version;
import org.jackhuang.hellominecraft.C;
/**
* @author hyh
* @author huangyuhui
*/
public class MinecraftVersionRequest {
public static final int Unkown = 0, Invaild = 1, InvaildJar = 2,

View File

@@ -20,7 +20,7 @@ import java.awt.Color;
/**
*
* @author hyh
* @author huangyuhui
*/
public class BasicColors {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.Utils;
/**
*
* @author hyh
* @author huangyuhui
*/
public class LogWindow extends javax.swing.JFrame {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.views;
/**
* The frame given to choose things.
* @author hyh
* @author huangyuhui
*/
public class Selector extends javax.swing.JDialog {
String[] selList;