CloneSet221


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
84230.962class_body_declarations[8]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
19268
E:/TSE/Projects-CloneDR/sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/types/OracleXmlTypeDataTypeComponent.java
28457
E:/TSE/Projects-CloneDR/sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/types/PostgreSqlXmlTypeDataTypeComponent.java
Next
Last
Clone Instance
1
Line Count
92
Source Line
68
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/types/OracleXmlTypeDataTypeComponent.java

/**
 * I18n messages
 */
static interface i18n {
  // i18n[OracleXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
  String CELL_ERROR_MSG = s_stringMgr.getString("OracleXmlTypeDataTypeComponent.cellErrorMsg");
}

/* IDataTypeComponent interface methods 

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#canDoFileIO()
 */
public boolean canDoFileIO() {
  return true;
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getClassName()
 */
@Override public String getClassName() {
  return "java.lang.String";
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getDefaultValue(java.lang.String)
 */
public Object getDefaultValue(String dbDefaultValue) {
  // At the moment, no default value
  if (s_log.isInfoEnabled()) {
    s_log.info("getDefaultValue: not yet implemented");
  }
  return dbDefaultValue;
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getWhereClauseValue(java.lang.Object,
 *      net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
 */
@Override public String getWhereClauseValue(Object value, ISQLDatabaseMetaData md) {
  /*
  * For Oracle 10g we could say something like : 
  * 
  * "where XMLSERIALIZE(CONTENT " + _colDef.getLabel() +") like '<value>'"
  * 
  * This doesn't appear to work on Oracle 9i at the moment, so we will
  * avoid using this column in any where clause if the value is non-null,
  * which is what the superclass implementation does.
  * 
  * TODO: Find a way to do this for both versions or split this behavior
  * so that it works on 10g and is disabled on 9i.
  */
  return super.getWhereClauseValue(value, md);
}

/**
 * This Data Type can be edited in a table cell as long as there are no issues using the XDK to display the
 * data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
 * (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
 * data with our tool accidentally)
 * 
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
 */
public boolean isEditableInCell(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
 * This Data Type can be edited in a popup as long as there are no issues using the XDK to display the
 * data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
 * (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
 * data with our tool accidentally)
 * 
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
 */
public boolean isEditableInPopup(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#needToReRead(java.lang.Object)
 */
public boolean needToReRead(Object originalValue) {
  return false;
}


First
Previous
Clone Instance
2
Line Count
84
Source Line
57
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/types/PostgreSqlXmlTypeDataTypeComponent.java

/**
 * I18n messages
 */
static interface i18n {
  // i18n[PostgreSqlXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
  String CELL_ERROR_MSG = s_stringMgr.getString("PostgreSqlXmlTypeDataTypeComponent.cellErrorMsg");
}

/* IDataTypeComponent interface methods 

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#canDoFileIO()
 */
public boolean canDoFileIO() {
  return true;
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getClassName()
 */
public String getClassName() {
  return "java.lang.String";
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getDefaultValue(java.lang.String)
 */
public Object getDefaultValue(String dbDefaultValue) {
  // At the moment, no default value
  if (s_log.isInfoEnabled()) {
    s_log.info("getDefaultValue: not yet implemented");
  }
  return null;
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getWhereClauseValue(java.lang.Object,
 *      net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
 */
public String getWhereClauseValue(Object value, ISQLDatabaseMetaData md) {
  // This results in "ERROR: operator does not exist: xml = unknown"
  // return _colDef.getLabel() + "='" + SQLUtilities.escapeLine(value.toString(), md) + "'";
  //
  // So don't use xml type column in where clauses if it has a non-null value for now (which is what the
  // base class implementation provides).
  //
  return super.getWhereClauseValue(value, md);
}

/**
 * This Data Type can be edited in a table cell as long as there are no issues displaying the data. If we
 * detect our error message in the cell, then we should prevent the user from editing the cell (our error
 * message is not meant to be valid XML data; further, we don't want to let the user whack their data with
 * our tool accidentally)
 * 
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
 */
public boolean isEditableInCell(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
 * This Data Type can be edited in a popup as long as there are no issues displaying the data. If we
 * detect our error message in the cell, then we should prevent the user from editing the cell (our error
 * message is not meant to be valid XML data; further, we don't want to let the user whack their data with
 * our tool accidentally)
 * 
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
 */
public boolean isEditableInPopup(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#needToReRead(java.lang.Object)
 */
public boolean needToReRead(Object originalValue) {
  return false;
}


Clone AbstractionParameter Count: 3Parameter Bindings

/**
         * I18n messages
         */
static interface i18n {
  // i18n[PostgreSqlXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
  // i18n[OracleXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
  String CELL_ERROR_MSG = s_stringMgr.getString( [[#variable18d644e0]]);
}

/* IDataTypeComponent interface methods 
        
        /**
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#canDoFileIO()
         */
public boolean canDoFileIO() {
  return true;
}

 [[#variable18d64460]]String getClassName() {
  return "java.lang.String";
}

/**
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getDefaultValue(java.lang.String)
         */
public Object getDefaultValue(String dbDefaultValue) {
  // At the moment, no default value
  if (s_log.isInfoEnabled()) {
    s_log.info("getDefaultValue: not yet implemented");
  }
  return [[#variable18d643a0]];
}

 [[#variable18d64460]]String getWhereClauseValue(Object value, ISQLDatabaseMetaData md) {
  // This results in "ERROR: operator does not exist: xml = unknown"
  // return _colDef.getLabel() + "='" + SQLUtilities.escapeLine(value.toString(), md) + "'";
  //
  // So don't use xml type column in where clauses if it has a non-null value for now (which is what the
  // base class implementation provides).
  //
  /*
                  * For Oracle 10g we could say something like : 
                  * 
                  * "where XMLSERIALIZE(CONTENT " + _colDef.getLabel() +") like '<value>'"
                  * 
                  * This doesn't appear to work on Oracle 9i at the moment, so we will
                  * avoid using this column in any where clause if the value is non-null,
                  * which is what the superclass implementation does.
                  * 
                  * TODO: Find a way to do this for both versions or split this behavior
                  * so that it works on 10g and is disabled on 9i.
                  */
  return super.getWhereClauseValue(value, md);
}

/**
         * This Data Type can be edited in a table cell as long as there are no issues displaying the data. If we
         * detect our error message in the cell, then we should prevent the user from editing the cell (our error
         * message is not meant to be valid XML data; further, we don't want to let the user whack their data with
         * our tool accidentally)
         * 
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
         */
/**
         * This Data Type can be edited in a table cell as long as there are no issues using the XDK to display the
         * data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
         * (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
         * data with our tool accidentally)
         * 
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
         */
public boolean isEditableInCell(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
         * This Data Type can be edited in a popup as long as there are no issues displaying the data. If we
         * detect our error message in the cell, then we should prevent the user from editing the cell (our error
         * message is not meant to be valid XML data; further, we don't want to let the user whack their data with
         * our tool accidentally)
         * 
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
         */
/**
         * This Data Type can be edited in a popup as long as there are no issues using the XDK to display the
         * data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
         * (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
         * data with our tool accidentally)
         * 
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
         */
public boolean isEditableInPopup(Object originalValue) {
  return !i18n.CELL_ERROR_MSG.equals(originalValue);
}

/**
         * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#needToReRead(java.lang.Object)
         */
public boolean needToReRead(Object originalValue) {
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#18d644e0]]
"OracleXmlTypeDataTypeComponent.cellErrorMsg" 
12[[#18d644e0]]
"PostgreSqlXmlTypeDataTypeComponent.cellErrorMsg" 
21[[#18d64460]]
/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getClassName()
 */
@Override public 
22[[#18d64460]]
/**
 * @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getClassName()
 */
public 
31[[#18d643a0]]
dbDefaultValue 
32[[#18d643a0]]
null