Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
* Added file header comment to `SetterMethodChecker.java`.
* Extended `SetterMethodCheckerTest.java` by test cases for Lazy
  Initialisation.
* Changed `MutatesAsInternalCaching.java` to be effective immutable
  as using Lazy Initialisation.
  • Loading branch information
Juergen Fickel committed Jun 16, 2013
1 parent bf8c14e commit 8e2d242
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2008-2013 Graham Allan, Juergen Fickel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.mutabilitydetector.checkers.settermethod;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down
Expand Up @@ -30,9 +30,14 @@ public MutatesAsInternalCaching(String myString, String otherString) {

public int getConcatenatedLength() {
if (lengthWhenConcatenated == 0) {
lengthWhenConcatenated = myString.concat(otherString).length();
// lengthWhenConcatenated = myString.concat(otherString).length();
lengthWhenConcatenated = getLengthWhenConcatenated();
}
return lengthWhenConcatenated;
}

private int getLengthWhenConcatenated() {
return myString.concat(otherString).length();
}

}
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2008-2013 Graham Allan, Juergen Fickel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.mutabilitydetector.benchmarks.settermethod;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down

0 comments on commit 8e2d242

Please sign in to comment.