MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / deprecated

Method deprecated

src/test/java/org/htmlunit/CodeStyleTest.java:445–460  ·  view source on GitHub ↗

Verifies that deprecated tag is followed by "As of " or "since ", and '@Deprecated' annotation follows.

(final List<String> lines, final String relativePath)

Source from the content-addressed store, hash-verified

443 * Verifies that deprecated tag is followed by "As of " or "since ", and '@Deprecated' annotation follows.
444 */
445 private void deprecated(final List<String> lines, final String relativePath) {
446 int i = 0;
447 for (String line : lines) {
448 line = line.trim().toLowerCase(Locale.ROOT);
449 if (line.startsWith("* @deprecated")) {
450 if (!line.startsWith("* @deprecated as of ") && !line.startsWith("* @deprecated since ")) {
451 addFailure(relativePath, i + 1,
452 "@deprecated must be immediately followed by \"As of \" or \"since \"");
453 }
454 if (!getAnnotations(lines, i).contains("@Deprecated")) {
455 addFailure(relativePath, i + 1, "No \"@Deprecated\" annotation");
456 }
457 }
458 i++;
459 }
460 }
461
462 /**
463 * Returns all annotation lines that comes after the given 'javadoc' line.

Callers 13

processMethod · 0.95
dojo.jsFile · 0.80
behavior.jsFile · 0.80
ready.jsFile · 0.80
script.jsFile · 0.80
iframe.jsFile · 0.80
kernel.jsFile · 0.80
html.jsFile · 0.80
dojo.jsFile · 0.80
NodeList.jsFile · 0.80

Calls 5

addFailureMethod · 0.95
getAnnotationsMethod · 0.95
trimMethod · 0.80
containsMethod · 0.65
startsWithMethod · 0.45

Tested by

no test coverage detected