Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.8.2
-
None
-
None
Description
I have try use standard Singleton pattern in groovy script:
public class SingleTest { private static final Instance = new SingleTest(); private SingleTest(){ } public SingleTest getInstance(){ return Instance; } void test(){ println 'test'; } } SingleTest test = new SingleTest(); test.test();
But groovy instantiate object even if constructor marked as private:
D:\imus\IdeaProjects\imus\instup\src\main\java\test-private-constructor>groovy test.groovy test
P.S. Sorry for noise with http://jira.codehaus.org/browse/GROOVY-5012 I'd expect what in cloning process I can be able change description of bug.