You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2014/09/29 23:40:15 UTC

git commit: kafka-1618 (followup); Exception thrown when running console producer with no port number for the broker; patched by Balaji Seshadri; reviewed by Jun Rao

Repository: kafka
Updated Branches:
  refs/heads/trunk a9c7d7724 -> 6861d4688


kafka-1618 (followup); Exception thrown when running console producer with no port number for the broker; patched by Balaji Seshadri; reviewed by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6861d468
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6861d468
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6861d468

Branch: refs/heads/trunk
Commit: 6861d4688ad044447881bfff22a1183ed8b6fc9e
Parents: a9c7d77
Author: BalajiSeshadri <ba...@dish.com>
Authored: Mon Sep 29 14:40:09 2014 -0700
Committer: Jun Rao <ju...@gmail.com>
Committed: Mon Sep 29 14:40:09 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/utils/ToolsUtils.scala | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6861d468/core/src/main/scala/kafka/utils/ToolsUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/utils/ToolsUtils.scala b/core/src/main/scala/kafka/utils/ToolsUtils.scala
index cfbf279..fef9392 100644
--- a/core/src/main/scala/kafka/utils/ToolsUtils.scala
+++ b/core/src/main/scala/kafka/utils/ToolsUtils.scala
@@ -17,19 +17,17 @@
 package kafka.utils
 
 import joptsimple.OptionParser
-import scala.util.matching.Regex
 
 object ToolsUtils {
 
   def validatePortOrDie(parser: OptionParser, hostPort: String) = {
-    val regex = new Regex(":[0-9]")
     val hostPorts: Array[String] = if(hostPort.contains(','))
       hostPort.split(",")
     else
       Array(hostPort)
     val validHostPort = hostPorts.filter {
       hostPortData =>
-        regex.findAllMatchIn(hostPortData).size > 0
+        org.apache.kafka.common.utils.Utils.getPort(hostPortData) != null
     }
     val isValid = !(validHostPort.isEmpty) && validHostPort.size == hostPorts.length
     if(!isValid)