Issue Details (XML | Word | Printable)

Key: GROOVY-2501
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Danno Ferrin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Java.lang.VerifyError... signature: (Ljavax/swing/JTable;Ljava/lang/Object;Lboolean;Lboolean;Lint;Lint;)Ljava/awt/Component;)

Created: 14/Jan/08 02:14 PM   Updated: 17/Jan/08 09:58 AM
Component/s: bytecode
Affects Version/s: 1.5.1
Fix Version/s: 1.5.2, 1.6-rc-2

Time Tracking:
Not Specified


 Description  « Hide
This script...
import groovy.swing.SwingBuilder
import javax.swing.*
import javax.swing.table.*

class MyRenderer extends DefaultTableCellRenderer {
    public JComponent getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)  {
        println "value: $value, selected: $isSelected, focus: $hasFocus, row: $row, column: $column"
        return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column)
    }
}

def data = [
  [nick:'MrG', full:'Guillaume Laforge'],
  [nick:'jez', full:'Jeremy Rayner' ],
  [nick:'fraz', full:'Franck Rasolo' ],
  [nick:'sormuras', full:'Christian Stein' ],
  [nick:'blackdrag', full:'Jochen Theodorou' ],
  [nick:'Mittie', full:'Dierk Koenig' ]
]

def swing = new SwingBuilder()
def frame = swing.frame(title:'Table Demo') {
    scrollPane {
        table(id:'table') {
            tableModel(list:data) { 
                propertyColumn(header:'Nickname', propertyName:'nick') 
                propertyColumn(header:'Full Name', propertyName:'full') 
            }
        }
    }
}

swing.table.setDefaultRenderer(Object, new MyRenderer())
swing.table.setDefaultRenderer(String, new MyRenderer())

frame.pack()
frame.show()

creates this error

java.lang.VerifyError: (class: MyRenderer, method: getTableCellRendererComponent signature: (Ljavax/swing/JTable;Ljava/lang/Object;Lboolean;Lboolean;Lint;Lint;)Ljava/awt/Component;) Register 3 contains wrong type
	at Script0.class$(Script0)
	at Script0.run(Script0:33)

Shouldn't the signature be class: MyRenderer, method: getTableCellRendererComponent signature: (Ljavax/swing/JTable;Ljava/lang/Object;ZZII)Ljava/awt/Component ? Are we encoding primitives wrong in some cases?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 17/Jan/08 09:58 AM
yes, the ClassNode was proxied for a covariant return (Component vs. JComponent) and this was done wrong for primitive types. Should be fixed now.