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

[JENKINS-39414] - Stapler 1.246 Binary Incompatibility. Part 2 #88

Merged
merged 7 commits into from
Nov 7, 2016

Conversation

oleg-nenashev
Copy link
Member

1.247 didn't fix the issue completely, because there was another incompatible method (getFunctions()), which I have missed somehow.

This change intends to solve the binary compat issue:

  • - Add default implementations for abstract KlassNavigator methods introduced in 1.246
  • - Add Javadocs for the involved methods
  • - Add tests for KlassNavigator#getFunctions()
  • - Add tests for KlassNavigator#getDEclaredMethods() (generally was not required for this PR)
  • - Also provide new API for retrieving info from Methods references Add API for getting info about method name and references in KlassNavigator #86

I've verified that Ruby Runtime plugin starts correctly and shows UIs without errors in System logs after the fix.

https://issues.jenkins-ci.org/browse/JENKINS-39414

@reviewbybees

@rsandell
Copy link
Member

rsandell commented Nov 7, 2016

🐝

// TODO: what to do with Logging? The error must be VERY visible, but it will totally pollute system logs
return Collections.emptyList();
}
return navigator.getDeclaredFields(clazz);
Copy link

Choose a reason for hiding this comment

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

IMHO we need to test this change. You removed the try catch, but are sure that getDeclaredFields never throws an exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was a hack in #85 in order to suppress the binary compatibility issue. Now we solve it by providing default implementations in KlassNavigator. Hence this AbstractMethodError handler is no longer required

@ghost
Copy link

ghost commented Nov 7, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@scherler
Copy link

scherler commented Nov 7, 2016

@oleg-nenashev ok thanks for the clarification 🐝

@oleg-nenashev
Copy link
Member Author

@reviewbybees done

@ghost
Copy link

ghost commented Nov 7, 2016

This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging.

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

🐝

* @param clazz Class
* @return List of the fields functions declared for the class.
* By default this list is empty, {@link KlassNavigator} implementations are responsible to implement it.
* @since 1.246
Copy link
Member

Choose a reason for hiding this comment

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

BTW getDeclaredMethods was also added as abstract somewhat recently (1.220), but I suppose if this caused problems we would have hit them long since.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I decided not to touch that code. Ruby Runtime has a dep on a greater version

* @since 1.248
*/
@CheckForNull
public String getName() {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a proposed caller for this, or is it just KlassTest?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this API is generally useful, e.g. for diagnostic purposes. Right now just in KlassTest and RubyKlassNavigatorTest. The latter one is supposed to be an external lib.

MyRubyClass(Ruby runtime) {
super(runtime);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Gratuitous whitespace changes.

@jglick jglick merged commit efce501 into jenkinsci:master Nov 7, 2016
@jglick
Copy link
Member

jglick commented Apr 17, 2018

FTR this corrects a regression introduced in #77. jenkinsci/ruby-runtime-plugin#4 or its port to jenkins.rb would be needed for a full fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants