From Dave: a bunch of @Override annotating and some other cleanup.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2356 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2008-08-06 12:59:06 +00:00
parent 3a283a16e1
commit ca764911c8
116 changed files with 529 additions and 437 deletions
@@ -70,133 +70,133 @@ public abstract class ExtensiblePrintStream extends PrintStream
*/
public abstract void handleNewLine ();
// documentation inherited
@Override
public void print (boolean b)
{
super.print(b);
handlePrinted(b ? "true" : "false");
}
// documentation inherited
@Override
public void print (char c)
{
super.print(c);
handlePrinted(String.valueOf(c));
}
// documentation inherited
@Override
public void print (int i)
{
super.print(i);
handlePrinted(String.valueOf(i));
}
// documentation inherited
@Override
public void print (long l)
{
super.print(l);
handlePrinted(String.valueOf(l));
}
// documentation inherited
@Override
public void print (float f)
{
super.print(f);
handlePrinted(String.valueOf(f));
}
// documentation inherited
@Override
public void print (double d)
{
super.print(d);
handlePrinted(String.valueOf(d));
}
// documentation inherited
@Override
public void print (char[] s)
{
super.print(s);
handlePrinted(String.valueOf(s));
}
// documentation inherited
@Override
public void print (String s)
{
super.print(s);
handlePrinted((s == null) ? "null" : s);
}
// documentation inherited
@Override
public void print (Object obj)
{
super.print(obj);
handlePrinted(String.valueOf(obj));
}
// documentation inherited
@Override
public void println ()
{
super.println();
handleNewLine();
}
// documentation inherited
@Override
public void println (boolean x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (char x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (int x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (long x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (float x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (double x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (char[] x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (String x)
{
super.println(x);
handleNewLine();
}
// documentation inherited
@Override
public void println (Object x)
{
super.println(x);
@@ -38,7 +38,7 @@ public abstract class WriteOnlyUnit extends Invoker.Unit
super(name);
}
// from abstract Invoker.Unit
@Override // from abstract Invoker.Unit
public boolean invoke ()
{
try {
@@ -42,7 +42,7 @@ public interface CacheInvalidator
public void invalidate (PersistenceContext ctx) {
ctx.cacheTraverse(_cacheId, new PersistenceContext.CacheEvictionFilter<T>() {
protected boolean testForEviction (Serializable key, T record) {
@Override protected boolean testForEviction (Serializable key, T record) {
return TraverseWithFilter.this.testForEviction(key, record);
}
});
@@ -565,7 +565,7 @@ public class DepotMarshaller<T extends PersistentRecord>
// check to see if our schema version table exists, create it if not
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
liaison.createTableIfMissing(
conn, SCHEMA_VERSION_TABLE,
new String[] { "persistentClass", "version" },
@@ -592,7 +592,7 @@ public class DepotMarshaller<T extends PersistentRecord>
}
final Iterable<Index> indexen = _indexes.values();
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
// create the table
String[] primaryKeyColumns = null;
if (_pkColumns != null) {
@@ -640,7 +640,7 @@ public class DepotMarshaller<T extends PersistentRecord>
// make sure the versions match
int currentVersion = ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
String query =
" select " + liaison.columnSQL("version") +
" from " + liaison.tableSQL(SCHEMA_VERSION_TABLE) +
@@ -693,7 +693,7 @@ public class DepotMarshaller<T extends PersistentRecord>
final ColumnDefinition coldef = fmarsh.getColumnDefinition();
log.info("Adding column to " + getTableName() + ": " + fmarsh.getColumnName());
ctx.invoke(new Modifier.Simple() {
protected String createQuery (DatabaseLiaison liaison) {
@Override protected String createQuery (DatabaseLiaison liaison) {
return "alter table " + liaison.tableSQL(getTableName()) +
" add column " + liaison.columnSQL(fmarsh.getColumnName()) + " " +
liaison.expandDefinition(coldef);
@@ -709,7 +709,7 @@ public class DepotMarshaller<T extends PersistentRecord>
coldef.getType().equalsIgnoreCase("datetime"))) {
log.info("Assigning current time to " + fmarsh.getColumnName() + ".");
ctx.invoke(new Modifier.Simple() {
protected String createQuery (DatabaseLiaison liaison) {
@Override protected String createQuery (DatabaseLiaison liaison) {
// TODO: is NOW() standard SQL?
return "update " + liaison.tableSQL(getTableName()) +
" set " + liaison.columnSQL(fmarsh.getColumnName()) + " = NOW()";
@@ -722,7 +722,7 @@ public class DepotMarshaller<T extends PersistentRecord>
if (hasPrimaryKey() && metaData.pkName == null) {
log.info("Adding primary key.");
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
liaison.addPrimaryKey(
conn, getTableName(), fieldsToColumns(getPrimaryKeyFields()));
return 0;
@@ -733,7 +733,7 @@ public class DepotMarshaller<T extends PersistentRecord>
final String pkName = metaData.pkName;
log.info("Dropping primary key: " + pkName);
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
liaison.dropPrimaryKey(conn, getTableName(), pkName);
return 0;
}
@@ -750,7 +750,7 @@ public class DepotMarshaller<T extends PersistentRecord>
}
// but this is a new, named index, so we create it
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
liaison.addIndexToTable(
conn, getTableName(), fieldsToColumns(index.fields()),
ixName, index.unique());
@@ -785,7 +785,7 @@ public class DepotMarshaller<T extends PersistentRecord>
final String[] colArr = colSet.toArray(new String[colSet.size()]);
final String fName = indexName;
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
liaison.addIndexToTable(conn, getTableName(), colArr, fName, true);
return 0;
}
@@ -806,7 +806,7 @@ public class DepotMarshaller<T extends PersistentRecord>
// but not this one, so let's create it
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
builder.addFullTextSearch(conn, DepotMarshaller.this, recordFts);
return 0;
}
@@ -832,7 +832,7 @@ public class DepotMarshaller<T extends PersistentRecord>
// last of all (re-)initialize our value generators, since one might've been added
if (_valueGenerators.size() > 0) {
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
for (ValueGenerator vg : _valueGenerators.values()) {
vg.init(conn, liaison);
}
@@ -843,7 +843,7 @@ public class DepotMarshaller<T extends PersistentRecord>
// record our new version in the database
ctx.invoke(new Modifier() {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
updateVersion(conn, liaison, _schemaVersion);
return 0;
}
@@ -916,7 +916,7 @@ public class DepotMarshaller<T extends PersistentRecord>
throws PersistenceException
{
return ctx.invoke(new Query.TrivialQuery<TableMetaData>() {
public TableMetaData invoke (Connection conn, DatabaseLiaison dl)
@Override public TableMetaData invoke (Connection conn, DatabaseLiaison dl)
throws SQLException {
return new TableMetaData(conn.getMetaData(), tableName);
}
@@ -187,7 +187,7 @@ public abstract class DepotRepository
// key will be null if record was supplied without a primary key
return _ctx.invoke(new CachingModifier<T>(record, key, key) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
// set any auto-generated column values
Set<String> identityFields =
marsh.generateFieldValues(conn, liaison, _result, false);
@@ -241,7 +241,7 @@ public abstract class DepotRepository
builder.newQuery(update);
return _ctx.invoke(new CachingModifier<T>(record, key, key) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = builder.prepare(conn);
try {
return stmt.executeUpdate();
@@ -282,7 +282,7 @@ public abstract class DepotRepository
builder.newQuery(update);
return _ctx.invoke(new CachingModifier<T>(record, key, key) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = builder.prepare(conn);
// clear out _result so that we don't rewrite this partial record to the cache
_result = null;
@@ -424,7 +424,7 @@ public abstract class DepotRepository
builder.newQuery(update);
return _ctx.invoke(new Modifier(invalidator) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = builder.prepare(conn);
try {
return stmt.executeUpdate();
@@ -556,7 +556,7 @@ public abstract class DepotRepository
builder.newQuery(update);
return _ctx.invoke(new Modifier(invalidator) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = builder.prepare(conn);
try {
return stmt.executeUpdate();
@@ -593,7 +593,7 @@ public abstract class DepotRepository
final boolean[] created = new boolean[1];
_ctx.invoke(new CachingModifier<T>(record, key, key) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = null;
try {
if (_key != null) {
@@ -701,7 +701,7 @@ public abstract class DepotRepository
builder.newQuery(delete);
return _ctx.invoke(new Modifier(invalidator) {
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
PreparedStatement stmt = builder.prepare(conn);
try {
return stmt.executeUpdate();
@@ -79,7 +79,7 @@ public class EHCacheAdapter
public T getValue () {
return value;
}
public String toString () {
@Override public String toString () {
return String.valueOf(value);
}
};
@@ -147,17 +147,17 @@ public class EHCacheAdapter
/** A class to represent an explicitly Serializable concept of null for EHCache. */
protected static class NullValue implements Serializable
{
public String toString ()
@Override public String toString ()
{
return "<EHCache Null>";
}
public boolean equals (Object other)
@Override public boolean equals (Object other)
{
return other != null && other.getClass().equals(NullValue.class);
}
public int hashCode ()
@Override public int hashCode ()
{
return 1;
}
@@ -47,7 +47,7 @@ public abstract class EntityMigration extends Modifier
_columnName = columnName;
}
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
if (!liaison.tableContainsColumn(conn, _tableName, _columnName)) {
// we'll accept this inconsistency
log.warning(_tableName + "." + _columnName + " already dropped.");
@@ -72,7 +72,7 @@ public abstract class EntityMigration extends Modifier
_newColumnName = newColumnName;
}
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
if (!liaison.tableContainsColumn(conn, _tableName, _oldColumnName)) {
if (liaison.tableContainsColumn(conn, _tableName, _newColumnName)) {
// we'll accept this inconsistency
@@ -97,11 +97,11 @@ public abstract class EntityMigration extends Modifier
conn, _tableName, _oldColumnName, _newColumnName, _newColumnDef) ? 1 : 0;
}
public boolean runBeforeDefault () {
@Override public boolean runBeforeDefault () {
return true;
}
protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
@Override protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
super.init(tableName, marshallers);
_newColumnDef = marshallers.get(_newColumnName).getColumnDefinition();
}
@@ -122,18 +122,18 @@ public abstract class EntityMigration extends Modifier
_fieldName = fieldName;
}
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
log.info("Updating type of '" + _fieldName + "' in " + _tableName);
return liaison.changeColumn(conn, _tableName, _fieldName, _newColumnDef.getType(),
_newColumnDef.isNullable(), _newColumnDef.isUnique(),
_newColumnDef.getDefaultValue()) ? 1 : 0;
}
public boolean runBeforeDefault () {
@Override public boolean runBeforeDefault () {
return false;
}
protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
@Override protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
super.init(tableName, marshallers);
_columnName = marshallers.get(_fieldName).getColumnName();
_newColumnDef = marshallers.get(_fieldName).getColumnDefinition();
@@ -227,190 +227,190 @@ public abstract class FieldMarshaller<T>
}
protected static class BooleanMarshaller extends FieldMarshaller<Boolean> {
public Boolean getFromObject (Object po)
@Override public Boolean getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getBoolean(po);
}
public Boolean getFromSet (ResultSet rs)
@Override public Boolean getFromSet (ResultSet rs)
throws SQLException {
return rs.getBoolean(getColumnName());
}
public void writeToObject (Object po, Boolean value)
@Override public void writeToObject (Object po, Boolean value)
throws IllegalArgumentException, IllegalAccessException {
_field.setBoolean(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Boolean value)
@Override public void writeToStatement (PreparedStatement ps, int column, Boolean value)
throws SQLException {
ps.setBoolean(column, value);
}
}
protected static class ByteMarshaller extends FieldMarshaller<Byte> {
public Byte getFromObject (Object po)
@Override public Byte getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getByte(po);
}
public Byte getFromSet (ResultSet rs)
@Override public Byte getFromSet (ResultSet rs)
throws SQLException {
return rs.getByte(getColumnName());
}
public void writeToObject (Object po, Byte value)
@Override public void writeToObject (Object po, Byte value)
throws IllegalArgumentException, IllegalAccessException {
_field.setByte(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Byte value)
@Override public void writeToStatement (PreparedStatement ps, int column, Byte value)
throws SQLException {
ps.setByte(column, value);
}
}
protected static class ShortMarshaller extends FieldMarshaller<Short> {
public Short getFromObject (Object po)
@Override public Short getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getShort(po);
}
public Short getFromSet (ResultSet rs)
@Override public Short getFromSet (ResultSet rs)
throws SQLException {
return rs.getShort(getColumnName());
}
public void writeToObject (Object po, Short value)
@Override public void writeToObject (Object po, Short value)
throws IllegalArgumentException, IllegalAccessException {
_field.setShort(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Short value)
@Override public void writeToStatement (PreparedStatement ps, int column, Short value)
throws SQLException {
ps.setShort(column, value);
}
}
protected static class IntMarshaller extends FieldMarshaller<Integer> {
public Integer getFromObject (Object po)
@Override public Integer getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getInt(po);
}
public Integer getFromSet (ResultSet rs)
@Override public Integer getFromSet (ResultSet rs)
throws SQLException {
return rs.getInt(getColumnName());
}
public void writeToObject (Object po, Integer value)
@Override public void writeToObject (Object po, Integer value)
throws IllegalArgumentException, IllegalAccessException {
_field.setInt(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Integer value)
@Override public void writeToStatement (PreparedStatement ps, int column, Integer value)
throws SQLException {
ps.setInt(column, value);
}
}
protected static class LongMarshaller extends FieldMarshaller<Long> {
public Long getFromObject (Object po)
@Override public Long getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getLong(po);
}
public Long getFromSet (ResultSet rs)
@Override public Long getFromSet (ResultSet rs)
throws SQLException {
return rs.getLong(getColumnName());
}
public void writeToObject (Object po, Long value)
@Override public void writeToObject (Object po, Long value)
throws IllegalArgumentException, IllegalAccessException {
_field.setLong(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Long value)
@Override public void writeToStatement (PreparedStatement ps, int column, Long value)
throws SQLException {
ps.setLong(column, value);
}
}
protected static class FloatMarshaller extends FieldMarshaller<Float> {
public Float getFromObject (Object po)
@Override public Float getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getFloat(po);
}
public Float getFromSet (ResultSet rs)
@Override public Float getFromSet (ResultSet rs)
throws SQLException {
return rs.getFloat(getColumnName());
}
public void writeToObject (Object po, Float value)
@Override public void writeToObject (Object po, Float value)
throws IllegalArgumentException, IllegalAccessException {
_field.setFloat(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Float value)
@Override public void writeToStatement (PreparedStatement ps, int column, Float value)
throws SQLException {
ps.setFloat(column, value);
}
}
protected static class DoubleMarshaller extends FieldMarshaller<Double> {
public Double getFromObject (Object po)
@Override public Double getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.getDouble(po);
}
public Double getFromSet (ResultSet rs)
@Override public Double getFromSet (ResultSet rs)
throws SQLException {
return rs.getDouble(getColumnName());
}
public void writeToObject (Object po, Double value)
@Override public void writeToObject (Object po, Double value)
throws IllegalArgumentException, IllegalAccessException {
_field.setDouble(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Double value)
@Override public void writeToStatement (PreparedStatement ps, int column, Double value)
throws SQLException {
ps.setDouble(column, value);
}
}
protected static class ObjectMarshaller extends FieldMarshaller<Object> {
public Object getFromObject (Object po)
@Override public Object getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return _field.get(po);
}
public Object getFromSet (ResultSet rs)
@Override public Object getFromSet (ResultSet rs)
throws SQLException {
return rs.getObject(getColumnName());
}
public void writeToObject (Object po, Object value)
@Override public void writeToObject (Object po, Object value)
throws IllegalArgumentException, IllegalAccessException {
_field.set(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, Object value)
@Override public void writeToStatement (PreparedStatement ps, int column, Object value)
throws SQLException {
ps.setObject(column, value);
}
}
protected static class ByteArrayMarshaller extends FieldMarshaller<byte[]> {
public byte[] getFromObject (Object po)
@Override public byte[] getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return (byte[]) _field.get(po);
}
public byte[] getFromSet (ResultSet rs)
@Override public byte[] getFromSet (ResultSet rs)
throws SQLException {
return rs.getBytes(getColumnName());
}
public void writeToObject (Object po, byte[] value)
@Override public void writeToObject (Object po, byte[] value)
throws IllegalArgumentException, IllegalAccessException {
_field.set(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, byte[] value)
@Override public void writeToStatement (PreparedStatement ps, int column, byte[] value)
throws SQLException {
ps.setBytes(column, value);
}
}
protected static class IntArrayMarshaller extends FieldMarshaller<int[]> {
public int[] getFromObject (Object po)
@Override public int[] getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return (int[]) _field.get(po);
}
public int[] getFromSet (ResultSet rs)
@Override public int[] getFromSet (ResultSet rs)
throws SQLException {
return (int[]) rs.getObject(getColumnName());
}
public void writeToObject (Object po, int[] value)
@Override public void writeToObject (Object po, int[] value)
throws IllegalArgumentException, IllegalAccessException {
_field.set(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, int[] value)
@Override public void writeToStatement (PreparedStatement ps, int column, int[] value)
throws SQLException {
ps.setObject(column, value);
}
@@ -431,11 +431,11 @@ public abstract class FieldMarshaller<T>
}
}
public ByteEnum getFromObject (Object po)
@Override public ByteEnum getFromObject (Object po)
throws IllegalArgumentException, IllegalAccessException {
return (ByteEnum) _field.get(po);
}
public ByteEnum getFromSet (ResultSet rs)
@Override public ByteEnum getFromSet (ResultSet rs)
throws SQLException {
try {
return (ByteEnum) _factmeth.invoke(null, rs.getByte(getColumnName()));
@@ -445,11 +445,11 @@ public abstract class FieldMarshaller<T>
throw new RuntimeException(e);
}
}
public void writeToObject (Object po, ByteEnum value)
@Override public void writeToObject (Object po, ByteEnum value)
throws IllegalArgumentException, IllegalAccessException {
_field.set(po, value);
}
public void writeToStatement (PreparedStatement ps, int column, ByteEnum value)
@Override public void writeToStatement (PreparedStatement ps, int column, ByteEnum value)
throws SQLException {
ps.setByte(column, value.toByte());
}
+2 -4
View File
@@ -75,8 +75,7 @@ public class Key<T extends PersistentRecord> extends WhereClause
return _values;
}
@Override
public boolean equals (Object obj)
@Override public boolean equals (Object obj)
{
if (this == obj) {
return true;
@@ -88,8 +87,7 @@ public class Key<T extends PersistentRecord> extends WhereClause
return _pClass == other._pClass && _values.equals(other.getValues());
}
@Override
public int hashCode ()
@Override public int hashCode ()
{
return _pClass.hashCode() ^ _values.hashCode();
}
@@ -41,7 +41,7 @@ public abstract class Modifier
super(null);
}
public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
@Override public int invoke (Connection conn, DatabaseLiaison liaison) throws SQLException {
Statement stmt = conn.createStatement();
try {
return stmt.executeUpdate(createQuery(liaison));
@@ -56,8 +56,7 @@ public class MySQLBuilder
{
public class MSBuildVisitor extends BuildVisitor
{
@Override
public void visit (FullTextMatch match)
@Override public void visit (FullTextMatch match)
throws Exception
{
_builder.append("match(");
@@ -73,8 +72,7 @@ public class MySQLBuilder
_builder.append(") against (? in boolean mode)");
}
@Override
public void visit (DeleteClause<? extends PersistentRecord> deleteClause)
@Override public void visit (DeleteClause<? extends PersistentRecord> deleteClause)
throws Exception
{
_builder.append("delete from ");
@@ -104,17 +102,17 @@ public class MySQLBuilder
super(types);
}
protected void appendTableName (Class<? extends PersistentRecord> type)
@Override protected void appendTableName (Class<? extends PersistentRecord> type)
{
_builder.append(_types.getTableName(type));
}
protected void appendTableAbbreviation (Class<? extends PersistentRecord> type)
@Override protected void appendTableAbbreviation (Class<? extends PersistentRecord> type)
{
_builder.append(_types.getTableAbbreviation(type));
}
protected void appendIdentifier (String field)
@Override protected void appendIdentifier (String field)
{
_builder.append(field);
}
@@ -127,8 +125,7 @@ public class MySQLBuilder
super(types, stmt);
}
@Override
public void visit (FullTextMatch match)
@Override public void visit (FullTextMatch match)
throws Exception
{
_stmt.setString(_argIdx ++, match.getQuery());
@@ -58,8 +58,7 @@ public class PostgreSQLBuilder
{
public class PGBuildVisitor extends BuildVisitor
{
@Override
public void visit (FullTextMatch match)
@Override public void visit (FullTextMatch match)
throws Exception
{
appendIdentifier("ftsCol_" + match.getName());
@@ -79,7 +78,7 @@ public class PostgreSQLBuilder
super(types);
}
protected void appendIdentifier (String field)
@Override protected void appendIdentifier (String field)
{
_builder.append("\"").append(field).append("\"");
}
@@ -87,8 +86,7 @@ public class PostgreSQLBuilder
public class PGBindVisitor extends BindVisitor
{
@Override
public void visit (FullTextMatch match)
@Override public void visit (FullTextMatch match)
throws Exception
{
// The tsearch2 engine takes queries on the form
@@ -42,8 +42,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "+";
}
@@ -62,8 +61,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "-";
}
@@ -82,8 +80,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "*";
}
@@ -102,8 +99,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return " / "; // Pad with spaces to work-around a MySQL bug.
}
@@ -122,8 +118,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "&";
}
@@ -142,8 +137,7 @@ public abstract class Arithmetic
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "|";
}
@@ -85,8 +85,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "=";
}
@@ -105,8 +104,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "!=";
}
@@ -125,8 +123,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "<";
}
@@ -145,8 +142,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return "<=";
}
@@ -165,8 +161,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return ">";
}
@@ -185,8 +180,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return ">=";
}
@@ -260,8 +254,7 @@ public abstract class Conditionals
super(column, value);
}
@Override
public String operator()
@Override public String operator()
{
return " like ";
}
@@ -47,8 +47,7 @@ public abstract class Logic
super(conditions);
}
@Override
public String operator()
@Override public String operator()
{
return "or";
}
@@ -69,8 +68,7 @@ public abstract class Logic
super(conditions);
}
@Override
public String operator()
@Override public String operator()
{
return "and";
}
@@ -54,6 +54,7 @@ public class TestRecord extends PersistentRecord
@Column(nullable=false)
public Timestamp lastModified;
@Override
public String toString ()
{
return StringUtil.fieldsToString(this);
@@ -78,9 +78,7 @@ public class GenRecordTask extends Task
_cloader = ClasspathUtils.getClassLoaderForPath(getProject(), pathref);
}
/**
* Performs the actual work of the task.
*/
@Override
public void execute () throws BuildException
{
if (_cloader == null) {
@@ -18,18 +18,17 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.jdbc.jora;
/** This error is raised when error is happened during data transfer
* between program and database server (for example IOException was thrown
* while operation with InputStream field)
*/
public class DataTransferError extends java.lang.Error {
DataTransferError() {
super("Database data transfer error");
}
DataTransferError(Exception ex) {
super(ex.getMessage());
}
}
package com.samskivert.jdbc.jora;
/** This error is raised when error is happened during data transfer
* between program and database server (for example IOException was thrown
* while operation with InputStream field)
*/
public class DataTransferError extends java.lang.Error {
DataTransferError() {
super("Database data transfer error");
}
DataTransferError(Exception ex) {
super(ex.getMessage());
}
}
@@ -135,6 +135,7 @@ public class FieldMask
* Creates a copy of this field mask, with all fields set to
* not-modified.
*/
@Override
public Object clone ()
{
try {
@@ -146,7 +147,7 @@ public class FieldMask
}
}
// documentation inherited
@Override
public String toString ()
{
// return a list of the modified fields
+1 -3
View File
@@ -416,9 +416,7 @@ public class Table<T>
return nDeleted;
}
/**
* Generates a string representation of this table.
*/
@Override
public String toString ()
{
return "[name=" + name +
@@ -52,7 +52,7 @@ public class HttpPostUtil
final ServiceWaiter<String> waiter = new ServiceWaiter<String>(
(timeout < 0) ? ServiceWaiter.NO_TIMEOUT : timeout);
Thread tt = new Thread() {
public void run () {
@Override public void run () {
try {
HttpURLConnection conn =
(HttpURLConnection) url.openConnection();
@@ -179,7 +179,8 @@ public class JDBCTableSiteIdentifier implements SiteIdentifier
long now = System.currentTimeMillis();
boolean reload = false;
synchronized (this) {
if (reload = (now - _lastReload > RELOAD_INTERVAL)) {
reload = (now - _lastReload > RELOAD_INTERVAL);
if (reload) {
_lastReload = now;
}
}
@@ -306,8 +307,7 @@ public class JDBCTableSiteIdentifier implements SiteIdentifier
return other._rdomain.compareTo(_rdomain);
}
/** Returns a string representation of this site mapping. */
public String toString ()
@Override public String toString ()
{
return "[" + domain + " => " + siteId + "]";
}
+1 -3
View File
@@ -49,9 +49,7 @@ public class Site
{
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return StringUtil.fieldsToString(this);
@@ -174,9 +174,7 @@ public class SiteResourceLoader
}
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
return "[jarPath=" + _jarPath + "]";
@@ -285,10 +283,7 @@ public class SiteResourceLoader
return _lastModified;
}
/**
* Returns a string representation of this instance.
*/
public String toString ()
@Override public String toString ()
{
return "[bundle=" + file + "]";
}
@@ -337,7 +332,7 @@ public class SiteResourceLoader
_bundle = bundle;
}
public InputStream getResourceAsStream (String path)
@Override public InputStream getResourceAsStream (String path)
{
try {
return _bundle.getResourceAsStream(path);
@@ -349,7 +344,7 @@ public class SiteResourceLoader
}
}
public String toString ()
@Override public String toString ()
{
return _bundle.toString();
}
@@ -45,6 +45,7 @@ public class SiteResourceLoaderTest extends TestCase
super(SiteResourceLoaderTest.class.getName());
}
@Override
public void runTest ()
{
// we need to fake a couple of things to get the test to work
@@ -179,7 +179,7 @@ public class User
_dirty = dirty;
}
/** Returns a string representation of this instance. */
@Override
public String toString ()
{
return StringUtil.fieldsToString(this);
@@ -141,7 +141,7 @@ public class UserManager
// register a cron job to prune the session table every hour
_pruner = new Interval(pruneQueue) {
public void expired () {
@Override public void expired () {
try {
_repository.pruneSessions();
} catch (PersistenceException pe) {
@@ -508,7 +508,7 @@ public class UserRepository extends JORARepository
return ids.toString();
}
// documentation inherited
@Override
protected void createTables ()
{
// create our table object
@@ -51,7 +51,7 @@ public class Username
return _username;
}
/** Returns a string representation of this instance. */
@Override
public String toString ()
{
return _username;
@@ -99,8 +99,7 @@ public class ExceptionMap
// method overloading
final ArrayList<String> classes = new ArrayList<String>();
Properties loader = new Properties() {
public Object put (Object key, Object value)
{
@Override public Object put (Object key, Object value) {
classes.add((String)key);
_values.add((String)value);
return key;
@@ -95,7 +95,7 @@ public class CollapsiblePanel extends JPanel
// When the content is shown, make sure it's scrolled visible
_content.addComponentListener(new ComponentAdapter() {
public void componentShown (ComponentEvent event)
@Override public void componentShown (ComponentEvent event)
{
// we can't do it just yet, the content doesn't know its size
EventQueue.invokeLater(new Runnable() {
@@ -107,7 +107,7 @@ public class ComboButtonBox extends JPanel
addButtons(0, _model.getSize());
}
// documentation inherited
@Override
public void setEnabled (boolean enabled)
{
super.setEnabled(enabled);
@@ -47,7 +47,7 @@ public class CommandButton extends JButton
return _argument;
}
// documentation inherited
@Override
protected void fireActionPerformed (ActionEvent event)
{
Object[] listeners = listenerList.getListenerList();
@@ -47,6 +47,7 @@ public class DimenInfo
public Dimension[] dimens;
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder();
@@ -48,7 +48,7 @@ public class GroupLayoutTest
frame.addWindowListener(new WindowAdapter ()
{
public void windowClosing (WindowEvent e)
@Override public void windowClosing (WindowEvent e)
{
System.exit(0);
}
@@ -55,6 +55,7 @@ public class HGroupLayout extends GroupLayout
{
}
@Override
protected Dimension getLayoutSize (Container parent, int type)
{
DimenInfo info = computeDimens(parent, type);
@@ -80,6 +81,7 @@ public class HGroupLayout extends GroupLayout
return dims;
}
@Override
public void layoutContainer (Container parent)
{
Rectangle b = parent.getBounds();
+4 -5
View File
@@ -90,7 +90,7 @@ public class IntField extends JTextField
// remove operation is modified to do the sneaky highlighting we do.
final IntDocument doc = (IntDocument) getDocument();
doc.setDocumentFilter(new DocumentFilter() {
public void remove (FilterBypass fb, int offset, int length)
@Override public void remove (FilterBypass fb, int offset, int length)
throws BadLocationException
{
String current = doc.getText(0, doc.getLength());
@@ -131,7 +131,7 @@ public class IntField extends JTextField
setSelectionStart(selStart - 1);
}
public void insertString (FilterBypass fb, int offset,
@Override public void insertString (FilterBypass fb, int offset,
String s, AttributeSet attr)
throws BadLocationException
{
@@ -141,7 +141,7 @@ public class IntField extends JTextField
transform(fb, current, potential);
}
public void replace (FilterBypass fb, int offset, int length,
@Override public void replace (FilterBypass fb, int offset, int length,
String text, AttributeSet attrs)
throws BadLocationException
{
@@ -327,8 +327,7 @@ public class IntField extends JTextField
*/
protected static class IntDocument extends PlainDocument
{
// documentation inherited
protected void fireRemoveUpdate (DocumentEvent e)
@Override protected void fireRemoveUpdate (DocumentEvent e)
{
// suppress: the DocumentFilter implements replace by doing
// a remove and then an insert. We do not want listeners to ever
@@ -36,7 +36,7 @@ public class IntegerTableCellRenderer extends DefaultTableCellRenderer
setHorizontalAlignment(RIGHT);
}
// documentation inherited
@Override
protected void setValue (Object value)
{
if ((value instanceof Integer) || (value instanceof Long)) {
@@ -52,7 +52,7 @@ public class LazyComponent extends JComponent
_creator = creator;
}
// documentation inherited
@Override
public void addNotify ()
{
super.addNotify();
@@ -60,7 +60,7 @@ public class LazyComponent extends JComponent
checkCreate();
}
// documentation inherited
@Override
public void setVisible (boolean vis)
{
super.setVisible(vis);
@@ -218,7 +218,7 @@ public class MultiLineLabel extends JComponent
repaint();
}
// documentation inherited
@Override
public void paintComponent (Graphics g)
{
super.paintComponent(g);
@@ -260,7 +260,7 @@ public class MultiLineLabel extends JComponent
}
}
// documentation inherited
@Override
public void doLayout ()
{
super.doLayout();
@@ -345,7 +345,7 @@ public class MultiLineLabel extends JComponent
}
}
// documentation inherited
@Override
public Dimension getPreferredSize ()
{
if (isPreferredSizeSet()) {
@@ -326,20 +326,17 @@ public class ObjectEditorTable extends JTable
return _data.size();
}
// documentation inherited
public String getColumnName (int col)
@Override public String getColumnName (int col)
{
return _interp.getName(_fields[col]);
}
// documentation inherited
public boolean isCellEditable (int row, int col)
@Override public boolean isCellEditable (int row, int col)
{
return _editable.get(col);
}
// documentation inherited
public Class<?> getColumnClass (int col)
@Override public Class<?> getColumnClass (int col)
{
return _interp.getClass(_fields[col]);
}
@@ -351,8 +348,7 @@ public class ObjectEditorTable extends JTable
return _interp.getValue(o, _fields[col]);
}
// documentation inherited
public void setValueAt (Object value, int row, int col)
@Override public void setValueAt (Object value, int row, int col)
{
Object o = getObjectAt(row);
Object oldValue = _interp.getValue(o, _fields[col]);
@@ -113,7 +113,7 @@ public class RadialLabelSausage extends LabelSausage
closedBounds.height = closedBounds.width = _size.height;
}
// documentation inherited
@Override
protected void drawLabel (Graphics2D gfx, int x, int y)
{
if (_active) {
@@ -121,7 +121,7 @@ public class RadialLabelSausage extends LabelSausage
}
}
// documentation inherited
@Override
protected void drawBorder (Graphics2D gfx, int x, int y)
{
// then around all that draw the borders
@@ -156,7 +156,7 @@ public class RadialLabelSausage extends LabelSausage
}
}
// documentation inherited
@Override
protected void drawExtras (Graphics2D gfx, int x, int y, Object cliData)
{
RadialMenu menu = (RadialMenu) cliData;
@@ -174,6 +174,7 @@ public class RadialLabelSausage extends LabelSausage
* Draw the base circle or sausage within which all the other
* decorations are added.
*/
@Override
protected void drawBase (Graphics2D gfx, int x, int y)
{
if (_active) {
@@ -93,6 +93,7 @@ public class RadialMenuItem extends RadialLabelSausage
* displayed. Calls through to the {@link RadialMenu.Predicate} if we
* have one.
*/
@Override
public boolean isEnabled (RadialMenu menu)
{
return (predicate == null || predicate.isEnabled(menu, this));
@@ -103,6 +104,7 @@ public class RadialMenuItem extends RadialLabelSausage
* declare ourselves to be equal to a string with the same value
* as our command.
*/
@Override
public boolean equals (Object other)
{
if (other instanceof RadialMenuItem) {
@@ -123,7 +125,7 @@ public class RadialMenuItem extends RadialLabelSausage
paint(gfx, x, y, menu);
}
// documentation inherited
@Override
protected void drawIcon (Graphics2D gfx, int x, int y, Object cliData)
{
super.drawIcon(gfx, x, y, cliData);
@@ -177,7 +177,7 @@ public class RuntimeAdjust
_config.setValue(_name, value);
}
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
editor.add(_valbox = new JCheckBox(), GroupLayout.FIXED);
_valbox.setSelected(getValue());
@@ -226,7 +226,7 @@ public class RuntimeAdjust
_config.setValue(_name, value);
}
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
super.populateEditor(editor);
_valbox.setText("" + getValue());
@@ -287,7 +287,7 @@ public class RuntimeAdjust
}
}
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
editor.add(_valbox = new JComboBox(_values), GroupLayout.FIXED);
_valbox.addActionListener(this);
@@ -341,7 +341,7 @@ public class RuntimeAdjust
_config.setValue(_name, value);
}
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
// set up the label
JPanel p = GroupLayout.makeVBox();
@@ -418,7 +418,7 @@ public class RuntimeAdjust
super(descrip, name, null);
}
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
JButton actbut = new JButton("Go");
editor.add(actbut, GroupLayout.FIXED);
@@ -447,8 +447,7 @@ public class RuntimeAdjust
super(descrip, name, config);
}
// documentation inherited
protected void populateEditor (JPanel editor)
@Override protected void populateEditor (JPanel editor)
{
editor.add(_valbox = new JTextField(), GroupLayout.FIXED);
_valbox.addFocusListener(this);
@@ -505,7 +504,7 @@ public class RuntimeAdjust
_adjusts.insertSorted(this); // keep 'em sorted
}
public boolean equals (Object other)
@Override public boolean equals (Object other)
{
return _name.equals(((Adjust)other)._name);
}
@@ -554,7 +553,7 @@ public class RuntimeAdjust
protected abstract void populateEditor (JPanel editor);
public String toString ()
@Override public String toString ()
{
return StringUtil.shortClassName(this) +
"[name=" + _name + ", desc=" + _descrip + "]";
@@ -30,6 +30,7 @@ import javax.swing.JLayeredPane;
*/
public class SafeLayeredPane extends JLayeredPane
{
@Override
public void remove (int index)
{
Component c = getComponent(index);
+7 -10
View File
@@ -62,7 +62,7 @@ public class ScrollBox extends JPanel
addMouseMotionListener(_mouser);
}
// documentation inherited
@Override
public void addNotify ()
{
super.addNotify();
@@ -73,7 +73,7 @@ public class ScrollBox extends JPanel
updateBox();
}
// documentation inherited
@Override
public void removeNotify ()
{
super.removeNotify();
@@ -82,7 +82,7 @@ public class ScrollBox extends JPanel
_vert.removeChangeListener(_changebob);
}
// documentation inherited
@Override
public void setBounds (int x, int y, int w, int h)
{
super.setBounds(x, y, w, h);
@@ -90,7 +90,7 @@ public class ScrollBox extends JPanel
updateBox();
}
// documentation inherited
@Override
public void paintComponent (Graphics g)
{
paintBackground(g);
@@ -169,8 +169,7 @@ public class ScrollBox extends JPanel
*/
protected MouseInputAdapter _mouser = new MouseInputAdapter ()
{
// documentation inherited
public void mousePressed (MouseEvent e)
@Override public void mousePressed (MouseEvent e)
{
if (isActiveButton(e)) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
@@ -186,8 +185,7 @@ public class ScrollBox extends JPanel
}
}
// documentation inherited
public void mouseDragged (MouseEvent e)
@Override public void mouseDragged (MouseEvent e)
{
if (_lastPoint != null) {
Point p = e.getPoint();
@@ -197,8 +195,7 @@ public class ScrollBox extends JPanel
}
}
// documentation inherited
public void mouseReleased (MouseEvent e)
@Override public void mouseReleased (MouseEvent e)
{
if (isActiveButton(e)) {
setCursor(null);
@@ -76,7 +76,7 @@ public class SimpleSlider extends JPanel
}
}
// documentation inherited
@Override
public void setFont (Font font)
{
super.setFont(font);
@@ -34,6 +34,7 @@ public class SmartPolygon extends Polygon
* Returns the internally cached bounds rectangle for this polygon.
* <em>Don't modify it!</em>
*/
@Override
@SuppressWarnings("deprecation")
public Rectangle getBoundingBox ()
{
@@ -75,313 +75,368 @@ public class TGraphics2D extends Graphics2D
return _primary;
}
@Override
public void draw3DRect (int x, int y, int w, int h, boolean r)
{
_copy.draw3DRect(x, y, w, h, r);
_primary.draw3DRect(x, y, w, h, r);
}
@Override
public void fill3DRect (int x, int y, int w, int h, boolean r)
{
_copy.fill3DRect(x, y, w, h, r);
_primary.fill3DRect(x, y, w, h, r);
}
@Override
public void draw (Shape s)
{
_copy.draw(s);
_primary.draw(s);
}
@Override
public boolean drawImage (Image i, AffineTransform a, ImageObserver o)
{
_copy.drawImage(i, a, null);
return _primary.drawImage(i, a, o);
}
@Override
public void drawImage (BufferedImage i, BufferedImageOp o, int x, int y)
{
_copy.drawImage(i, o, x, y);
_primary.drawImage(i, o, x, y);
}
@Override
public void drawRenderedImage (RenderedImage i, AffineTransform a)
{
_copy.drawRenderedImage(i, a);
_primary.drawRenderedImage(i, a);
}
@Override
public void drawRenderableImage (RenderableImage i, AffineTransform a)
{
_copy.drawRenderableImage(i, a);
_primary.drawRenderableImage(i, a);
}
@Override
public void drawString (String s, int x, int y)
{
_copy.drawString(s, x, y);
_primary.drawString(s, x, y);
}
@Override
public void drawString (String s, float x, float y)
{
_copy.drawString(s, x, y);
_primary.drawString(s, x, y);
}
@Override
public void drawString (AttributedCharacterIterator i, int x, int y)
{
_copy.drawString(i, x, y);
_primary.drawString(i, x, y);
}
@Override
public void drawString (AttributedCharacterIterator i, float x, float y)
{
_copy.drawString(i, x, y);
_primary.drawString(i, x, y);
}
@Override
public void drawGlyphVector (GlyphVector g, float x, float y)
{
_copy.drawGlyphVector(g, x, y);
_primary.drawGlyphVector(g, x, y);
}
@Override
public void fill (Shape s)
{
_copy.fill(s);
_primary.fill(s);
}
@Override
public boolean hit (Rectangle r, Shape s, boolean x)
{
_copy.hit(r, s, x);
return _primary.hit(r, s, x);
}
@Override
public GraphicsConfiguration getDeviceConfiguration ()
{
return _primary.getDeviceConfiguration();
}
@Override
public void setComposite (Composite c)
{
_copy.setComposite(c);
_primary.setComposite(c);
}
@Override
public void setPaint (Paint p)
{
_copy.setPaint(p);
_primary.setPaint(p);
}
@Override
public void setStroke (Stroke s)
{
_copy.setStroke(s);
_primary.setStroke(s);
}
@Override
public void setRenderingHint (RenderingHints.Key k, Object v)
{
_copy.setRenderingHint(k, v);
_primary.setRenderingHint(k, v);
}
@Override
public Object getRenderingHint (RenderingHints.Key k)
{
return _primary.getRenderingHint(k);
}
@Override
public void setRenderingHints (Map<?, ?> m)
{
_copy.setRenderingHints(m);
_primary.setRenderingHints(m);
}
@Override
public void addRenderingHints (Map<?, ?> m)
{
_copy.addRenderingHints(m);
_primary.addRenderingHints(m);
}
@Override
public RenderingHints getRenderingHints ()
{
return _primary.getRenderingHints();
}
@Override
public void translate (int x, int y)
{
_copy.translate(x, y);
_primary.translate(x, y);
}
@Override
public void translate (double x, double y)
{
_copy.translate(x, y);
_primary.translate(x, y);
}
@Override
public void rotate (double t)
{
_copy.rotate(t);
_primary.rotate(t);
}
@Override
public void rotate (double t, double u, double v)
{
_copy.rotate(t, u, v);
_primary.rotate(t, u, v);
}
@Override
public void scale (double x, double y)
{
_copy.scale(x, y);
_primary.scale(x, y);
}
@Override
public void shear (double x, double y)
{
_copy.shear(x, y);
_primary.shear(x, y);
}
@Override
public void transform (AffineTransform a)
{
_copy.transform(a);
_primary.transform(a);
}
@Override
public void setTransform (AffineTransform a)
{
_copy.setTransform(a);
_primary.setTransform(a);
}
@Override
public AffineTransform getTransform ()
{
return _primary.getTransform();
}
@Override
public Paint getPaint ()
{
return _primary.getPaint();
}
@Override
public Composite getComposite ()
{
return _primary.getComposite();
}
@Override
public void setBackground (Color c)
{
_copy.setBackground(c);
_primary.setBackground(c);
}
@Override
public Color getBackground ()
{
return _primary.getBackground();
}
@Override
public Stroke getStroke ()
{
return _primary.getStroke();
}
@Override
public void clip (Shape s)
{
_copy.clip(s);
_primary.clip(s);
}
@Override
public FontRenderContext getFontRenderContext ()
{
return _primary.getFontRenderContext();
}
@Override
public Graphics create ()
{
return _primary.create();
}
@Override
public Graphics create (int x, int y, int w, int h)
{
return _primary.create(x, y, w, h);
}
@Override
public Color getColor ()
{
return _primary.getColor();
}
@Override
public void setColor (Color c)
{
_copy.setColor(c);
_primary.setColor(c);
}
@Override
public void setPaintMode ()
{
_copy.setPaintMode();
_primary.setPaintMode();
}
@Override
public void setXORMode (Color c)
{
_copy.setXORMode(c);
_primary.setXORMode(c);
}
@Override
public Font getFont ()
{
return _primary.getFont();
}
@Override
public void setFont (Font f)
{
_copy.setFont(f);
_primary.setFont(f);
}
@Override
public FontMetrics getFontMetrics ()
{
return _primary.getFontMetrics();
}
@Override
public FontMetrics getFontMetrics (Font f)
{
return _primary.getFontMetrics(f);
}
@Override
public Rectangle getClipBounds ()
{
return _primary.getClipBounds();
}
@Override
public void clipRect (int x, int y, int w, int h)
{
_copy.clipRect(x, y, w, h);
_primary.clipRect(x, y, w, h);
}
@Override
public void setClip (int x, int y, int w, int h)
{
_copy.setClip(x, y, w, h);
_primary.setClip(x, y, w, h);
}
@Override
public Shape getClip ()
{
return _primary.getClip();
}
@Override
public void setClip (Shape s)
{
_copy.setClip(s);
_primary.setClip(s);
}
@Override
public void copyArea (int x, int y, int w, int h, int a, int b)
{
// was seeing errors here, Don't worry about failure on copy
@@ -392,114 +447,133 @@ public class TGraphics2D extends Graphics2D
_primary.copyArea(x, y, w, h, a, b);
}
@Override
public void drawLine (int x, int y, int a, int b)
{
_copy.drawLine(x, y, a, b);
_primary.drawLine(x, y, a, b);
}
@Override
public void fillRect (int x, int y, int w, int h)
{
_copy.fillRect(x, y, w, h);
_primary.fillRect(x, y, w, h);
}
@Override
public void drawRect (int x, int y, int w, int h)
{
_copy.drawRect(x, y, w, h);
_primary.drawRect(x, y, w, h);
}
@Override
public void clearRect (int x, int y, int w, int h)
{
_copy.clearRect(x, y, w, h);
_primary.clearRect(x, y, w, h);
}
@Override
public void drawRoundRect (int x, int y, int w, int h, int a, int b)
{
_copy.drawRoundRect(x, y, w, h, a, b);
_primary.drawRoundRect(x, y, w, h, a, b);
}
@Override
public void fillRoundRect (int x, int y, int w, int h, int a, int b)
{
_copy.fillRoundRect(x, y, w, h, a, b);
_primary.fillRoundRect(x, y, w, h, a, b);
}
@Override
public void drawOval (int x, int y, int w, int h)
{
_copy.drawOval(x, y, w, h);
_primary.drawOval(x, y, w, h);
}
@Override
public void fillOval (int x, int y, int w, int h)
{
_copy.fillOval(x, y, w, h);
_primary.fillOval(x, y, w, h);
}
@Override
public void drawArc (int x, int y, int w, int h, int a, int b)
{
_copy.drawArc(x, y, w, h, a, b);
_primary.drawArc(x, y, w, h, a, b);
}
@Override
public void fillArc (int x, int y, int w, int h, int a, int b)
{
_copy.fillArc(x, y, w, h, a, b);
_primary.fillArc(x, y, w, h, a, b);
}
@Override
public void drawPolyline (int[] x, int[] y, int n)
{
_copy.drawPolyline(x, y, n);
_primary.drawPolyline(x, y, n);
}
@Override
public void drawPolygon (int[] x, int[] y, int n)
{
_copy.drawPolygon(x, y, n);
_primary.drawPolygon(x, y, n);
}
@Override
public void drawPolygon (Polygon p)
{
_copy.drawPolygon(p);
_primary.drawPolygon(p);
}
@Override
public void fillPolygon (int[] x, int[] y, int n)
{
_copy.fillPolygon(x, y, n);
_primary.fillPolygon(x, y, n);
}
@Override
public void fillPolygon (Polygon p)
{
_copy.fillPolygon(p);
_primary.fillPolygon(p);
}
@Override
public void drawChars (char[] c, int x, int y, int w, int h)
{
_copy.drawChars(c, x, y, w, h);
_primary.drawChars(c, x, y, w, h);
}
@Override
public void drawBytes (byte[] b, int x, int y, int w, int h)
{
_copy.drawBytes(b, x, y, w, h);
_primary.drawBytes(b, x, y, w, h);
}
@Override
public boolean drawImage (Image i, int x, int y, ImageObserver o)
{
_copy.drawImage(i, x, y, null);
return _primary.drawImage(i, x, y, o);
}
@Override
public boolean drawImage (
Image i, int x, int y, int w, int h, ImageObserver o)
{
@@ -507,12 +581,14 @@ public class TGraphics2D extends Graphics2D
return _primary.drawImage(i, x, y, w, h, o);
}
@Override
public boolean drawImage (Image i, int x, int y, Color c, ImageObserver o)
{
_copy.drawImage(i, x, y, c, null);
return _primary.drawImage(i, x, y, c, o);
}
@Override
public boolean drawImage (
Image i, int x, int y, int w, int h, Color c, ImageObserver o)
{
@@ -520,6 +596,7 @@ public class TGraphics2D extends Graphics2D
return _primary.drawImage(i, x, y, w, h, c, o);
}
@Override
public boolean drawImage (
Image i, int x, int y, int w, int h,
int a, int b, int c, int d, ImageObserver o)
@@ -528,6 +605,7 @@ public class TGraphics2D extends Graphics2D
return _primary.drawImage(i, x, y, w, h, a, b, c, d, o);
}
@Override
public boolean drawImage (
Image i, int x, int y, int w, int h,
int a, int b, int c, int d, Color k, ImageObserver o)
@@ -536,23 +614,27 @@ public class TGraphics2D extends Graphics2D
return _primary.drawImage(i, x, y, w, h, a, b, c, d, k, o);
}
@Override
public void dispose ()
{
_copy.dispose();
_primary.dispose();
}
@Override
public void finalize ()
{
_copy.finalize();
_primary.finalize();
}
@Override
public String toString ()
{
return _primary.toString();
}
@Override
@Deprecated
public Rectangle getClipRect ()
{
@@ -561,11 +643,13 @@ public class TGraphics2D extends Graphics2D
return _primary.getClipBounds();
}
@Override
public boolean hitClip (int x, int y, int w, int h)
{
return _primary.hitClip(x, y, w, h);
}
@Override
public Rectangle getClipBounds (Rectangle r)
{
return _primary.getClipBounds(r);
+14 -8
View File
@@ -20,6 +20,10 @@
package com.samskivert.swing;
import javax.swing.table.*;
import javax.swing.event.TableModelListener;
import javax.swing.event.TableModelEvent;
/**
* In a chain of data manipulators some behaviour is common. TableMap
* provides most of this behavour and can be subclassed by filters
@@ -30,14 +34,11 @@ package com.samskivert.swing;
* should have no effect.
*
* @version 1.4 12/17/97
* @author Philip Milne */
import javax.swing.table.*;
import javax.swing.event.TableModelListener;
import javax.swing.event.TableModelEvent;
* @author Philip Milne
*/
public class TableMap extends AbstractTableModel
implements TableModelListener {
implements TableModelListener
{
protected TableModel model;
public TableModel getModel() {
@@ -56,6 +57,7 @@ public class TableMap extends AbstractTableModel
return model.getValueAt(aRow, aColumn);
}
@Override
public void setValueAt(Object aValue, int aRow, int aColumn) {
model.setValueAt(aValue, aRow, aColumn);
}
@@ -68,17 +70,21 @@ public class TableMap extends AbstractTableModel
return (model == null) ? 0 : model.getColumnCount();
}
@Override
public String getColumnName(int aColumn) {
return model.getColumnName(aColumn);
}
@Override
public Class<?> getColumnClass(int aColumn) {
return model.getColumnClass(aColumn);
}
@Override
public boolean isCellEditable(int row, int column) {
return model.isCellEditable(row, column);
return model.isCellEditable(row, column);
}
//
// Implementation of the TableModelListener interface,
//
@@ -281,14 +281,17 @@ public class TableSorter extends AbstractTableModel {
return (tableModel == null) ? 0 : tableModel.getColumnCount();
}
@Override
public String getColumnName(int column) {
return tableModel.getColumnName(column);
}
@Override
public Class<?> getColumnClass(int column) {
return tableModel.getColumnClass(column);
}
@Override
public boolean isCellEditable(int row, int column) {
return tableModel.isCellEditable(modelIndex(row), column);
}
@@ -297,6 +300,7 @@ public class TableSorter extends AbstractTableModel {
return tableModel.getValueAt(modelIndex(row), column);
}
@Override
public void setValueAt(Object aValue, int row, int column) {
tableModel.setValueAt(aValue, modelIndex(row), column);
}
@@ -395,7 +399,7 @@ public class TableSorter extends AbstractTableModel {
}
private class MouseHandler extends MouseAdapter {
public void mouseClicked(MouseEvent e) {
@Override public void mouseClicked(MouseEvent e) {
JTableHeader h = (JTableHeader) e.getSource();
TableColumnModel columnModel = h.getColumnModel();
int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+3 -3
View File
@@ -59,7 +59,7 @@ public class Timer extends javax.swing.Timer
}
}
// documentation inherited
@Override
public String toString ()
{
return "Timer [source=" + _source +
@@ -67,7 +67,7 @@ public class Timer extends javax.swing.Timer
"]";
}
// documentation inherited
@Override
protected void fireActionPerformed (ActionEvent e)
{
if (_event != null) {
@@ -96,7 +96,7 @@ public class Timer extends javax.swing.Timer
* due to the repeating nature: the event could get re-fired
* before your controller has dealt with it.
*/
public long getWhen ()
@Override public long getWhen ()
{
return _when;
}
@@ -55,6 +55,7 @@ public class VGroupLayout extends GroupLayout
{
}
@Override
protected Dimension getLayoutSize (Container parent, int type)
{
DimenInfo info = computeDimens(parent, type);
@@ -80,6 +81,7 @@ public class VGroupLayout extends GroupLayout
return dims;
}
@Override
public void layoutContainer (Container parent)
{
Rectangle b = parent.getBounds();
@@ -369,7 +369,7 @@ public class DnDManager
/** A handy helper that removes components when they're no longer in
* the hierarchy. */
protected AncestorAdapter _remover = new AncestorAdapter() {
public void ancestorRemoved (AncestorEvent ae)
@Override public void ancestorRemoved (AncestorEvent ae)
{
JComponent comp = ae.getComponent();
// try both..
@@ -399,7 +399,7 @@ public class DnDManager
/** Listens to registered drag source components. */
protected MouseInputAdapter _sourceListener = new MouseInputAdapter() {
public void mouseDragged (MouseEvent me)
@Override public void mouseDragged (MouseEvent me)
{
// make sure a drag hasn't already started.
if (isDragging()) {
@@ -442,7 +442,7 @@ public class DnDManager
setComponentCursor(_sourceComp);
}
public void mouseReleased (MouseEvent event)
@Override public void mouseReleased (MouseEvent event)
{
if (!isDragging()) {
return;
@@ -463,14 +463,14 @@ public class DnDManager
reset();
}
public void mouseExited (MouseEvent event)
@Override public void mouseExited (MouseEvent event)
{
if (isDragging()) {
clearComponentCursor();
}
}
public void mouseEntered (MouseEvent event)
@Override public void mouseEntered (MouseEvent event)
{
if (isDragging()) {
setComponentCursor(event.getComponent());
@@ -480,7 +480,7 @@ public class DnDManager
/** Listens to registered drop targets and their children. */
protected MouseInputAdapter _targetListener = new MouseInputAdapter() {
public void mouseEntered (MouseEvent event)
@Override public void mouseEntered (MouseEvent event)
{
if (!isDragging()) {
return;
@@ -500,7 +500,7 @@ public class DnDManager
setComponentCursor(newcomp);
}
public void mouseExited (MouseEvent event)
@Override public void mouseExited (MouseEvent event)
{
if (!isDragging()) {
return;
@@ -517,7 +517,7 @@ public class DnDManager
checkAutoscroll(event);
}
public void mouseDragged (MouseEvent event)
@Override public void mouseDragged (MouseEvent event)
{
if (!isDragging()) {
return;
@@ -53,9 +53,7 @@ public class CommandEvent extends ActionEvent
return _argument;
}
/**
* Generates a string representation of this command.
*/
@Override
public String toString ()
{
return "[cmd=" + getActionCommand() + ", src=" + getSource() +
@@ -49,8 +49,7 @@ public abstract class MouseArmingAdapter
public MouseArmingAdapter (final Component component, final Shape bounds)
{
MouseInputAdapter mia = new MouseInputAdapter() {
// documentation inherited
public void mousePressed (MouseEvent e)
@Override public void mousePressed (MouseEvent e)
{
if (button1(e) && contains(e)) {
_armed = _startedArmed = true;
@@ -58,8 +57,7 @@ public abstract class MouseArmingAdapter
}
}
// documentation inherited
public void mouseReleased (MouseEvent e)
@Override public void mouseReleased (MouseEvent e)
{
if (button1(e)) {
if (_armed && contains(e)) {
@@ -69,8 +67,7 @@ public abstract class MouseArmingAdapter
}
}
// documentation inherited
public void mouseDragged (MouseEvent e)
@Override public void mouseDragged (MouseEvent e)
{
if (_startedArmed && (contains(e) != _armed)) {
_armed = !_armed;
@@ -85,6 +85,7 @@ public class LabelDemo extends JPanel
}
}
@Override
public void doLayout ()
{
super.doLayout();
@@ -99,6 +100,7 @@ public class LabelDemo extends JPanel
}
}
@Override
public void paintComponent (Graphics g)
{
super.paintComponent(g);
@@ -131,6 +133,7 @@ public class LabelDemo extends JPanel
}
}
@Override
public Dimension getPreferredSize ()
{
return new Dimension(400, 300);
@@ -36,6 +36,7 @@ public class ProximityTrackerTest extends TestCase
super(ProximityTrackerTest.class.getName());
}
@Override
public void runTest ()
{
Random rand = new Random();
@@ -120,7 +120,7 @@ public class MouseHijacker
/** Used to capture each motion event while everything's hijacked. */
protected MouseMotionListener _motionCatcher = new MouseMotionAdapter() {
public void mouseMoved (MouseEvent evt)
@Override public void mouseMoved (MouseEvent evt)
{
_lastMotion = evt;
}
@@ -207,9 +207,7 @@ public class ProximityTracker
return _records[minidx].object;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return "[size=" + _size +
@@ -276,7 +274,7 @@ public class ProximityTracker
this.object = object;
}
public String toString ()
@Override public String toString ()
{
return "[x=" + x + ", y=" + y + "]"; // + ", object=" + object + "]";
}
@@ -371,8 +371,7 @@ public class SwingUtil
// set up the filter.
((AbstractDocument) doc).setDocumentFilter(new DocumentFilter()
{
// documentation inherited
public void remove (FilterBypass fb, int offset, int length)
@Override public void remove (FilterBypass fb, int offset, int length)
throws BadLocationException
{
if (replaceOk(offset, length, "")) {
@@ -381,8 +380,7 @@ public class SwingUtil
}
}
// documentation inherited
public void insertString (
@Override public void insertString (
FilterBypass fb, int offset, String string, AttributeSet attr)
throws BadLocationException
{
@@ -392,8 +390,7 @@ public class SwingUtil
}
}
// documentation inherited
public void replace (
@Override public void replace (
FilterBypass fb, int offset, int length, String text,
AttributeSet attrs)
throws BadLocationException
@@ -99,7 +99,8 @@ public class TaskMaster
* invoke this runnable so run() is synchronized. Oh how I love
* Chapter 17.
*/
public synchronized void run ()
@Override
public synchronized void run ()
{
switch (_mode) {
default:
+15 -17
View File
@@ -60,7 +60,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
this(DEFAULT_CAPACITY);
}
// documentation inherited from interface
@Override
public int size ()
{
return _size;
@@ -78,13 +78,13 @@ public class ArrayIntSet extends AbstractSet<Integer>
return _values[index];
}
// documentation inherited from interface
@Override
public boolean isEmpty ()
{
return _size == 0;
}
// documentation inherited from interface
@Override
public boolean contains (Object o)
{
return contains(((Integer)o).intValue());
@@ -132,13 +132,13 @@ public class ArrayIntSet extends AbstractSet<Integer>
};
}
// documentation inherited from interface
@Override
public Iterator<Integer> iterator ()
{
return interator();
}
// documentation inherited from interface
@Override
public Object[] toArray ()
{
return toArray(new Integer[_size]);
@@ -188,7 +188,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
return values;
}
// documentation inherited from interface
@Override
public boolean add (Integer o)
{
return add(o.intValue());
@@ -245,7 +245,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
return modified;
}
// documentation inherited from interface
@Override
public boolean remove (Object o)
{
return remove(((Integer)o).intValue());
@@ -294,7 +294,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
return modified;
}
// documentation inherited from interface
@Override
public boolean containsAll (Collection<?> c)
{
if (c instanceof Interable) {
@@ -311,7 +311,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
}
}
// documentation inherited from interface
@Override
public boolean addAll (Collection<? extends Integer> c)
{
if (c instanceof Interable) {
@@ -329,7 +329,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
}
}
// documentation inherited from interface
@Override
public boolean retainAll (Collection<?> c)
{
if (c instanceof IntSet) {
@@ -357,14 +357,14 @@ public class ArrayIntSet extends AbstractSet<Integer>
}
}
// documentation inherited from interface
@Override
public void clear ()
{
Arrays.fill(_values, 0);
_size = 0;
}
// documentation inherited from interface
@Override
public boolean equals (Object o)
{
if (o instanceof ArrayIntSet) {
@@ -384,7 +384,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
return false;
}
// documentation inherited from interface
@Override
public int hashCode ()
{
int hashCode = 0;
@@ -394,7 +394,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
return hashCode;
}
// documentation inherited from interface
@Override
public Object clone ()
{
try {
@@ -407,9 +407,7 @@ public class ArrayIntSet extends AbstractSet<Integer>
}
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
return StringUtil.toString(iterator());
@@ -182,7 +182,7 @@ public class AuditLogger
/** The interval that rolls over the log file. */
protected Interval _rollover = new Interval() {
public void expired () {
@Override public void expired () {
checkRollOver();
}
};
+19 -14
View File
@@ -39,31 +39,32 @@ import static com.samskivert.Log.log;
public abstract class BaseArrayList<E> extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, Serializable
{
// documentation inherited from interface
@Override
public int size ()
{
return _size;
}
// documentation inherited from interface
@Override
public boolean isEmpty ()
{
return (_size == 0);
}
// documentation inherited from interface
@Override
public boolean contains (Object o)
{
return ListUtil.contains(_elements, o);
}
// documentation inherited from interface
@Override
public Object[] toArray ()
{
return toArray(new Object[_size]);
}
@SuppressWarnings("unchecked") // documentation inherited from interface
@Override
@SuppressWarnings("unchecked")
public <T> T[] toArray (T[] target)
{
// create the target array if necessary
@@ -80,14 +81,15 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
return target;
}
// documentation inherited
@Override
public void clear ()
{
_elements = null;
_size = 0;
}
@SuppressWarnings("unchecked") // documentation inherited from interface
@Override
@SuppressWarnings("unchecked")
public boolean add (E o)
{
_elements = (E[])ListUtil.add(_elements, _size, o);
@@ -95,7 +97,7 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
return true;
}
// documentation inherited from interface
@Override
public boolean remove (Object o)
{
if (ListUtil.remove(_elements, o) != null) {
@@ -105,14 +107,14 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
return false;
}
// documentation inherited from interface
@Override
public E get (int index)
{
rangeCheck(index, false);
return _elements[index];
}
// documentation inherited from interface
@Override
public E set (int index, E element)
{
rangeCheck(index, false);
@@ -121,7 +123,8 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
return old;
}
@SuppressWarnings("unchecked") // documentation inherited from interface
@Override
@SuppressWarnings("unchecked")
public void add (int index, E element)
{
rangeCheck(index, true);
@@ -129,7 +132,8 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
_size++;
}
@SuppressWarnings("unchecked") // documentation inherited from interface
@Override
@SuppressWarnings("unchecked")
public E remove (int index)
{
rangeCheck(index, false);
@@ -138,7 +142,7 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
return oval;
}
// documentation inherited from interface
@Override
public int indexOf (Object o)
{
return ListUtil.indexOf(_elements, o);
@@ -162,7 +166,8 @@ public abstract class BaseArrayList<E> extends AbstractList<E>
}
}
@SuppressWarnings("unchecked") // documentation inherited
@Override
@SuppressWarnings("unchecked")
public Object clone ()
{
try {
@@ -49,7 +49,7 @@ public class BasicRunQueue extends LoopingThread
return Thread.currentThread() == this;
}
// documentation inherited
@Override
protected void iterate ()
{
Runnable r = _queue.get();
@@ -61,7 +61,7 @@ public class BasicRunQueue extends LoopingThread
}
}
// documentation inherited
@Override
protected void kick ()
{
postRunnable(new Runnable() {
+12 -6
View File
@@ -346,15 +346,18 @@ public class Collections
}
}
public boolean equals(Object o) {
@Override
public boolean equals(Object o) {
synchronized(mutex) {return m.equals(o);}
}
public int hashCode() {
@Override
public int hashCode() {
synchronized(mutex) {return m.hashCode();}
}
public String toString() {
@Override
public String toString() {
synchronized(mutex) {return m.toString();}
}
}
@@ -374,10 +377,12 @@ public class Collections
super(s, mutex);
}
public boolean equals(Object o) {
@Override
public boolean equals(Object o) {
synchronized(mutex) {return c.equals(o);}
}
public int hashCode() {
@Override
public int hashCode() {
synchronized(mutex) {return c.hashCode();}
}
}
@@ -484,7 +489,8 @@ public class Collections
public void clear() {
synchronized(mutex) {c.clear();}
}
public String toString() {
@Override
public String toString() {
synchronized(mutex) {return c.toString();}
}
}
+2 -2
View File
@@ -654,12 +654,12 @@ public class ConfigUtil
}
}
public boolean equals (Object other)
@Override public boolean equals (Object other)
{
return _package.equals(((PropRecord)other)._package);
}
public String toString ()
@Override public String toString ()
{
return "[package=" + _package +
", overrides=" + StringUtil.toString(_overrides) +
+11 -10
View File
@@ -108,8 +108,8 @@ public class CountHashMap<K> extends HashMap<K, int[]>
public int getTotalCount ()
{
int count = 0;
for (Iterator<int[]> itr = values().iterator(); itr.hasNext(); ) {
count += itr.next()[0];
for (int[] name : values()) {
count += name[0];
}
return count;
}
@@ -126,7 +126,8 @@ public class CountHashMap<K> extends HashMap<K, int[]>
}
}
@SuppressWarnings("unchecked") // documentation inherited
@Override
@SuppressWarnings("unchecked")
public Set<Map.Entry<K, int[]>> entrySet ()
{
// a giant mess of hoop-jumpery so that we can convert each Map.Entry
@@ -150,7 +151,7 @@ public class CountHashMap<K> extends HashMap<K, int[]>
_entry = entry;
}
public boolean equals (Object o)
@Override public boolean equals (Object o)
{
return _entry.equals(o);
}
@@ -165,7 +166,7 @@ public class CountHashMap<K> extends HashMap<K, int[]>
return _entry.getValue();
}
public int hashCode ()
@Override public int hashCode ()
{
return _entry.hashCode();
}
@@ -199,7 +200,7 @@ public class CountHashMap<K> extends HashMap<K, int[]>
_superset = superset;
}
public Iterator<Entry<E>> iterator ()
@Override public Iterator<Entry<E>> iterator ()
{
final Iterator<Map.Entry<E, int[]>> itr = _superset.iterator();
return new Iterator<Entry<E>>() {
@@ -220,22 +221,22 @@ public class CountHashMap<K> extends HashMap<K, int[]>
};
}
public boolean contains (Object o)
@Override public boolean contains (Object o)
{
return _superset.contains(o);
}
public boolean remove (Object o)
@Override public boolean remove (Object o)
{
return _superset.remove(o);
}
public int size ()
@Override public int size ()
{
return CountHashMap.this.size();
}
public void clear ()
@Override public void clear ()
{
CountHashMap.this.clear();
}
+21 -21
View File
@@ -75,13 +75,13 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
this(DEFAULT_BUCKETS, DEFAULT_LOAD_FACTOR);
}
// documentation inherited
@Override
public int size ()
{
return _size;
}
// documentation inherited
@Override
public boolean containsKey (Object key)
{
return containsKey(((Integer)key).intValue());
@@ -93,7 +93,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return get(key) != null;
}
// documentation inherited
@Override
public boolean containsValue (Object o)
{
for (int ii = 0, ll = _buckets.length; ii < ll; ii++) {
@@ -106,7 +106,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return false;
}
// documentation inherited
@Override
public V get (Object key)
{
return get(((Integer)key).intValue());
@@ -124,7 +124,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return null;
}
// documentation inherited
@Override
public V put (Integer key, V value)
{
return put(key.intValue(), value);
@@ -163,7 +163,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return null;
}
// documentation inherited
@Override
public V remove (Object key)
{
return remove(((Integer)key).intValue());
@@ -213,7 +213,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
}
}
// documentation inherited
@Override
public void clear ()
{
// abandon all of our hash chains (the joy of garbage collection)
@@ -291,14 +291,14 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
}
}
// documentation inherited
@Override
public Set<Entry<Integer,V>> entrySet ()
{
return new AbstractSet<Entry<Integer,V>>() {
public int size () {
@Override public int size () {
return _size;
}
public Iterator<Entry<Integer,V>> iterator () {
@Override public Iterator<Entry<Integer,V>> iterator () {
return new MapEntryIterator();
}
};
@@ -308,10 +308,10 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
public Set<IntEntry<V>> intEntrySet ()
{
return new AbstractSet<IntEntry<V>>() {
public int size () {
@Override public int size () {
return _size;
}
public Iterator<IntEntry<V>> iterator () {
@Override public Iterator<IntEntry<V>> iterator () {
return new IntEntryIterator();
}
};
@@ -394,7 +394,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
protected class IntKeySet extends AbstractSet<Integer>
implements IntSet
{
public Iterator<Integer> iterator () {
@Override public Iterator<Integer> iterator () {
return interator();
}
@@ -416,11 +416,11 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
};
}
public int size () {
@Override public int size () {
return HashIntMap.this.size();
}
public boolean contains (Object t) {
@Override public boolean contains (Object t) {
return HashIntMap.this.containsKey(t);
}
@@ -432,7 +432,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
throw new UnsupportedOperationException();
}
public boolean remove (Object o) {
@Override public boolean remove (Object o) {
return (null != HashIntMap.this.remove(o));
}
@@ -461,7 +461,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return _keySet;
}
// documentation inherited
@Override
public Set<Integer> keySet ()
{
return intKeySet();
@@ -484,7 +484,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return values().iterator();
}
// documentation inherited from interface cloneable
@Override
public Object clone ()
{
HashIntMap<V> copy = new HashIntMap<V>(_buckets.length, _loadFactor);
@@ -576,7 +576,7 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
return ovalue;
}
public boolean equals (Object o)
@Override public boolean equals (Object o)
{
if (!(o instanceof IntEntry)) {
return false;
@@ -586,12 +586,12 @@ public class HashIntMap<V> extends AbstractMap<Integer,V>
ObjectUtil.equals(this.value, that.getValue());
}
public int hashCode ()
@Override public int hashCode ()
{
return key ^ ((value == null) ? 0 : value.hashCode());
}
public String toString ()
@Override public String toString ()
{
return key + "=" + StringUtil.toString(value);
}
+1 -3
View File
@@ -101,9 +101,7 @@ public class Histogram
return buf.toString();
}
/**
* Returns a string representation of this histogram.
*/
@Override
public String toString ()
{
return "[min=" + _minValue + ", max=" + _maxValue +
+5 -7
View File
@@ -280,9 +280,7 @@ public class IntIntMap
return toIntArray(false);
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder("[");
@@ -317,11 +315,11 @@ public class IntIntMap
public Set<IntIntEntry> entrySet ()
{
return new AbstractSet<IntIntEntry>() {
public int size () {
@Override public int size () {
return _size;
}
public Iterator<IntIntEntry> iterator() {
@Override public Iterator<IntIntEntry> iterator() {
return new IntEntryIterator();
}
};
@@ -405,7 +403,7 @@ public class IntIntMap
return oldVal;
}
public boolean equals (Object o) {
@Override public boolean equals (Object o) {
if (o instanceof IntIntEntry) {
IntIntEntry that = (IntIntEntry) o;
return (this.key == that.getIntKey()) &&
@@ -414,7 +412,7 @@ public class IntIntMap
return false;
}
public int hashCode () {
@Override public int hashCode () {
return key;
}
}
@@ -49,6 +49,7 @@ public class IntTuple
/**
* Returns the combined hashcode of the two elements.
*/
@Override
public int hashCode ()
{
return left ^ right;
@@ -65,6 +66,7 @@ public class IntTuple
* are equal to the left and right elements (respectively) of the
* other tuple.
*/
@Override
public boolean equals (Object other)
{
if (other instanceof IntTuple) {
@@ -75,6 +77,7 @@ public class IntTuple
}
}
@Override
public String toString ()
{
return "[left=" + left + ", right=" + right + "]";
+3 -5
View File
@@ -222,8 +222,7 @@ public abstract class Interval
_interval = interval;
}
@Override
public boolean cancel ()
@Override public boolean cancel ()
{
// remove the reference back to the interval, allowing the Interval itself
// to be gc'd even as this Task potentially sits on the Timer queue.
@@ -231,8 +230,7 @@ public abstract class Interval
return super.cancel();
}
// documentation inherited
public void run () {
@Override public void run () {
Interval ival = _interval;
if (ival == null) {
return;
@@ -254,7 +252,7 @@ public abstract class Interval
return _interval;
}
public String toString () {
@Override public String toString () {
Interval ival = _interval;
return (ival != null) ? ival.toString() : "(Interval was cancelled)";
}
+7 -6
View File
@@ -104,7 +104,7 @@ public class Invoker extends LoopingThread
}
/** Returns the name of this invoker. */
public String toString ()
@Override public String toString ()
{
return _name;
}
@@ -148,12 +148,12 @@ public class Invoker extends LoopingThread
public void postRunnable (final Runnable r)
{
postUnit(new Unit() {
public boolean invoke () {
@Override public boolean invoke () {
r.run();
return false;
}
public String toString () {
@Override public String toString () {
return "Posted Runnable: " + String.valueOf(r);
}
});
@@ -165,7 +165,7 @@ public class Invoker extends LoopingThread
return (this == Thread.currentThread());
}
// documentation inherited
@Override
public void iterate ()
{
// pop the next item off of the queue
@@ -199,10 +199,11 @@ public class Invoker extends LoopingThread
* Shuts down the invoker thread by queueing up a unit that will cause the thread to exit after
* all currently queued units are processed.
*/
@Override
public void shutdown ()
{
_queue.append(new Unit() {
public boolean invoke () {
@Override public boolean invoke () {
_running = false;
return false;
}
@@ -266,7 +267,7 @@ public class Invoker extends LoopingThread
_histo.clear();
}
public String toString () {
@Override public String toString () {
int count = _histo.size();
return _totalElapsed + "ms/" + count + " = " + (_totalElapsed/count) + "ms avg " +
StringUtil.toString(_histo.getBuckets());
+3 -4
View File
@@ -56,21 +56,20 @@ public class KeyValue<K extends Comparable<? super K>,V>
this.value = value;
}
/**
* Generates a string representation of this instance.
*/
@Override
public String toString ()
{
return key + "=" + value;
}
@Override
@SuppressWarnings("unchecked") // documentation inherited
public boolean equals (Object other)
{
return key.equals(((KeyValue<K,V>)other).key);
}
// documentation inherited
@Override
public int hashCode ()
{
return key.hashCode();
+4 -3
View File
@@ -122,7 +122,8 @@ public class LRUHashMap<K,V> implements Map<K,V>
*/
public void setCanFlush (boolean canFlush)
{
if (_canFlush = canFlush) {
_canFlush = canFlush;
if (_canFlush) {
// if we just reenabled flushing, flush
flush();
}
@@ -327,13 +328,13 @@ public class LRUHashMap<K,V> implements Map<K,V>
return Collections.unmodifiableSet(_delegate.entrySet());
}
// documentation inherited from interface
@Override
public boolean equals (Object o)
{
return _delegate.equals(o);
}
// documentation inherited from interface
@Override
public int hashCode ()
{
return _delegate.hashCode();
@@ -66,6 +66,7 @@ public class LoopingThread extends Thread
* #iterate} to perform whatever action needs to be performed inside
* the loop.
*/
@Override
public void run ()
{
try {
@@ -64,6 +64,7 @@ public class MethodFinder
_clazz = clazz;
}
@Override
public boolean equals (Object o)
{
if (this == o) {
@@ -57,7 +57,7 @@ public class OneLineLogFormatter extends Formatter
_showWhere = showWhere;
}
// documentation inherited
@Override
public String format (LogRecord record)
{
StringBuffer buf = new StringBuffer();
+9 -18
View File
@@ -58,8 +58,7 @@ public abstract class Predicate<T>
_class = clazz;
}
// from Predicate
public boolean isMatch (T obj)
@Override public boolean isMatch (T obj)
{
return _class.isInstance(obj);
}
@@ -82,8 +81,7 @@ public abstract class Predicate<T>
_preds = preds;
}
// from Predicate
public boolean isMatch (T obj)
@Override public boolean isMatch (T obj)
{
for (Predicate<T> pred : _preds) {
if (!pred.isMatch(obj)) {
@@ -111,8 +109,7 @@ public abstract class Predicate<T>
_preds = preds;
}
// from Predicate
public boolean isMatch (T obj)
@Override public boolean isMatch (T obj)
{
for (Predicate<T> pred : _preds) {
if (pred.isMatch(obj)) {
@@ -135,8 +132,7 @@ public abstract class Predicate<T>
_pred = negated;
}
// from Predicate
public boolean isMatch (T obj)
@Override public boolean isMatch (T obj)
{
return !_pred.isMatch(obj);
}
@@ -255,8 +251,7 @@ public abstract class Predicate<T>
{
// TODO: create a collection of the same type?
return new AbstractCollection<E>() {
// from abstract AbstractCollection
public int size ()
@Override public int size ()
{
// oh god, oh god: we iterate and count
int size = 0;
@@ -266,20 +261,17 @@ public abstract class Predicate<T>
return size;
}
@Override
public boolean add (E element)
@Override public boolean add (E element)
{
return input.add(element);
}
@Override
public boolean remove (Object element)
@Override public boolean remove (Object element)
{
return input.remove(element);
}
@Override
public boolean contains (Object element)
@Override public boolean contains (Object element)
{
try {
@SuppressWarnings("unchecked")
@@ -292,8 +284,7 @@ public abstract class Predicate<T>
}
}
// from abstract AbstractCollection
public Iterator<E> iterator ()
@Override public Iterator<E> iterator ()
{
return filter(input.iterator());
}
@@ -290,27 +290,27 @@ public class PrefsConfig extends Config
public NullPreferences () {
super(null, "");
}
protected void putSpi (String key, String value) {
@Override protected void putSpi (String key, String value) {
}
protected String getSpi (String key) {
@Override protected String getSpi (String key) {
return null;
}
protected void removeSpi (String key) {
@Override protected void removeSpi (String key) {
}
protected void removeNodeSpi () throws BackingStoreException {
@Override protected void removeNodeSpi () throws BackingStoreException {
}
protected String[] keysSpi () throws BackingStoreException {
@Override protected String[] keysSpi () throws BackingStoreException {
return new String[0];
}
protected String[] childrenNamesSpi () throws BackingStoreException {
@Override protected String[] childrenNamesSpi () throws BackingStoreException {
return new String[0];
}
protected AbstractPreferences childSpi (String name) {
@Override protected AbstractPreferences childSpi (String name) {
return null;
}
protected void syncSpi () throws BackingStoreException {
@Override protected void syncSpi () throws BackingStoreException {
}
protected void flushSpi () throws BackingStoreException {
@Override protected void flushSpi () throws BackingStoreException {
}
}
@@ -70,7 +70,7 @@ public class ProcessLogger
_reader = new BufferedReader(new InputStreamReader(input));
}
public void run ()
@Override public void run ()
{
String line;
try {
@@ -114,14 +114,14 @@ public class PropertiesUtil
{
final String dprefix = prefix + ".";
return new Properties() {
public String getProperty (String key) {
@Override public String getProperty (String key) {
return getProperty(key, null);
}
public String getProperty (String key, String defaultValue) {
@Override public String getProperty (String key, String defaultValue) {
return source.getProperty(dprefix + key,
source.getProperty(key, defaultValue));
}
public Enumeration<?> propertyNames () {
@Override public Enumeration<?> propertyNames () {
return new Enumeration<Object>() {
public boolean hasMoreElements () {
return next != null;
+1
View File
@@ -243,6 +243,7 @@ public class Queue<T>
return (T[])new Object[size];
}
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder();
@@ -129,7 +129,7 @@ public class SerialExecutor
// start up a timer that will abort this thread after the specified
// timeout
new Interval() {
public void expired () {
@Override public void expired () {
// this will NOOP if the task has already completed
thread.abort();
}
@@ -174,7 +174,7 @@ public class SerialExecutor
}
}
public void run ()
@Override public void run ()
{
final ExecutorTask task = _task;
try {
+1 -3
View File
@@ -173,9 +173,7 @@ public class SystemInfo
srate + ", " + sfull;
}
/**
* Returns a string representation of this instance.
*/
@Override
public String toString ()
{
StringBuilder buf = new StringBuilder();
+3 -3
View File
@@ -58,6 +58,7 @@ public class Tuple<L,R> implements Serializable
/**
* Returns the combined hashcode of the two elements.
*/
@Override
public int hashCode ()
{
return left.hashCode() ^ right.hashCode();
@@ -68,6 +69,7 @@ public class Tuple<L,R> implements Serializable
* are equal to the left and right elements (respectively) of the
* other tuple.
*/
@Override
public boolean equals (Object other)
{
if (other instanceof Tuple) {
@@ -78,9 +80,7 @@ public class Tuple<L,R> implements Serializable
}
}
/**
* Generates a string representation of this tuple.
*/
@Override
public String toString ()
{
return "[left=" + left + ", right=" + right + "]";
@@ -35,6 +35,7 @@ public class ArrayIntSetTest extends TestCase
super(ArrayIntSetTest.class.getName());
}
@Override
public void runTest ()
{
ArrayIntSet set = new ArrayIntSet();
@@ -38,6 +38,7 @@ public class ArrayUtilTest extends TestCase
super(ArrayUtilTest.class.getName());
}
@Override
public void runTest ()
{
// test reversing an array
@@ -35,6 +35,7 @@ public class CheapIntMapTest extends TestCase
super(CheapIntMapTest.class.getName());
}
@Override
public void runTest ()
{
CheapIntMap map = new CheapIntMap(10);
@@ -41,6 +41,7 @@ public class CollectionUtilTest extends TestCase
super(CollectionUtil.class.getName());
}
@Override
public void runTest ()
{
ArrayList<Integer> list = new ArrayList<Integer>();
@@ -39,6 +39,7 @@ public class ConfigTest extends TestCase
super(ConfigTest.class.getName());
}
@Override
public void runTest ()
{
PrefsConfig config = new PrefsConfig("rsrc/util/test");
@@ -73,6 +73,7 @@ public class ConfigUtilTest extends TestCase
super(ConfigUtilTest.class.getName());
}
@Override
public void runTest ()
{
try {
@@ -37,6 +37,7 @@ public class HashIntMapTest extends TestCase
super(HashIntMapTest.class.getName());
}
@Override
public void runTest ()
{
HashIntMap<Integer> table = new HashIntMap<Integer>();
@@ -34,6 +34,7 @@ public class IntListUtilTest extends TestCase
super(IntListUtilTest.class.getName());
}
@Override
public void runTest ()
{
int[] list = null;
@@ -35,6 +35,7 @@ public class LRUHashMapTest extends TestCase
super(LRUHashMapTest.class.getName());
}
@Override
public void runTest ()
{
LRUHashMap<String,Integer> map =
@@ -35,6 +35,7 @@ public class ObserverListTest extends TestCase
super(ObserverListTest.class.getName());
}
@Override
public void runTest ()
{
// Log.info("Testing safe list.");
@@ -110,7 +111,7 @@ public class ObserverListTest extends TestCase
// Log.info("foozle! " + _index);
}
public String toString ()
@Override public String toString ()
{
return Integer.toString(_index);
}
@@ -37,6 +37,7 @@ public class QuickSortTest extends TestCase
super(QuickSortTest.class.getName());
}
@Override
public void runTest ()
{
Integer[] a = new Integer[100];
@@ -39,6 +39,7 @@ public class SerialExecutorTest extends TestCase
_main = Thread.currentThread();
}
@Override
public void runTest ()
{
SerialExecutor executor = new SerialExecutor(this);

Some files were not shown because too many files have changed in this diff Show More