Skip to content

Static For Each#18757

Merged
jdconrad merged 21 commits intoelastic:masterfrom
jdconrad:each
Jun 7, 2016
Merged

Static For Each#18757
jdconrad merged 21 commits intoelastic:masterfrom
jdconrad:each

Conversation

@jdconrad
Copy link
Copy Markdown
Contributor

@jdconrad jdconrad commented Jun 6, 2016

Added the ability to use Java-style for each loops on non-def target types.

Also added some documentation in a few other places.

void write(MethodWriter writer) {
// can cause class cast exception among other things at runtime
writer.writeDebugInfo(location);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we want to restore the debug information here? since it can hit classcastexception in other cases, its safe to just do it always?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me. I wasn't sure it was safe given that it was only cat before.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

its always safe to emit debug information. I've been trying to do it 'smartly' but if things are dicey, its not the end of the world to emit "extra useless" debug info. In this case I know its needed for some error cases (by inspecting error messages from our test), that is why i changed it recently

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. Fixed.

@jdconrad jdconrad mentioned this pull request Jun 6, 2016
18 tasks
@rmuir
Copy link
Copy Markdown
Contributor

rmuir commented Jun 7, 2016

+1 this is a big win.

@jdconrad
Copy link
Copy Markdown
Contributor Author

jdconrad commented Jun 7, 2016

Thanks @rmuir for the review!

@jdconrad jdconrad merged commit 3dfe2bb into elastic:master Jun 7, 2016
@jdconrad jdconrad deleted the each branch June 7, 2016 23:16
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Plugin Lang Painless labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement v5.0.0-alpha4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants