if (propertiesAlreadyLoaded == false) { // get parameters previously set by user, or set default values _readClobs = false; // set to the default String readClobsString = DTProperties.get(thisClassName, "readClobs"); if (readClobsString != null && readClobsString.equals("true")) _readClobs = true; _readCompleteClobs = false; // set to the default String readCompleteClobsString = DTProperties.get(thisClassName, "readCompleteClobs"); if (readCompleteClobsString != null && readCompleteClobsString.equals("true")) _readCompleteClobs = true; _readClobsSize = LARGE_COLUMN_DEFAULT_READ_LENGTH; // set to default String readClobsSizeString = DTProperties.get(thisClassName, "readClobsSize"); if (readClobsSizeString != null) _readClobsSize = Integer.parseInt(readClobsSizeString); _makeNewlinesVisibleInCell = true; // set to the default String makeNewlinesVisibleString = DTProperties.get(thisClassName, "makeNewlinesVisibleInCell"); if (makeNewlinesVisibleString != null && makeNewlinesVisibleString.equals("false")) _makeNewlinesVisibleInCell = false; propertiesAlreadyLoaded = true; }
if (propertiesAlreadyLoaded == false) { propertiesAlreadyLoaded = true; // get parameters previously set by user, or set default values useJavaDefaultFormat =true; // set to use the Java default String useJavaDefaultFormatString = DTProperties.get( thisClassName, "useJavaDefaultFormat"); if (useJavaDefaultFormatString != null && useJavaDefaultFormatString.equals("false")) useJavaDefaultFormat =false; // get which locale-dependent format to use localeFormat =DateFormat.SHORT; // set to use the Java default String localeFormatString = DTProperties.get( thisClassName, "localeFormat"); if (localeFormatString != null) localeFormat = Integer.parseInt(localeFormatString); // use lenient input or force user to enter exact format lenient = true; // set to allow less stringent input String lenientString = DTProperties.get( thisClassName, "lenient"); if (lenientString != null && lenientString.equals("false")) lenient =false; // Bug #1757076 // always use false unless user specifies otherwise; this breaks // date editing in Derby (possibly DB2 as well) readDateAsTimestamp = false; String readDateAsTimestampString = DTProperties.get(thisClassName, "readDateAsTimestamp"); if (readDateAsTimestampString != null && readDateAsTimestampString.equals("true")) { readDateAsTimestamp = true; } }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeClob.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeDate.java
Method name: void loadProperties() Method name: void loadProperties()
Number of AST nodes: 18 Number of AST nodes: 18
1
if (propertiesAlreadyLoaded == false) {
1
if (propertiesAlreadyLoaded == false) {
2
            propertiesAlreadyLoaded = true;
2
			// get parameters previously set by user, or set default values
3
			// get parameters previously set by user, or set default values
3
			_readClobs = false;	// set to the default
4
			useJavaDefaultFormat =true;	// set to use the Java default
4
			String readClobsString = DTProperties.get(
5
			String useJavaDefaultFormatString = DTProperties.get(
5
thisClassName, "readClobs");
6
				thisClassName, "
6
			if (readClobsString != null && readClobs
7
useJavaDefaultFormat");
7
String.equals("true"))
8
			if (useJavaDefaultFormatString != null && useJavaDefaultFormatString.equals("false"))
8
				_readClobs = true;
9
				
9
			_readCompleteClobs = false;	// set to the
10
useJavaDefaultFormat =false;
11
			// get which locale-dependent format to use
10
 default
12
			localeFormat =DateFormat.SHORT;	// set to use the Java default
11
			String readCompleteClobsString = DTProperties.get(
13
			String localeFormatString = DTProperties.get(
12
thisClassName, "readCompleteClobs");
14
				thisClassName, "
13
			if (readCompleteClobsString != null && readCompleteClobsString.equals("true"))
14
				_readCompleteClobs = true;
15
            
16
			_readClobsSize = LARGE_COLUMN_DEFAULT_READ_LENGTH;	// set to default
17
			String readClobsSize
15
localeFormat");
16
			if (localeFormatString != null)
17
				localeFormat = Integer.parseInt(localeFormatString);
18
			// use lenient input or force user to enter exact format
19
			lenient = true;	// set to allow less stringent input
18
String = DTProperties.get(
20
			String lenientString = DTProperties.get(
19
thisClassName, "readClobsSize");
21
				thisClassName, "
20
			if (readClobsSizeString != null)
21
				_readClobsSize = Integer.parseInt(readClobsSizeString);
22
			_makeNewlinesVisibleInCell = true;	// set to the default
23
			String makeNewlinesVisibleString = DTProperties.get(thisClassName, "makeNewlinesVisibleInCell");
24
			if (makeNewlinesVisibleString != null && makeNewlinesVisible
22
lenient");
23
			if (lenientString != null && lenientString.equals("false"))
24
				lenient =false;
25
            
26
            // Bug #1757076
27
            // always use false unless user specifies otherwise; this breaks
28
            // date editing in Derby (possibly DB2 as well)
29
            readDateAsTimestamp = false;
30
            String readDateAsTimestampString = 
31
                DTProperties.get(thisClassName, "readDateAsTimestamp");
32
            if (readDateAsTimestampString != null && 
25
String.equals("false"))
33
                    readDateAsTimestampString.equals("
26
				_makeNewlinesVisibleInCell = false;
27
			propertiesAlreadyLoaded = true;
34
true")) 
35
            {
36
                readDateAsTimestamp = true;
37
            }
28
		}
38
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)2.6
Clones locationClones are in different classes having the same super class
Number of node comparisons137
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)22.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (propertiesAlreadyLoaded == false)
    1
    if (propertiesAlreadyLoaded == false)
    2
    _readClobs = false;
    2
    _readClobs = false;
    15
    readDateAsTimestamp = false;
    Differences
    Expression1Expression2Difference
    _readClobsreadDateAsTimestampVARIABLE_NAME_MISMATCH
    15
    readDateAsTimestamp = false;
    3
    String readClobsString = DTProperties.get(thisClassName, "readClobs");
    3
    String readClobsString = DTProperties.get(thisClassName, "readClobs");
    16
    String readDateAsTimestampString = DTProperties.get(thisClassName, "readDateAsTimestamp");
    Differences
    Expression1Expression2Difference
    readClobsStringreadDateAsTimestampStringVARIABLE_NAME_MISMATCH
    "readClobs""readDateAsTimestamp"LITERAL_VALUE_MISMATCH
    16
    String readDateAsTimestampString = DTProperties.get(thisClassName, "readDateAsTimestamp");
    4
    if (readClobsString != null && readClobsString.equals("true"))
    4
    if (readClobsString != null && readClobsString.equals("true"))
    17
    if (readDateAsTimestampString != null && readDateAsTimestampString.equals("true"))
    Differences
    Expression1Expression2Difference
    readClobsStringreadDateAsTimestampStringVARIABLE_NAME_MISMATCH
    readClobsStringreadDateAsTimestampStringVARIABLE_NAME_MISMATCH
    17
    if (readDateAsTimestampString != null && readDateAsTimestampString.equals("true"))
    5
    _readClobs = true;
    5
    _readClobs = true;
    18
    readDateAsTimestamp = true;
    Differences
    Expression1Expression2Difference
    _readClobsreadDateAsTimestampVARIABLE_NAME_MISMATCH
    18
    readDateAsTimestamp = true;
    6
    _readCompleteClobs = false;
    6
    _readCompleteClobs = false;
    11
    lenient = true;
    Differences
    Expression1Expression2Difference
    _readCompleteClobslenientVARIABLE_NAME_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    11
    lenient = true;
    7
    String readCompleteClobsString = DTProperties.get(thisClassName, "readCompleteClobs");
    7
    String readCompleteClobsString = DTProperties.get(thisClassName, "readCompleteClobs");
    12
    String lenientString = DTProperties.get(thisClassName, "lenient");
    Differences
    Expression1Expression2Difference
    readCompleteClobsStringlenientStringVARIABLE_NAME_MISMATCH
    "readCompleteClobs""lenient"LITERAL_VALUE_MISMATCH
    12
    String lenientString = DTProperties.get(thisClassName, "lenient");
    8
    if (readCompleteClobsString != null && readCompleteClobsString.equals("true"))
    8
    if (readCompleteClobsString != null && readCompleteClobsString.equals("true"))
    13
    if (lenientString != null && lenientString.equals("false"))
    Differences
    Expression1Expression2Difference
    readCompleteClobsStringlenientStringVARIABLE_NAME_MISMATCH
    "true""false"LITERAL_VALUE_MISMATCH
    readCompleteClobsStringlenientStringVARIABLE_NAME_MISMATCH
    13
    if (lenientString != null && lenientString.equals("false"))
    9
    _readCompleteClobs = true;
    9
    _readCompleteClobs = true;
    14
    lenient = false;
    Differences
    Expression1Expression2Difference
    _readCompleteClobslenientVARIABLE_NAME_MISMATCH
    truefalseLITERAL_VALUE_MISMATCH
    14
    lenient = false;
    10
    _readClobsSize = LARGE_COLUMN_DEFAULT_READ_LENGTH;
    10
    _readClobsSize = LARGE_COLUMN_DEFAULT_READ_LENGTH;
    7
    localeFormat = DateFormat.SHORT;
    Differences
    Expression1Expression2Difference
    _readClobsSizelocaleFormatVARIABLE_NAME_MISMATCH
    LARGE_COLUMN_DEFAULT_READ_LENGTHDateFormat.SHORTTYPE_COMPATIBLE_REPLACEMENT
    7
    localeFormat = DateFormat.SHORT;
    11
    String readClobsSizeString = DTProperties.get(thisClassName, "readClobsSize");
    11
    String readClobsSizeString = DTProperties.get(thisClassName, "readClobsSize");
    8
    String localeFormatString = DTProperties.get(thisClassName, "localeFormat");
    Differences
    Expression1Expression2Difference
    readClobsSizeStringlocaleFormatStringVARIABLE_NAME_MISMATCH
    "readClobsSize""localeFormat"LITERAL_VALUE_MISMATCH
    8
    String localeFormatString = DTProperties.get(thisClassName, "localeFormat");
    12
    if (readClobsSizeString != null)
    12
    if (readClobsSizeString != null)
    9
    if (localeFormatString != null)
    Differences
    Expression1Expression2Difference
    readClobsSizeStringlocaleFormatStringVARIABLE_NAME_MISMATCH
    9
    if (localeFormatString != null)
    13
    _readClobsSize = Integer.parseInt(readClobsSizeString);
    13
    _readClobsSize = Integer.parseInt(readClobsSizeString);
    10
    localeFormat = Integer.parseInt(localeFormatString);
    Differences
    Expression1Expression2Difference
    _readClobsSizelocaleFormatVARIABLE_NAME_MISMATCH
    readClobsSizeStringlocaleFormatStringVARIABLE_NAME_MISMATCH
    10
    localeFormat = Integer.parseInt(localeFormatString);
    14
    _makeNewlinesVisibleInCell = true;
    14
    _makeNewlinesVisibleInCell = true;
    3
    useJavaDefaultFormat = true;
    Differences
    Expression1Expression2Difference
    _makeNewlinesVisibleInCelluseJavaDefaultFormatVARIABLE_NAME_MISMATCH
    3
    useJavaDefaultFormat = true;
    15
    String makeNewlinesVisibleString = DTProperties.get(thisClassName, "makeNewlinesVisibleInCell");
    15
    String makeNewlinesVisibleString = DTProperties.get(thisClassName, "makeNewlinesVisibleInCell");
    4
    String useJavaDefaultFormatString = DTProperties.get(thisClassName, "useJavaDefaultFormat");
    Differences
    Expression1Expression2Difference
    makeNewlinesVisibleStringuseJavaDefaultFormatStringVARIABLE_NAME_MISMATCH
    "makeNewlinesVisibleInCell""useJavaDefaultFormat"LITERAL_VALUE_MISMATCH
    4
    String useJavaDefaultFormatString = DTProperties.get(thisClassName, "useJavaDefaultFormat");
    16
    if (makeNewlinesVisibleString != null && makeNewlinesVisibleString.equals("false"))
    16
    if (makeNewlinesVisibleString != null && makeNewlinesVisibleString.equals("false"))
    5
    if (useJavaDefaultFormatString != null && useJavaDefaultFormatString.equals("false"))
    Differences
    Expression1Expression2Difference
    makeNewlinesVisibleStringuseJavaDefaultFormatStringVARIABLE_NAME_MISMATCH
    makeNewlinesVisibleStringuseJavaDefaultFormatStringVARIABLE_NAME_MISMATCH
    5
    if (useJavaDefaultFormatString != null && useJavaDefaultFormatString.equals("false"))
    17
    _makeNewlinesVisibleInCell = false;
    17
    _makeNewlinesVisibleInCell = false;
    6
    useJavaDefaultFormat = false;
    Differences
    Expression1Expression2Difference
    _makeNewlinesVisibleInCelluseJavaDefaultFormatVARIABLE_NAME_MISMATCH
    6
    useJavaDefaultFormat = false;
    18
    propertiesAlreadyLoaded = true;
    2
    propertiesAlreadyLoaded = true;
    Precondition Violations (0)
    Row Violation