From a89ccfb13affdb43955f72b9841a93c2435b9749 Mon Sep 17 00:00:00 2001 From: incastrix Date: Wed, 23 Dec 2009 17:55:27 +0000 Subject: [PATCH] Refactory: remove unused classes, imports, fields and methods. --- .../phpdt/internal/formatter/AbortFormatting.java | 31 -------- .../phpdt/internal/formatter/CodeFormatter.java | 82 ++++++++++---------- .../internal/formatter/OptimizedReplaceEdit.java | 30 ------- .../formatter/align/AlignmentException.java | 55 ------------- 4 files changed, 41 insertions(+), 157 deletions(-) delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/AbortFormatting.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/OptimizedReplaceEdit.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/align/AlignmentException.java diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/AbortFormatting.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/AbortFormatting.java deleted file mode 100644 index b598ccc..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/AbortFormatting.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 International Business Machines Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ -package net.sourceforge.phpdt.internal.formatter; - -/** - * Unchecked exception wrapping invalid input checked exception which may occur - * when scanning original formatted source. - * - * @since 2.1 - */ -public class AbortFormatting extends RuntimeException { - - Throwable nestedException; - - public AbortFormatting(String message) { - super(message); - } - - public AbortFormatting(Throwable nestedException) { - super(nestedException.getMessage()); - this.nestedException = nestedException; - } -} diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java index 3be2d55..4d7ed3e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java @@ -15,7 +15,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Hashtable; -import java.util.Locale; +//import java.util.Locale; import java.util.Map; //import javax.swing.text.html.Option; @@ -148,9 +148,9 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * * @deprecated Use CodeFormatter(ConfigurableOption[]) instead */ - public CodeFormatter() { - this((Map) null); - } +// public CodeFormatter() { +// this((Map) null); +// } /** * Creates a new instance of Code Formatter using the given settings. @@ -1261,40 +1261,40 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * * @deprecated backport 1.0 internal functionality */ - public static ConfigurableOption[] getDefaultOptions(Locale locale) { - String componentName = CodeFormatter.class.getName(); - FormatterOptions options = new FormatterOptions(); - return new ConfigurableOption[] { - new ConfigurableOption(componentName, "newline.openingBrace", - locale, options.newLineBeforeOpeningBraceMode ? 0 : 1), - //$NON-NLS-1$ - new ConfigurableOption(componentName, - "newline.controlStatement", locale, - options.newlineInControlStatementMode ? 0 : 1), - //$NON-NLS-1$ - new ConfigurableOption(componentName, "newline.clearAll", - locale, options.clearAllBlankLinesMode ? 0 : 1), - //$NON-NLS-1$ - // new ConfigurableOption(componentName, "newline.elseIf", - // locale, - // options.compactElseIfMode ? 0 : 1), //$NON-NLS-1$ - new ConfigurableOption(componentName, "newline.emptyBlock", - locale, options.newLineInEmptyBlockMode ? 0 : 1), - //$NON-NLS-1$ - new ConfigurableOption(componentName, "line.split", locale, - options.maxLineLength), - //$NON-NLS-1$ - new ConfigurableOption(componentName, - "style.compactAssignment", locale, - options.compactAssignmentMode ? 0 : 1), - //$NON-NLS-1$ - new ConfigurableOption(componentName, "tabulation.char", - locale, options.indentWithTab ? 0 : 1), - //$NON-NLS-1$ - new ConfigurableOption(componentName, - "tabulation.size", locale, options.tabSize) //$NON-NLS-1$ - }; - } +// public static ConfigurableOption[] getDefaultOptions(Locale locale) { +// String componentName = CodeFormatter.class.getName(); +// FormatterOptions options = new FormatterOptions(); +// return new ConfigurableOption[] { +// new ConfigurableOption(componentName, "newline.openingBrace", +// locale, options.newLineBeforeOpeningBraceMode ? 0 : 1), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, +// "newline.controlStatement", locale, +// options.newlineInControlStatementMode ? 0 : 1), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, "newline.clearAll", +// locale, options.clearAllBlankLinesMode ? 0 : 1), +// //$NON-NLS-1$ +// // new ConfigurableOption(componentName, "newline.elseIf", +// // locale, +// // options.compactElseIfMode ? 0 : 1), //$NON-NLS-1$ +// new ConfigurableOption(componentName, "newline.emptyBlock", +// locale, options.newLineInEmptyBlockMode ? 0 : 1), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, "line.split", locale, +// options.maxLineLength), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, +// "style.compactAssignment", locale, +// options.compactAssignmentMode ? 0 : 1), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, "tabulation.char", +// locale, options.indentWithTab ? 0 : 1), +// //$NON-NLS-1$ +// new ConfigurableOption(componentName, +// "tabulation.size", locale, options.tabSize) //$NON-NLS-1$ +// }; +// } /** * Returns the array of mapped positions. Returns null is no positions have @@ -2256,9 +2256,9 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * @return an object containing the operator and all the substrings or null * if the string cannot be split */ - public SplitLine split(String stringToSplit) { - return split(stringToSplit, 0); - } +// public SplitLine split(String stringToSplit) { +// return split(stringToSplit, 0); +// } /** * Splits stringToSplit on the top level token
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/OptimizedReplaceEdit.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/OptimizedReplaceEdit.java deleted file mode 100644 index 4429d74..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/OptimizedReplaceEdit.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 International Business Machines Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ -package net.sourceforge.phpdt.internal.formatter; - -class OptimizedReplaceEdit { - - int offset; - - int length; - - String replacement; - - OptimizedReplaceEdit(int offset, int length, String replacement) { - this.offset = offset; - this.length = length; - this.replacement = replacement; - } - - public String toString() { - return "(" + this.offset + ", length " + this.length + " :>" + this.replacement + "<"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ - } -} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/align/AlignmentException.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/align/AlignmentException.java deleted file mode 100644 index 82adfab..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/align/AlignmentException.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 International Business Machines Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ -package net.sourceforge.phpdt.internal.formatter.align; - -/** - * Exception used to backtrack and break available alignments When the exception - * is thrown, it is assumed that some alignment will be changed. - * - * @since 2.1 - */ -public class AlignmentException extends RuntimeException { - - public static final int LINE_TOO_LONG = 1; - - public static final int ALIGN_TOO_SMALL = 2; - - int reason; - - int value; - - public int relativeDepth; - - public AlignmentException(int reason, int relativeDepth) { - this(reason, 0, relativeDepth); - } - - public AlignmentException(int reason, int value, int relativeDepth) { - this.reason = reason; - this.value = value; - this.relativeDepth = relativeDepth; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(10); - switch (this.reason) { - case LINE_TOO_LONG: - buffer.append("LINE_TOO_LONG"); //$NON-NLS-1$ - break; - case ALIGN_TOO_SMALL: - buffer.append("ALIGN_TOO_SMALL"); //$NON-NLS-1$ - break; - } - buffer.append("\n"); //$NON-NLS-1$ - return buffer.toString(); - } -} -- 1.7.1