Skip to content
Snippets Groups Projects
Commit f907563e authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

New naming conventions

parent 004fe344
No related branches found
No related tags found
No related merge requests found
Showing
with 122 additions and 112 deletions
......@@ -83,10 +83,20 @@
<module name="ModifierOrder"/>
<module name="MemberName"/>
<module name="MemberName">
<property name="format" value="^iv[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^a[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^cv[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="LocalVariableName"/>
<module name="TypeName"/>
<module name="MethodName"/>
<module name="AbstractClassName">
<property name="format" value="^Abstract.+$"/>
</module>
......
......@@ -27,13 +27,13 @@ import kieker.diagnosis.controller.MainController;
*/
public final class Main extends Application {
public static void main(final String[] args) {
Application.launch(args);
public static void main(final String[] aArgs) {
Application.launch(aArgs);
}
@Override
public void start(final Stage stage) throws Exception {
MainController.loadMainPane(stage);
public void start(final Stage aStage) throws Exception {
MainController.loadMainPane(aStage);
}
}
......@@ -27,25 +27,25 @@ import kieker.diagnosis.util.Mapper;
*/
public abstract class AbstractStringConverter<T> extends StringConverter<T> {
private final Mapper<T, String> mapper = new Mapper<>();
private final Mapper<T, String> ivMapper = new Mapper<>();
public AbstractStringConverter() {
final String bundleBaseName = "locale.kieker.diagnosis.components.components";
final ResourceBundle resourceBundle = ResourceBundle.getBundle(bundleBaseName, Locale.getDefault());
this.fillMapper(this.mapper, resourceBundle);
this.fillMapper(this.ivMapper, resourceBundle);
}
protected abstract void fillMapper(final Mapper<T, String> mapper, final ResourceBundle resourceBundle);
protected abstract void fillMapper(final Mapper<T, String> aMapper, final ResourceBundle aResourceBundle);
@Override
public T fromString(final String string) {
return this.mapper.invertedResolve(string);
public final T fromString(final String aString) {
return this.ivMapper.invertedResolve(aString);
}
@Override
public String toString(final T object) {
return this.mapper.resolve(object);
public final String toString(final T aObject) {
return this.ivMapper.resolve(aObject);
}
}
......@@ -27,12 +27,12 @@ import kieker.diagnosis.util.Mapper;
public final class ComponentNamesStringConverter extends AbstractStringConverter<ComponentNames> {
@Override
protected void fillMapper(final Mapper<ComponentNames, String> mapper, final ResourceBundle resourceBundle) {
final String shortStr = resourceBundle.getString("short");
final String longStr = resourceBundle.getString("long");
protected void fillMapper(final Mapper<ComponentNames, String> aMapper, final ResourceBundle aResourceBundle) {
final String shortStr = aResourceBundle.getString("short");
final String longStr = aResourceBundle.getString("long");
mapper.map(ComponentNames.SHORT).to(shortStr + " (Catalog)");
mapper.map(ComponentNames.LONG).to(longStr + " (kieker.examples.bookstore.Catalog)");
aMapper.map(ComponentNames.SHORT).to(shortStr + " (Catalog)");
aMapper.map(ComponentNames.LONG).to(longStr + " (kieker.examples.bookstore.Catalog)");
}
}
......@@ -27,12 +27,12 @@ import kieker.diagnosis.util.Mapper;
public final class OperationNamesStringConverter extends AbstractStringConverter<OperationNames> {
@Override
protected void fillMapper(final Mapper<OperationNames, String> mapper, final ResourceBundle resourceBundle) {
final String shortStr = resourceBundle.getString("short");
final String longStr = resourceBundle.getString("long");
protected void fillMapper(final Mapper<OperationNames, String> aMapper, final ResourceBundle aResourceBundle) {
final String shortStr = aResourceBundle.getString("short");
final String longStr = aResourceBundle.getString("long");
mapper.map(OperationNames.SHORT).to(shortStr + " (getBook(...))");
mapper.map(OperationNames.LONG).to(longStr + " (public void kieker.examples.bookstore.Catalog.getBook(boolean))");
aMapper.map(OperationNames.SHORT).to(shortStr + " (getBook(...))");
aMapper.map(OperationNames.LONG).to(longStr + " (public void kieker.examples.bookstore.Catalog.getBook(boolean))");
}
}
......@@ -24,16 +24,16 @@ import kieker.diagnosis.util.Mapper;
public final class ThresholdStringConverter extends AbstractStringConverter<Threshold> {
@Override
protected void fillMapper(final Mapper<Threshold, String> mapper, final ResourceBundle resourceBundle) {
final String threshold = resourceBundle.getString("threshold");
protected void fillMapper(final Mapper<Threshold, String> aMapper, final ResourceBundle aResourceBundle) {
final String threshold = aResourceBundle.getString("threshold");
mapper.map(Threshold.THRESHOLD_0_5).to(threshold + " < 0.5 %");
mapper.map(Threshold.THRESHOLD_1).to(threshold + " < 1 %");
mapper.map(Threshold.THRESHOLD_10).to(threshold + " < 10 %");
mapper.map(Threshold.THRESHOLD_20).to(threshold + " < 20 %");
mapper.map(Threshold.THRESHOLD_30).to(threshold + " < 30 %");
mapper.map(Threshold.THRESHOLD_40).to(threshold + " < 40 %");
mapper.map(Threshold.THRESHOLD_50).to(threshold + " < 50 %");
aMapper.map(Threshold.THRESHOLD_0_5).to(threshold + " < 0.5 %");
aMapper.map(Threshold.THRESHOLD_1).to(threshold + " < 1 %");
aMapper.map(Threshold.THRESHOLD_10).to(threshold + " < 10 %");
aMapper.map(Threshold.THRESHOLD_20).to(threshold + " < 20 %");
aMapper.map(Threshold.THRESHOLD_30).to(threshold + " < 30 %");
aMapper.map(Threshold.THRESHOLD_40).to(threshold + " < 40 %");
aMapper.map(Threshold.THRESHOLD_50).to(threshold + " < 50 %");
}
}
......@@ -27,20 +27,20 @@ import kieker.diagnosis.util.Mapper;
public final class TimeUnitStringConverter extends AbstractStringConverter<TimeUnit> {
@Override
protected void fillMapper(final Mapper<TimeUnit, String> mapper, final ResourceBundle resourceBundle) {
final String nanoseconds = resourceBundle.getString("nanoseconds");
final String microseconds = resourceBundle.getString("microseconds");
final String milliseconds = resourceBundle.getString("milliseconds");
final String seconds = resourceBundle.getString("seconds");
final String minutes = resourceBundle.getString("minutes");
final String hours = resourceBundle.getString("hours");
protected void fillMapper(final Mapper<TimeUnit, String> aMapper, final ResourceBundle aResourceBundle) {
final String nanoseconds = aResourceBundle.getString("nanoseconds");
final String microseconds = aResourceBundle.getString("microseconds");
final String milliseconds = aResourceBundle.getString("milliseconds");
final String seconds = aResourceBundle.getString("seconds");
final String minutes = aResourceBundle.getString("minutes");
final String hours = aResourceBundle.getString("hours");
mapper.map(TimeUnit.NANOSECONDS).to(nanoseconds);
mapper.map(TimeUnit.MICROSECONDS).to(microseconds);
mapper.map(TimeUnit.MILLISECONDS).to(milliseconds);
mapper.map(TimeUnit.SECONDS).to(seconds);
mapper.map(TimeUnit.MINUTES).to(minutes);
mapper.map(TimeUnit.HOURS).to(hours);
aMapper.map(TimeUnit.NANOSECONDS).to(nanoseconds);
aMapper.map(TimeUnit.MICROSECONDS).to(microseconds);
aMapper.map(TimeUnit.MILLISECONDS).to(milliseconds);
aMapper.map(TimeUnit.SECONDS).to(seconds);
aMapper.map(TimeUnit.MINUTES).to(minutes);
aMapper.map(TimeUnit.HOURS).to(hours);
}
}
......@@ -24,12 +24,12 @@ import kieker.diagnosis.util.Mapper;
public final class TimestampTypesStringConverter extends AbstractStringConverter<TimestampTypes> {
@Override
protected void fillMapper(final Mapper<TimestampTypes, String> mapper, final ResourceBundle resourceBundle) {
mapper.map(TimestampTypes.TIMESTAMP).to("1418993603113900610");
mapper.map(TimestampTypes.DATE).to("19.12.14");
mapper.map(TimestampTypes.SHORT_TIME).to("13:53");
mapper.map(TimestampTypes.LONG_TIME).to("13:53:23");
mapper.map(TimestampTypes.DATE_AND_TIME).to("19.12.2014 13:53:23");
protected void fillMapper(final Mapper<TimestampTypes, String> aMapper, final ResourceBundle aResourceBundle) {
aMapper.map(TimestampTypes.TIMESTAMP).to("1418993603113900610");
aMapper.map(TimestampTypes.DATE).to("19.12.14");
aMapper.map(TimestampTypes.SHORT_TIME).to("13:53");
aMapper.map(TimestampTypes.LONG_TIME).to("13:53:23");
aMapper.map(TimestampTypes.DATE_AND_TIME).to("19.12.2014 13:53:23");
}
}
......@@ -25,25 +25,25 @@ import kieker.diagnosis.domain.AbstractOperationCall;
public abstract class AbstractTableCellFactory<S, T> implements Callback<TableColumn<S, T>, TableCell<S, T>> {
@Override
public TableCell<S, T> call(final TableColumn<S, T> p) {
public final TableCell<S, T> call(final TableColumn<S, T> aTableColumn) {
return new FailedTableCell();
}
protected abstract String getItemLabel(T item);
protected abstract String getItemLabel(T aItem);
private final class FailedTableCell extends TableCell<S, T> {
@Override
protected void updateItem(final T item, final boolean empty) {
protected void updateItem(final T aItem, final boolean aEmpty) {
this.setFailedStyle();
super.updateItem(item, empty);
super.updateItem(aItem, aEmpty);
if (empty || (item == null)) {
if (aEmpty || (aItem == null)) {
this.setText(null);
this.setGraphic(null);
} else {
this.setText(AbstractTableCellFactory.this.getItemLabel(item));
this.setText(AbstractTableCellFactory.this.getItemLabel(aItem));
}
}
......
......@@ -36,17 +36,17 @@ public final class ComponentCellValueFactory implements Callback<CellDataFeature
private static final Logger LOGGER = LogManager.getLogger(ComponentCellValueFactory.class);
private final String property;
private final String ivProperty;
public ComponentCellValueFactory(@NamedArg(value = "property") final String property) {
this.property = property.substring(0, 1).toUpperCase(Locale.ROOT) + property.substring(1);
public ComponentCellValueFactory(@NamedArg(value = "property") final String aProperty) {
this.ivProperty = aProperty.substring(0, 1).toUpperCase(Locale.ROOT) + aProperty.substring(1);
}
@Override
public ObservableValue<String> call(final CellDataFeatures<?, String> call) {
public ObservableValue<String> call(final CellDataFeatures<?, String> aCall) {
try {
final Method getter = call.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
String componentName = (String) getter.invoke(call.getValue(), new Object[0]);
final Method getter = aCall.getValue().getClass().getMethod("get" + this.ivProperty, new Class<?>[0]);
String componentName = (String) getter.invoke(aCall.getValue(), new Object[0]);
if (PropertiesModel.getInstance().getComponentNames() == ComponentNames.SHORT) {
componentName = NameConverter.toShortComponentName(componentName);
......
......@@ -39,23 +39,23 @@ public final class DurationCellValueFactory implements Callback<CellDataFeatures
private static final Logger LOGGER = LogManager.getLogger(DurationCellValueFactory.class);
private final DataModel dataModel = DataModel.getInstance();
private final PropertiesModel propertiesModel = PropertiesModel.getInstance();
private final DataModel ivDataModel = DataModel.getInstance();
private final PropertiesModel ivPropertiesModel = PropertiesModel.getInstance();
private final String property;
private final String ivProperty;
public DurationCellValueFactory(@NamedArg(value = "property") final String property) {
this.property = property.substring(0, 1).toUpperCase(Locale.ROOT) + property.substring(1);
public DurationCellValueFactory(@NamedArg(value = "property") final String aProperty) {
this.ivProperty = aProperty.substring(0, 1).toUpperCase(Locale.ROOT) + aProperty.substring(1);
}
@Override
public ObservableValue<Long> call(final CellDataFeatures<?, String> call) {
public ObservableValue<Long> call(final CellDataFeatures<?, String> aCall) {
try {
final TimeUnit srcTimeUnit = this.dataModel.getTimeUnit();
final TimeUnit dstTimeUnit = this.propertiesModel.getTimeUnit();
final TimeUnit srcTimeUnit = this.ivDataModel.getTimeUnit();
final TimeUnit dstTimeUnit = this.ivPropertiesModel.getTimeUnit();
final Method getter = call.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
final long duration = (long) getter.invoke(call.getValue(), new Object[0]);
final Method getter = aCall.getValue().getClass().getMethod("get" + this.ivProperty, new Class<?>[0]);
final long duration = (long) getter.invoke(aCall.getValue(), new Object[0]);
final long newDuration = dstTimeUnit.convert(duration, srcTimeUnit);
return new ReadOnlyObjectWrapper<Long>(newDuration);
......
......@@ -25,8 +25,8 @@ import kieker.diagnosis.util.NameConverter;
public final class DurationTableCellFactory<S, T> extends AbstractTableCellFactory<S, T> {
@Override
protected String getItemLabel(final T item) {
return (item.toString() + " " + NameConverter.toShortTimeUnit(PropertiesModel.getInstance().getTimeUnit()));
protected String getItemLabel(final T aItem) {
return (aItem.toString() + " " + NameConverter.toShortTimeUnit(PropertiesModel.getInstance().getTimeUnit()));
}
}
......@@ -22,8 +22,8 @@ package kieker.diagnosis.components.table;
public final class FailedTableCellFactory<S, T> extends AbstractTableCellFactory<S, T> {
@Override
protected String getItemLabel(final T item) {
return item.toString();
protected String getItemLabel(final T aItem) {
return aItem.toString();
}
}
......@@ -37,17 +37,17 @@ public final class OperationCellValueFactory implements Callback<CellDataFeature
private static final Logger LOGGER = LogManager.getLogger(DurationTreeCellValueFactory.class);
private final String property;
private final String ivProperty;
public OperationCellValueFactory(@NamedArg(value = "property") final String property) {
this.property = property.substring(0, 1).toUpperCase(Locale.ROOT) + property.substring(1);
public OperationCellValueFactory(@NamedArg(value = "property") final String aProperty) {
this.ivProperty = aProperty.substring(0, 1).toUpperCase(Locale.ROOT) + aProperty.substring(1);
}
@Override
public ObservableValue<String> call(final CellDataFeatures<?, String> call) {
public ObservableValue<String> call(final CellDataFeatures<?, String> aCall) {
try {
final Method getter = call.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
String operationName = (String) getter.invoke(call.getValue(), new Object[0]);
final Method getter = aCall.getValue().getClass().getMethod("get" + this.ivProperty, new Class<?>[0]);
String operationName = (String) getter.invoke(aCall.getValue(), new Object[0]);
if (PropertiesModel.getInstance().getOperationNames() == OperationNames.SHORT) {
operationName = NameConverter.toShortOperationName(operationName);
......
......@@ -22,8 +22,8 @@ import kieker.diagnosis.util.NameConverter;
public final class TimestampTableCellFactory<S, T> extends AbstractTableCellFactory<S, T> {
@Override
protected String getItemLabel(final T item) {
return (NameConverter.toTimestampString((Long) item, DataModel.getInstance().getTimeUnit()));
protected String getItemLabel(final T aItem) {
return (NameConverter.toTimestampString((Long) aItem, DataModel.getInstance().getTimeUnit()));
}
}
......@@ -28,16 +28,16 @@ import kieker.diagnosis.domain.AbstractOperationCall;
*/
public abstract class AbstractLazyOperationCallTreeItem<T extends AbstractOperationCall<T>> extends TreeItem<T> {
private boolean childrenInitialized = false;
private boolean ivChildrenInitialized = false;
public AbstractLazyOperationCallTreeItem(final T value) {
super(value);
public AbstractLazyOperationCallTreeItem(final T aValue) {
super(aValue);
}
@Override
public final ObservableList<TreeItem<T>> getChildren() {
if (!this.childrenInitialized) {
this.childrenInitialized = true;
if (!this.ivChildrenInitialized) {
this.ivChildrenInitialized = true;
this.initializeChildren();
}
......
......@@ -25,7 +25,7 @@ import kieker.diagnosis.domain.AbstractOperationCall;
public abstract class AbstractTreeTableCellFactory<S, T> implements Callback<TreeTableColumn<S, T>, TreeTableCell<S, T>> {
@Override
public TreeTableCell<S, T> call(final TreeTableColumn<S, T> p) {
public final TreeTableCell<S, T> call(final TreeTableColumn<S, T> aTreeTableColumn) {
return new FailedTableCell();
}
......@@ -34,16 +34,16 @@ public abstract class AbstractTreeTableCellFactory<S, T> implements Callback<Tre
private final class FailedTableCell extends TreeTableCell<S, T> {
@Override
protected void updateItem(final T item, final boolean empty) {
protected void updateItem(final T aItem, final boolean aEmpty) {
this.setFailedStyle();
super.updateItem(item, empty);
super.updateItem(aItem, aEmpty);
if (empty || (item == null)) {
if (aEmpty || (aItem == null)) {
this.setText(null);
this.setGraphic(null);
} else {
this.setText(AbstractTreeTableCellFactory.this.getItemLabel(item));
this.setText(AbstractTreeTableCellFactory.this.getItemLabel(aItem));
}
}
......
......@@ -37,17 +37,17 @@ public final class ComponentTreeCellValueFactory implements Callback<CellDataFea
private static final Logger LOGGER = LogManager.getLogger(ComponentTreeCellValueFactory.class);
private final String property;
private final String ivProperty;
public ComponentTreeCellValueFactory(@NamedArg(value = "property") final String property) {
this.property = property.substring(0, 1).toUpperCase(Locale.ROOT) + property.substring(1);
public ComponentTreeCellValueFactory(@NamedArg(value = "property") final String aProperty) {
this.ivProperty = aProperty.substring(0, 1).toUpperCase(Locale.ROOT) + aProperty.substring(1);
}
@Override
public ObservableValue<String> call(final CellDataFeatures<?, String> call) {
public ObservableValue<String> call(final CellDataFeatures<?, String> aCall) {
try {
final TreeItem<?> item = (call.getValue());
final Method getter = item.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
final TreeItem<?> item = (aCall.getValue());
final Method getter = item.getValue().getClass().getMethod("get" + this.ivProperty, new Class<?>[0]);
String componentName = (String) getter.invoke(item.getValue(), new Object[0]);
if (PropertiesModel.getInstance().getComponentNames() == ComponentNames.SHORT) {
......
......@@ -25,8 +25,8 @@ import kieker.diagnosis.util.NameConverter;
public final class DurationTreeCellFactory<S, T> extends AbstractTreeTableCellFactory<S, T> {
@Override
protected String getItemLabel(final T item) {
return (item.toString() + " " + NameConverter.toShortTimeUnit(PropertiesModel.getInstance().getTimeUnit()));
protected String getItemLabel(final T aItem) {
return (aItem.toString() + " " + NameConverter.toShortTimeUnit(PropertiesModel.getInstance().getTimeUnit()));
}
}
......@@ -40,23 +40,23 @@ public final class DurationTreeCellValueFactory implements Callback<CellDataFeat
private static final Logger LOGGER = LogManager.getLogger(DurationTreeCellValueFactory.class);
private final DataModel dataModel = DataModel.getInstance();
private final PropertiesModel propertiesModel = PropertiesModel.getInstance();
private final DataModel ivDataModel = DataModel.getInstance();
private final PropertiesModel ivPropertiesModel = PropertiesModel.getInstance();
private final String property;
private final String ivProperty;
public DurationTreeCellValueFactory(@NamedArg(value = "property") final String property) {
this.property = property.substring(0, 1).toUpperCase(Locale.ROOT) + property.substring(1);
public DurationTreeCellValueFactory(@NamedArg(value = "property") final String aProperty) {
this.ivProperty = aProperty.substring(0, 1).toUpperCase(Locale.ROOT) + aProperty.substring(1);
}
@Override
public ObservableValue<Long> call(final CellDataFeatures<?, String> call) {
public ObservableValue<Long> call(final CellDataFeatures<?, String> aCall) {
try {
final TimeUnit srcTimeUnit = this.dataModel.getTimeUnit();
final TimeUnit dstTimeUnit = this.propertiesModel.getTimeUnit();
final TimeUnit srcTimeUnit = this.ivDataModel.getTimeUnit();
final TimeUnit dstTimeUnit = this.ivPropertiesModel.getTimeUnit();
final TreeItem<?> item = (call.getValue());
final Method getter = item.getValue().getClass().getMethod("get" + this.property, new Class<?>[0]);
final TreeItem<?> item = (aCall.getValue());
final Method getter = item.getValue().getClass().getMethod("get" + this.ivProperty, new Class<?>[0]);
final long duration = (long) getter.invoke(item.getValue(), new Object[0]);
final long newDuration = dstTimeUnit.convert(duration, srcTimeUnit);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment