Changeset 13444


Ignore:
Timestamp:
Sep 11, 2019 9:28:25 AM (3 months ago)
Author:
tgutzmann
Message:

#5838 Enforce stricter compile time checks by Eclipse. Fix according existing problems.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/.settings/org.eclipse.jdt.core.prefs

    r12984 r13444  
    1313org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    1414org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
    15 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     15org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
    1616org.eclipse.jdt.core.compiler.problem.deadCode=warning
    1717org.eclipse.jdt.core.compiler.problem.deprecation=warning
     
    1919org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
    2020org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
    21 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
     21org.eclipse.jdt.core.compiler.problem.emptyStatement=error
    2222org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
    23 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     23org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
    2424org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
    25 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
     25org.eclipse.jdt.core.compiler.problem.fieldHiding=info
    2626org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
    2727org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
    2828org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
    29 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     29org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
    3030org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
    3131org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
    32 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     32org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
    3333org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
    3434org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
     
    4040org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
    4141org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
    42 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     42org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
    4343org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
    44 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
     44org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
    4545org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
    4646org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
     
    5555org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
    5656org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
    57 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     57org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
    5858org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
    5959org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     
    6767org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
    6868org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
    69 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     69org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
    7070org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
    7171org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     
    9090org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=info
    9191org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
    92 org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
     92org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=error
    9393org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
    94 org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
     94org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
    9595org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
    96 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     96org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
    9797org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
    9898org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
     
    105105org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
    106106org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
    107 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
     107org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
    108108org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
    109109org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
  • trunk/Compiler/FmiXMLCodeGen/src/jastadd/FmiXMLGenerator.jrag

    r12844 r13444  
    247247    /**
    248248     * Used for registering new vendor annotation tag. Returns the name
    249      * for conveninence. Vendor annotation tags should inherit
     249     * for convenience. Vendor annotation tags should inherit
    250250     * FMIVendorAnnotation.
    251251     */
     
    257257    /**
    258258     * Used for registering new tool specific tag under the vendor annotation tag.
    259      * Returns the name for conveninence.
     259     * Returns the name for convenience.
    260260     */
    261261    public static String addVendorAnnotationTool(String childName) {
  • trunk/Compiler/ModelicaFrontEnd/src/java/org/jmodelica/util/AbstractModelicaScanner.java

    r11221 r13444  
    3535
    3636    public int[] getLineBreakMap() {
    37         if (lineBreakMap.length > maxLineBreakLine + 1)
    38             lineBreakMap = Arrays.copyOf(lineBreakMap, maxLineBreakLine + 1);
     37        if (lineBreakMap.length > maxLineBreakLine + 1) {
     38            lineBreakMap = Arrays.copyOf(lineBreakMap, maxLineBreakLine + 1);
     39        }
    3940        return lineBreakMap;
    4041    }
     
    6869            switch (text.charAt(i)) {
    6970            case '\r':
    70                 if (i < text.length() - 1 && text.charAt(i + 1) == '\n')
    71                     ++i;
    72             case '\n':
     71                if (i < text.length() - 1 && text.charAt(i + 1) == '\n') {
     72                    ++i;
     73                }
     74                //$FALL-THROUGH$
     75            case '\n':
    7376                addLineBreak(++line, matchOffset() + i + 1);
    7477                ++numberOfLineBreaksAdded;
     
    7982
    8083    private void addLineBreak(int line, int offset) {
    81         if (lineBreakMap.length <= line)
    82             lineBreakMap = Arrays.copyOf(lineBreakMap, 4 * lineBreakMap.length);
     84        if (lineBreakMap.length <= line) {
     85            lineBreakMap = Arrays.copyOf(lineBreakMap, 4 * lineBreakMap.length);
     86        }
    8387        lineBreakMap[line] = offset;
    84         if (line > maxLineBreakLine)
    85             maxLineBreakLine = line;
     88        if (line > maxLineBreakLine) {
     89            maxLineBreakLine = line;
     90        }
    8691    }
    8792
     
    157162    protected void addFormattingInformation(FormattingType type, String data, int numberOfLineBreaks) {
    158163        int endColumn;
    159         if (numberOfLineBreaks > 0)
    160             endColumn = data.length() - Math.max(data.lastIndexOf('\n'), data.lastIndexOf('\r')) - 1;
    161         else
    162             endColumn = matchColumn() + matchLength();
     164        if (numberOfLineBreaks > 0) {
     165            endColumn = data.length() - Math.max(data.lastIndexOf('\n'), data.lastIndexOf('\r')) - 1;
     166        } else {
     167            endColumn = matchColumn() + matchLength();
     168        }
    163169        formattingRecorder.addItem(type, data, matchLine() + 1, matchColumn() + 1, matchLine() + numberOfLineBreaks + 1, endColumn);
    164170    }
  • trunk/Compiler/ModelicaFrontEnd/test/junit/org/jmodelica/test/common/QualifiedNameTest.java

    r12700 r13444  
    22
    33import static org.junit.Assert.assertEquals;
     4import static org.junit.Assert.assertFalse;
    45import static org.junit.Assert.assertTrue;
    5 import static org.junit.Assert.assertFalse;
    66
    77import org.jmodelica.util.QualifiedName;
     
    7979    @Test(expected=NameFormatException.class)
    8080    public void missplacedQuote() {
    81         new QualifiedName("first.secon'd.third'");
     81        new QualifiedName("first.secon'd.third'").toString();
    8282    }
    8383
    8484    @Test(expected=NameFormatException.class)
    8585    public void unmatchedQuotes() {
    86         new QualifiedName("first.'unclosedPart");
     86        new QualifiedName("first.'unclosedPart").toString();
    8787    }
    8888
    8989    @Test(expected=NameFormatException.class)
    9090    public void emptyNames() {
    91         new QualifiedName("first...last");
     91        new QualifiedName("first...last").toString();
    9292    }
    9393
    9494    @Test(expected=NameFormatException.class)
    9595    public void emptyNamesQuoted()  {
    96         new QualifiedName("first...'last'");
     96        new QualifiedName("first...'last'").toString();
    9797    }
    9898
    9999    @Test(expected=NameFormatException.class)
    100100    public void noName()  {
    101         new QualifiedName("");
     101        new QualifiedName("").toString();
    102102    }
    103103}
  • trunk/Compiler/ModelicaMiddleEnd/src/jastadd/structural/Graphs.jadd

    r13396 r13444  
    10381038
    10391039    /**
    1040      * Retrevies the list of strongly connected component contributors.
     1040     * Retrieves the list of strongly connected component contributors.
    10411041     * This method should always be used since it ensures that the list is
    1042      * initialized propperly.
     1042     * initialized properly.
    10431043     */
    10441044    public static Collection<SCCContributor> getSCCContributors() {
Note: See TracChangeset for help on using the changeset viewer.