> On Feb. 10, 2014, 6:26 p.m., Tom Beerbower wrote:
> > Minor :
> > 
> > Would it be better to use ...
> > 
> >     if (object instanceof String) {
> > 
> > instead of ... 
> > 
> >     if (object != null && object.getClass().equals(String.class)){
> > 
> > ?
> 
> Nate Cole wrote:
>     I agree with Tom - I've also used String.class.isInstance(object)

My personal preference is 'object instanceof String' simply because it reads 
more like how you would describe the line in English, which makes the code much 
easier to read.  Sort of like how 'myString.equals("FOO")' is much easier to 
read than '"FOO".equals(myString)' (which drives me nuts).


- Tom


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17596/#review34089
-----------------------------------------------------------


On Feb. 5, 2014, 4:54 p.m., Dmytro Shkvyra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/17596/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2014, 4:54 p.m.)
> 
> 
> Review request for Ambari, Mahadev Konar, Nate Cole, Tom Beerbower, and 
> Yusaku Sako.
> 
> 
> Bugs: AMBARI-4490
>     https://issues.apache.org/jira/browse/AMBARI-4490
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The cause of error messages is that we start use new format properties like 
> "dfs.datanode.http.address":"0.0.0.0:${ambari.dfs.datanode.http.port}".
> It means that we have to replace ${ambari.dfs.datanode.http.port} with value 
> of ambari.dfs.datanode.http.port property from current config.
> In this case we need process these value references and keep in mind that:
> 1) We can have some references in one property, like this 
> "dfs.datanode.http.address":"${ambari.dfs.datanode.http.host}:${ambari.dfs.datanode.http.port}"
> 2) Also value references can be referenced to another references.
> 3) Patch have to impact all configs
> So, I have created private method postProcessPropertyValue in 
> ResourceImpl.java for resolve all of value references
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
>  f39893c 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
>  1a1bad6 
> 
> Diff: https://reviews.apache.org/r/17596/diff/
> 
> 
> Testing
> -------
> 
> Added unitests
> 
> 
> Thanks,
> 
> Dmytro Shkvyra
> 
>

Reply via email to