camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <>
Subject About 2 commits of today...
Date Mon, 18 Nov 2013 19:59:49 GMT

Just spotted couple of things on the commit mailing list of today:

This commit now makes the following asserts passing:

  assertStartsWith((String[]) null, "foo");
  assertStartsWith(new String[] {}, "foo");
  assertStartsWith((Collection<String>) null, "foo");
  assertStartsWith(new ArrayList<String>(), "foo");

Which is actually wrong as that would be wrong to claim that e.g. the
String "foo" is an element of a given empty collection. Other than that
this change does not actually fix the failing test as the problem is
something else, namely there're elements inside the given array/collection
which do NOT start with the given prefix. So maybe a better approach would
be to change the asserts from:



  assertTrue("'" + value + "' does not start with the prefix: '" + prefix
+ "'!", value.startsWith(prefix));

So we get an idea about what actually is going wrong on ubuntu. See also
the note inside the checkProtocols() method of this test class.

- The following getters are missing: getProvider() / getSchemaLocation() /
getSchemaLocations() for the properties being newly introduced.
- Instead of:

  JSONProvider jsonProvider = new JSONProvider();

We could better do:

  JSONProvider<Object> jsonProvider = new JSONProvider<Object>();

- There's no benefit of the following generic List type newly introduced
by the API:

  public void setProviders(List<? extends Object> providers)...

As <?> is as good as <? extends Object> so maybe better do:

  public void setProviders(List<?> providers)...


...Every type variable declared as a type parameter has a bound. If no
bound is declared for a type variable, Object is assumed.


View raw message