Note that there are some explanatory texts on larger screens.

plurals
  1. POnull pointer exception in reading tsv file
    primarykey
    data
    text
    <p>hi can anybody help me with below code. why this is throwing null pointer exception and how i can avoid it. i am trying to read a tsv file and csv file and do some processing with this. when i am calling getDictionaryValues function it throwing null pointer exception. </p> <pre><code>package com.ugam.qa.tittle; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class TittleMatch { private static TittleMatchUtil tMU; public static void main(String[] args) { String fullname="d:/files/listing/Headphones.tsv"; Set&lt;String&gt; attributeSet=new HashSet&lt;String&gt;(); attributeSet.add("Storage Type"); attributeSet.add("Recording Definition"); attributeSet.add("Type"); attributeSet.add("Brand"); BufferedReader in = null; try { System.out.println("file found"); in= new BufferedReader(new FileReader(fullname)); } catch (FileNotFoundException e1) { e1.printStackTrace(); } String str; String prv_Pid="-1"; try { str = in.readLine(); while ((str = in.readLine()) != null) { if (str.trim().length() == 0 ) { System.out.println("while loop"); continue;} String[] values = str.split("\\t"); //System.out.println(values.length); if(prv_Pid=="-1" || values[9]==prv_Pid) { if(attributeSet.contains(values[12])) { ArrayList&lt;Set&lt;String&gt;&gt; dicValues=new ArrayList&lt;Set&lt;String&gt;&gt;(); if(values[12]!=null &amp;&amp; values[13]!=null) { dicValues=tMU.getDictionaryValues(values[12],values[13]); } //Set&lt;String&gt; tittle=new HashSet&lt;String&gt;(); //tittle.add(values[8]); //System.out.println(tittle); } } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload