@Test public void null_results_in_empty_string() throws Exception { String result = extractorToTest.extractLocation(null); assertEquals("", result); }
public String extractLocation(DocAnnotationData data) { if (data==null) { return ""; } Method method = data.linkedMethod; if (method!=null) { return createMethodIdentifier(method); } Field field = data.linkedField; if (field!=null) { return createFieldIdentifier(field); } Class<?> clazz = data.linkedClass; if (clazz!=null) { return createClassIdentifier(clazz); } return ""; }
AnnotationDataLocationExtractor { public String extractLocation(DocAnnotationData data) { if (data==null) { return ""; } Method method = data.linkedMethod; if (method!=null) { return createMethodIdentifier(method); } Field field = data.linkedField; if (field!=null) { return createFieldIdentifier(field); } Class<?> clazz = data.linkedClass; if (clazz!=null) { return createClassIdentifier(clazz); } return ""; } }
AnnotationDataLocationExtractor { public String extractLocation(DocAnnotationData data) { if (data==null) { return ""; } Method method = data.linkedMethod; if (method!=null) { return createMethodIdentifier(method); } Field field = data.linkedField; if (field!=null) { return createFieldIdentifier(field); } Class<?> clazz = data.linkedClass; if (clazz!=null) { return createClassIdentifier(clazz); } return ""; }  }
AnnotationDataLocationExtractor { public String extractLocation(DocAnnotationData data) { if (data==null) { return ""; } Method method = data.linkedMethod; if (method!=null) { return createMethodIdentifier(method); } Field field = data.linkedField; if (field!=null) { return createFieldIdentifier(field); } Class<?> clazz = data.linkedClass; if (clazz!=null) { return createClassIdentifier(clazz); } return ""; }  String extractLocation(DocAnnotationData data); }
AnnotationDataLocationExtractor { public String extractLocation(DocAnnotationData data) { if (data==null) { return ""; } Method method = data.linkedMethod; if (method!=null) { return createMethodIdentifier(method); } Field field = data.linkedField; if (field!=null) { return createFieldIdentifier(field); } Class<?> clazz = data.linkedClass; if (clazz!=null) { return createClassIdentifier(clazz); } return ""; }  String extractLocation(DocAnnotationData data);  }