Skip to content

Commit

Permalink
[cleanup] Remove useless comments for the internationalization
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
  • Loading branch information
sbegaudeau committed Dec 15, 2022
1 parent 11b0007 commit 4d42d96
Show file tree
Hide file tree
Showing 1,057 changed files with 5,388 additions and 5,394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
@Immutable
public final class BarChart implements IChart {
public static final String KIND = "BarChart"; //$NON-NLS-1$
public static final String KIND = "BarChart";

private String id;

Expand Down Expand Up @@ -92,7 +92,7 @@ public static Builder newBarChart(String id) {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, descriptionId: {2}, label: {3}, kind: {4}, width: {5}, height: {6}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, descriptionId: {2}, label: {3}, kind: {4}, width: {5}, height: {6}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.descriptionId, this.label, this.kind, this.width, this.height);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Number getValue() {

@Override
public String toString() {
String pattern = "{0} '{'key: {1}, value: {2}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'key: {1}, value: {2}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.key, this.value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Builder newBarChartStyle() {

@Override
public String toString() {
String pattern = "{0} '{'barsColor: {1}, fontSize: {2}, italic: {3}, bold: {4}, underline: {5}, strikeThrough: {6}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'barsColor: {1}, fontSize: {2}, italic: {3}, bold: {4}, underline: {5}, strikeThrough: {6}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.barsColor, this.fontSize, this.italic, this.bold, this.underline, this.strikeThrough);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Immutable
public final class BarChartElementProps implements IProps {

public static final String TYPE = "BarChart"; //$NON-NLS-1$
public static final String TYPE = "BarChart";

private String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public List<HierarchyNode> getChildren() {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, targetObjectId: {2}, descriptionId: {3}, label: {4}, kind: {5}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, targetObjectId: {2}, descriptionId: {3}, label: {4}, kind: {5}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.targetObjectId, this.descriptionId, this.label, this.kind);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public List<HierarchyNode> getChildren() {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, targetObjectId: {2}, label: {3}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, targetObjectId: {2}, label: {3}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.targetObjectId, this.label);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Element render() {

String id = optionalPreviousHierarchy.map(Hierarchy::getId).orElseGet(() -> UUID.randomUUID().toString());
String targetObjectId = hierarchyDescription.getTargetObjectIdProvider().apply(variableManager);
String label = variableManager.get(HierarchyDescription.LABEL, String.class).orElse(""); //$NON-NLS-1$
String label = variableManager.get(HierarchyDescription.LABEL, String.class).orElse("");
String kind = hierarchyDescription.getKind();

List<HierarchyNode> previousNodes = optionalPreviousHierarchy.map(Hierarchy::getChildren).orElse(List.of());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author sbegaudeau
*/
public class HierarchyDescription implements IRepresentationDescription {
public static final String LABEL = "label"; //$NON-NLS-1$
public static final String LABEL = "label";

private String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class HierarchyElementProps implements IProps {

public static final String TYPE = "Hierarchy"; //$NON-NLS-1$
public static final String TYPE = "Hierarchy";

private final String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class HierarchyNodeElementProps implements IProps {

public static final String TYPE = "HierarchyNode"; //$NON-NLS-1$
public static final String TYPE = "HierarchyNode";

private final String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
@Immutable
public final class PieChart implements IChart {
public static final String KIND = "PieChart"; //$NON-NLS-1$
public static final String KIND = "PieChart";

private String id;

Expand Down Expand Up @@ -80,7 +80,7 @@ public static Builder newPieChart(String id) {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, descriptionId: {2}, label: {3}, kind: {4}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, descriptionId: {2}, label: {3}, kind: {4}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.descriptionId, this.label, this.kind);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Number getValue() {

@Override
public String toString() {
String pattern = "{0} '{'key: {1}, value: {2}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'key: {1}, value: {2}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.key, this.value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Element render() {
Optional<PieChart> optionalPreviousPieChart = this.props.getPreviousPieChart();

String id = optionalPreviousPieChart.map(PieChart::getId).orElseGet(() -> UUID.randomUUID().toString());
String label = Optional.ofNullable(pieChartDescription.getLabel()).orElse(""); //$NON-NLS-1$
String label = Optional.ofNullable(pieChartDescription.getLabel()).orElse("");
List<Number> values = pieChartDescription.getValuesProvider().apply(variableManager);
List<String> keys = pieChartDescription.getKeysProvider().apply(variableManager);
PieChartStyle pieChartStyle = pieChartDescription.getStyleProvider().apply(variableManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static Builder newPieChartStyle() {

@Override
public String toString() {
String pattern = "{0} '{'colors: {1}, strokeWidth: {2}, strokeColor: {3}, fontSize: {4}, italic: {5}, bold: {6}, underline: {7}, strikeThrough: {8}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'colors: {1}, strokeWidth: {2}, strokeColor: {3}, fontSize: {4}, italic: {5}, bold: {6}, underline: {7}, strikeThrough: {8}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.colors, this.strokeWidth, this.strokeColor, this.fontSize, this.italic, this.bold, this.underline,
this.strikeThrough);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Immutable
public final class PieChartElementProps implements IProps {

public static final String TYPE = "PieChart"; //$NON-NLS-1$
public static final String TYPE = "PieChart";

private String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author sbegaudeau
*/
public final class ArchitectureConstants {
public static final String SIRIUS_COMPONENTS_CHARTS_ROOT_PACKAGE = "org.eclipse.sirius.components.charts.."; //$NON-NLS-1$
public static final String SIRIUS_COMPONENTS_CHARTS_ROOT_PACKAGE = "org.eclipse.sirius.components.charts..";

// @formatter:off
public static final JavaClasses CLASSES = new ClassFileImporter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public HierarchyCreationService(IRepresentationDescriptionSearchService represen
this.objectService = Objects.requireNonNull(objectService);
// @formatter:off
this.timer = Timer.builder(Monitoring.REPRESENTATION_EVENT_PROCESSOR_REFRESH)
.tag(Monitoring.NAME, "hierarchy") //$NON-NLS-1$
.tag(Monitoring.NAME, "hierarchy")
.register(meterRegistry);
// @formatter:on
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ public HierarchyDeserializer(IKindParser kindParser) {
@Override
public boolean canHandle(ObjectNode root) {
// @formatter:off
return Optional.ofNullable(root.get("kind")) //$NON-NLS-1$
return Optional.ofNullable(root.get("kind"))
.map(JsonNode::asText)
.filter(this::isHierarchyRepresentation)
.isPresent();
// @formatter:on
}

private boolean isHierarchyRepresentation(String kind) {
String type = this.kindParser.getParameterValues(kind).get("type").get(0); //$NON-NLS-1$
return type.equals("ForceDirectedTree") || type.equals("TreeMap") || type.equals("ZoomableCirclePacking"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String type = this.kindParser.getParameterValues(kind).get("type").get(0);
return type.equals("ForceDirectedTree") || type.equals("TreeMap") || type.equals("ZoomableCirclePacking");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void hierarchyRefreshed(IInput input, Hierarchy newHierarchy) {
if (this.sink.currentSubscriberCount() > 0) {
EmitResult emitResult = this.sink.tryEmitNext(new HierarchyRefreshedEventPayload(input.getId(), this.currentHierarchy));
if (emitResult.isFailure()) {
String pattern = "An error has occurred while emitting a HierarchyRefreshedEventPayload: {}"; //$NON-NLS-1$
String pattern = "An error has occurred while emitting a HierarchyRefreshedEventPayload: {}";
this.logger.warn(pattern, emitResult);
}
}
Expand All @@ -63,7 +63,7 @@ public Flux<IPayload> getFlux(IInput input) {
public void dispose() {
EmitResult emitResult = this.sink.tryEmitComplete();
if (emitResult.isFailure()) {
String pattern = "An error has occurred while marking the publisher as complete: {}"; //$NON-NLS-1$
String pattern = "An error has occurred while marking the publisher as complete: {}";
this.logger.warn(pattern, emitResult);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public UUID getHierarchyId() {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, projectId: {2}, hierarchyId: {3}'}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, projectId: {2}, hierarchyId: {3}'}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.editingContextId, this.hierarchyId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class HierarchyEventProcessor implements IHierarchyEventProcessor {
private final HierarchyEventFlux hierarchyEventFlux;

public HierarchyEventProcessor(IEditingContext editingContext, HierarchyContext hierarchyContext, ISubscriptionManager subscriptionManager, HierarchyCreationService hierarchyCreationService) {
this.logger.trace("Creating the hierarchy event processor {}", hierarchyContext.getHierarchy().getId()); //$NON-NLS-1$
this.logger.trace("Creating the hierarchy event processor {}", hierarchyContext.getHierarchy().getId());

this.editingContext = Objects.requireNonNull(editingContext);
this.hierarchyContext = Objects.requireNonNull(hierarchyContext);
Expand All @@ -64,7 +64,7 @@ public HierarchyEventProcessor(IEditingContext editingContext, HierarchyContext
hierarchyContext.update(hierarchy);
this.hierarchyEventFlux = new HierarchyEventFlux(hierarchy);

this.logger.trace("Hierarchy refreshed: {})", hierarchy.getId()); //$NON-NLS-1$
this.logger.trace("Hierarchy refreshed: {})", hierarchy.getId());
}

@Override
Expand All @@ -87,7 +87,7 @@ public void refresh(ChangeDescription changeDescription) {
if (this.shouldRefresh(changeDescription)) {
Hierarchy refreshedHierarchy = this.hierarchyCreationService.refresh(this.editingContext, this.hierarchyContext).orElse(null);

this.logger.trace("Hierarchy refreshed: {}", refreshedHierarchy.getId()); //$NON-NLS-1$
this.logger.trace("Hierarchy refreshed: {}", refreshedHierarchy.getId());

this.hierarchyContext.update(refreshedHierarchy);
this.hierarchyEventFlux.hierarchyRefreshed(changeDescription.getInput(), refreshedHierarchy);
Expand Down Expand Up @@ -117,7 +117,7 @@ public Flux<IPayload> getOutputEvents(IInput input) {

@Override
public void dispose() {
this.logger.trace("Disposing the hierarchy event processor {}", this.hierarchyContext.getHierarchy().getId()); //$NON-NLS-1$
this.logger.trace("Disposing the hierarchy event processor {}", this.hierarchyContext.getHierarchy().getId());

this.subscriptionManager.dispose();
this.hierarchyEventFlux.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Hierarchy getHierarchy() {

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, hierarchy: '{'id: {2}, label: {3}'}''}'"; //$NON-NLS-1$
String pattern = "{0} '{'id: {1}, hierarchy: '{'id: {2}, label: {3}'}''}'";
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.hierarchy.getId(), this.hierarchy.getLabel());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
@Configuration
public class CollaborativeChartsMessageServiceConfiguration {
private static final String PATH = "messages/sirius-components-collaborative-charts"; //$NON-NLS-1$
private static final String PATH = "messages/sirius-components-collaborative-charts";

@Bean
public MessageSourceAccessor collaborativeChartsMessageSourceAccessor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public final class MessageConstants {

public static final String INVALID_INPUT = "INVALID_INPUT"; //$NON-NLS-1$
public static final String INVALID_INPUT = "INVALID_INPUT";

private MessageConstants() {
// Prevent instantiation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Obeo.
* Copyright (c) 2019, 2022 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -85,18 +85,18 @@ private List<Class<?>> getJavaServices(Viewpoint viewpoint) {
// @formatter:on

for (String qualifiedName : qualifiedNames) {
if (qualifiedName.contains("::")) { //$NON-NLS-1$
this.logger.warn("Sirius Web does not support Acceleo-style :: references"); //$NON-NLS-1$
if (qualifiedName.contains("::")) {
this.logger.warn("Sirius Web does not support Acceleo-style :: references");
continue;
}
try {
Class<?> aClass = Class.forName(qualifiedName);
classes.add(aClass);
} catch (ClassNotFoundException exception) {
this.logger.warn("Could not load class '{}'", qualifiedName); //$NON-NLS-1$
this.logger.warn("Could not load class '{}'", qualifiedName);
} catch (NoClassDefFoundError exception) {
this.logger.error("Could not load class '{}'; not all dependencies could be " //$NON-NLS-1$
+ "instantiated by the JVM: {}", qualifiedName, exception.getMessage()); //$NON-NLS-1$
this.logger.error("Could not load class '{}'; not all dependencies could be "
+ "instantiated by the JVM: {}", qualifiedName, exception.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Obeo.
* Copyright (c) 2019, 2022 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -32,7 +32,7 @@ public class DomainClassPredicate implements Predicate<EClass> {
/**
* The pattern used to match the separator used by both Sirius and AQL.
*/
private static final Pattern SEPARATOR = Pattern.compile("(::?|\\.)"); //$NON-NLS-1$
private static final Pattern SEPARATOR = Pattern.compile("(::?|\\.)");

private String domainClass;

Expand All @@ -54,7 +54,7 @@ public boolean test(EClass actualType) {
className = this.domainClass;
}

if (!("EObject".equals(className) && packageName == null) && !("EObject".equals(className) && "ecore".equals(packageName))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (!("EObject".equals(className) && packageName == null) && !("EObject".equals(className) && "ecore".equals(packageName))) {
boolean result = false;

List<EClass> eAllTypes = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Obeo.
* Copyright (c) 2019, 2022 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -40,7 +40,7 @@ public class SemanticCandidatesProvider implements Function<VariableManager, Lis
* semantic resources of the session's ResourceSet, while the expression below will only look into the current
* resource.
*/
private static final String DEFAULT_SEMANTIC_CANDIDATES_EXPRESSION = "aql:self.eResource().getContents().eAllContents()"; //$NON-NLS-1$
private static final String DEFAULT_SEMANTIC_CANDIDATES_EXPRESSION = "aql:self.eResource().getContents().eAllContents()";

private AQLInterpreter interpreter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
*/
public class ToolImageProvider implements Supplier<String> {

private static final String ICON_PATH = "iconPath"; //$NON-NLS-1$
private static final String ICON_PATH = "iconPath";

private static final String ICON = "icon"; //$NON-NLS-1$
private static final String ICON = "icon";

private static final Pattern SEPARATOR = Pattern.compile("(::?|\\.)"); //$NON-NLS-1$
private static final Pattern SEPARATOR = Pattern.compile("(::?|\\.)");

private final IObjectService objectService;

Expand All @@ -65,7 +65,7 @@ public String get() {
// @formatter:off
return this.getImagePathFromIconPath()
.or(this::getImagePathFromDomainClass)
.orElse(""); //$NON-NLS-1$
.orElse("");
// @formatter:on
}

Expand All @@ -86,8 +86,8 @@ private Optional<String> getImagePathFromIconPath() {

private String normalize(String iconPath) {
String path = iconPath;
if (!iconPath.startsWith("/")) { //$NON-NLS-1$
path = "/" + iconPath; //$NON-NLS-1$
if (!iconPath.startsWith("/")) {
path = "/" + iconPath;
}

int index = path.indexOf('/', 1);
Expand Down
Loading

0 comments on commit 4d42d96

Please sign in to comment.