Source:
<code>public CertificateController(LocalPreferences localPreferences) { if (localPreferences == null) { throw new IllegalArgumentException("localPreferences cannot be null"); } this.localPreferences = localPreferences; certificates = new ArrayList<>(); tableModel = new DefaultTableModel() { public Class<?> getColumnClass(int column) { switch (column) { case 0: return String.class; case 1: return String.class; case 2: return String.class; case 3: return String.class; case 4: return Boolean.class; default: <START> return String.class; <END> } } }; tableModel.setColumnIdentifiers(COLUMN_NAMES); certEntry = new Object[NUMBER_OF_COLUMNS]; try { FileInputStream input = new FileInputStream(localPreferences.getTrustStorePath()); trustStore = KeyStore.getInstance(localPreferences.getPKIStore().toString()); trustStore.load(input, localPreferences.getTrustStorePassword().toCharArray()); Enumeration store = trustStore.aliases(); while (store.hasMoreElements()) { String alias = (String) store.nextElement(); X509Certificate certificate = (X509Certificate) trustStore.getCertificate(alias); certificates.add(new CertificateModel(certificate, alias)); } for (CertificateModel cert : certificates) { certEntry[0] = cert.getAlias(); certEntry[1] = cert.getIssuer(); certEntry[2] = cert.getSubject(); certEntry[3] = cert.isValid(); certEntry[4] = cert.isExempted(); tableModel.addRow(certEntry); } } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e) { Log.warning("Cannot acces Truststore, it might be not set up", e); } }</code><technical_language>5 columns now, correct? default block executed, I think? If correct, instead of running a value, throw unchecked exception, a bug in code if state reached</technical_language>

Target:
public CertificateController(LocalPreferences localPreferences) { if (localPreferences == null) { throw new IllegalArgumentException("localPreferences cannot be null"); } this.localPreferences = localPreferences; certificates = new ArrayList<>(); tableModel = new DefaultTableModel() { public Class<?> getColumnClass(int column) { switch (column) { case 0: return String.class; case 1: return String.class; case 2: return Boolean.class; default: throw new RuntimeException("Cannot assign classes for columns"); } } }; tableModel.setColumnIdentifiers(COLUMN_NAMES); certEntry = new Object[NUMBER_OF_COLUMNS]; try { FileInputStream input = new FileInputStream(localPreferences.getTrustStorePath()); trustStore = KeyStore.getInstance(localPreferences.getPKIStore().toString()); trustStore.load(input, localPreferences.getTrustStorePassword().toCharArray()); Enumeration store = trustStore.aliases(); while (store.hasMoreElements()) { String alias = (String) store.nextElement(); X509Certificate certificate = (X509Certificate) trustStore.getCertificate(alias); certificates.add(new CertificateModel(certificate, alias)); } for (CertificateModel cert : certificates) { if (cert.getSubjectCommonName() != null) { certEntry[0] = cert.getSubjectCommonName(); } else { certEntry[0] = cert.getSubject(); } certEntry[1] = cert.getValidityStatus(); certEntry[2] = cert.isExempted(); tableModel.addRow(certEntry); } } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e) { Log.warning("Cannot access Truststore, it might be not set up", e); } }