<?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 Re: Switch on String in tJava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232316#M22323</link>
    <description>Hi&amp;nbsp;
&lt;BR /&gt;It is a compilation error, can you show us the Java code on tJava component?
&lt;BR /&gt;Shong</description>
    <pubDate>Thu, 22 Jan 2015 14:15:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-22T14:15:57Z</dc:date>
    <item>
      <title>Switch on String in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232315#M22322</link>
      <description>Hello,&lt;BR /&gt;While using the tJava component we have an error when switching on a String:&lt;BR /&gt;&lt;PRE&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problem: &lt;BR /&gt;	Cannot switch on a value of type String. Only convertible int values or enum constants are permitted&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;Talend is however configured to use a Java 7 JRE:&lt;BR /&gt;&lt;BR /&gt;How is that possible ?&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan.</description>
      <pubDate>Thu, 22 Jan 2015 14:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232315#M22322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-22T14:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Switch on String in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232316#M22323</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;It is a compilation error, can you show us the Java code on tJava component?
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 22 Jan 2015 14:15:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232316#M22323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-22T14:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Switch on String in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232317#M22324</link>
      <description>Hi,&lt;BR /&gt;Here is the code.&lt;BR /&gt;I can't seem to add a screenshot though. It shows on my upload list and the editor but not in the final post.&lt;BR /&gt;&lt;PRE&gt;switch (input_row.TYPE) {&lt;BR /&gt;	case "A" :&lt;BR /&gt;		context.table = "a";&lt;BR /&gt;		break;&lt;BR /&gt;	case "B" :&lt;BR /&gt;		context.table = "b";&lt;BR /&gt;		break;&lt;BR /&gt;	case "C" :&lt;BR /&gt;		context.table = "b";&lt;BR /&gt;		break;&lt;BR /&gt;	case "D" :&lt;BR /&gt;		context.table = "c";&lt;BR /&gt;		break;&lt;BR /&gt;	case "E" :&lt;BR /&gt;		context.table = "d";&lt;BR /&gt;		break;&lt;BR /&gt;	default :&lt;BR /&gt;		throw new IllegalArgumentException("Unknown truncate action !");&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;And the error message :&lt;BR /&gt;&lt;PRE&gt;Starting job a at 09:53 23/01/2015.&lt;BR /&gt; connecting to socket on port 3837&lt;BR /&gt; connected&lt;BR /&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problem: &lt;BR /&gt;	Cannot switch on a value of type String. Only convertible int values or enum constants are permitted&lt;BR /&gt;	at a.b.c.tFileInputDelimited_1Process(c.java:589)&lt;BR /&gt;	at a.b.c.runJobInTOS(c.java:914)&lt;BR /&gt;	at a.b.c.main(c.java:757)&lt;BR /&gt;Job a ended at 09:53 23/01/2015. &lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan.</description>
      <pubDate>Fri, 23 Jan 2015 09:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232317#M22324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T09:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Switch on String in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232318#M22325</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;It is a basic Java issue, you can't use string type in switch statement expression with your JDK version, see&amp;nbsp; 
&lt;BR /&gt; 
&lt;A href="http://stackoverflow.com/questions/6231907/java-7-switch-statement-with-strings-not-working" rel="nofollow noopener noreferrer"&gt;http://stackoverflow.com/questions/6231907/java-7-switch-statement-with-strings-not-working&lt;/A&gt; 
&lt;BR /&gt; 
&lt;A href="http://stackoverflow.com/questions/338206/why-cant-i-switch-on-a-string" rel="nofollow noopener noreferrer"&gt;http://stackoverflow.com/questions/338206/why-cant-i-switch-on-a-string&lt;/A&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 26 Jan 2015 02:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Switch-on-String-in-tJava/m-p/2232318#M22325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-26T02:20:23Z</dc:date>
    </item>
  </channel>
</rss>

