Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Using a uninitialized variable in a Java class crashes the gui and on restart refuses to draw the diagram of the hop.
Example of used code where the relevant variable is "val". If initialized properly everthing is OK. If not, total misery and loss of your hop if you don't know how to fix it:
<transform>
<name>User defined Java class</name>
<type>UserDefinedJavaClass</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<definitions>
<definition>
<class_type>TRANSFORM_CLASS</class_type>
<class_name>Processor</class_name>
<class_source>
public boolean processRow() throws HopException
{
if (first)
{ first = false; }Object[] r = getRow();
if (r == null)
{ setOutputDone(); return false; }Object[] outputRow = createOutputRow(r, data.outputRowMeta.size());
String val;
if (false) { val = "Yes"; }
//else { val = "No"; }
get(Fields.Out, "val").setValue(outputRow,val);
putRow(data.outputRowMeta, outputRow);
return true;
}
</class_source>
</definition>
</definitions>
<fields>
<field>
<field_name>val</field_name>
<field_type>String</field_type>
<field_length>-1</field_length>
<field_precision>-1</field_precision>
</field>
</fields>
<clear_result_fields>N</clear_result_fields>
<info_transforms/>
<target_transforms/>
<usage_parameters/>
<attributes/>
<GUI>
<xloc>288</xloc>
<yloc>176</yloc>
</GUI>
</transform>