Created
October 23, 2008 17:51
-
-
Save pope/19127 to your computer and use it in GitHub Desktop.
JRuby Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Component { | |
private Integer id; | |
public Integer getID() { return id; } | |
public void setID(id) { this.id = id; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Container { | |
private Integer id; | |
public Integer getID() { return id; } | |
public void setID(id) { this.id = id; } | |
private Integer pieceID; | |
public Integer getPieceID() { return pieceID; } | |
public void setPieceID(id) { this.pieceID = id; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component = Component.new | |
component = componentDao.update(component) # returns a new component, so somewhere in the Java code, the ID is being set | |
container = Container.new | |
container.setPieceID(component.getID) # fail on the setter | |
container.setPieceID(java.lang.Integer.new(component.getID)) # this works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment