java - Default detail formatter for arrays in Eclipse -
java - Default detail formatter for arrays in Eclipse -
when debugging java programme in eclipse, in variables view, when highlight variable prints detail variable in pane below. pane called "detail view," , value displayed "detail" variable. default, result of calling .tostring()
on variable. eclipse allows specify , customize "detail formatters" arbitrary objects maps them more helpful , descriptive strings in view.
my question this: .tostring() method invoked on array (say of integers) returns unhelpful memory address. however, when highlight array variable in debug mode, eclipse seems intelligently parse helpful comma-delimited string (e.g. "[42, 13, null, 19]"
). gather means eclipse has established default detail formatter arrays helpful functionality. does know how can leverage detail formatter in code avoid rewriting identical logic?
in case you're interested, motivation generating contents of in clause sql query. is, i'm trying generate sql query:
select * table id in (1,2,3)
from on arbitrary int[]:
int[] ids = new int[] {1,2,3}
i realize accomplish writing loop, using stringbuilder, etc., wondering if eclipse has done me , exposes helpful method (read: exceedingly lazy)
eclipse uses arrays.tostring
, if want utilize parentheses instead of square brackets, might want utilize guava:
return "(" + ints.join(",", array) + ")";
java sql eclipse debugging
Comments
Post a Comment