Skip to content

Commit

Permalink
Merge branch 'master' into javadoc_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbagu committed Nov 8, 2017
2 parents 05ea017 + c8ce2d5 commit 33b8348
Show file tree
Hide file tree
Showing 79 changed files with 123 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public class AmplUtil {
public final class AmplUtil {

private AmplUtil() {
}
Expand Down
6 changes: 6 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@
<property name="message" value="Line has trailing spaces."/>
</module>

<module name="Translation"/>

<module name="TreeWalker">
<module name="ArrayTypeStyle"/>
<module name="ConstantName"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="ignored"/>
</module>
<module name="EmptyStatement"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="IllegalImport"/>
<module name="Indentation"/>
<module name="LeftCurly"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MethodParamPad"/>
<module name="MutableException"/>
<module name="NeedBraces"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
Expand All @@ -39,6 +43,8 @@
<module name="ParenPad"/>
<module name="RedundantImport"/>
<module name="RightCurly"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="SuppressWarningsHolder"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class DymolaUtil {
public final class DymolaUtil {


static final String PRODUCT_NAME = "Dymola";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static void main(String[] args) throws InterruptedException {
LOGGER.info("running Dymola client: {}", sc.toString());

String simRes = "";
if (isFake == true) {
if (isFake) {
simRes = sc.runDymolaFake(Paths.get(workingDir), inputZipFileName, outputZipFileName, modelFileName, modelName, outputDymolaMatFileName);
} else {
simRes = sc.runDymola(Paths.get(workingDir), inputZipFileName, outputZipFileName, modelFileName, modelName, outputDymolaMatFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public class BranchParallelIndexes {
public final class BranchParallelIndexes {

private final Map<String, Character> parallelIndexes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author pihan
*
*/
public class EchUtil {
public final class EchUtil {

private EchUtil() {
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public static Iterable<Switch> getSwitches(VoltageLevel vl, EurostagEchExportCon
}
}

private static class DecoratedBus {
private static final class DecoratedBus {
Bus bus;
int branch = 0;
int regulatingGenerator = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public class EurostagDictionary {
public final class EurostagDictionary {

private static final EurostagNamingStrategy NAMING_STRATEGY = new DicoEurostagNamingStrategyFactory().create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ private void createStaticVarCompensators(EsgNetwork esgNetwork) {
EsgConnectionStatus xsvcst = bus.isConnected() ? EsgConnectionStatus.CONNECTED : EsgConnectionStatus.NOT_CONNECTED;
Esg8charName znodsvc = new Esg8charName(dictionary.getEsgId(bus.getId()));
float factor = (float) Math.pow(svc.getTerminal().getVoltageLevel().getNominalV(), 2);
float bmin = (config.isSvcAsFixedInjectionInLF() == false) ? svc.getBmin() * factor : -9999999; // [Mvar]
float binit = (config.isSvcAsFixedInjectionInLF() == false) ? svc.getReactivePowerSetPoint() : -svc.getTerminal().getQ() * (float) Math.pow(svc.getTerminal().getVoltageLevel().getNominalV() / EchUtil.getBus(svc.getTerminal(), config).getV(), 2); // [Mvar]
float bmax = (config.isSvcAsFixedInjectionInLF() == false) ? svc.getBmax() * factor : 9999999; // [Mvar]
float bmin = (!config.isSvcAsFixedInjectionInLF()) ? svc.getBmin() * factor : -9999999; // [Mvar]
float binit = (!config.isSvcAsFixedInjectionInLF()) ? svc.getReactivePowerSetPoint() : -svc.getTerminal().getQ() * (float) Math.pow(svc.getTerminal().getVoltageLevel().getNominalV() / EchUtil.getBus(svc.getTerminal(), config).getV(), 2); // [Mvar]
float bmax = (!config.isSvcAsFixedInjectionInLF()) ? svc.getBmax() * factor : 9999999; // [Mvar]
EsgRegulatingMode xregsvc = ((svc.getRegulationMode() == StaticVarCompensator.RegulationMode.VOLTAGE) && (!config.isSvcAsFixedInjectionInLF())) ? EsgRegulatingMode.REGULATING : EsgRegulatingMode.NOT_REGULATING;
float vregsvc = svc.getVoltageSetPoint();
float qsvsch = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author Christian Biasuzzi <christian.biasuzzi@techrain.it>
*/
public class EurostagFakeNodes {
public final class EurostagFakeNodes {

private static final Logger LOGGER = LoggerFactory.getLogger(EurostagFakeNodes.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public class EurostagUtil {
public final class EurostagUtil {

private static final Logger LOGGER = LoggerFactory.getLogger(EurostagUtil.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public class EurostagStepUpTransformerInserter {
public final class EurostagStepUpTransformerInserter {

private static final Logger LOGGER = LoggerFactory.getLogger(EurostagStepUpTransformerInserter.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
class RecordUtil {
final class RecordUtil {

private RecordUtil() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author Leonel Carvalho - INESC TEC
*/

public class Converter {
public final class Converter {

private Converter() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class XmlActionsContingenciesUtils {
public final class XmlActionsContingenciesUtils {

private static final Logger LOGGER = LoggerFactory.getLogger(XmlActionsContingenciesUtils.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class EjbClientCtxUtils {
public final class EjbClientCtxUtils {
static Logger LOGGER = LoggerFactory.getLogger(EjbClientCtxUtils.class.getName());

private EjbClientCtxUtils() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public String toString() {
@Override
// This must return true for another ModelTemplateContainer this method is used to manage <f:selectItems value=""/>
public boolean equals(Object other) {
return other instanceof ModelTemplateContainer ?
ddbId.equals(((ModelTemplateContainer) other).getDdbId()) : false;
return other instanceof ModelTemplateContainer && ddbId.equals(((ModelTemplateContainer) other).getDdbId());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public String toString() {
@Override
// This must return true for another ParametersContainer this method is used to manage <f:selectItems value=""/>
public boolean equals(Object other) {
return other instanceof ParametersContainer ?
ddbId.equals(((ParametersContainer) other).getDdbId()) : false;
return other instanceof ParametersContainer && ddbId.equals(((ParametersContainer) other).getDdbId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class Utils {
public final class Utils {

private Utils() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public String populateDDB_M1M2(EurostagRecord zone, Map<String, String> amap,
}

Equipment eq1 = ddbmanager.findEquipment(cimId);
if ((eq1 != null) && (updateFlag == true)) {
if ((eq1 != null) && updateFlag) {
Set<String> connectedInternals = getConnectedInternals(cimId, ddbmanager);

//remove this equipment graph
Expand Down Expand Up @@ -422,7 +422,7 @@ public String populateDDB_M21(EurostagRecord zone, Map<String, String> amap,
}

Equipment eq1 = ddbmanager.findEquipment(cimId);
if ((eq1 != null) && (updateFlag == true)) {
if ((eq1 != null) && updateFlag) {
Set<String> connectedInternals = getConnectedInternals(cimId, ddbmanager);

//remove this equipment graph
Expand Down Expand Up @@ -532,7 +532,7 @@ private String populateDDB_R(EurostagRecord zone, Map<String, String> amap,
}
//if it does exist, and the update flag is set, delete it
if (mt1 != null) {
if (updateFlag == true) {
if (updateFlag) {
log.info("--- removing existing Model Template: {}, {}, {}", mt1.getSimulator(), mt1.getTypeName(), mt1.getComment());
mtc1.getModelTemplates().remove(mt1);
mtc1 = ddbmanager.save(mtc1);
Expand Down Expand Up @@ -836,7 +836,7 @@ public void dumpDtaFile(Path workingDir, String fileName,
}

private boolean filteredGenerator(Generator g) {
if (configExport.getGensPQfilter() == true) {
if (configExport.getGensPQfilter()) {
if (!Float.isNaN(g.getTerminal().getP()) && ((-g.getTerminal().getP() > g.getMaxP()) || (-g.getTerminal().getP() < g.getMinP()))) {
return true;
}
Expand Down Expand Up @@ -877,7 +877,7 @@ public void dumpDtaFile(Path workingDir, String fileName,
this.network = network;
this.parallelIndexes = parallelIndexes;

if (configExport.getGensPQfilter() == true) {
if (configExport.getGensPQfilter()) {
log.warn("Dta export configured to skip generators when their P is outside (MinP, MaxP)");
}

Expand Down Expand Up @@ -1121,8 +1121,8 @@ public void dumpDataInternals(Path workingDir, String cimId, Equipment eq, Simul

//keeps track of reg name, pro .pcp, .rcp compiling
//skipping those regs that do not have both .rcp and .pcp files
if (((foundFRI == true) && (foundFRM == true) && (foundPAR == true))
&& ((foundPCP == false) || (foundRCP == false))) {
if ((foundFRI && foundFRM && foundPAR)
&& ((!foundPCP) || (!foundRCP))) {
uniqueRegNamesSet.add(intName);
}
//keeps track of generators in RST zones
Expand Down Expand Up @@ -1486,7 +1486,7 @@ public void dumpData(Internal inst, SimulatorInst simInst, DDBManager ddbmanager
zm.put("coupling.par9", null);
}
} else {
if (couplingDataExists == true) {
if (couplingDataExists) {
log.warn("coupling macroblock data in ddb - macroblock name: " + zm.get("macroblock.name") + "; machine name: " + machineName);
}
zm.put("coupling.par1", null);
Expand Down Expand Up @@ -1924,8 +1924,8 @@ public void dumpDataRST(SimulatorInst eurostagSim, DDBManager ddbmanager,
}
//keeps track of reg name, pro .pcp, .rcp compiling
//skipping those regs that do not have both .rcp and .pcp files
if (((foundFRI == true) && (foundFRM == true) && (foundPAR == true))
&& ((foundPCP == false) || (foundRCP == false))) {
if ((foundFRI && foundFRM && foundPAR)
&& (!foundPCP || !foundRCP)) {
uniqueRegNamesSet.add(intName);
}
}
Expand Down Expand Up @@ -2059,8 +2059,8 @@ public void dumpDataACMC(SimulatorInst eurostagSim, DDBManager ddbmanager,
}
//keeps track of reg name, pro .pcp, .rcp compiling
//skipping those regs that do not have both .rcp and .pcp files
if (((foundFRI == true) && (foundFRM == true) && (foundPAR == true))
&& ((foundPCP == false) || (foundRCP == false))) {
if ((foundFRI && foundFRM && foundPAR)
&& ((!foundPCP) || (!foundRCP))) {
uniqueRegNamesSet.add(intName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* @author Quinary <itesla@quinary.com>
*/
public class DtaParser {
public final class DtaParser {

private static final Logger LOGGER = LoggerFactory.getLogger(DtaParser.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void run(CommandLine line, ToolRunningContext context) throws Exception {
Path genPath = ddData.resolve("reguls");
Path dicoPath = ddData.resolve("dico.txt");

if ((ddFilePath.toFile().isFile()) == false) {
if (!ddFilePath.toFile().isFile()) {
throw new RuntimeException(DD_FILE + ": " + ddFile + " is not a file!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class Utils {
public final class Utils {

static Logger log = LoggerFactory.getLogger(Utils.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class Utils {
public final class Utils {

private Utils() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @author Luis Maria Zamarreno <zamarrenolm@aia.com>
* @author Silvia Machado <machados@aia.es>
*/
public class LibUploaderTest {
public final class LibUploaderTest {

private LibUploaderTest() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author Luis Maria Zamarreno <zamarrenolm@aia.com>
* @author Silvia Machado <machados@aia.es>
*/
public class ModelicaGrammar {
public final class ModelicaGrammar {

private ModelicaGrammar() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author Luis Maria Zamarreno <zamarrenolm@aia.com>
* @author Silvia Machado <machados@aia.es>
*/
public class Utils {
public final class Utils {

private Utils() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public String apply(final PsseRegister s) {
ListMultimap<String, PsseRegister> groupByBusByType = Multimaps.index(groupsByBus.get(dyrId), new Function<PsseRegister, String>() {
@Override
public String apply(final PsseRegister s) {
return (PsseRegisterType.isEquipment(s) == true) ? "equipment" : "internal";
return PsseRegisterType.isEquipment(s) ? "equipment" : "internal";
}
});
// check the assumption that for a given dyrId there must be just one machine: if not , ERROR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class PsseDyrParser {
public final class PsseDyrParser {

static Logger log = LoggerFactory.getLogger(PsseDyrParser.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class PsseRegisterFactory {
public final class PsseRegisterFactory {

static Logger log = LoggerFactory.getLogger(PsseRegisterFactory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class Constants {
public final class Constants {

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author Quinary <itesla@quinary.com>
*/
public class Sorter {
public final class Sorter {

private Sorter() {
}
Expand Down

0 comments on commit 33b8348

Please sign in to comment.