[
https://issues.apache.org/jira/browse/ARIES-1105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Kordowski updated ARIES-1105:
----------------------------------
Description:
Hi,
org.apache.aries.application.impl.ApplicationMetadataImpl
org.apache.aries.application.impl.DeploymentMetadataImpl
show several null-check problems:
* setup(Manifest) method:
this.appScope = this.appSymbolicName + "_" + this.appVersion.toString();
if (this.appSymbolicName == null || this.appVersion == null) {
-> either running into a NPE in the first place or the check is unnecessary
* DeploymentMetadataImpl(Map):
if (map != null) {
for (Map.Entry<String, String> entry : map.entrySet()) {
attributes.putValue(entry.getKey(), entry.getValue());
}
}
parseDeploymentContent(map.get(AppConstants.DEPLOYMENT_CONTENT),
_deploymentContent);
-> what if map is null
* DeploymentMetadataImpl(AriesApplication, Set):
if ((appContentRange == null) && (useBundleRange == null)){
_provisionSharedContent.add(dp);
} else if (appContentRange.matches(info.getVersion())) {
_deploymentContent.add(dp);
} else if (useBundleRange.matches(info.getVersion())) {
_deployedUseBundleContent.add(dp);
}
-> what if only one variable is null
Best regards,
Jens
was:
Hi,
the implementation of the store(File) function in both
org.apache.aries.application.impl.ApplicationMetadataImpl and
org.apache.aries.application.impl.DeploymentMetadataImpl
can run into an IOException while not closing the resource.
Best regards,
Jens
> Insufficient null-checks
> ------------------------
>
> Key: ARIES-1105
> URL: https://issues.apache.org/jira/browse/ARIES-1105
> Project: Aries
> Issue Type: Bug
> Components: Application
> Reporter: Jens Kordowski
>
> Hi,
> org.apache.aries.application.impl.ApplicationMetadataImpl
> org.apache.aries.application.impl.DeploymentMetadataImpl
> show several null-check problems:
> * setup(Manifest) method:
> this.appScope = this.appSymbolicName + "_" + this.appVersion.toString();
> if (this.appSymbolicName == null || this.appVersion == null) {
> -> either running into a NPE in the first place or the check is unnecessary
> * DeploymentMetadataImpl(Map):
> if (map != null) {
> for (Map.Entry<String, String> entry : map.entrySet()) {
> attributes.putValue(entry.getKey(), entry.getValue());
> }
> }
> parseDeploymentContent(map.get(AppConstants.DEPLOYMENT_CONTENT),
> _deploymentContent);
> -> what if map is null
> * DeploymentMetadataImpl(AriesApplication, Set):
> if ((appContentRange == null) && (useBundleRange == null)){
> _provisionSharedContent.add(dp);
> } else if (appContentRange.matches(info.getVersion())) {
> _deploymentContent.add(dp);
> } else if (useBundleRange.matches(info.getVersion())) {
> _deployedUseBundleContent.add(dp);
> }
> -> what if only one variable is null
> Best regards,
> Jens
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira