Ignore:
Timestamp:
2014-08-06T19:33:57+02:00 (10 years ago)
Author:
donvip
Message:

[josm_opendata] add more unit tests, fix Java 7 warnings

Location:
applications/editors/josm/plugins/opendata/includes/org
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/BindInfo.java

    r29679 r30568  
    55
    66public class BindInfo {
    7     public RecordVector<CoderStreamsInfo> Coders = new RecordVector<CoderStreamsInfo>();
    8     public RecordVector<BindPair> BindPairs = new RecordVector<BindPair>();
     7    public RecordVector<CoderStreamsInfo> Coders = new RecordVector<>();
     8    public RecordVector<BindPair> BindPairs = new RecordVector<>();
    99    public IntVector InStreams = new IntVector();
    1010    public IntVector OutStreams = new IntVector();
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/CoderMixer2ST.java

    r29681 r30568  
    2020   
    2121    BindInfo _bindInfo = new BindInfo();
    22     ObjectVector<STCoderInfo> _coders = new ObjectVector<STCoderInfo>();
     22    ObjectVector<STCoderInfo> _coders = new ObjectVector<>();
    2323   
    2424    public CoderMixer2ST() {
     
    202202        CoderInfo mainCoder = _coders.get(_mainCoderIndex);
    203203       
    204         ObjectVector< java.io.InputStream > seqInStreams = new ObjectVector< java.io.InputStream >(); // CObjectVector< CMyComPtr<ISequentialInStream> >
    205         ObjectVector< java.io.OutputStream > seqOutStreams = new ObjectVector< java.io.OutputStream >(); // CObjectVector< CMyComPtr<ISequentialOutStream> >
     204        ObjectVector< java.io.InputStream > seqInStreams = new ObjectVector< >(); // CObjectVector< CMyComPtr<ISequentialInStream> >
     205        ObjectVector< java.io.OutputStream > seqOutStreams = new ObjectVector< >(); // CObjectVector< CMyComPtr<ISequentialOutStream> >
    206206        int startInIndex = _bindInfo.GetCoderInStreamIndex(_mainCoderIndex);
    207207        int startOutIndex = _bindInfo.GetCoderOutStreamIndex(_mainCoderIndex);
     
    220220            seqOutStreams.add(seqOutStream);
    221221        }
    222         RecordVector< java.io.InputStream > seqInStreamsSpec = new RecordVector< java.io.InputStream >();
    223         RecordVector< java.io.OutputStream > seqOutStreamsSpec = new RecordVector< java.io.OutputStream >();
     222        RecordVector< java.io.InputStream > seqInStreamsSpec = new RecordVector< >();
     223        RecordVector< java.io.OutputStream > seqOutStreamsSpec = new RecordVector< >();
    224224        for (i = 0; i < mainCoder.NumInStreams; i++)
    225225            seqInStreamsSpec.add(seqInStreams.get(i));
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/FilterCoder.java

    r29681 r30568  
    44import java.io.IOException;
    55
    6 import org.j7zip.SevenZip.HRESULT;
    76import org.j7zip.SevenZip.ICompressCoder;
    87import org.j7zip.SevenZip.ICompressSetOutStream;
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/ArchiveDatabase.java

    r29679 r30568  
    1010    public BoolVector PackCRCsDefined = new BoolVector();
    1111    public IntVector PackCRCs = new IntVector();
    12     public ObjectVector<Folder> Folders = new ObjectVector<Folder>();
     12    public ObjectVector<Folder> Folders = new ObjectVector<>();
    1313    public IntVector NumUnPackStreamsVector = new IntVector();
    14     public ObjectVector<FileItem> Files = new ObjectVector<FileItem>();
     14    public ObjectVector<FileItem> Files = new ObjectVector<>();
    1515   
    1616    void Clear() {
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/BindInfoEx.java

    r29679 r30568  
    77class BindInfoEx extends BindInfo {
    88   
    9     RecordVector<MethodID> CoderMethodIDs = new RecordVector<MethodID>();
     9    RecordVector<MethodID> CoderMethodIDs = new RecordVector<>();
    1010   
    1111    public void Clear() {
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/CoderInfo.java

    r29679 r30568  
    77    int NumInStreams;
    88    int NumOutStreams;
    9     public ObjectVector<AltCoderInfo> AltCoders = new org.j7zip.Common.ObjectVector<AltCoderInfo>();
     9    public ObjectVector<AltCoderInfo> AltCoders = new org.j7zip.Common.ObjectVector<>();
    1010   
    1111    boolean IsSimpleCoder() { return (NumInStreams == 1) && (NumOutStreams == 1); }
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Decoder.java

    r29681 r30568  
    4545       
    4646        _mixerCoder = null;
    47         _decoders = new ObjectVector<Object>();
     47        _decoders = new ObjectVector<>();
    4848       
    4949        // #ifndef EXCLUDE_COM -- LoadMethodMap();
     
    117117       
    118118       
    119         ObjectVector<java.io.InputStream> inStreams = new ObjectVector<java.io.InputStream>(); // CObjectVector< CMyComPtr<ISequentialInStream> >
     119        ObjectVector<java.io.InputStream> inStreams = new ObjectVector<>(); // CObjectVector< CMyComPtr<ISequentialInStream> >
    120120       
    121121        LockedInStream lockedInStream = new LockedInStream();
     
    357357        if (numCoders == 0)
    358358            return 0;
    359         RecordVector<java.io.InputStream> inStreamPointers = new RecordVector<java.io.InputStream>(); // CRecordVector<ISequentialInStream *>
     359        RecordVector<java.io.InputStream> inStreamPointers = new RecordVector<>(); // CRecordVector<ISequentialInStream *>
    360360        inStreamPointers.Reserve(inStreams.size());
    361361        for (i = 0; i < inStreams.size(); i++)
    362362            inStreamPointers.add(inStreams.get(i));
    363363
    364         RecordVector<java.io.OutputStream> outStreamPointer = new RecordVector<java.io.OutputStream>();
     364        RecordVector<java.io.OutputStream> outStreamPointer = new RecordVector<>();
    365365        outStreamPointer.add(outStream);
    366366        return _mixerCoder.Code(
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Folder.java

    r29679 r30568  
    1111
    1212class Folder {
    13     public RecordVector<CoderInfo> Coders = new RecordVector<CoderInfo>();
    14     RecordVector<BindPair> BindPairs = new RecordVector<BindPair>();
     13    public RecordVector<CoderInfo> Coders = new RecordVector<>();
     14    RecordVector<BindPair> BindPairs = new RecordVector<>();
    1515    IntVector PackStreams = new IntVector();
    1616    LongVector UnPackSizes = new LongVector();
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Handler.java

    r29681 r30568  
    8484            return HRESULT.S_OK;
    8585       
    86         ObjectVector<ExtractFolderInfo> extractFolderInfoVector = new ObjectVector<ExtractFolderInfo>();
     86        ObjectVector<ExtractFolderInfo> extractFolderInfoVector = new ObjectVector<>();
    8787        for(int ii = 0; ii < numItems; ii++) {
    8888            int ref2Index = allFilesMode ? ii : indices[ii];
  • applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/InArchive.java

    r29681 r30568  
    3232   
    3333    public InArchive() {
    34         _inByteVector = new ObjectVector<InByte2>();
     34        _inByteVector = new ObjectVector<>();
    3535        _inByteBack = new InByte2();
    3636    }
     
    710710        IntVector packCRCs = new IntVector(); // CRecordVector<UInt32> packCRCs;
    711711       
    712         ObjectVector<Folder> folders = new ObjectVector<Folder>();
     712        ObjectVector<Folder> folders = new ObjectVector<>();
    713713       
    714714        IntVector numUnPackStreamsInFolders = new IntVector();
     
    823823        streamSwitch.Set(this, buffer2);
    824824       
    825         ObjectVector<ByteBuffer> dataVector = new ObjectVector<ByteBuffer>(); // CObjectVector<CByteBuffer> dataVector;
     825        ObjectVector<ByteBuffer> dataVector = new ObjectVector<>(); // CObjectVector<CByteBuffer> dataVector;
    826826       
    827827        for (;;) {
     
    863863        }
    864864       
    865         ObjectVector<ByteBuffer> dataVector = new ObjectVector<ByteBuffer>();
     865        ObjectVector<ByteBuffer> dataVector = new ObjectVector<>();
    866866       
    867867        if (type == NID.kAdditionalStreamsInfo) {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ChildCreator.java

    r28000 r30568  
    3737            throw new NullPointerException("null content");
    3838        this.content = content;
    39         this.elemsOrder = new ArrayList<Element>(children);
     39        this.elemsOrder = new ArrayList<>(children);
    4040    }
    4141
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ImmutableDocStyledNode.java

    r28000 r30568  
    2525
    2626    private static final Set<Document> getDocuments(final ODPackage pkg) {
    27         final Set<Document> res = new HashSet<Document>();
     27        final Set<Document> res = new HashSet<>();
    2828        for (final String entry : pkg.getEntries()) {
    2929            final ODPackageEntry e = pkg.getEntry(entry);
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODMeta.java

    r28000 r30568  
    4242    private static final Map<XMLVersion, List<Element>> ELEMS_ORDER;
    4343    static {
    44         ELEMS_ORDER = new HashMap<XMLVersion, List<Element>>(2);
     44        ELEMS_ORDER = new HashMap<>(2);
    4545        ELEMS_ORDER.put(XMLVersion.getOOo(), createChildren(XMLVersion.getOOo()));
    4646        ELEMS_ORDER.put(XMLVersion.getOD(), createChildren(XMLVersion.getOD()));
     
    5050        final Namespace meta = ins.getMETA();
    5151        final Namespace dc = ins.getNS("dc");
    52         final List<Element> res = new ArrayList<Element>(8);
     52        final List<Element> res = new ArrayList<>(8);
    5353        res.add(new Element("generator", meta));
    5454        res.add(new Element("title", dc));
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODPackage.java

    r28000 r30568  
    3737    private static final Set<String> subdocNames;
    3838    static {
    39         subdocNames = new HashSet<String>();
     39        subdocNames = new HashSet<>();
    4040        // section 2.1 of OpenDocument-v1.1-os.odt
    4141        subdocNames.add("content.xml");
     
    4949
    5050    public ODPackage() {
    51         this.files = new HashMap<String, ODPackageEntry>();
     51        this.files = new HashMap<>();
    5252        this.file = null;
    5353    }
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODSingleXMLDocument.java

    r28000 r30568  
    2828    final static Set<String> DONT_PREFIX;
    2929    static {
    30         DONT_PREFIX = new HashSet<String>();
     30        DONT_PREFIX = new HashSet<>();
    3131        // don't touch to user fields and variables
    3232        // we want them to be the same across the document
     
    5757    ODSingleXMLDocument(ODSingleXMLDocument doc, ODPackage p) {
    5858        super(doc);
    59         this.stylesNames = new HashSet<String>(doc.stylesNames);
    60         this.listStylesNames = new HashSet<String>(doc.listStylesNames);
     59        this.stylesNames = new HashSet<>(doc.stylesNames);
     60        this.listStylesNames = new HashSet<>(doc.listStylesNames);
    6161        this.pkg = p;
    6262        this.meta = ODMeta.create(this);
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODXMLDocument.java

    r28000 r30568  
    4141    private static final Map<XMLVersion, List<Element>> ELEMS_ORDER;
    4242    static {
    43         ELEMS_ORDER = new HashMap<XMLVersion, List<Element>>(2);
     43        ELEMS_ORDER = new HashMap<>(2);
    4444        ELEMS_ORDER.put(XMLVersion.getOOo(), createChildren(XMLVersion.getOOo()));
    4545        ELEMS_ORDER.put(XMLVersion.getOD(), createChildren(XMLVersion.getOD()));
     
    4848    private static final List<Element> createChildren(XMLVersion ins) {
    4949        final Namespace ns = ins.getOFFICE();
    50         final List<Element> res = new ArrayList<Element>(8);
     50        final List<Element> res = new ArrayList<>(8);
    5151        res.add(new Element("meta", ns));
    5252        res.add(new Element("settings", ns));
     
    6363    static private final Map<String, String> namePrefixes;
    6464    static {
    65         namePrefixes = new HashMap<String, String>();
     65        namePrefixes = new HashMap<>();
    6666        namePrefixes.put("table:table", "table");
    6767        namePrefixes.put("text:a", "office");
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleDesc.java

    r28000 r30568  
    6868        this.family = family;
    6969        this.baseName = baseName;
    70         this.refElements = new CollectionMap<String, String>();
     70        this.refElements = new CollectionMap<>();
    7171        // 4 since they are not common
    72         this.multiRefElements = new CollectionMap<String, String>(4);
     72        this.multiRefElements = new CollectionMap<>(4);
    7373    }
    7474
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleStyle.java

    r28000 r30568  
    3737    private static boolean descsLoaded = false;
    3838    static {
    39         family2Desc = new HashMap<XMLVersion, Map<String, StyleDesc<?>>>();
    40         class2Desc = new HashMap<XMLVersion, Map<Class<? extends StyleStyle>, StyleDesc<?>>>();
     39        family2Desc = new HashMap<>();
     40        class2Desc = new HashMap<>();
    4141        for (final XMLVersion v : XMLVersion.values()) {
    4242            family2Desc.put(v, new HashMap<String, StyleDesc<?>>());
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/XMLVersion.java

    r28000 r30568  
    8181
    8282    private XMLVersion(String name, Namespace manifest) {
    83         this.nss = new HashMap<String, Namespace>(16);
     83        this.nss = new HashMap<>(16);
    8484    }
    8585
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Cell.java

    r28000 r30568  
    136136     */
    137137    public String getTextValue(final boolean ooMode) {
    138         final List<String> ps = new ArrayList<String>();
     138        final List<String> ps = new ArrayList<>();
    139139        for (final Object o : this.getElement().getChildren()) {
    140140            final Element child = (Element) o;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Row.java

    r28000 r30568  
    4444        this.parent = parent;
    4545        this.index = index;
    46         this.cells = new ArrayList<Cell<D>>();
     46        this.cells = new ArrayList<>();
    4747        for (final Element cellElem : this.getCellElements()) {
    4848            addCellElem(cellElem);
     
    5959
    6060    private void addCellElem(final Element cellElem) {
    61         final Cell<D> cell = new Cell<D>(this, cellElem);
     61        final Cell<D> cell = new Cell<>(this, cellElem);
    6262        this.cells.add(cell);
    6363
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/SpreadSheet.java

    r28000 r30568  
    4949
    5050        // map Sheet by XML elements so has not to depend on ordering or name
    51         this.sheets = new HashMap<Element, Sheet>();
     51        this.sheets = new HashMap<>();
    5252    }
    5353
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Table.java

    r28000 r30568  
    4444        super(parent, local, TableStyle.class);
    4545
    46         this.rows = new ArrayList<Row<D>>();
    47         this.cols = new ArrayList<Column<D>>();
     46        this.rows = new ArrayList<>();
     47        this.cols = new ArrayList<>();
    4848
    4949        this.readColumns();
     
    7171
    7272    private final void addCol(Element clone) {
    73         this.cols.add(new Column<D>(this, clone));
     73        this.cols.add(new Column<>(this, clone));
    7474    }
    7575
    7676    private Tuple2<List<Element>, Integer> flatten(boolean col) {
    77         final List<Element> res = new ArrayList<Element>();
     77        final List<Element> res = new ArrayList<>();
    7878        final Element header = this.getElement().getChild("table-header-" + getName(col) + "s", getTABLE());
    7979        if (header != null)
     
    128128
    129129    private synchronized void addRow(Element child) {
    130         this.rows.add(new Row<D>(this, child, this.rows.size()));
     130        this.rows.add(new Row<>(this, child, this.rows.size()));
    131131    }
    132132
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/io/SaxContentUnmarshaller.java

    r29298 r30568  
    4040
    4141    public SaxContentUnmarshaller() {
    42         this.stack = new Stack<Object>();
     42        this.stack = new Stack<>();
    4343    }
    4444
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/model/office/OfficeBody.java

    r28000 r30568  
    2424public class OfficeBody {
    2525
    26     private final List<OfficeSpreadsheet> officeSpreadsheets = new Vector<OfficeSpreadsheet>();
     26    private final List<OfficeSpreadsheet> officeSpreadsheets = new Vector<>();
    2727
    2828    public void addOfficeSpreadsheet(final OfficeSpreadsheet spread) {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/model/office/OfficeSpreadsheet.java

    r28000 r30568  
    2222
    2323public class OfficeSpreadsheet {
    24     List<TableTable> tables = new Vector<TableTable>();
     24    List<TableTable> tables = new Vector<>();
    2525
    2626    public void addTable(final TableTable table) {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/model/table/TableTable.java

    r28000 r30568  
    2525
    2626    // Une colonne ou ligne repeated est dupliquée dans la liste
    27     ArrayList<TableTableColumn> columns = new ArrayList<TableTableColumn>();
     27    ArrayList<TableTableColumn> columns = new ArrayList<>();
    2828
    2929    private int printStartCol = 0;
     
    3535    private int printStopRow = 0;
    3636
    37     ArrayList<TableTableRow> rows = new ArrayList<TableTableRow>();
     37    ArrayList<TableTableRow> rows = new ArrayList<>();
    3838
    3939    public void addColumn(final TableTableColumn col) {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/model/table/TableTableRow.java

    r29298 r30568  
    2727    ArrayList<TableTableCell> allCells;
    2828
    29     Vector<TableTableCell> cells = new Vector<TableTableCell>();
     29    Vector<TableTableCell> cells = new Vector<>();
    3030
    3131    int id = 0;
     
    4747     */
    4848    void computeAllCells() {
    49         this.allCells = new ArrayList<TableTableCell>();
     49        this.allCells = new ArrayList<>();
    5050        for (int index = 0; index < this.cells.size(); index++) {
    5151            final TableTableCell c = this.cells.get(index);
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/model/text/TextP.java

    r28000 r30568  
    2424public class TextP {
    2525
    26     private final List<TextSpan> textSpans = new Vector<TextSpan>();
     26    private final List<TextSpan> textSpans = new Vector<>();
    2727
    2828    public void addTextSpan(final TextSpan p) {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/util/FileUtils.java

    r28000 r30568  
    3131    private static final Map<String, String> ext2mime;
    3232    static {
    33         ext2mime = new HashMap<String, String>();
     33        ext2mime = new HashMap<>();
    3434        ext2mime.put(".xml", "text/xml");
    3535        ext2mime.put(".jpg", "image/jpeg");
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/util/StringUtils.java

    r28000 r30568  
    4747            super();
    4848            this.esc = esc;
    49             this.substitution = new LinkedHashMap<Character, Character>();
    50             this.inv = new HashMap<Character, Character>();
     49            this.substitution = new LinkedHashMap<>();
     50            this.inv = new HashMap<>();
    5151            this.add(esc, name);
    5252        }
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/util/Tuple2.java

    r28000 r30568  
    3131    // just to make the code shorter
    3232    public static final <A, B> Tuple2<A, B> create(A a, B b) {
    33         return new Tuple2<A, B>(a, b);
     33        return new Tuple2<>(a, b);
    3434    }
    3535
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/util/cc/Transformer.java

    r28000 r30568  
    2121
    2222    public static final <N> ITransformer<N, N> nopTransformer() {
    23         return new ITransformerWrapper<N, N>(TransformerUtils.nopTransformer());
     23        return new ITransformerWrapper<>(TransformerUtils.nopTransformer());
    2424    }
    2525
Note: See TracChangeset for help on using the changeset viewer.