You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by mbreslow <gi...@git.apache.org> on 2016/01/29 17:13:42 UTC
[GitHub] activemq pull request: Fix AMQ-6150 (Found 3 instances of impossib...
GitHub user mbreslow opened a pull request:
https://github.com/apache/activemq/pull/166
Fix AMQ-6150 (Found 3 instances of impossible casts in the activemq code)
Running static analysis on activemq I was able to identify 3 instances of impossible casts in the code. This pull request resolves them.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DevFactory/activemq AMQ-6150-fix-impossible-cast-issues
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq/pull/166.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #166
----
commit 364e10d40569042595ec27ae710c2fd687fa2746
Author: Marc Breslow <ma...@devfactory.com>
Date: 2016-01-28T21:39:29Z
Fix Impossible Cast issues in MemoryTopicSub:
- recoverSubscription()
-- map is defined as LinkedHashMap<MessageId, Message>
-- msg is defined as <map> entry.getValue() so must be a Message
-- condition if (msg.getClass() == MessageId.class) could never be true
-- no need to cast at all when using generics
- recoverNextMessages()
-- basically same code copy/pasted so same fix
commit 61f951d0c811b8c9dcde306fa7843aadce70d199
Author: Marc Breslow <ma...@devfactory.com>
Date: 2016-01-29T15:51:18Z
Removed 2 conditions from ServerSessionPoolImpl that would result in impossible casts. Conditions removed were trying to cast ActiveMQQueueSession and ActiveMQTopicSession to ActiveMQSession which is illegal.
Since it isn't obvious what to do if you get an ActiveMQQueueSession or ActiveMQTopicSession from getServerSession() I make it fall back to the else condition which raises an async exception. This is better than getting a ClassCastException at runtime.
commit f177a52c62336115dc3df7af0694851046ae670c
Author: Marc Breslow <ma...@devfactory.com>
Date: 2016-01-29T16:00:31Z
Remove impossible cast in MemoryMessageStore
commit 509fe1ce8f3e1a6b5b64be4a027487e9c11737a6
Author: Marc Breslow <ma...@devfactory.com>
Date: 2016-01-29T16:11:30Z
Merge branch 'master' into AMQ-6150-fix-impossible-cast-issues
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] activemq pull request: Fix AMQ-6150 (Found 3 instances of impossib...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/activemq/pull/166
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---