experiments/JavaCompilerProblemRegistry.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 06 Sep 2013 00:16:38 +0100
branchdevelopment
changeset 2711 a00302fe5083
parent 2645 b7a540a27521
child 2731 13f5be2bf83b
permissions -rw-r--r--
Added version_CVS to all classes and build files regenerated & cleaned. This is necessary step before updating CVS.

"
 Copyright (c) 2010-2011 Jan Vrany, Jan Kurs & Marcel Hlopko,
                         SWING Research Group, Czech Technical University 
                         in Prague

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
"
"{ Package: 'stx:libjava/experiments' }"

Object subclass:#JavaCompilerProblemRegistry
	instanceVariableNames:'problems'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Support-Compiling'
!

JavaCompilerProblemRegistry class instanceVariableNames:'theOneAndOnlyInstance'

"
 No other class instance variables are inherited by this class.
"
!

!JavaCompilerProblemRegistry class methodsFor:'documentation'!

copyright
"
 Copyright (c) 2010-2011 Jan Vrany, Jan Kurs & Marcel Hlopko,
                         SWING Research Group, Czech Technical University 
                         in Prague

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the 'Software'), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.

"
! !

!JavaCompilerProblemRegistry class methodsFor:'instance creation'!

flush
    "flushes the cached singleton"

    theOneAndOnlyInstance := nil

    "
     self flushSingleton
    "

    "Created: / 06-08-2013 / 10:19:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

instance
    "returns a singleton"

    theOneAndOnlyInstance isNil ifTrue:[
        theOneAndOnlyInstance := self basicNew initialize.
    ].
    ^ theOneAndOnlyInstance.

    "Created: / 06-08-2013 / 10:19:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

new
    "returns a singleton"

    ^ self instance.

    "Modified: / 06-08-2013 / 10:20:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaCompilerProblemRegistry class methodsFor:'accessing'!

problemsFor: jclass
    ^ self instance problemsFor: jclass.

    "Created: / 06-08-2013 / 10:29:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

problemsFor: jclass put: problems
    ^ self instance problemsFor: jclass put: problems

    "Created: / 06-08-2013 / 10:29:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaCompilerProblemRegistry methodsFor:'accessing'!

problemsFor: jclass
    ^ problems at: jclass ifAbsent:[nil]

    "Created: / 06-08-2013 / 10:24:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

problemsFor: jclass put: problemsForClass
    problemsForClass isNil ifTrue:[
        problems removeKey: jclass ifAbsent:[nil].
    ] ifFalse:[
        problems at: jclass put: problemsForClass.
    ].
    self changed: #problems with: jclass.

    "Created: / 06-08-2013 / 10:25:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaCompilerProblemRegistry methodsFor:'initialization'!

initialize
    "Invoked when a new instance is created."

    problems := WeakIdentityDictionary new.

    "Modified: / 06-08-2013 / 10:20:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaCompilerProblemRegistry class methodsFor:'documentation'!

version_CVS
    ^ '$Header$'
! !