<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java equals() selection in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-equals-selection/m-p/1229913#M79273</link>
    <description>&lt;P&gt;In Java, if I try to do.equals() on a null string, a null pointer error is issued. I'm wondering whether I can perform the following if I'm attempting to compare if a string is equal to a constant string:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;MY CONSTANT STRING.equals(aStringVariable)&lt;/LI-CODE&gt;&lt;P&gt;I'm sure it'll work, but is this simply extremely bad code?&lt;BR /&gt;This is a common Java idiom known colloquially as a Yoda condition. Personally, I prefer to handle the null situation directly, but the Yoda method is widely used, and any competent Java programmer should quickly grasp what is going on. How should I proceed?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2022 12:42:22 GMT</pubDate>
    <dc:creator>MubashshirHasan</dc:creator>
    <dc:date>2022-11-09T12:42:22Z</dc:date>
    <item>
      <title>Java equals() selection</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-equals-selection/m-p/1229913#M79273</link>
      <description>&lt;P&gt;In Java, if I try to do.equals() on a null string, a null pointer error is issued. I'm wondering whether I can perform the following if I'm attempting to compare if a string is equal to a constant string:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;MY CONSTANT STRING.equals(aStringVariable)&lt;/LI-CODE&gt;&lt;P&gt;I'm sure it'll work, but is this simply extremely bad code?&lt;BR /&gt;This is a common Java idiom known colloquially as a Yoda condition. Personally, I prefer to handle the null situation directly, but the Yoda method is widely used, and any competent Java programmer should quickly grasp what is going on. How should I proceed?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 12:42:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/java-equals-selection/m-p/1229913#M79273</guid>
      <dc:creator>MubashshirHasan</dc:creator>
      <dc:date>2022-11-09T12:42:22Z</dc:date>
    </item>
  </channel>
</rss>

