Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException #2

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments
Open

NullPointerException #2

GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Compile and run Rev 78 
2. Click to "PORT CONFIG"
3. Click to "Main"

What is the expected output? What do you see instead?
NullPointerException, the app closes.

What version of the product are you using? On what operating system?
Asus Transformer 101, Android 4.0.3

Please provide any additional information below.

The NullPointer Exception happens at    mApp.setSerialPortConfigSelections. It 
looks like the HashTables are not filled correctly, due to wrong string 
comparisons (== instead of .equals()).

Original issue reported on code.google.com by gerth...@gmail.com on 13 May 2012 at 12:50

@GoogleCodeExporter
Copy link
Author

The wrong string comparisons happen for example here:

//stop bits hashmap
        for(String str: stop_bits_list){
            if(str == "1"){
                mStopBitsHashMap.put(str, FTDI_Constants.STOP_BITS_1);
            }else if(str == "1.5"){
                mStopBitsHashMap.put(str, FTDI_Constants.STOP_BITS_15);
            }else if(str == "2"){
                mStopBitsHashMap.put(str, FTDI_Constants.STOP_BITS_2);
            }
        }

Original comment by gerth...@gmail.com on 13 May 2012 at 12:51

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Indeed, changing all '==' to equals() solves this problem.

Original comment by giorgos...@gmail.com on 11 Jun 2012 at 4:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant