Skip to content

Conversation

@anantk24
Copy link
Contributor

anant and others added 11 commits August 16, 2021 21:25
- Defined hash code api
- added null check and class check in equals api
- Modified access modifiers according to JLS.
…ogs.

- Updated command in maven github workflow.
- Added default and contributor profile
- Updated read me doc and contributing doc.
Minor edit for punctuation.
`mvn test` will still run, but does nothing. This would be surprising to anyone running this build. So I added back the `mvn test` line with some info about the contributor profile.
- When offsetInDecimalSeconds is NAN then it is considered as 0.0d
- When offsetInDecimalSeconds is NAN then it is considered as 0.0d
@Test
void testNanWithNegativeAdd() {
DateTimeStamp dateTimeStamp = new DateTimeStamp("2018-04-04T10:09:59.586-0100");
DateTimeStamp forComparing = new DateTimeStamp("2018-04-04T10:10:00.586-0100").add(-1);
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 this be minus(Double.NaN)?

@dsgrieve
Copy link
Contributor

Would you mind looking at all of the DateTimeStamp API that takes a double?

  • There is a hole in the constructor where new DateTimeStamp((String)null, Double.NaN) sets timeStamp = Double.NaN
  • before/after(Double.NaN) both return false (because they compare with inequality). Double.compareTo handles NaN, but if we interpret NaN as zero, then it doesn't do the right thing. I mean, Double.compareTo(42d, Double.NaN) returns -1 where we want Double.compareTo(42d, 0.0d) (which returns 1).

@karianna karianna added the bug Something isn't working label Aug 19, 2021
@anantk24
Copy link
Contributor Author

Would you mind looking at all of the DateTimeStamp API that takes a double?

  • There is a hole in the constructor where new DateTimeStamp((String)null, Double.NaN) sets timeStamp = Double.NaN
  • before/after(Double.NaN) both return false (because they compare with inequality). Double.compareTo handles NaN, but if we interpret NaN as zero, then it doesn't do the right thing. I mean, Double.compareTo(42d, Double.NaN) returns -1 where we want Double.compareTo(42d, 0.0d) (which returns 1).

Yes sure will look for all api.

@anantk24
Copy link
Contributor Author

anantk24 commented Aug 23, 2021

@dsgrieve @karianna @pliakas Any guess why this is failing ?
My branch is up to date. I haven't changed any file in workflow, looks like some step from my side is missing.
I am not able to understand the root cause?
Any suggestion? Thanks !

@dsgrieve
Copy link
Contributor

@anantk24 It's looking for a file DateTimeStampNaN which it can't find. Is this a file you created? If so, it was never pushed.

@anantk24
Copy link
Contributor Author

anantk24 commented Aug 24, 2021

@anantk24 It's looking for a file DateTimeStampNaN which it can't find. Is this a file you created? If so, it was never pushed.

It is the branch I have created , trying to create pull request from the same.
commits into microsoft:main from anantk24:DateTimeStampNAN
I tried creating different pull request from diff branch #54 . It failed there too.

@dsgrieve
Copy link
Contributor

It looks like the build script is trying to commit the badges to gctoolkit and not your fork, which I guess makes sense. Maybe there needs to be a different script for PRs that doesn't do the badging. Or maybe there is some config for the commit script that's missing. IDK. New territory for me. I need to investigate.

@dsgrieve
Copy link
Contributor

@anantk24 - I pushed a fix for the badge commit. Please pull from gctoolkit/main

@anantk24
Copy link
Contributor Author

It looks like the build script is trying to commit the badges to gctoolkit and not your fork, which I guess makes sense. Maybe there needs to be a different script for PRs that doesn't do the badging. Or maybe there is some config for the commit script that's missing. IDK. New territory for me. I need to investigate.

@dsgrieve - Thanks for update. I was thinking on similar lines, opened discussion #52 for the same. Automatic badge update is available in markdown and through supported code analysis server.

@anantk24
Copy link
Contributor Author

@anantk24 - I pushed a fix for the badge commit. Please pull from gctoolkit/main

@dsgrieve Thanks for changes. Pulled changes from main. It failed again . Is it working for everyone else?

@dsgrieve
Copy link
Contributor

I'm not sure why this worked for my PR and not yours, unless it has to do with some mojo I have that you do not. Maybe committing the badge doesn't make sense for a PR build. But the git-auto-commit-action doc implies it should work for the PR. Maybe it's the detached head state of the checkout. Maybe the workaround is to have a separate PR workflow yaml.

@dsgrieve
Copy link
Contributor

I just recreated the issue by checking out your pr, setting upstream to my fork, and then creating a PR from there (PR #57).

The reason it happens on your branch and not others is that you added tests, thus changing the badge, resulting in an attempt to do the commit.

The answer, I believe, lies somewhere in the branch option of the git-auto-commit-action.

@dsgrieve dsgrieve merged commit 2f379de into microsoft:main Aug 24, 2021
@dsgrieve
Copy link
Contributor

Thanks again, @anantk24!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants