> On Dec. 19, 2014, 2:36 a.m., Eric Olander wrote:
> > core/src/main/scala/kafka/tools/ConsoleProducer.scala, line 269
> > <https://reviews.apache.org/r/29231/diff/1/?file=797000#file797000line269>
> >
> >     remove() returns the value assigned to the key being removed, so you 
> > could simply do:
> >     
> >     topic = props.remove("topic")
> >     
> >     instead of the getProperty() and remove()
> 
> Gwen Shapira wrote:
>     Will do. Thanks for the tip, Eric :)

So, I forgot that the underlying implementation of Properties is stupid - it is 
HashMap<Object, Object> instead of HashMap<String, String> which its API covers 
for. So, the remove() is going to return an Object rather than a String, so 
you'd have to add a cast to handle that.  Anyway, that might be more convoluted 
than what you have.  And I'm sure moving away from using Properties is a far 
more invasive change.  So, sorry to have sent you donw that rabbit hole.


- Eric


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


On Dec. 19, 2014, 1:56 a.m., Gwen Shapira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29231/
> -----------------------------------------------------------
> 
> (Updated Dec. 19, 2014, 1:56 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1824
>     https://issues.apache.org/jira/browse/KAFKA-1824
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> fixing accidental return of "WARN Property topic is not valid"
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/tools/ConsoleProducer.scala 
> 1061cc74fac69693836f1e75add06b09d459a764 
> 
> Diff: https://reviews.apache.org/r/29231/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gwen Shapira
> 
>

Reply via email to