Toggle navigation
Home
org.hamcrest.BaseMatcher to org.hamcrest.Matcher
No. of Instances - 4
No. of Commits - 1
No. of Projects - {'error-prone'}
Hierarchy/Composition: R_SUPER_T
Primitive Info: -
NameSpace: External -> External
Mapping:
Cascading Type Change (Similar)
BaseMatcher<Diagnostic<JavaFileObject>>
to
TypeSafeDiagnosingMatcher<Diagnostic<? extends JavaFileObject>>
BaseMatcher<Diagnostic<JavaFileObject>>
to
TypeSafeDiagnosingMatcher<Diagnostic<? extends JavaFileObject>>
BaseMatcher<Diagnostic<JavaFileObject>>
to
TypeSafeDiagnosingMatcher<Diagnostic<? extends JavaFileObject>>
BaseMatcher<Diagnostic<JavaFileObject>>
to
TypeSafeDiagnosingMatcher<Diagnostic<? extends JavaFileObject>>
Update Anonymous class
{ @Override public boolean matches( Object object){ Diagnostic<?> item=(Diagnostic<?>)object; return item.getSource() instanceof JavaFileObject && ((JavaFileObject)item.getSource()).toUri().equals(fileURI) && item.getLineNumber() == line && item.getMessage(Locale.getDefault()).contains(message); } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line ").appendValue(line).appendText(" that contains \n").appendValue(message).appendText("\n"); } }
to
{ @Override public boolean matchesSafely( Diagnostic<? extends JavaFileObject> item, Description mismatchDescription){ if (!item.getSource().toUri().equals(fileURI)) { mismatchDescription.appendText("diagnostic not in file ").appendValue(fileURI); return false; } if (item.getLineNumber() != line) { mismatchDescription.appendText("diagnostic not on line ").appendValue(item.getLineNumber()); return false; } if (!item.getMessage(Locale.getDefault()).contains(message)) { mismatchDescription.appendText("diagnostic does not contain ").appendValue(message); return false; } return true; } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line ").appendValue(line).appendText(" that contains \n").appendValue(message).appendText("\n"); } }
{ @Override public boolean matches( Object object){ Diagnostic<?> item=(Diagnostic<?>)object; return matcher.matches(item.getMessage(Locale.getDefault())); } @Override public void describeTo( Description description){ description.appendText("a diagnostic with message ").appendDescriptionOf(matcher); } }
to
{ @Override public boolean matchesSafely( Diagnostic<? extends JavaFileObject> item, Description mismatchDescription){ if (!matcher.matches(item.getMessage(Locale.getDefault()))) { mismatchDescription.appendText("diagnostic message does not match ").appendDescriptionOf(matcher); return false; } return true; } @Override public void describeTo( Description description){ description.appendText("a diagnostic with message ").appendDescriptionOf(matcher); } }
{ @Override public boolean matches( Object object){ Diagnostic<?> item=(Diagnostic<?>)object; return item.getLineNumber() == line && item.getColumnNumber() == column; } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line:column ").appendValue(line).appendText(":").appendValue(column); } }
to
{ @Override protected boolean matchesSafely( Diagnostic<? extends JavaFileObject> item, Description mismatchDescription){ if (item.getLineNumber() != line) { mismatchDescription.appendText("diagnostic not on line ").appendValue(item.getLineNumber()); return false; } if (item.getColumnNumber() != column) { mismatchDescription.appendText("diagnostic not on column ").appendValue(item.getColumnNumber()); return false; } return true; } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line:column ").appendValue(line).appendText(":").appendValue(column); } }
{ @Override public boolean matches( Object object){ Diagnostic<?> item=(Diagnostic<?>)object; return item.getSource() instanceof JavaFileObject && ((JavaFileObject)item.getSource()).toUri().equals(fileURI) && item.getLineNumber() == line; } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line ").appendValue(line); } }
to
{ @Override public boolean matchesSafely( Diagnostic<? extends JavaFileObject> item, Description mismatchDescription){ if (!item.getSource().toUri().equals(fileURI)) { mismatchDescription.appendText("diagnostic not in file ").appendValue(fileURI); return false; } if (item.getLineNumber() != line) { mismatchDescription.appendText("diagnostic not on line ").appendValue(item.getLineNumber()); return false; } return true; } @Override public void describeTo( Description description){ description.appendText("a diagnostic on line ").appendValue(line); } }