< prev index next >

## src/com/sun/javatest/cof/COFTest.java

Print this page

    @@ -114,17 +114,17 @@
         private static DateFormat[] dateFormats;
         protected final static Pattern idPattern = Pattern.compile(".*[^\\w\\.\\[\\]\\(\\)\\{\\},_\\-]([\\w\\.\\[\\]\\(\\)\\{\\},_\\-]+)");
         static boolean noTestCases = false;
         protected final static Pattern testCasePattern = Pattern //.compile("^(\\S+): (Passed\\.|Failed\\.|Error\\.|Not\\ run\\.)(.*)");
                 .compile("^(.*): (Passed\\.|Failed\\.|Error\\.|Not\\ run\\.)(.*)");
    -    static LinkedHashMap xmlAttributes;
    -    static LinkedHashMap xmlElements;
    +    static LinkedHashMap<String, String> xmlAttributes;
    +    static LinkedHashMap<String, String> xmlElements;
         static String xmlTagName;

         static {
    -        xmlElements = new LinkedHashMap();
    -        xmlAttributes = new LinkedHashMap();
    +        xmlElements = new LinkedHashMap<>();
    +        xmlAttributes = new LinkedHashMap<>();
             xmlElements.put("name", "name");
             xmlElements.put("appuse", "appuse");
             xmlElements.put("status", "status");
             xmlElements.put("testcases", "testcases");
             xmlElements.put("starttime", "starttime");

    @@ -145,11 +145,11 @@
             cofStatus[Status.NOT_RUN] = "did_not_run";
         }
         //    @XmlAttribute
         protected String analysis;
         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
    -    protected List/*<String>*/ appuse;
    +    protected List<String> appuse;
         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
         protected COFTestAttributes attributes;
         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
         protected String description;
         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", type = String.class)

    @@ -261,12 +261,12 @@
             if (mtl == null) {
                 // mtl is not specified
                 return;
             }

    -        List  /*<COFTestCase>*/ jtrCases = testcases.getTestcase();
    -        List  /*<String>*/ mtlTestCases = mtl.getTestCases(tr.getTestName());
    +        List  <COFTestCase> jtrCases = testcases.getTestcase();
    +        List  <String> mtlTestCases = mtl.getTestCases(tr.getTestName());
             if (mtlTestCases != null && mtlTestCases.size() > 0) {
                 // for (COFTestCase jtrCase : jtrCases) {
                 Iterator it = jtrCases.iterator();
                 while (it.hasNext()) {
                     COFTestCase jtrCase = (COFTestCase) it.next();

    @@ -281,11 +281,11 @@
                         COFStatus nStatus = new COFStatus();
                         nTc.setName(testCaseName);
                         String strS = cofStatus[tr.getStatus().getType()];
                         nStatus.setValue(strS);
                         //System.out.println("+ " + tr.getTestName() + " " + tcName + " " + strS );
    -                    testcases.getTestcase().add(testCaseName);
    +                    testcases.getTestcase().add(nTc);
                     }
                 }
             }
         }

    @@ -325,13 +325,13 @@
          * Objects of the following type(s) are allowed in the list
          * {@link String }
          *
          *
          */
    -    public List/*<String>*/ getAppuse() {
    +    public List<String> getAppuse() {
             if (appuse == null) {
    -            appuse = new ArrayList/*<String>*/();
    +            appuse = new ArrayList<>();
             }
             return this.appuse;
         }

         /**

    @@ -392,15 +392,15 @@
                 id = "test:" + idNum;
             }
             return id;
         }

    -    LinkedHashMap getItemAttributes() {
    +    LinkedHashMap<String, String> getItemAttributes() {
             return xmlAttributes;
         }

    -    LinkedHashMap getItemElements() {
    +    LinkedHashMap<String, String> getItemElements() {
             return xmlElements;
         }

         String getItemTagName() {
             return xmlTagName;

    @@ -464,11 +464,11 @@
          */
         //  public void setId(String value) {
         //          this.id = value;
         //  }
         private static void initDateFormats() {
    -        Vector v = new Vector();
    +        Vector<DateFormat> v = new Vector<>();

             // generic Java default
             // 10-Sep-99 3:25:11 PM
             v.addElement(DateFormat.getDateTimeInstance());

< prev index next >