groovy

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.5.2, 1.6-rc-2
  • Component/s: bytecode
  • Labels:
    None
  • Number of attachments :
    0

Description

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?

Activity

Hide
blackdrag blackdrag added a comment -

yes, the ClassNode was proxied for a covariant return (Component vs. JComponent) and this was done wrong for primitive types. Should be fixed now.

Show
blackdrag blackdrag added a comment - yes, the ClassNode was proxied for a covariant return (Component vs. JComponent) and this was done wrong for primitive types. Should be fixed now.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: