-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #12282: Resolve Pitest suppression for ParenPad
- Loading branch information
1 parent
423c0a7
commit bb71b4b
Showing
4 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../puppycrawl/tools/checkstyle/checks/whitespace/parenpad/InputParenPadForSynchronized.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
ParenPad | ||
option = (default)nospace | ||
tokens = LITERAL_SYNCHRONIZED, CTOR_DEF, CTOR_CALL, LITERAL_IF | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.whitespace.parenpad; | ||
|
||
/** | ||
* | ||
* Thread-safe Singleton class. | ||
* The instance is lazily initialized and thus needs synchronization | ||
* mechanism. | ||
* | ||
*/ | ||
class InputParenPadForSynchronized { | ||
|
||
private static InputParenPadForSynchronized instance = null; | ||
private InputParenPadForSynchronized() { | ||
} | ||
|
||
public synchronized static InputParenPadForSynchronized getInstance() { | ||
/* | ||
* The instance gets created only when it is called for first time. | ||
* Lazy -loading | ||
*/ | ||
if(instance == null) { | ||
instance = new InputParenPadForSynchronized(); | ||
} | ||
return instance; | ||
} | ||
} |