Remove deprecated getInstance()

This commit is contained in:
Mike Bierlee 2016-12-26 15:33:39 +01:00
parent 4ac095c25b
commit 898dfd8943
3 changed files with 2 additions and 20 deletions

View file

@ -5,7 +5,8 @@ Poodinis Changelog
* ADD @PostConstruct UDA for marking methods which should be called after a dependency is resolved and autowired. * ADD @PostConstruct UDA for marking methods which should be called after a dependency is resolved and autowired.
* ADD @PreDestroy UDA for marking methods which should be called when the container loses a dependency's registration. It is called when * ADD @PreDestroy UDA for marking methods which should be called when the container loses a dependency's registration. It is called when
removeRegistration or clearAllRegistrations is called. It is also called when the container is destroyed. removeRegistration or clearAllRegistrations is called. It is also called when the container is destroyed.
* FIX nullpointer exception in instance factory when debugging with poodinisVerbose * FIX nullpointer exception in instance factory when debugging with poodinisVerbose.
* REMOVE previously deprecated getInstance().
**Version 7.0.1** **Version 7.0.1**
* FIX codegeneration of constructor injection factories for constructors with dependencies from foreign modules, * FIX codegeneration of constructor injection factories for constructors with dependencies from foreign modules,

View file

@ -437,18 +437,6 @@ synchronized class DependencyContainer {
} }
} }
/**
* Returns a global singleton instance of a dependency container.
* Deprecated: create new instance with new keyword or implement your own singleton factory (method)
*/
deprecated public static shared(DependencyContainer) getInstance() {
static shared DependencyContainer instance;
if (instance is null) {
instance = new DependencyContainer();
}
return instance;
}
/** /**
* Apply persistent registration options which will be used everytime register() is called. * Apply persistent registration options which will be used everytime register() is called.
*/ */

View file

@ -53,13 +53,6 @@ version(unittest) {
assertThrown!ResolveException(container.resolve!TestClass, "Resolving cleared type does not fail"); assertThrown!ResolveException(container.resolve!TestClass, "Resolving cleared type does not fail");
} }
// Test get singleton of container (DEPRECATED)
unittest {
auto instance1 = DependencyContainer.getInstance();
auto instance2 = DependencyContainer.getInstance();
assert(instance1 is instance2, "getInstance does not return the same instance");
}
// Test resolve single instance for type // Test resolve single instance for type
unittest { unittest {
auto container = new shared DependencyContainer(); auto container = new shared DependencyContainer();