title: String was passed as argument, but in the function it turned out to be a Rec
body: <p><img src="https://i.stack.imgur.com/NGTGh.jpg" alt="enter image description here">I was developing an android app using java language. 
   The body of the method was below: a string "3" was passed to it as first argument--nextCmdId, but in the method it turned out to be a Rect, and the application crashed.
   Quite odd!! 
  thanks
  BR
  shawn</p>
  
  <pre><code>public String formatSyncTagPreamble(String nextCmdId,
                                      String sourceName,
                                      String sourceUri)
  {
  
      StringBuffer syncTag = new StringBuffer();
  
      syncTag.append("&lt;CmdID&gt;").append(nextCmdId)
             .append("&lt;/CmdID&gt;\n")
             .append("&lt;Target&gt;&lt;LocURI&gt;")
             .append(sourceUri)
             .append("&lt;/LocURI&gt;&lt;/Target&gt;\n")
             .append("&lt;Source&gt;&lt;LocURI&gt;")
             .append(sourceName)
             .append("&lt;/LocURI&gt;&lt;/Source&gt;\n");
  
      return syncTag.toString();
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dKrf2.jpg" alt="enter image description here"></p>