This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
there seems to be a bug in the merge function of the schema2beans.jar on this site: http://schema2beans.netbeans.org/files/documents/117/538/schema2beans-4.2.0.zip when I'm merging two graphs with the mergeUpdate method, I do not receive any PropertyChangeEvents when Attributes are changing. Steps to reproduce: generate binding classes with GenBeans for the jasperreports dtd: http://jasperreports.sourceforge.net/dtds/jasperreport.dtd create two report files that differ in one attribute: 8<--------------file1.jrxml--------------->8 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport bottomMargin="30" columnWidth="555" isFloatColumnFooter="true" leftMargin="20" name="TableReport" pageHeight="842" pageWidth="595" rightMargin="20" topMargin="30"> <style fontName="Arial" fontSize="10" isBold="false" isDefault="true" isItalic="false" isPdfEmbedded="false" isStrikeThrough="false" isUnderline="false" name="Arial" pdfEncoding="Cp1252" pdfFontName="Helvetica"/> <background> <band height="17" isSplitAllowed="true"> </band> </background> <title> <band height="47" isSplitAllowed="true"> </band> <!-- do not change this comment--> </title> <pageHeader> <band height="109"> </band> </pageHeader> <detail> <band height="128"> </band> </detail> <columnFooter> <band height="67"> </band> </columnFooter> </jasperReport> 8<--------------file2.jrxml--------------->8 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport bottomMargin="30" columnWidth="555" isFloatColumnFooter="true" leftMargin="20" name="TableReport" pageHeight="842" pageWidth="595" rightMargin="20" topMargin="30"> <style fontName="Arial" fontSize="10" isBold="false" isDefault="true" isItalic="false" isPdfEmbedded="false" isStrikeThrough="false" isUnderline="false" name="Arial" pdfEncoding="Cp1252" pdfFontName="Helvetica"/> <background> <band height="18" isSplitAllowed="true"> </band> </background> <title> <band height="47" isSplitAllowed="true"> </band> <!-- do not change this comment--> </title> <pageHeader> <band height="109"> </band> </pageHeader> <detail> <band height="128"> </band> </detail> <columnFooter> <band height="67"> </band> </columnFooter> </jasperReport> 8<----------------------------->8 write a test class: JasperReport report = JasperReport.createGraph(new File("file1.xml")); final PropertyChangeListener listen = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { System.out.println("event "+evt.getPropertyName()); } }; jasperReport.addPropertyChangeListener(listen); JasperReport report2 = JasperReport.createGraph(new File("file2.xml")); report.merge(report2,BaseBean.MERGE_UPDATE); ----------------------------- expected behaviour: event /JasperReport/Title/Band:Height ----------------------------- observed behaviour: ----------------------------- I only receive events when Elements are updated.
The same is true for the schema2beans module in netbeans 5.5
I made some tests with the library and found out, that the Attributes are set, but there is no PropertyChangeEvent. In BaseBean's mergeTree method there is a check for differences via BeanComparators (isArray is false). If a Difference is found, newValue is set, but apparently never used: if (o3 != o1){ newValue = (c==0)?o3:newValue; } It seems that the attributes, although they are stated in the dtd and part of the generated classes are silently set via Schema2BeansUtil.mergeUnsupportedElements instead. When I change the mergeTree method to merge the Attributes when differences are found I get the behaviour I expected: if (o3 != o1){ newValue = (c==0)?o3:newValue; if (!hasKey && cmp.hasKeyDefined(prop))((BaseBean)o1).mergeAttributes((BaseBean) newValue, mode); } For me this bug is a showstopper, because I'm using classes generated by schema2beans as a datamodel for a multiview editor. My jasperreports module relies on propertychangeevents to synchronize the visual editor with the xml view.
Marking as a duplicate then. *** This issue has been marked as a duplicate of 88200 ***
This bug is NOT a duplicate of #88200. To explain this misconception: I had submitted two bug independent bug reports to the mailing list, because I didn't know how to add it here by then. emononen has added one of these bugs as #88200. The other -independent- bug was added by me here. I mentioned this as a comment on 88200, to thank erno for filing the bug and pjiricka seems to have misinterpreted this and has marked this as a duplicate of #88200. Sorry for the confusion :) , Toni
Should be fixed for 6.0, so setting the TM accordingly.
Needs to be re-evaluated.
update no67 keyword
As this bug does not affect the NetBeans IDE and the Oracle NetBeans team is not planning to address it, I am closing this as WONTFIX. Anyone who would like to take this on and contribute the solution, please reopen and reassign to yourself.