提交 3d763b4a authored 作者: Noel Grandin's avatar Noel Grandin

remove some dead code

found by UCDetector
上级 67aa05ba
...@@ -344,12 +344,6 @@ public class DbSettings extends SettingsBase { ...@@ -344,12 +344,6 @@ public class DbSettings extends SettingsBase {
*/ */
public final boolean compressData = get("COMPRESS", false); public final boolean compressData = get("COMPRESS", false);
/**
* Database setting <code>MULTI_THREADED</code>
* (default: false).<br />
*/
public final boolean multiThreaded = get("MULTI_THREADED", false);
private DbSettings(HashMap<String, String> s) { private DbSettings(HashMap<String, String> s) {
super(s); super(s);
} }
......
...@@ -22,11 +22,6 @@ public class Mode { ...@@ -22,11 +22,6 @@ public class Mode {
REGULAR, DB2, Derby, MSSQLServer, HSQLDB, MySQL, Oracle, PostgreSQL, Ignite, REGULAR, DB2, Derby, MSSQLServer, HSQLDB, MySQL, Oracle, PostgreSQL, Ignite,
} }
/**
* The name of the default mode.
*/
static final String REGULAR = ModeEnum.REGULAR.name();
private static final HashMap<String, Mode> MODES = New.hashMap(); private static final HashMap<String, Mode> MODES = New.hashMap();
// Modes are also documented in the features section // Modes are also documented in the features section
...@@ -317,10 +312,6 @@ public class Mode { ...@@ -317,10 +312,6 @@ public class Mode {
return MODES.get(StringUtils.toUpperEnglish(name)); return MODES.get(StringUtils.toUpperEnglish(name));
} }
public static Mode getMySQL() {
return getInstance(ModeEnum.MySQL.name());
}
public static Mode getOracle() { public static Mode getOracle() {
return getInstance(ModeEnum.Oracle.name()); return getInstance(ModeEnum.Oracle.name());
} }
......
...@@ -85,17 +85,6 @@ public class SysProperties { ...@@ -85,17 +85,6 @@ public class SysProperties {
public static final String ALLOWED_CLASSES = public static final String ALLOWED_CLASSES =
Utils.getProperty("h2.allowedClasses", "*"); Utils.getProperty("h2.allowedClasses", "*");
/**
* System property <code>h2.browser</code> (default: null).<br />
* The preferred browser to use. If not set, the default browser is used.
* For Windows, to use the Internet Explorer, set this property to
* 'explorer'. For Mac OS, if the default browser is not Safari and you want
* to use Safari, use:
* <code>java -Dh2.browser="open,-a,Safari,%url" ...</code>.
*/
public static final String BROWSER =
Utils.getProperty(H2_BROWSER, null);
/** /**
* System property <code>h2.enableAnonymousTLS</code> (default: true).<br /> * System property <code>h2.enableAnonymousTLS</code> (default: true).<br />
* When using TLS connection, the anonymous cipher suites should be enabled. * When using TLS connection, the anonymous cipher suites should be enabled.
......
...@@ -49,11 +49,6 @@ public class PgServer implements Service { ...@@ -49,11 +49,6 @@ public class PgServer implements Service {
*/ */
public static final int PG_TYPE_VARCHAR = 1043; public static final int PG_TYPE_VARCHAR = 1043;
/**
* The integer array type (for the column pg_index.indkey).
*/
public static final int PG_TYPE_INT2VECTOR = 22;
public static final int PG_TYPE_BOOL = 16; public static final int PG_TYPE_BOOL = 16;
public static final int PG_TYPE_BYTEA = 17; public static final int PG_TYPE_BYTEA = 17;
public static final int PG_TYPE_BPCHAR = 1042; public static final int PG_TYPE_BPCHAR = 1042;
......
...@@ -24,7 +24,6 @@ import java.util.Map.Entry; ...@@ -24,7 +24,6 @@ import java.util.Map.Entry;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.TimeZone; import java.util.TimeZone;
import org.h2.engine.Constants; import org.h2.engine.Constants;
import org.h2.engine.SysProperties; import org.h2.engine.SysProperties;
import org.h2.message.DbException; import org.h2.message.DbException;
...@@ -189,22 +188,6 @@ public class WebServer implements Service { ...@@ -189,22 +188,6 @@ public class WebServer implements Service {
return data; return data;
} }
/**
* Check if this is a simple name (only contains '.', '-', '_', letters, or
* digits).
*
* @param s the string
* @return true if it's a simple name
*/
static boolean isSimpleName(String s) {
for (char c : s.toCharArray()) {
if (c != '.' && c != '_' && c != '-' && !Character.isLetterOrDigit(c)) {
return false;
}
}
return true;
}
/** /**
* Remove this web thread from the set of running threads. * Remove this web thread from the set of running threads.
* *
......
...@@ -594,28 +594,6 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -594,28 +594,6 @@ public class LobStorageBackend implements LobStorageInterface {
return lob; return lob;
} }
@Override
public void setTable(ValueLobDb lob, int table) {
long lobId = lob.getLobId();
assertNotHolds(conn.getSession());
// see locking discussion at the top
synchronized (database) {
synchronized (conn.getSession()) {
try {
init();
String sql = "UPDATE " + LOBS + " SET TABLE = ? WHERE ID = ?";
PreparedStatement prep = prepare(sql);
prep.setInt(1, table);
prep.setLong(2, lobId);
prep.executeUpdate();
reuse(sql, prep);
} catch (SQLException e) {
throw DbException.convert(e);
}
}
}
}
private static void assertNotHolds(Object lock) { private static void assertNotHolds(Object lock) {
if (Thread.holdsLock(lock)) { if (Thread.holdsLock(lock)) {
throw DbException.throwInternalError(lock.toString()); throw DbException.throwInternalError(lock.toString());
......
...@@ -72,11 +72,6 @@ public class LobStorageFrontend implements LobStorageInterface { ...@@ -72,11 +72,6 @@ public class LobStorageFrontend implements LobStorageInterface {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public void setTable(ValueLobDb lob, int tableIdSessionVariable) {
throw new UnsupportedOperationException();
}
@Override @Override
public void removeAllForTable(int tableId) { public void removeAllForTable(int tableId) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
......
...@@ -55,14 +55,6 @@ public interface LobStorageInterface { ...@@ -55,14 +55,6 @@ public interface LobStorageInterface {
InputStream getInputStream(ValueLobDb lob, byte[] hmac, long byteCount) InputStream getInputStream(ValueLobDb lob, byte[] hmac, long byteCount)
throws IOException; throws IOException;
/**
* Set the table reference of this lob.
*
* @param lob the lob
* @param table the table
*/
void setTable(ValueLobDb lob, int table);
/** /**
* Delete a LOB (from the database, if it is stored there). * Delete a LOB (from the database, if it is stored there).
* *
......
...@@ -289,19 +289,6 @@ public class LobStorageMap implements LobStorageInterface { ...@@ -289,19 +289,6 @@ public class LobStorageMap implements LobStorageInterface {
return streamStore.get(streamStoreId); return streamStore.get(streamStoreId);
} }
@Override
public void setTable(ValueLobDb lob, int tableId) {
init();
long lobId = lob.getLobId();
Object[] value = lobMap.remove(lobId);
if (TRACE) {
trace("move " + lob.getTableId() + "/" + lob.getLobId() +
" > " + tableId + "/" + lobId);
}
value[1] = tableId;
lobMap.put(lobId, value);
}
@Override @Override
public void removeAllForTable(int tableId) { public void removeAllForTable(int tableId) {
init(); init();
......
...@@ -95,10 +95,6 @@ public class Column { ...@@ -95,10 +95,6 @@ public class Column {
this(name, type, -1, -1, -1, null); this(name, type, -1, -1, -1, null);
} }
public Column(String name, int type, String[] enumerators) {
this(name, type, -1, -1, -1, enumerators);
}
public Column(String name, int type, long precision, int scale, public Column(String name, int type, long precision, int scale,
int displaySize) { int displaySize) {
this(name, type, precision, scale, displaySize, null); this(name, type, precision, scale, displaySize, null);
......
...@@ -35,15 +35,6 @@ public class ColumnNamer { ...@@ -35,15 +35,6 @@ public class ColumnNamer {
} }
} }
/**
* Create a standardized column name that isn't null and doesn't have a CR/LF in it.
* @param expr the column expression
* @param indexOfColumn index of column in below array
*/
public String getColumnName(Expression expr, int indexOfColumn) {
return getColumnName(expr, indexOfColumn, (String) null);
}
/** /**
* Create a standardized column name that isn't null and doesn't have a CR/LF in it. * Create a standardized column name that isn't null and doesn't have a CR/LF in it.
* @param columnExp the column expression * @param columnExp the column expression
......
...@@ -94,16 +94,6 @@ public abstract class Task implements Runnable { ...@@ -94,16 +94,6 @@ public abstract class Task implements Runnable {
return finished; return finished;
} }
/**
* Interrupt the thread.
*/
public void interruptThread() {
if (thread == null) {
throw new IllegalStateException("Thread not started");
}
thread.interrupt();
}
/** /**
* Get the exception that was thrown in the call (if any). * Get the exception that was thrown in the call (if any).
* *
......
...@@ -26,13 +26,12 @@ public class TestColumnNamer extends TestBase { ...@@ -26,13 +26,12 @@ public class TestColumnNamer extends TestBase {
/** /**
* Run just this test. * Run just this test.
*
* @param a ignored
*/ */
public static void main(String[] args) { public static void main(String[] args) {
new TestColumnNamer().test(); new TestColumnNamer().test();
} }
@Override
public void test() { public void test() {
ColumnNamer columnNamer = new ColumnNamer(null); ColumnNamer columnNamer = new ColumnNamer(null);
columnNamer.getConfiguration().configure("MAX_IDENTIFIER_LENGTH = 30"); columnNamer.getConfiguration().configure("MAX_IDENTIFIER_LENGTH = 30");
......
...@@ -394,21 +394,6 @@ public class XMLParser { ...@@ -394,21 +394,6 @@ public class XMLParser {
return eventType; return eventType;
} }
/**
* Read the next start, end, or character tag. This method skips comments,
* DTDs, and processing instructions.
*
* @return the event type of the next tag
*/
public int nextTag() {
while (true) {
int type = next();
if (type != COMMENT && type != DTD && type != PROCESSING_INSTRUCTION) {
return type;
}
}
}
/** /**
* Get the event type of the current token. * Get the event type of the current token.
* *
...@@ -465,46 +450,6 @@ public class XMLParser { ...@@ -465,46 +450,6 @@ public class XMLParser {
return attributeValues[index * 3 + 1]; return attributeValues[index * 3 + 1];
} }
/**
* Get the full name of the attribute. If there is no prefix, only the local
* name is returned, otherwise the prefix, ':', and the local name.
*
* @param index the index of the attribute (starting with 0)
* @return the full name
*/
public String getAttributeName(int index) {
String pre = getAttributePrefix(index);
String name = getAttributeLocalName(index);
return pre == null || pre.length() == 0 ? name : pre + ":" + name;
}
/**
* Get the value of this attribute.
*
* @param index the index of the attribute (starting with 0)
* @return the value
*/
public String getAttributeValue(int index) {
return attributeValues[index * 3 + 2];
}
/**
* Get the value of this attribute.
*
* @param namespaceURI the namespace URI (currently ignored)
* @param name the local name of the attribute
* @return the value or null
*/
public String getAttributeValue(@SuppressWarnings("unused") String namespaceURI, String name) {
int len = getAttributeCount();
for (int i = 0; i < len; i++) {
if (getAttributeLocalName(i).equals(name)) {
return getAttributeValue(i);
}
}
return null;
}
/** /**
* Get the full name of the current start or end element. If there is no * Get the full name of the current start or end element. If there is no
* prefix, only the local name is returned, otherwise the prefix, ':', and * prefix, only the local name is returned, otherwise the prefix, ':', and
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论