<commit_before>package org.wms.controller.orderedit;

import java.util.List;

import javax.swing.table.AbstractTableModel;

import org.wms.model.order.Order;
import org.wms.model.order.OrderRow;

public class MaterialListTableModel extends AbstractTableModel {
	
	private Order order;
	
	private String[] headers = {"Code", "Quantity"};
	
	public MaterialListTableModel(Order order) {
		super();
		this.order = order;
	}

	@Override
	public int getRowCount() {
		return order.getMaterials().size();
	}

	@Override
	public int getColumnCount() {
		return headers.length;
	}
	
	@Override
	public String getColumnName(int column) {
		return headers[column];
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		OrderRow row = (OrderRow) order.getMaterials().toArray()[columnIndex];
		
		switch (columnIndex) {
		case 0:
			return row.getMaterial();
		case 1:
			return row.getQuantity();
		default:
			break;
		}
		
		return "Unknow column: " + columnIndex;
	}
	

}
<commit_msg>fixes typos<commit_after>package org.wms.controller.orderedit;

import java.util.List;

import javax.swing.table.AbstractTableModel;

import org.wms.model.order.Order;
import org.wms.model.order.OrderRow;

public class MaterialListTableModel extends AbstractTableModel {
	
	private Order order;
	
	private String[] headers = {"Code", "Quantity"};
	
	public MaterialListTableModel(Order order) {
		super();
		this.order = order;
	}

	@Override
	public int getRowCount() {
		//TODO rimuovere try catch
		try {
			return order.getMaterials().size();
		} catch (Exception e) {
			return 0;
		}
		
	}

	@Override
	public int getColumnCount() {
		return headers.length;
	}
	
	@Override
	public String getColumnName(int column) {
		return headers[column];
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		OrderRow row = (OrderRow) order.getMaterials().toArray()[columnIndex];
		
		switch (columnIndex) {
		case 0:
			return row.getMaterial();
		case 1:
			return row.getQuantity();
		default:
			break;
		}
		
		return "Unknow column: " + columnIndex;
	}
	

}

{'fraction_non_alphanumeric': 0.11405197305101059, 'fraction_numerical': 0.002406159769008662, 'mean_word_length': 4.009638554216868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2651195', 'n_tokens_mistral': 755, 'n_tokens_neox': 656, 'n_words': 161}