Shuhrat Dehkanov committed 7e77699

Move a line into try block

Currently, NumberFormatException is never handled as
Integer.parseInt() is called outside try block.
This moves that line inside try block.

Change-Id: I54544f5a665ca0f821de5351001755cb965078dc
Signed-off-by: Shuhrat Dehkanov <>

Comments (0)

Files changed (1)


     private CheckBoxPreference mNotificationPulse;
     private final Configuration mCurConfig = new Configuration();
     private ListPreference mScreenTimeoutPreference;
     private Preference mScreenSaverPreference;
                == false) {
         mScreenTimeoutPreference = (ListPreference) findPreference(KEY_SCREEN_TIMEOUT);
         final long currentTimeout = Settings.System.getLong(resolver, SCREEN_OFF_TIMEOUT,
         return indices.length-1;
     public void readFontSizePreference(ListPreference pref) {
         try {
     public void onResume() {
     public boolean onPreferenceChange(Preference preference, Object objValue) {
         final String key = preference.getKey();
         if (KEY_SCREEN_TIMEOUT.equals(key)) {
-            int value = Integer.parseInt((String) objValue);
             try {
+                int value = Integer.parseInt((String) objValue);
                 Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, value);
             } catch (NumberFormatException e) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.