Skip to content

Commit

Permalink
reduced visibility of some methods
Browse files Browse the repository at this point in the history
when redefining them it's useless to make them public; when used
internally, make them private
  • Loading branch information
LorenzoBettini committed Jan 2, 2024
1 parent 74faea2 commit 15b244d
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ protected XExpression normalizeBlockExpression(XExpression expr) {
}

@Override
public void doInternalToJavaStatement(XExpression obj, ITreeAppendable appendable, boolean isReferenced) {
protected void doInternalToJavaStatement(XExpression obj, ITreeAppendable appendable, boolean isReferenced) {
prependLocalTypesIfFieldInitializer(obj, appendable, isReferenced);
if(obj instanceof AnonymousClass)
_toJavaStatement((AnonymousClass)obj, appendable, isReferenced);
Expand All @@ -374,7 +374,7 @@ private void prependLocalTypesIfFieldInitializer(XExpression obj, ITreeAppendabl
}
}

public void _toJavaStatement(RichString richString, ITreeAppendable b, boolean isReferenced) {
private void _toJavaStatement(RichString richString, ITreeAppendable b, boolean isReferenced) {
LightweightTypeReference actualType = getLightweightType(richString);
b = b.trace(richString);
if (actualType.isType(StringConcatenationClient.class)) {
Expand Down Expand Up @@ -416,7 +416,7 @@ public void _toJavaStatement(RichString richString, ITreeAppendable b, boolean i
}

@Override
public void internalToConvertedExpression(XExpression obj, ITreeAppendable appendable) {
protected void internalToConvertedExpression(XExpression obj, ITreeAppendable appendable) {
if (obj instanceof AnonymousClass)
_toJavaExpression((AnonymousClass) obj, appendable);
else if (obj instanceof RichString)
Expand All @@ -425,7 +425,7 @@ else if (obj instanceof RichString)
super.internalToConvertedExpression(obj, appendable);
}

protected void _toJavaExpression(AnonymousClass anonymousClass, ITreeAppendable b) {
private void _toJavaExpression(AnonymousClass anonymousClass, ITreeAppendable b) {
String varName = getReferenceName(anonymousClass, b);
if (varName != null) {
b.trace(anonymousClass, false).append(varName);
Expand All @@ -445,7 +445,7 @@ protected void constructorCallToJavaExpression(XConstructorCall expr, ITreeAppen
}
}

protected void compileAnonymousClassBody(AnonymousClass anonymousClass, JvmDeclaredType type, ITreeAppendable b) {
private void compileAnonymousClassBody(AnonymousClass anonymousClass, JvmDeclaredType type, ITreeAppendable b) {
ITreeAppendable appendable = b.trace(anonymousClass, true);
appendable.append(" ");
appendable.openScope();
Expand All @@ -455,7 +455,7 @@ protected void compileAnonymousClassBody(AnonymousClass anonymousClass, JvmDecla
appendable.closeScope();
}

public void _toJavaExpression(RichString richString, ITreeAppendable b) {
private void _toJavaExpression(RichString richString, ITreeAppendable b) {
b.append(getVarName(richString, b));
if(getLightweightType(richString).isType(String.class))
b.append(".toString()");
Expand All @@ -468,7 +468,7 @@ protected void appendCatchClauseParameter(XCatchClause catchClause, JvmTypeRefer
super.appendCatchClauseParameter(catchClause, parameterType, parameterName, appendable);
}

protected void appendExtensionAnnotation(JvmFormalParameter parameter, EObject context,
private void appendExtensionAnnotation(JvmFormalParameter parameter, EObject context,
ITreeAppendable appendable, boolean newLine) {
if (parameter instanceof XtendFormalParameter) {
XtendFormalParameter castedParameter = (XtendFormalParameter) parameter;
Expand All @@ -478,7 +478,7 @@ protected void appendExtensionAnnotation(JvmFormalParameter parameter, EObject c
}
}

protected void appendExtensionAnnotation(EObject context, ITreeAppendable appendable, boolean newLine) {
private void appendExtensionAnnotation(EObject context, ITreeAppendable appendable, boolean newLine) {
JvmType extension = findKnownTopLevelType(Extension.class, context);
if (extension != null) {
appendable.append("@");
Expand Down Expand Up @@ -538,8 +538,8 @@ public void _toJavaExpression(XStringLiteral expr, ITreeAppendable b) {
public void _toJavaStatement(final XStringLiteral expr, ITreeAppendable b, boolean isReferenced) {
toJavaStatement(expr, b, isReferenced, false);
}
protected void _toJavaStatement(final AnonymousClass anonymousClass, ITreeAppendable b, final boolean isReferenced) {

private void _toJavaStatement(final AnonymousClass anonymousClass, ITreeAppendable b, final boolean isReferenced) {
_toJavaStatement(anonymousClass.getConstructorCall(), b, isReferenced);
}

Expand Down

0 comments on commit 15b244d

Please sign in to comment.