Skip to content

Commit

Permalink
Merge pull request #38644 from ballerina-platform/revert-idl-client-d…
Browse files Browse the repository at this point in the history
…eclaration

Revert idl client declaration feature
  • Loading branch information
azinneera committed Nov 14, 2022
2 parents 101d4d3 + 1a494ad commit 084b505
Show file tree
Hide file tree
Showing 320 changed files with 158 additions and 15,568 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pull_request_ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- stage-swan-lake
- 2201.[0-9]+.x
- 2201.[0-9]+.[0-9]+-stage
- native-build-stage

jobs:
ubuntu_build:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull_request_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- ballerina-[0-9]+.[0-9]+.x
- 2201.[0-9]+.x
- 2201.[0-9]+.[0-9]+-stage
- native-build-stage

jobs:
windows_build:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ velocity.log
/composer/modules/web/dist-electron
extractedDistribution
misc/testerina/modules/report-tools/node_modules/
generated

# gradle
.gradle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@ public void execute(Project project) {

System.setProperty(CentralClientConstants.ENABLE_OUTPUT_STREAM, "true");

// Run IDL generator plugins
project.currentPackage().runIDLGeneratorPlugins();
List<Diagnostic> diagnostics = new ArrayList<>();

try {
List<Diagnostic> diagnostics = new ArrayList<>();
long start = 0;
if (project.buildOptions().dumpBuildTime()) {
start = System.currentTimeMillis();
Expand Down
14 changes: 0 additions & 14 deletions compiler/ballerina-lang/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@
<Class name="io.ballerina.projects.ModuleCompilation"/>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>
<Match>
<Class name="io.ballerina.projects.internal.bala.IDLClientsJson"/>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>
<Match>
<Class name="org.wso2.ballerinalang.compiler.bir.optimizer.BIROptimizer$OptimizerEnv"/>
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
Expand Down Expand Up @@ -315,11 +311,6 @@
<Class name="io.ballerina.projects.internal.BalaFiles" />
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
</Match>
<Match>
<Class name="io.ballerina.projects.internal.BalaFiles" />
<Method name="createIDLClientsMapFromJson" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
<Match>
<Class name="io.ballerina.projects.internal.ProjectFiles" />
<Method name="loadDocuments" />
Expand Down Expand Up @@ -442,9 +433,4 @@
<Method name="addMatchingIncludePaths" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
<Match>
<Class name="io.ballerina.projects.Package" />
<Method name="saveGeneratedModules" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.BLangBlockFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangClassDefinition;
import org.wso2.ballerinalang.compiler.tree.BLangClientDeclaration;
import org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit;
import org.wso2.ballerinalang.compiler.tree.BLangErrorVariable;
import org.wso2.ballerinalang.compiler.tree.BLangExprFunctionBody;
Expand Down Expand Up @@ -230,10 +229,6 @@ public void visit(BLangImportPackage importPkgNode) {
public void visit(BLangXMLNS xmlnsNode) {
}

@Override
public void visit(BLangClientDeclaration clientDecl) {
}

@Override
public void visit(BLangFunction funcNode) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.BLangBlockFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangClassDefinition;
import org.wso2.ballerinalang.compiler.tree.BLangClientDeclaration;
import org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit;
import org.wso2.ballerinalang.compiler.tree.BLangErrorVariable;
import org.wso2.ballerinalang.compiler.tree.BLangExprFunctionBody;
Expand Down Expand Up @@ -282,12 +281,6 @@ private boolean lookupNode(BLangNode node) {
public void visit(BLangXMLNS xmlnsNode) {
lookupNode(xmlnsNode.namespaceURI);
}

@Override
public void visit(BLangClientDeclaration clientDeclNode) {
lookupNode((BLangNode) clientDeclNode.getUri());
}

@Override
public void visit(BLangFunction funcNode) {
// Compare the target lookup pos with the function symbol pos to ensure that we are not looking for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.BLangBlockFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangClassDefinition;
import org.wso2.ballerinalang.compiler.tree.BLangClientDeclaration;
import org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit;
import org.wso2.ballerinalang.compiler.tree.BLangErrorVariable;
import org.wso2.ballerinalang.compiler.tree.BLangExprFunctionBody;
Expand Down Expand Up @@ -284,13 +283,6 @@ public void visit(BLangXMLNS xmlnsNode) {
find(xmlnsNode.namespaceURI);
addIfSameSymbol(xmlnsNode.symbol, xmlnsNode.prefix.pos);
}

@Override
public void visit(BLangClientDeclaration clientDeclNode) {
find((BLangNode) clientDeclNode.getUri());
addIfSameSymbol(clientDeclNode.symbol, clientDeclNode.prefix.pos);
}

@Override
public void visit(BLangFunction funcNode) {
find(funcNode.annAttachments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.ballerina.compiler.api.impl.symbols.BallerinaAnnotationSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaClassFieldSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaClassSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaClientDeclSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaConstantSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaEnumSymbol;
import io.ballerina.compiler.api.impl.symbols.BallerinaFunctionSymbol;
Expand Down Expand Up @@ -67,7 +66,6 @@
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BAttachedFunction;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BClassSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BClientDeclarationSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BConstantSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BEnumSymbol;
import org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol;
Expand Down Expand Up @@ -234,10 +232,6 @@ public Symbol getBCompiledSymbol(BSymbol symbol, String name) {
return createXMLNamespaceSymbol((BXMLNSSymbol) symbol);
}

if (symbol.kind == SymbolKind.CLIENT_DECL) {
return createClientDeclSymbol((BClientDeclarationSymbol) symbol);
}

throw new IllegalArgumentException("Unsupported symbol type: " + symbol.getClass().getName());
}

Expand Down Expand Up @@ -674,37 +668,6 @@ public BallerinaXMLNSSymbol createXMLNamespaceSymbol(BXMLNSSymbol symbol) {
return symbolBuilder.build();
}

/**
* Creates a client declaration Symbol.
*
* @param symbol declaration symbol to convert
* @return {@link BallerinaClientDeclSymbol}
*/
private BallerinaClientDeclSymbol createClientDeclSymbol(BClientDeclarationSymbol symbol) {
BallerinaClientDeclSymbol.ClientDeclSymbolBuilder symbolBuilder =
new BallerinaClientDeclSymbol.ClientDeclSymbolBuilder(symbol.getName().getValue(), symbol, context);

for (AnnotationAttachmentSymbol annot : symbol.getAnnotations()) {
BallerinaAnnotationAttachmentSymbol annotAttachment =
createAnnotAttachment((BAnnotationAttachmentSymbol) annot);
symbolBuilder.withAnnotationAttachment(annotAttachment);
symbolBuilder.withAnnotation(annotAttachment.typeDescriptor());
}

return symbolBuilder.build();
}

/**
* Get associated module of the given client declaration symbol.
*
* @param clientDeclSymbol Client declaration Symbol
* @return {@link BallerinaModule} symbol generated
*/
public BallerinaModule getAssociatedModule(BClientDeclarationSymbol clientDeclSymbol) {
BPackageSymbol packageSymbol = (BPackageSymbol) symResolver.resolveClientDeclPrefix(clientDeclSymbol);
return createModuleSymbol(packageSymbol, packageSymbol.getName().value);
}

/**
* Create a module symbol.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.BLangBlockFunctionBody;
import org.wso2.ballerinalang.compiler.tree.BLangClassDefinition;
import org.wso2.ballerinalang.compiler.tree.BLangClientDeclaration;
import org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit;
import org.wso2.ballerinalang.compiler.tree.BLangErrorVariable;
import org.wso2.ballerinalang.compiler.tree.BLangExprFunctionBody;
Expand Down Expand Up @@ -290,15 +289,6 @@ public void visit(BLangXMLNS xmlnsNode) {
lookupNode(xmlnsNode.namespaceURI);
}

@Override
public void visit(BLangClientDeclaration clientDeclNode) {
if (setEnclosingNode(clientDeclNode.symbol, clientDeclNode.prefix.pos)) {
return;
}

lookupNode((BLangNode) clientDeclNode.getUri());
}

@Override
public void visit(BLangFunction funcNode) {
if (setEnclosingNode(funcNode.symbol, funcNode.name.pos)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ public static List<AnnotationAttachPoint> getAttachPoints(int maskedPoints) {
if (Symbols.isAttachPointPresent(maskedPoints, AttachPoints.RECORD_FIELD)) {
annotationAttachPoints.add(AnnotationAttachPoint.RECORD_FIELD);
}
if (Symbols.isAttachPointPresent(maskedPoints, AttachPoints.CLIENT)) {
annotationAttachPoints.add(AnnotationAttachPoint.CLIENT);
}

return annotationAttachPoints;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ public enum AnnotationAttachPoint {
EXTERNAL,
VAR,
CONST,
WORKER,
CLIENT
WORKER;
}
Loading

0 comments on commit 084b505

Please sign in to comment.