Skip to content

Commit

Permalink
chore(checkstyle): bumped checkstyle version to 10.15.0 (#392)
Browse files Browse the repository at this point in the history
* done to support intelliJ checkstyle plugin
* some adjustments in the configuration were required due to version changes
* chore(checkstyle): set validateThrows to false (see http://www.javapractices.com/topic/TopicAction.do?Id=171)
* chore(checkstyle): added further valid abbreviations
* chore(checkstyle): getting rid of more checkstyle warnings
* chore(checkstyle): added SuppressWarnings module so checkstyle warnings can be suppressed if necessary
* chore(checkstyle): ignore naming in conventions in Wgs84Projection

Signed-off-by: Moritz Schweppenhäuser <[email protected]>
  • Loading branch information
schwepmo committed Jul 3, 2024
1 parent 84cce36 commit f1f0682
Show file tree
Hide file tree
Showing 23 changed files with 706 additions and 349 deletions.
28 changes: 15 additions & 13 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->

<module name = "Checker">
<module name="Checker">
<property name="charset" value="UTF-8"/>

<property name="severity" value="warning"/>

<property name="fileExtensions" value="java, properties, xml"/>

<module name="SuppressWarningsFilter"/>
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/checkstyle-excludes.xml" />
<property name="file" value="${config_loc}/checkstyle-excludes.xml"/>
</module>

<!-- Excludes all 'module-info.java' files -->
Expand All @@ -44,14 +45,15 @@
</module>

<module name="RegexpSingleline">
<property name="format" value="^\s*\*\s*@author" />
<property name="minimum" value="0" />
<property name="maximum" value="0" />
<property name="message" value="Javadoc has illegal ''author'' tag." />
<property name="fileExtensions" value="java" />
<property name="format" value="^\s*\*\s*@author"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Javadoc has illegal ''author'' tag."/>
<property name="fileExtensions" value="java"/>
</module>

<module name="TreeWalker">
<module name="SuppressWarningsHolder"/>
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
Expand Down Expand Up @@ -154,7 +156,7 @@
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="format" value="(^[a-z]([a-zA-Z0-9]*)?$)|^x$|^y$|^z$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
Expand All @@ -175,7 +177,7 @@
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<property name="format" value="(^[a-z]([a-zA-Z0-9]*)?$)|^x$|^y$|^z$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
Expand Down Expand Up @@ -216,7 +218,7 @@
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
<property name="allowedAbbreviations" value="CAM,IVIM,SPATM,DENM" />
<property name="allowedAbbreviations" value="CAM,IVIM,SPATM,DENM,SQL,CMD"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
Expand Down Expand Up @@ -263,17 +265,17 @@
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="validateThrows" value="true"/>
<property name="validateThrows" value="false"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test, Deprecated"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="3"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="ignoreMethodNamesRegex" value="^get.*$|^with.*$|^set.*$|^is.*$|"/>
<property name="ignoreMethodNamesRegex" value="^get.*$|^with.*$|^set.*$|^is.*$|^add.*$"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public final String getId() {
*
* @param event the event to process.
* @return true if this method has processed the given event
* @throws RuntimeException if {@link Event} could not be properly handled by the processor
*/
public final boolean preProcessEvent(final Event event) {
final Object resource = event.getResource();
Expand Down Expand Up @@ -501,10 +502,6 @@ public final File getConfigurationPath() {
return SimulationKernel.SimulationKernel.getConfigurationPath();
}

public boolean canProcessEvent() {
return true;
}

@Override
public String getGroup() {
return group;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
* Contact: [email protected]
*/

package org.eclipse.mosaic.fed.sumo.bridge;


Expand Down Expand Up @@ -45,6 +46,12 @@ public class LibSumoBridge implements Bridge {
private final RouteFacade routeControl;
private final PoiFacade poiControl;

/**
* Constructor for the {@link LibSumoBridge}, initializing simulation and facades based on configuration.
*
* @param sumoConfiguration the MOSAIC internal {@link CSumo SUMO configuration}
* @param parameters the program arguments for starting the simulation
*/
public LibSumoBridge(CSumo sumoConfiguration, List<String> parameters) {

Simulation.load(new StringVector(parameters));
Expand Down
Loading

0 comments on commit f1f0682

Please sign in to comment.