<commit_before>package org.jetbrains.plugins.scala.codeInspection.bundled

import javax.swing.event.TableModelListener
import javax.swing.table.TableModel
import java.util

import com.intellij.openapi.project.Project

import scala.collection.mutable

/**
  * User: Dmitry.Naydanov
  * Date: 06.10.16.
  */
class BundledInspectionsUiTableModel(pathToInspections: util.Map[String, util.ArrayList[String]], 
                                     disabledIds: util.Set[String], project: Project) extends TableModel {
  private val rows = {
    val result = mutable.ArrayBuffer[(java.lang.Boolean, String, String, String)]()

    val idsToNames = BundledInspectionStoreComponent.getInstance(project).getLoadedInspections.map(i => (i.getId, i.getName)).toMap
    val it = pathToInspections.entrySet().iterator()
    
    while (it.hasNext) {
      val entry = it.next()
      val jarName = entry.getKey
      val il = entry.getValue.iterator()
      
      while (il.hasNext) {
        val insName = il.next()
        
        result.+=((new java.lang.Boolean(!disabledIds.contains(insName)), idsToNames.getOrElse(insName, "No name"), insName, jarName))<commit_msg>NPE in settings when default project is open fixed<commit_after>package org.jetbrains.plugins.scala.codeInspection.bundled

import javax.swing.event.TableModelListener
import javax.swing.table.TableModel
import java.util

import com.intellij.openapi.project.Project

import scala.collection.mutable

/**
  * User: Dmitry.Naydanov
  * Date: 06.10.16.
  */
class BundledInspectionsUiTableModel(pathToInspections: util.Map[String, util.ArrayList[String]], 
                                     disabledIds: util.Set[String], project: Project) extends TableModel {
  private val rows = {
    val result = mutable.ArrayBuffer[(java.lang.Boolean, String, String, String)]()

    val idsToNames: Map[String, String] = Option(BundledInspectionStoreComponent.getInstance(project)) match {
      case Some(sc) => sc.getLoadedInspections.map(i => (i.getId, i.getName)).toMap
      case _ => Map.empty
    }
    val it = pathToInspections.entrySet().iterator()
    
    while (it.hasNext) {
      val entry = it.next()
      val jarName = entry.getKey
      val il = entry.getValue.iterator()
      
      while (il.hasNext) {
        val insName = il.next()
        
        result.+=((new java.lang.Boolean(!disabledIds.contains(insName)), idsToNames.getOrElse(insName, "No name"), insName, jarName))
{'fraction_non_alphanumeric': 0.11805555555555555, 'fraction_numerical': 0.004901960784313725, 'mean_word_length': 3.381037567084079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '424203', 'n_tokens_mistral': 761, 'n_tokens_neox': 746, 'n_words': 147}