Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for IBM JDK 6 #5312

Merged
merged 1 commit into from
May 23, 2015
Merged

Fix for IBM JDK 6 #5312

merged 1 commit into from
May 23, 2015

Conversation

noctarius
Copy link
Contributor

Fixed IBM Java 6 unittest failures. The problems are caused by the ArrayList implementation in that very version of J9. We might want to consider updating it, it is fixed in the latest version, probably the reason I couldn't reproduce it locally.

@pveentjer
Copy link
Contributor

We should not add possible fixes. Either it is a fix or it isn't.

@noctarius
Copy link
Contributor Author

I can't reproduce, I can't fix it surely.

@pveentjer
Copy link
Contributor

I understand it is difficult to fix a problem that is difficult to reproduce. But who says that this fixes the problem? Perhaps it causes new problems.

@noctarius
Copy link
Contributor Author

Well at least it fixes the Iterator contract which doesn't require to call Iterator::hasNext before Iterator::next and I guess on IBM that might sometimes happen (depending on the JIT but I can't make it happen locally).

@pveentjer
Copy link
Contributor

I don't see any tests added. And afaik the nature of next has changed since it now throws a NoSuchElementException. So we need to have additional tests for these IteratorFactories.

@noctarius
Copy link
Contributor Author

@pveentjer
Copy link
Contributor

I know how the next works :) But we need to make sure we follow good practices when making code changes, and adding tests is one of them.

@@ -49,6 +50,18 @@ public boolean hasNext() {

@Override
public Map.Entry<K, V> next() {
if (entry == null) {
while (iterator.hasNext()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Shouldn't we set null to entry before next() method returns a value?

@metanet
Copy link
Contributor

metanet commented May 17, 2015

I think this PR should have corresponding unit tests for the iterators.

@@ -48,6 +49,18 @@ public boolean hasNext() {

@Override
public K next() {
if (entry == null) {
while (iterator.hasNext()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't understand how this while loop works. Shouldn't it stop when a valid entry is found?

@@ -240,7 +240,7 @@
-Dhazelcast.test.use.network=false
</argLine>
<includes>
<include>**/**.java</include>
<include>com/hazelcast/replicatedmap/**.java</include>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be reverted when it is about to merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it will be reverted, currently I'm just running the repmap tests in my own jenkins build and running all takes too much time :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the intention, I added note for in case of it is forgotten.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k :P

@noctarius noctarius changed the title Possible fix for IBM JDK 6 Fix for IBM JDK 6 May 18, 2015
@pveentjer
Copy link
Contributor

@Danny-Hazelcast can you verify the modified classes have 87.5% test coverage?

@gurbuzali
Copy link
Contributor

verify

pveentjer added a commit that referenced this pull request May 23, 2015
@pveentjer pveentjer merged commit 726c3ea into hazelcast:master May 23, 2015
@bilalyasar
Copy link
Contributor

seems this PR didn't fix the failures. ( at least for client side)
https://hazelcast-l337.ci.cloudbees.com/job/Hazelcast-3.x-IbmJDK1.6/556/

@noctarius
Copy link
Contributor Author

oops I guess I haven't done anything about client side

@noctarius
Copy link
Contributor Author

As I already mentioned above the bug is actually in the JRE implementation and fixed in newer version, therefore this is not a real bugfix but a workaround (in the test only!) for an old JRE bug.

@noctarius noctarius deleted the fix-repmap-ibm6 branch May 24, 2015 20:49
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Internal PR or issue was opened by an employee Team: Core Type: Defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants