From 15b244df8293c79627f6d02f6cf5b71864282a02 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Tue, 2 Jan 2024 19:20:38 +0100 Subject: [PATCH] reduced visibility of some methods when redefining them it's useless to make them public; when used internally, make them private --- .../xtend/core/compiler/XtendCompiler.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/org.eclipse.xtend.core/src/org/eclipse/xtend/core/compiler/XtendCompiler.java b/org.eclipse.xtend.core/src/org/eclipse/xtend/core/compiler/XtendCompiler.java index bb95fe293e0..0eae3d402cd 100644 --- a/org.eclipse.xtend.core/src/org/eclipse/xtend/core/compiler/XtendCompiler.java +++ b/org.eclipse.xtend.core/src/org/eclipse/xtend/core/compiler/XtendCompiler.java @@ -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); @@ -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)) { @@ -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) @@ -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); @@ -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(); @@ -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()"); @@ -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; @@ -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("@"); @@ -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); }