Good code/Bad code

i need to include this in my QA/QC documents :smiley:

Should have been pairing :wink:

I recently discovered this while I was trying to set up code coverage because it was only failing when Clover was instrumenting the code :unsure:

@Test(expected = IllegalArgumentException.class)
@DataConstraints({ “chainPrefix=$.ChainPrefix” })
public void testGetDataConstraintsNullEntity() throws Exception {
Method m = getCurrentMethod((Class[]) null);
DataConstraints dcs = m.getAnnotation(DataConstraints.class);
_dataConstraintsFactory.getDataConstraints(Arrays.asList(dcs.value()), null);

When I asked the dev lead about it we looked at each other and went WTF! :w00t: