diff options
author | 2019-03-21 15:05:28 +0100 | |
---|---|---|
committer | 2019-03-21 15:05:28 +0100 | |
commit | 6079b3c8ddff996a64105ca05040cf01d071b304 (patch) | |
tree | cba4e4febeec6c0c7936b7461c27c588bf4bbc7e /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |
parent | Clean up dependencies of the application configuration plugin (diff) | |
download | VIATRA-Generator-6079b3c8ddff996a64105ca05040cf01d071b304.tar.gz VIATRA-Generator-6079b3c8ddff996a64105ca05040cf01d071b304.tar.zst VIATRA-Generator-6079b3c8ddff996a64105ca05040cf01d071b304.zip |
Do not throw exception for empty package names in application configuration files
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend index b049b4c9..35a747c8 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |||
@@ -112,7 +112,7 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
112 | 112 | ||
113 | private def getViatraPackageScope(EObject context, EReference reference, ConfigurationScript document) { | 113 | private def getViatraPackageScope(EObject context, EReference reference, ConfigurationScript document) { |
114 | val patternModelNameConverter = [ PatternModel patternModel | | 114 | val patternModelNameConverter = [ PatternModel patternModel | |
115 | qualifiedNameConverter.toQualifiedName(patternModel.packageName) | 115 | toQualifiedNameOrNull(patternModel.packageName) |
116 | ] | 116 | ] |
117 | Scopes.scopeFor(document.allViatraPackages, patternModelNameConverter, super.getScope(context, reference)) | 117 | Scopes.scopeFor(document.allViatraPackages, patternModelNameConverter, super.getScope(context, reference)) |
118 | } | 118 | } |
@@ -129,7 +129,7 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
129 | 129 | ||
130 | private def getCftPackageScope(EObject context, EReference reference, ConfigurationScript document) { | 130 | private def getCftPackageScope(EObject context, EReference reference, ConfigurationScript document) { |
131 | val cftModelNameConverter = [ CftModel cftModel | | 131 | val cftModelNameConverter = [ CftModel cftModel | |
132 | qualifiedNameConverter.toQualifiedName(cftModel.packageName) | 132 | toQualifiedNameOrNull(cftModel.packageName) |
133 | ] | 133 | ] |
134 | Scopes.scopeFor(document.allCftPackages, cftModelNameConverter, super.getScope(context, reference)) | 134 | Scopes.scopeFor(document.allCftPackages, cftModelNameConverter, super.getScope(context, reference)) |
135 | } | 135 | } |
@@ -143,4 +143,12 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
143 | } | 143 | } |
144 | Scopes.scopeFor(transformations) | 144 | Scopes.scopeFor(transformations) |
145 | } | 145 | } |
146 | |||
147 | private def toQualifiedNameOrNull(String packageName) { | ||
148 | if (packageName === null) { | ||
149 | null | ||
150 | } else { | ||
151 | qualifiedNameConverter.toQualifiedName(packageName) | ||
152 | } | ||
153 | } | ||
146 | } | 154 | } |