提交 1797573d authored 作者: Thomas Mueller's avatar Thomas Mueller

Removed the now unnecessary spaces around the generic wildcard < ? >

上级 9bed4a26
...@@ -132,7 +132,7 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -132,7 +132,7 @@ public class FunctionAlias extends SchemaObjectBase {
} }
private void loadClass() { private void loadClass() {
Class< ? > javaClass = Utils.loadUserClass(className); Class<?> javaClass = Utils.loadUserClass(className);
Method[] methods = javaClass.getMethods(); Method[] methods = javaClass.getMethods();
ArrayList<JavaMethod> list = New.arrayList(); ArrayList<JavaMethod> list = New.arrayList();
for (int i = 0, len = methods.length; i < len; i++) { for (int i = 0, len = methods.length; i < len; i++) {
...@@ -168,7 +168,7 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -168,7 +168,7 @@ public class FunctionAlias extends SchemaObjectBase {
private String getMethodSignature(Method m) { private String getMethodSignature(Method m) {
StatementBuilder buff = new StatementBuilder(m.getName()); StatementBuilder buff = new StatementBuilder(m.getName());
buff.append('('); buff.append('(');
for (Class< ? > p : m.getParameterTypes()) { for (Class<?> p : m.getParameterTypes()) {
// do not use a space here, because spaces are removed // do not use a space here, because spaces are removed
// in CreateFunctionAlias.setJavaClassMethod() // in CreateFunctionAlias.setJavaClassMethod()
buff.appendExceptFirst(","); buff.appendExceptFirst(",");
...@@ -275,29 +275,29 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -275,29 +275,29 @@ public class FunctionAlias extends SchemaObjectBase {
private final int dataType; private final int dataType;
private boolean hasConnectionParam; private boolean hasConnectionParam;
private boolean varArgs; private boolean varArgs;
private Class< ? > varArgClass; private Class<?> varArgClass;
private int paramCount; private int paramCount;
JavaMethod(Method method, int id) { JavaMethod(Method method, int id) {
this.method = method; this.method = method;
this.id = id; this.id = id;
Class< ? >[] paramClasses = method.getParameterTypes(); Class<?>[] paramClasses = method.getParameterTypes();
paramCount = paramClasses.length; paramCount = paramClasses.length;
if (paramCount > 0) { if (paramCount > 0) {
Class< ? > paramClass = paramClasses[0]; Class<?> paramClass = paramClasses[0];
if (Connection.class.isAssignableFrom(paramClass)) { if (Connection.class.isAssignableFrom(paramClass)) {
hasConnectionParam = true; hasConnectionParam = true;
paramCount--; paramCount--;
} }
} }
if (paramCount > 0) { if (paramCount > 0) {
Class< ? > lastArg = paramClasses[paramClasses.length - 1]; Class<?> lastArg = paramClasses[paramClasses.length - 1];
if (lastArg.isArray() && FunctionAlias.isVarArgs(method)) { if (lastArg.isArray() && FunctionAlias.isVarArgs(method)) {
varArgs = true; varArgs = true;
varArgClass = lastArg.getComponentType(); varArgClass = lastArg.getComponentType();
} }
} }
Class< ? > returnClass = method.getReturnType(); Class<?> returnClass = method.getReturnType();
dataType = DataType.getTypeFromClass(returnClass); dataType = DataType.getTypeFromClass(returnClass);
} }
...@@ -323,7 +323,7 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -323,7 +323,7 @@ public class FunctionAlias extends SchemaObjectBase {
* @return the value * @return the value
*/ */
public Value getValue(Session session, Expression[] args, boolean columnList) { public Value getValue(Session session, Expression[] args, boolean columnList) {
Class< ? >[] paramClasses = method.getParameterTypes(); Class<?>[] paramClasses = method.getParameterTypes();
Object[] params = new Object[paramClasses.length]; Object[] params = new Object[paramClasses.length];
int p = 0; int p = 0;
if (hasConnectionParam && params.length > 0) { if (hasConnectionParam && params.length > 0) {
...@@ -340,7 +340,7 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -340,7 +340,7 @@ public class FunctionAlias extends SchemaObjectBase {
for (int a = 0, len = args.length; a < len; a++, p++) { for (int a = 0, len = args.length; a < len; a++, p++) {
boolean currentIsVarArg = varArgs && p >= paramClasses.length - 1; boolean currentIsVarArg = varArgs && p >= paramClasses.length - 1;
Class< ? > paramClass; Class<?> paramClass;
if (currentIsVarArg) { if (currentIsVarArg) {
paramClass = varArgClass; paramClass = varArgClass;
} else { } else {
...@@ -404,7 +404,7 @@ public class FunctionAlias extends SchemaObjectBase { ...@@ -404,7 +404,7 @@ public class FunctionAlias extends SchemaObjectBase {
} }
} }
public Class< ? >[] getColumnClasses() { public Class<?>[] getColumnClasses() {
return method.getParameterTypes(); return method.getParameterTypes();
} }
......
...@@ -19,7 +19,7 @@ import org.h2.util.Utils; ...@@ -19,7 +19,7 @@ import org.h2.util.Utils;
public class UserAggregate extends DbObjectBase { public class UserAggregate extends DbObjectBase {
private String className; private String className;
private Class< ? > javaClass; private Class<?> javaClass;
public UserAggregate(Database db, int id, String name, String className, boolean force) { public UserAggregate(Database db, int id, String name, String className, boolean force) {
initDbObjectBase(db, id, name, Trace.FUNCTION); initDbObjectBase(db, id, name, Trace.FUNCTION);
......
...@@ -57,7 +57,7 @@ public class JdbcArray extends TraceObject implements Array { ...@@ -57,7 +57,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param map is ignored. Only empty or null maps are supported * @param map is ignored. Only empty or null maps are supported
* @return the Object array * @return the Object array
*/ */
public Object getArray(Map<String, Class< ? >> map) throws SQLException { public Object getArray(Map<String, Class<?>> map) throws SQLException {
try { try {
debugCode("getArray("+quoteMap(map)+");"); debugCode("getArray("+quoteMap(map)+");");
checkMap(map); checkMap(map);
...@@ -97,7 +97,7 @@ public class JdbcArray extends TraceObject implements Array { ...@@ -97,7 +97,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param map is ignored. Only empty or null maps are supported * @param map is ignored. Only empty or null maps are supported
* @return the Object array * @return the Object array
*/ */
public Object getArray(long index, int count, Map<String, Class< ? >> map) throws SQLException { public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
try { try {
debugCode("getArray(" + index + ", " + count + ", " + quoteMap(map)+");"); debugCode("getArray(" + index + ", " + count + ", " + quoteMap(map)+");");
checkClosed(); checkClosed();
...@@ -164,7 +164,7 @@ public class JdbcArray extends TraceObject implements Array { ...@@ -164,7 +164,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param map is ignored. Only empty or null maps are supported * @param map is ignored. Only empty or null maps are supported
* @return the result set * @return the result set
*/ */
public ResultSet getResultSet(Map<String, Class< ? >> map) throws SQLException { public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
try { try {
debugCode("getResultSet("+quoteMap(map)+");"); debugCode("getResultSet("+quoteMap(map)+");");
checkClosed(); checkClosed();
...@@ -207,7 +207,7 @@ public class JdbcArray extends TraceObject implements Array { ...@@ -207,7 +207,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param map is ignored. Only empty or null maps are supported * @param map is ignored. Only empty or null maps are supported
* @return the result set * @return the result set
*/ */
public ResultSet getResultSet(long index, int count, Map<String, Class< ? >> map) throws SQLException { public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
try { try {
debugCode("getResultSet("+index+", " + count+", " + quoteMap(map)+");"); debugCode("getResultSet("+index+", " + count+", " + quoteMap(map)+");");
checkClosed(); checkClosed();
...@@ -263,7 +263,7 @@ public class JdbcArray extends TraceObject implements Array { ...@@ -263,7 +263,7 @@ public class JdbcArray extends TraceObject implements Array {
return subset; return subset;
} }
private void checkMap(Map<String, Class< ? >> map) { private void checkMap(Map<String, Class<?>> map) {
if (map != null && map.size() > 0) { if (map != null && map.size() > 0) {
throw DbException.getUnsupportedException("map.size > 0"); throw DbException.getUnsupportedException("map.size > 0");
} }
......
...@@ -754,7 +754,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -754,7 +754,7 @@ public class JdbcConnection extends TraceObject implements Connection {
* @throws SQLException * @throws SQLException
* if the connection is closed * if the connection is closed
*/ */
public Map<String, Class< ? >> getTypeMap() throws SQLException { public Map<String, Class<?>> getTypeMap() throws SQLException {
try { try {
debugCodeCall("getTypeMap"); debugCodeCall("getTypeMap");
checkClosed(); checkClosed();
...@@ -768,7 +768,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -768,7 +768,7 @@ public class JdbcConnection extends TraceObject implements Connection {
* [Partially supported] Sets the type map. This is only supported if the * [Partially supported] Sets the type map. This is only supported if the
* map is empty or null. * map is empty or null.
*/ */
public void setTypeMap(Map<String, Class< ? >> map) throws SQLException { public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
try { try {
debugCode("setTypeMap(" + quoteMap(map) + ");"); debugCode("setTypeMap(" + quoteMap(map) + ");");
checkMap(map); checkMap(map);
...@@ -1033,7 +1033,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1033,7 +1033,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try { try {
//## Java 1.4 begin ## //## Java 1.4 begin ##
// check for existence of this class (avoiding Class . forName) // check for existence of this class (avoiding Class . forName)
Class< ? > clazz = java.sql.Savepoint.class; Class<?> clazz = java.sql.Savepoint.class;
clazz.getClass(); clazz.getClass();
//## Java 1.4 end ## //## Java 1.4 end ##
} catch (NoClassDefFoundError e) { } catch (NoClassDefFoundError e) {
...@@ -1586,7 +1586,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1586,7 +1586,7 @@ public class JdbcConnection extends TraceObject implements Connection {
* @param iface the class * @param iface the class
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
...@@ -1629,7 +1629,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1629,7 +1629,7 @@ public class JdbcConnection extends TraceObject implements Connection {
return v; return v;
} }
private void checkMap(Map<String, Class< ? >> map) { private void checkMap(Map<String, Class<?>> map) {
if (map != null && map.size() > 0) { if (map != null && map.size() > 0) {
throw DbException.getUnsupportedException("map.size > 0"); throw DbException.getUnsupportedException("map.size > 0");
} }
......
...@@ -2817,7 +2817,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat ...@@ -2817,7 +2817,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
* [Not supported] Checks if unwrap can return an object of this class. * [Not supported] Checks if unwrap can return an object of this class.
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -227,7 +227,7 @@ implements ParameterMetaData ...@@ -227,7 +227,7 @@ implements ParameterMetaData
* [Not supported] Checks if unwrap can return an object of this class. * [Not supported] Checks if unwrap can return an object of this class.
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -771,7 +771,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -771,7 +771,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* [Not supported] Gets a column as a object using the specified type * [Not supported] Gets a column as a object using the specified type
* mapping. * mapping.
*/ */
public Object getObject(String columnLabel, Map<String, Class< ? >> map) throws SQLException { public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
throw unsupported("map"); throw unsupported("map");
} }
...@@ -3415,7 +3415,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -3415,7 +3415,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* [Not supported] Checks if unwrap can return an object of this class. * [Not supported] Checks if unwrap can return an object of this class.
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -442,7 +442,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD ...@@ -442,7 +442,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
* [Not supported] Checks if unwrap can return an object of this class. * [Not supported] Checks if unwrap can return an object of this class.
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -973,7 +973,7 @@ public class JdbcStatement extends TraceObject implements Statement { ...@@ -973,7 +973,7 @@ public class JdbcStatement extends TraceObject implements Statement {
* [Not supported] Checks if unwrap can return an object of this class. * [Not supported] Checks if unwrap can return an object of this class.
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -354,7 +354,7 @@ public class JdbcConnectionPool implements DataSource, ConnectionEventListener { ...@@ -354,7 +354,7 @@ public class JdbcConnectionPool implements DataSource, ConnectionEventListener {
* @param iface the class * @param iface the class
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw DbException.getUnsupportedException("isWrapperFor"); throw DbException.getUnsupportedException("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -376,7 +376,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref ...@@ -376,7 +376,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
* @param iface the class * @param iface the class
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw unsupported("isWrapperFor"); throw unsupported("isWrapperFor");
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -355,7 +355,7 @@ public class TraceObject { ...@@ -355,7 +355,7 @@ public class TraceObject {
* @param map the map to convert * @param map the map to convert
* @return the Java source code * @return the Java source code
*/ */
protected String quoteMap(Map<String, Class< ? >> map) { protected String quoteMap(Map<String, Class<?>> map) {
if (map == null) { if (map == null) {
return "null"; return "null";
} }
...@@ -364,9 +364,9 @@ public class TraceObject { ...@@ -364,9 +364,9 @@ public class TraceObject {
} }
StringBuilder buff = new StringBuilder("new Map() /* "); StringBuilder buff = new StringBuilder("new Map() /* ");
try { try {
for (Map.Entry<String, Class < ? >> entry : map.entrySet()) { for (Map.Entry<String, Class <?>> entry : map.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Class< ? > clazz = entry.getValue(); Class<?> clazz = entry.getValue();
buff.append(key).append(':').append(clazz.getName()); buff.append(key).append(':').append(clazz.getName());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -31,7 +31,7 @@ public class WebServlet extends HttpServlet { ...@@ -31,7 +31,7 @@ public class WebServlet extends HttpServlet {
public void init() { public void init() {
ServletConfig config = getServletConfig(); ServletConfig config = getServletConfig();
Enumeration< ? > en = config.getInitParameterNames(); Enumeration<?> en = config.getInitParameterNames();
ArrayList<String> list = New.arrayList(); ArrayList<String> list = New.arrayList();
while (en.hasMoreElements()) { while (en.hasMoreElements()) {
String name = en.nextElement().toString(); String name = en.nextElement().toString();
...@@ -93,7 +93,7 @@ public class WebServlet extends HttpServlet { ...@@ -93,7 +93,7 @@ public class WebServlet extends HttpServlet {
file = getAllowedFile(req, file); file = getAllowedFile(req, file);
byte[] bytes = null; byte[] bytes = null;
Properties attributes = new Properties(); Properties attributes = new Properties();
Enumeration< ? > en = req.getAttributeNames(); Enumeration<?> en = req.getAttributeNames();
while (en.hasMoreElements()) { while (en.hasMoreElements()) {
String name = en.nextElement().toString(); String name = en.nextElement().toString();
String value = req.getAttribute(name).toString(); String value = req.getAttribute(name).toString();
......
...@@ -55,7 +55,7 @@ public class FileStore { ...@@ -55,7 +55,7 @@ public class FileStore {
private FileObject file; private FileObject file;
private long filePos; private long filePos;
private long fileLength; private long fileLength;
private Reference< ? > autoDeleteReference; private Reference<?> autoDeleteReference;
private boolean checkedWriting = true; private boolean checkedWriting = true;
private boolean synchronousMode; private boolean synchronousMode;
private String mode; private String mode;
......
...@@ -1117,9 +1117,9 @@ public class MetaTable extends Table { ...@@ -1117,9 +1117,9 @@ public class MetaTable extends Table {
for (SchemaObject aliasAsSchemaObject : database.getAllSchemaObjects(DbObject.FUNCTION_ALIAS)) { for (SchemaObject aliasAsSchemaObject : database.getAllSchemaObjects(DbObject.FUNCTION_ALIAS)) {
FunctionAlias alias = (FunctionAlias) aliasAsSchemaObject; FunctionAlias alias = (FunctionAlias) aliasAsSchemaObject;
for (FunctionAlias.JavaMethod method : alias.getJavaMethods()) { for (FunctionAlias.JavaMethod method : alias.getJavaMethods()) {
Class< ? >[] columnList = method.getColumnClasses(); Class<?>[] columnList = method.getColumnClasses();
for (int k = 0; k < columnList.length; k++) { for (int k = 0; k < columnList.length; k++) {
Class< ? > clazz = columnList[k]; Class<?> clazz = columnList[k];
int dataType = DataType.getTypeFromClass(clazz); int dataType = DataType.getTypeFromClass(clazz);
DataType dt = DataType.getDataType(dataType); DataType dt = DataType.getDataType(dataType);
int nullable = clazz.isPrimitive() ? DatabaseMetaData.columnNoNulls int nullable = clazz.isPrimitive() ? DatabaseMetaData.columnNoNulls
......
...@@ -484,7 +484,7 @@ public class Server extends Tool implements Runnable, ShutdownHandler { ...@@ -484,7 +484,7 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
return; return;
} }
try { try {
Class< ? > desktopClass = Class.forName("java.awt.Desktop"); Class<?> desktopClass = Class.forName("java.awt.Desktop");
// Desktop.isDesktopSupported() // Desktop.isDesktopSupported()
Boolean supported = (Boolean) desktopClass. Boolean supported = (Boolean) desktopClass.
getMethod("isDesktopSupported"). getMethod("isDesktopSupported").
......
...@@ -113,7 +113,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -113,7 +113,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public Object getArray(Map<String, Class< ? >> map) throws SQLException { public Object getArray(Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -127,7 +127,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -127,7 +127,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public Object getArray(long index, int count, Map<String, Class< ? >> map) throws SQLException { public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -159,7 +159,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -159,7 +159,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public ResultSet getResultSet(Map<String, Class< ? >> map) throws SQLException { public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -173,7 +173,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -173,7 +173,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public ResultSet getResultSet(long index, int count, Map<String, Class< ? >> map) throws SQLException { public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -1457,7 +1457,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -1457,7 +1457,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public Object getObject(int i, Map<String, Class< ? >> map) throws SQLException { public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -1583,7 +1583,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -1583,7 +1583,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
/** /**
* INTERNAL * INTERNAL
*/ */
public Object getObject(String colName, Map<String, Class< ? >> map) throws SQLException { public Object getObject(String colName, Map<String, Class<?>> map) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
...@@ -1841,7 +1841,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData { ...@@ -1841,7 +1841,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
* INTERNAL * INTERNAL
*/ */
//## Java 1.6 begin ## //## Java 1.6 begin ##
public boolean isWrapperFor(Class< ? > iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw getUnsupportedException(); throw getUnsupportedException();
} }
//## Java 1.6 end ## //## Java 1.6 end ##
......
...@@ -161,7 +161,7 @@ public class JdbcUtils { ...@@ -161,7 +161,7 @@ public class JdbcUtils {
if (StringUtils.isNullOrEmpty(driver)) { if (StringUtils.isNullOrEmpty(driver)) {
JdbcUtils.load(url); JdbcUtils.load(url);
} else { } else {
Class< ? > d = Utils.loadUserClass(driver); Class<?> d = Utils.loadUserClass(driver);
if (java.sql.Driver.class.isAssignableFrom(d)) { if (java.sql.Driver.class.isAssignableFrom(d)) {
return DriverManager.getConnection(url, prop); return DriverManager.getConnection(url, prop);
//## Java 1.4 begin ## //## Java 1.4 begin ##
......
...@@ -142,7 +142,7 @@ public class MathUtils { ...@@ -142,7 +142,7 @@ public class MathUtils {
// host name and ip addresses (if any) // host name and ip addresses (if any)
try { try {
// workaround for the Google App Engine: don't use InetAddress // workaround for the Google App Engine: don't use InetAddress
Class< ? > inetAddressClass = Class.forName("java.net.InetAddress"); Class<?> inetAddressClass = Class.forName("java.net.InetAddress");
Object localHost = inetAddressClass.getMethod("getLocalHost").invoke(null); Object localHost = inetAddressClass.getMethod("getLocalHost").invoke(null);
String hostName = inetAddressClass.getMethod("getHostName").invoke(localHost).toString(); String hostName = inetAddressClass.getMethod("getHostName").invoke(localHost).toString();
out.writeUTF(hostName); out.writeUTF(hostName);
......
...@@ -27,7 +27,7 @@ import org.h2.message.DbException; ...@@ -27,7 +27,7 @@ import org.h2.message.DbException;
*/ */
public class SourceCompiler { public class SourceCompiler {
private static final Class< ? > JAVAC_SUN; private static final Class<?> JAVAC_SUN;
/** /**
* The class name to source code map. * The class name to source code map.
...@@ -37,12 +37,12 @@ public class SourceCompiler { ...@@ -37,12 +37,12 @@ public class SourceCompiler {
/** /**
* The class name to byte code map. * The class name to byte code map.
*/ */
HashMap<String, Class< ? >> compiled = New.hashMap(); HashMap<String, Class<?>> compiled = New.hashMap();
private String compileDir = System.getProperty("java.io.tmpdir"); private String compileDir = System.getProperty("java.io.tmpdir");
static { static {
Class< ? > clazz; Class<?> clazz;
try { try {
clazz = Class.forName("com.sun.tools.javac.Main"); clazz = Class.forName("com.sun.tools.javac.Main");
} catch (Exception e) { } catch (Exception e) {
...@@ -69,16 +69,16 @@ public class SourceCompiler { ...@@ -69,16 +69,16 @@ public class SourceCompiler {
* @param packageAndClassName the class name * @param packageAndClassName the class name
* @return the class * @return the class
*/ */
private Class< ? > getClass(String packageAndClassName) throws ClassNotFoundException { private Class<?> getClass(String packageAndClassName) throws ClassNotFoundException {
Class< ? > compiledClass = compiled.get(packageAndClassName); Class<?> compiledClass = compiled.get(packageAndClassName);
if (compiledClass != null) { if (compiledClass != null) {
return compiledClass; return compiledClass;
} }
ClassLoader classLoader = new ClassLoader(getClass().getClassLoader()) { ClassLoader classLoader = new ClassLoader(getClass().getClassLoader()) {
public Class< ? > findClass(String name) throws ClassNotFoundException { public Class<?> findClass(String name) throws ClassNotFoundException {
Class< ? > classInstance = compiled.get(name); Class<?> classInstance = compiled.get(name);
if (classInstance == null) { if (classInstance == null) {
String source = sources.get(name); String source = sources.get(name);
String packageName = null; String packageName = null;
...@@ -111,7 +111,7 @@ public class SourceCompiler { ...@@ -111,7 +111,7 @@ public class SourceCompiler {
* @return the method name * @return the method name
*/ */
public Method getMethod(String className) throws ClassNotFoundException { public Method getMethod(String className) throws ClassNotFoundException {
Class< ? > clazz = getClass(className); Class<?> clazz = getClass(className);
Method[] methods = clazz.getDeclaredMethods(); Method[] methods = clazz.getDeclaredMethods();
for (Method m : methods) { for (Method m : methods) {
int modifiers = m.getModifiers(); int modifiers = m.getModifiers();
......
...@@ -20,7 +20,7 @@ import org.h2.message.DbException; ...@@ -20,7 +20,7 @@ import org.h2.message.DbException;
public class TempFileDeleter { public class TempFileDeleter {
private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
private final HashMap<PhantomReference< ? >, String> refMap = New.hashMap(); private final HashMap<PhantomReference<?>, String> refMap = New.hashMap();
private TempFileDeleter() { private TempFileDeleter() {
// utility class // utility class
...@@ -38,9 +38,9 @@ public class TempFileDeleter { ...@@ -38,9 +38,9 @@ public class TempFileDeleter {
* @param file the object to monitor * @param file the object to monitor
* @return the reference that can be used to stop deleting the file * @return the reference that can be used to stop deleting the file
*/ */
public synchronized Reference< ? > addFile(String fileName, Object file) { public synchronized Reference<?> addFile(String fileName, Object file) {
IOUtils.trace("TempFileDeleter.addFile", fileName, file); IOUtils.trace("TempFileDeleter.addFile", fileName, file);
PhantomReference< ? > ref = new PhantomReference<Object>(file, queue); PhantomReference<?> ref = new PhantomReference<Object>(file, queue);
refMap.put(ref, fileName); refMap.put(ref, fileName);
deleteUnused(); deleteUnused();
return ref; return ref;
...@@ -52,7 +52,7 @@ public class TempFileDeleter { ...@@ -52,7 +52,7 @@ public class TempFileDeleter {
* @param ref the reference as returned by addFile * @param ref the reference as returned by addFile
* @param fileName the file name * @param fileName the file name
*/ */
public synchronized void deleteFile(Reference< ? > ref, String fileName) { public synchronized void deleteFile(Reference<?> ref, String fileName) {
if (ref != null) { if (ref != null) {
String f2 = refMap.remove(ref); String f2 = refMap.remove(ref);
if (f2 != null) { if (f2 != null) {
...@@ -104,7 +104,7 @@ public class TempFileDeleter { ...@@ -104,7 +104,7 @@ public class TempFileDeleter {
* @param ref the reference as returned by addFile * @param ref the reference as returned by addFile
* @param fileName the file name * @param fileName the file name
*/ */
public void stopAutoDelete(Reference< ? > ref, String fileName) { public void stopAutoDelete(Reference<?> ref, String fileName) {
IOUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref); IOUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref);
if (ref != null) { if (ref != null) {
String f2 = refMap.remove(ref); String f2 = refMap.remove(ref);
......
...@@ -391,7 +391,7 @@ public class Utils { ...@@ -391,7 +391,7 @@ public class Utils {
* @param className the name of the class * @param className the name of the class
* @return the class object * @return the class object
*/ */
public static Class< ? > loadUserClass(String className) { public static Class<?> loadUserClass(String className) {
if (!ALLOW_ALL_CLASSES && !ALLOWED_CLASS_NAMES.contains(className)) { if (!ALLOW_ALL_CLASSES && !ALLOWED_CLASS_NAMES.contains(className)) {
boolean allowed = false; boolean allowed = false;
for (String s : ALLOWED_CLASS_NAME_PREFIXES) { for (String s : ALLOWED_CLASS_NAME_PREFIXES) {
......
...@@ -776,7 +776,7 @@ public class DataType { ...@@ -776,7 +776,7 @@ public class DataType {
* @param x the Java class * @param x the Java class
* @return the value type * @return the value type
*/ */
public static int getTypeFromClass(Class < ? > x) { public static int getTypeFromClass(Class <?> x) {
// TODO refactor: too many if/else in functions, can reduce! // TODO refactor: too many if/else in functions, can reduce!
if (x == null || Void.TYPE == x) { if (x == null || Void.TYPE == x) {
return Value.NULL; return Value.NULL;
...@@ -1011,7 +1011,7 @@ public class DataType { ...@@ -1011,7 +1011,7 @@ public class DataType {
* @param clazz the Java class * @param clazz the Java class
* @return the default object * @return the default object
*/ */
public static Object getDefaultForPrimitiveType(Class< ? > clazz) { public static Object getDefaultForPrimitiveType(Class<?> clazz) {
if (clazz == Boolean.TYPE) { if (clazz == Boolean.TYPE) {
return Boolean.FALSE; return Boolean.FALSE;
} else if (clazz == Byte.TYPE) { } else if (clazz == Byte.TYPE) {
...@@ -1041,7 +1041,7 @@ public class DataType { ...@@ -1041,7 +1041,7 @@ public class DataType {
* @param paramClass the target class * @param paramClass the target class
* @return the converted object * @return the converted object
*/ */
public static Object convertTo(SessionInterface session, JdbcConnection conn, Value v, Class< ? > paramClass) { public static Object convertTo(SessionInterface session, JdbcConnection conn, Value v, Class<?> paramClass) {
if (paramClass == Blob.class) { if (paramClass == Blob.class) {
return new JdbcBlob(conn, v, 0); return new JdbcBlob(conn, v, 0);
} else if (paramClass == Clob.class) { } else if (paramClass == Clob.class) {
......
...@@ -663,7 +663,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -663,7 +663,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
private void runTest(String className) { private void runTest(String className) {
try { try {
Class< ? > clazz = Class.forName(className); Class<?> clazz = Class.forName(className);
TestBase test = (TestBase) clazz.newInstance(); TestBase test = (TestBase) clazz.newInstance();
test.runTest(this); test.runTest(this);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -101,7 +101,7 @@ class Database { ...@@ -101,7 +101,7 @@ class Database {
Thread.sleep(100); Thread.sleep(100);
} else if (url.startsWith("jdbc:hsqldb:hsql:")) { } else if (url.startsWith("jdbc:hsqldb:hsql:")) {
if (!serverHSQLDB) { if (!serverHSQLDB) {
Class< ? > c; Class<?> c;
try { try {
c = Class.forName("org.hsqldb.server.Server"); c = Class.forName("org.hsqldb.server.Server");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -54,14 +54,14 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -54,14 +54,14 @@ public class TestCrashAPI extends TestBase implements Runnable {
private static final boolean RECOVER_ALL = false; private static final boolean RECOVER_ALL = false;
private static final Class< ? >[] INTERFACES = { Connection.class, PreparedStatement.class, Statement.class, private static final Class<?>[] INTERFACES = { Connection.class, PreparedStatement.class, Statement.class,
ResultSet.class, ResultSetMetaData.class, Savepoint.class, ResultSet.class, ResultSetMetaData.class, Savepoint.class,
ParameterMetaData.class, Clob.class, Blob.class, Array.class, CallableStatement.class }; ParameterMetaData.class, Clob.class, Blob.class, Array.class, CallableStatement.class };
private static final String DIR = "synth"; private static final String DIR = "synth";
private ArrayList<Object> objects = New.arrayList(); private ArrayList<Object> objects = New.arrayList();
private HashMap<Class < ? >, ArrayList<Method>> classMethods = New.hashMap(); private HashMap<Class <?>, ArrayList<Method>> classMethods = New.hashMap();
private RandomGen random = new RandomGen(); private RandomGen random = new RandomGen();
private ArrayList<String> statements = New.arrayList(); private ArrayList<String> statements = New.arrayList();
private int openCount; private int openCount;
...@@ -320,7 +320,7 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -320,7 +320,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
objects.remove(objectId); objects.remove(objectId);
continue; continue;
} }
Class< ? > in = getJdbcInterface(o); Class<?> in = getJdbcInterface(o);
ArrayList<Method> methods = classMethods.get(in); ArrayList<Method> methods = classMethods.get(in);
Method m = methods.get(random.getInt(methods.size())); Method m = methods.get(random.getInt(methods.size()));
Object o2 = callRandom(seed, i, objectId, o, m); Object o2 = callRandom(seed, i, objectId, o, m);
...@@ -356,7 +356,7 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -356,7 +356,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
} }
private Object callRandom(int seed, int id, int objectId, Object o, Method m) { private Object callRandom(int seed, int id, int objectId, Object o, Method m) {
Class< ? >[] paramClasses = m.getParameterTypes(); Class<?>[] paramClasses = m.getParameterTypes();
Object[] params = new Object[paramClasses.length]; Object[] params = new Object[paramClasses.length];
for (int i = 0; i < params.length; i++) { for (int i = 0; i < params.length; i++) {
params[i] = getRandomParam(paramClasses[i]); params[i] = getRandomParam(paramClasses[i]);
...@@ -376,7 +376,7 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -376,7 +376,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
if (result == null) { if (result == null) {
return null; return null;
} }
Class< ? > in = getJdbcInterface(result); Class<?> in = getJdbcInterface(result);
if (in == null) { if (in == null) {
return null; return null;
} }
...@@ -408,7 +408,7 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -408,7 +408,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
} }
} }
private Object getRandomParam(Class< ? > type) { private Object getRandomParam(Class<?> type) {
if (type == int.class) { if (type == int.class) {
return new Integer(random.getRandomInt()); return new Integer(random.getRandomInt());
} else if (type == byte.class) { } else if (type == byte.class) {
...@@ -478,8 +478,8 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -478,8 +478,8 @@ public class TestCrashAPI extends TestBase implements Runnable {
return null; return null;
} }
private Class< ? > getJdbcInterface(Object o) { private Class<?> getJdbcInterface(Object o) {
for (Class < ? > in : o.getClass().getInterfaces()) { for (Class <?> in : o.getClass().getInterfaces()) {
if (classMethods.get(in) != null) { if (classMethods.get(in) != null) {
return in; return in;
} }
...@@ -488,10 +488,10 @@ public class TestCrashAPI extends TestBase implements Runnable { ...@@ -488,10 +488,10 @@ public class TestCrashAPI extends TestBase implements Runnable {
} }
private void initMethods() { private void initMethods() {
for (Class< ? > inter : INTERFACES) { for (Class<?> inter : INTERFACES) {
classMethods.put(inter, new ArrayList<Method>()); classMethods.put(inter, new ArrayList<Method>());
} }
for (Class< ? > inter : INTERFACES) { for (Class<?> inter : INTERFACES) {
ArrayList<Method> list = classMethods.get(inter); ArrayList<Method> list = classMethods.get(inter);
for (Method m : inter.getMethods()) { for (Method m : inter.getMethods()) {
list.add(m); list.add(m);
......
...@@ -29,11 +29,11 @@ import org.h2.util.StringUtils; ...@@ -29,11 +29,11 @@ import org.h2.util.StringUtils;
* An argument of a statement. * An argument of a statement.
*/ */
class Arg { class Arg {
private Class< ? > clazz; private Class<?> clazz;
private Object obj; private Object obj;
private Statement stat; private Statement stat;
Arg(Class< ? > clazz, Object obj) { Arg(Class<?> clazz, Object obj) {
this.clazz = clazz; this.clazz = clazz;
this.obj = obj; this.obj = obj;
} }
...@@ -60,7 +60,7 @@ class Arg { ...@@ -60,7 +60,7 @@ class Arg {
} }
} }
Class< ? > getValueClass() { Class<?> getValueClass() {
return clazz; return clazz;
} }
...@@ -68,7 +68,7 @@ class Arg { ...@@ -68,7 +68,7 @@ class Arg {
return obj; return obj;
} }
private String quote(Class< ? > valueClass, Object value) { private String quote(Class<?> valueClass, Object value) {
if (value == null) { if (value == null) {
return null; return null;
} else if (valueClass == String.class) { } else if (valueClass == String.class) {
......
...@@ -145,7 +145,7 @@ public class Player { ...@@ -145,7 +145,7 @@ public class Player {
* @param className the class name * @param className the class name
* @return the class * @return the class
*/ */
static Class< ? > getClass(String className) { static Class<?> getClass(String className) {
for (String s : IMPORTED_PACKAGES) { for (String s : IMPORTED_PACKAGES) {
try { try {
return Class.forName(s + className); return Class.forName(s + className);
......
...@@ -39,7 +39,7 @@ class Statement { ...@@ -39,7 +39,7 @@ class Statement {
private Object object; private Object object;
private String methodName; private String methodName;
private Arg[] args; private Arg[] args;
private Class< ? > returnClass; private Class<?> returnClass;
Statement(Player player) { Statement(Player player) {
this.player = player; this.player = player;
...@@ -59,13 +59,13 @@ class Statement { ...@@ -59,13 +59,13 @@ class Statement {
} }
return null; return null;
} }
Class< ? > clazz; Class<?> clazz;
if (staticCall) { if (staticCall) {
clazz = Player.getClass(staticCallClass); clazz = Player.getClass(staticCallClass);
} else { } else {
clazz = object.getClass(); clazz = object.getClass();
} }
Class< ? >[] parameterTypes = new Class[args.length]; Class<?>[] parameterTypes = new Class[args.length];
Object[] parameters = new Object[args.length]; Object[] parameters = new Object[args.length];
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
Arg arg = args[i]; Arg arg = args[i];
...@@ -121,7 +121,7 @@ class Statement { ...@@ -121,7 +121,7 @@ class Statement {
return buff.toString(); return buff.toString();
} }
Class< ? > getReturnClass() { Class<?> getReturnClass() {
return returnClass; return returnClass;
} }
......
...@@ -52,9 +52,9 @@ public class TestClearReferences extends TestBase { ...@@ -52,9 +52,9 @@ public class TestClearReferences extends TestBase {
// initialize the known classes // initialize the known classes
MathUtils.secureRandomLong(); MathUtils.secureRandomLong();
ArrayList<Class < ? >> classes = New.arrayList(); ArrayList<Class <?>> classes = New.arrayList();
check(classes, new File("bin/org/h2")); check(classes, new File("bin/org/h2"));
for (Class< ? > clazz : classes) { for (Class<?> clazz : classes) {
clearClass(clazz); clearClass(clazz);
} }
if (hasError) { if (hasError) {
...@@ -62,7 +62,7 @@ public class TestClearReferences extends TestBase { ...@@ -62,7 +62,7 @@ public class TestClearReferences extends TestBase {
} }
} }
private void check(ArrayList<Class < ? >> classes, File file) { private void check(ArrayList<Class <?>> classes, File file) {
String name = file.getName(); String name = file.getName();
if (file.isDirectory()) { if (file.isDirectory()) {
if (name.equals("CVS") || name.equals(".svn")) { if (name.equals("CVS") || name.equals(".svn")) {
...@@ -83,7 +83,7 @@ public class TestClearReferences extends TestBase { ...@@ -83,7 +83,7 @@ public class TestClearReferences extends TestBase {
} }
className = className.replace('/', '.'); className = className.replace('/', '.');
className = className.substring(0, className.length() - ".class".length()); className = className.substring(0, className.length() - ".class".length());
Class< ? > clazz = null; Class<?> clazz = null;
try { try {
clazz = Class.forName(className); clazz = Class.forName(className);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
...@@ -100,7 +100,7 @@ public class TestClearReferences extends TestBase { ...@@ -100,7 +100,7 @@ public class TestClearReferences extends TestBase {
* *
* @param clazz the class to clear * @param clazz the class to clear
*/ */
private void clearClass(Class< ? > clazz) throws Exception { private void clearClass(Class<?> clazz) throws Exception {
for (Field field : clazz.getDeclaredFields()) { for (Field field : clazz.getDeclaredFields()) {
if (field.getType().isPrimitive() || field.getName().indexOf("$") != -1) { if (field.getType().isPrimitive() || field.getName().indexOf("$") != -1) {
continue; continue;
......
...@@ -35,7 +35,7 @@ public class TestOldVersion extends TestBase { ...@@ -35,7 +35,7 @@ public class TestOldVersion extends TestBase {
URL[] urls = { new URL("file:ext/h2-1.2.127.jar") }; URL[] urls = { new URL("file:ext/h2-1.2.127.jar") };
ClassLoader cl = new URLClassLoader(urls, null); ClassLoader cl = new URLClassLoader(urls, null);
// cl = getClass().getClassLoader(); // cl = getClass().getClassLoader();
Class< ? > driverClass; Class<?> driverClass;
try { try {
driverClass = cl.loadClass("org.h2.Driver"); driverClass = cl.loadClass("org.h2.Driver");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
...@@ -55,7 +55,7 @@ public class TestOldVersion extends TestBase { ...@@ -55,7 +55,7 @@ public class TestOldVersion extends TestBase {
} }
server.stop(); server.stop();
Class< ? > serverClass = cl.loadClass("org.h2.tools.Server"); Class<?> serverClass = cl.loadClass("org.h2.tools.Server");
m = serverClass.getMethod("createTcpServer", String[].class); m = serverClass.getMethod("createTcpServer", String[].class);
Object serverOld = m.invoke(null, new Object[]{new String[]{"-tcpPort", "9001"}}); Object serverOld = m.invoke(null, new Object[]{new String[]{"-tcpPort", "9001"}});
m = serverOld.getClass().getMethod("start"); m = serverOld.getClass().getMethod("start");
......
...@@ -73,7 +73,7 @@ public class TestSampleApps extends TestBase { ...@@ -73,7 +73,7 @@ public class TestSampleApps extends TestBase {
IOUtils.delete(getBaseDir() + "/optimizations.sql"); IOUtils.delete(getBaseDir() + "/optimizations.sql");
} }
private void testApp(String expected, Class< ? > clazz, String... args) throws Exception { private void testApp(String expected, Class<?> clazz, String... args) throws Exception {
DeleteDbFiles.execute("data", "test", true); DeleteDbFiles.execute("data", "test", true);
Method m = clazz.getMethod("main", String[].class); Method m = clazz.getMethod("main", String[].class);
PrintStream oldOut = System.out, oldErr = System.err; PrintStream oldOut = System.out, oldErr = System.err;
......
...@@ -162,7 +162,7 @@ public class TestTools extends TestBase { ...@@ -162,7 +162,7 @@ public class TestTools extends TestBase {
int len = m.getParameterTypes().length; int len = m.getParameterTypes().length;
Object[] params = new Object[len]; Object[] params = new Object[len];
int i = 0; int i = 0;
for (Class< ? > type : m.getParameterTypes()) { for (Class<?> type : m.getParameterTypes()) {
Object o = null; Object o = null;
if (type == int.class) { if (type == int.class) {
o = 1; o = 1;
......
...@@ -369,7 +369,7 @@ public class BuildBase { ...@@ -369,7 +369,7 @@ public class BuildBase {
*/ */
protected String getStaticField(String className, String fieldName) { protected String getStaticField(String className, String fieldName) {
try { try {
Class< ? > clazz = Class.forName(className); Class<?> clazz = Class.forName(className);
Field field = clazz.getField(fieldName); Field field = clazz.getField(fieldName);
return field.get(null).toString(); return field.get(null).toString();
} catch (Exception e) { } catch (Exception e) {
...@@ -386,7 +386,7 @@ public class BuildBase { ...@@ -386,7 +386,7 @@ public class BuildBase {
*/ */
protected String getStaticValue(String className, String methodName) { protected String getStaticValue(String className, String methodName) {
try { try {
Class< ? > clazz = Class.forName(className); Class<?> clazz = Class.forName(className);
Method method = clazz.getMethod(methodName); Method method = clazz.getMethod(methodName);
return method.invoke(null).toString(); return method.invoke(null).toString();
} catch (Exception e) { } catch (Exception e) {
...@@ -472,7 +472,7 @@ public class BuildBase { ...@@ -472,7 +472,7 @@ public class BuildBase {
"Building " "Building "
})); }));
} }
Class< ? > clazz = Class.forName("com.sun.tools.javadoc.Main"); Class<?> clazz = Class.forName("com.sun.tools.javadoc.Main");
Method execute = clazz.getMethod("execute", String[].class); Method execute = clazz.getMethod("execute", String[].class);
result = (Integer) invoke(execute, null, new Object[] { args }); result = (Integer) invoke(execute, null, new Object[] { args });
} catch (Exception e) { } catch (Exception e) {
...@@ -769,13 +769,13 @@ public class BuildBase { ...@@ -769,13 +769,13 @@ public class BuildBase {
int result; int result;
PrintStream old = System.err; PrintStream old = System.err;
try { try {
Class< ? > clazz = Class.forName("com.sun.tools.javac.Main"); Class<?> clazz = Class.forName("com.sun.tools.javac.Main");
if (quiet) { if (quiet) {
System.setErr(filter(System.err, new String[] { System.setErr(filter(System.err, new String[] {
"Note:" "Note:"
})); }));
} }
Method compile = clazz.getMethod("compile", new Class< ? >[] { String[].class }); Method compile = clazz.getMethod("compile", new Class<?>[] { String[].class });
Object instance = clazz.newInstance(); Object instance = clazz.newInstance();
result = (Integer) invoke(compile, instance, new Object[] { array }); result = (Integer) invoke(compile, instance, new Object[] { array });
} catch (Exception e) { } catch (Exception e) {
......
...@@ -32,7 +32,7 @@ public class Db { ...@@ -32,7 +32,7 @@ public class Db {
Utils.newWeakIdentityHashMap(); Utils.newWeakIdentityHashMap();
private final Connection conn; private final Connection conn;
private final Map<Class< ? >, TableDefinition< ? >> classMap = private final Map<Class<?>, TableDefinition<?>> classMap =
Utils.newHashMap(); Utils.newHashMap();
Db(Connection conn) { Db(Connection conn) {
...@@ -97,22 +97,22 @@ public class Db { ...@@ -97,22 +97,22 @@ public class Db {
} }
public <T> void insert(T t) { public <T> void insert(T t) {
Class< ? > clazz = t.getClass(); Class<?> clazz = t.getClass();
define(clazz).createTableIfRequired(this).insert(this, t); define(clazz).createTableIfRequired(this).insert(this, t);
} }
public <T> void merge(T t) { public <T> void merge(T t) {
Class< ? > clazz = t.getClass(); Class<?> clazz = t.getClass();
define(clazz).createTableIfRequired(this).merge(this, t); define(clazz).createTableIfRequired(this).merge(this, t);
} }
public <T> void update(T t) { public <T> void update(T t) {
Class< ? > clazz = t.getClass(); Class<?> clazz = t.getClass();
define(clazz).createTableIfRequired(this).update(this, t); define(clazz).createTableIfRequired(this).update(this, t);
} }
public <T extends Object> Query<T> from(T alias) { public <T extends Object> Query<T> from(T alias) {
Class< ? > clazz = alias.getClass(); Class<?> clazz = alias.getClass();
define(clazz).createTableIfRequired(this); define(clazz).createTableIfRequired(this);
return Query.from(this, alias); return Query.from(this, alias);
} }
......
...@@ -13,7 +13,7 @@ package org.h2.jaqu; ...@@ -13,7 +13,7 @@ package org.h2.jaqu;
//## Java 1.5 begin ## //## Java 1.5 begin ##
public class Define { public class Define {
private static TableDefinition< ? > currentTableDefinition; private static TableDefinition<?> currentTableDefinition;
private static Table currentTable; private static Table currentTable;
public static void primaryKey(Object... columns) { public static void primaryKey(Object... columns) {
......
...@@ -31,7 +31,7 @@ public class Query<T> { ...@@ -31,7 +31,7 @@ public class Query<T> {
private Db db; private Db db;
private SelectTable<T> from; private SelectTable<T> from;
private ArrayList<Token> conditions = Utils.newArrayList(); private ArrayList<Token> conditions = Utils.newArrayList();
private ArrayList<SelectTable< ? >> joins = Utils.newArrayList(); private ArrayList<SelectTable<?>> joins = Utils.newArrayList();
private final IdentityHashMap<Object, SelectColumn<T>> aliasMap = Utils.newIdentityHashMap(); private final IdentityHashMap<Object, SelectColumn<T>> aliasMap = Utils.newIdentityHashMap();
private ArrayList<OrderExpression<T>> orderByList = Utils.newArrayList(); private ArrayList<OrderExpression<T>> orderByList = Utils.newArrayList();
private Object[] groupByExpressions; private Object[] groupByExpressions;
...@@ -125,7 +125,7 @@ public class Query<T> { ...@@ -125,7 +125,7 @@ public class Query<T> {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private <X, Z> List<X> select(Z x, boolean distinct) { private <X, Z> List<X> select(Z x, boolean distinct) {
Class< ? > clazz = x.getClass(); Class<?> clazz = x.getClass();
if (Utils.isSimpleType(clazz)) { if (Utils.isSimpleType(clazz)) {
return getSimple((X) x, distinct); return getSimple((X) x, distinct);
} }
......
...@@ -12,10 +12,10 @@ package org.h2.jaqu; ...@@ -12,10 +12,10 @@ package org.h2.jaqu;
//## Java 1.5 begin ## //## Java 1.5 begin ##
public class QueryJoin { public class QueryJoin {
private Query< ? > query; private Query<?> query;
private SelectTable< ? > join; private SelectTable<?> join;
QueryJoin(Query< ? > query, SelectTable< ? > join) { QueryJoin(Query<?> query, SelectTable<?> join) {
this.query = query; this.query = query;
this.join = join; this.join = join;
} }
......
...@@ -14,17 +14,17 @@ package org.h2.jaqu; ...@@ -14,17 +14,17 @@ package org.h2.jaqu;
//## Java 1.5 begin ## //## Java 1.5 begin ##
public class QueryJoinCondition<A> { public class QueryJoinCondition<A> {
private Query< ? > query; private Query<?> query;
private SelectTable< ? > join; private SelectTable<?> join;
private A x; private A x;
QueryJoinCondition(Query< ? > query, SelectTable< ? > join, A x) { QueryJoinCondition(Query<?> query, SelectTable<?> join, A x) {
this.query = query; this.query = query;
this.join = join; this.join = join;
this.x = x; this.x = x;
} }
public Query< ? > is(A y) { public Query<?> is(A y) {
join.addConditionToken(new Condition<A>(x, y, CompareType.EQUAL)); join.addConditionToken(new Condition<A>(x, y, CompareType.EQUAL));
return query; return query;
} }
......
...@@ -153,7 +153,7 @@ class TableDefinition<T> { ...@@ -153,7 +153,7 @@ class TableDefinition<T> {
} }
private String getDataType(Field field) { private String getDataType(Field field) {
Class< ? > fieldClass = field.getType(); Class<?> fieldClass = field.getType();
if (fieldClass == Integer.class) { if (fieldClass == Integer.class) {
return "INT"; return "INT";
} else if (fieldClass == String.class) { } else if (fieldClass == String.class) {
......
...@@ -47,7 +47,7 @@ public class ClassReader { ...@@ -47,7 +47,7 @@ public class ClassReader {
public Token decompile(Object instance, Map<String, Object> fields, String method) { public Token decompile(Object instance, Map<String, Object> fields, String method) {
this.fieldMap = fields; this.fieldMap = fields;
this.convertMethodName = method; this.convertMethodName = method;
Class< ? > clazz = instance.getClass(); Class<?> clazz = instance.getClass();
String className = clazz.getName(); String className = clazz.getName();
debug("class name " + className); debug("class name " + className);
ByteArrayOutputStream buff = new ByteArrayOutputStream(); ByteArrayOutputStream buff = new ByteArrayOutputStream();
......
...@@ -24,7 +24,7 @@ public class ClassUtils { ...@@ -24,7 +24,7 @@ public class ClassUtils {
return (Class<X>) x.getClass(); return (Class<X>) x.getClass();
} }
public static Class< ? > loadClass(String className) { public static Class<?> loadClass(String className) {
try { try {
return Class.forName(className); return Class.forName(className);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -125,11 +125,11 @@ public class Utils { ...@@ -125,11 +125,11 @@ public class Utils {
return false; return false;
} }
public static Object convert(Object o, Class< ? > targetType) { public static Object convert(Object o, Class<?> targetType) {
if (o == null) { if (o == null) {
return null; return null;
} }
Class< ? > currentType = o.getClass(); Class<?> currentType = o.getClass();
if (targetType.isAssignableFrom(currentType)) { if (targetType.isAssignableFrom(currentType)) {
return o; return o;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论