1

When I am working with com.google.code.javaparser , I found that this parser have less documentation and creating new statements with this parser seems difficult. If I am wrong share the coding snippets to create method and VariableDeclarationExpr with this package.

Can anyone compare the difference between com.google.code.javaparser and com.github.javaparser.

    <dependency>
        <groupId>com.google.code.javaparser</groupId>
        <artifactId>javaparser</artifactId>
        <version>1.0.8</version>
    </dependency>

and

    <dependency>
        <groupId>com.github.javaparser</groupId>
        <artifactId>javaparser-symbol-solver-core</artifactId>
        <version>3.22.1</version>
    </dependency>

I found some useful coding examples for com.github.javaparser with their free ebook. But I find that there are less articles and documentation that discuss about creating new elements. One of such article that I found useful with code snippets that can be used to create code ,but this don't provide a sample program.

There are different versions of com.github.javaparser available, version: 3.22.1 . This version supports

import com.github.javaparser.StaticJavaParser

but this version is not supporting

import com.github.javaparser.ast.stmt.ForeachStmt 
import com.github.javaparser.ast.stmt.SwitchEntryStmt

So I changed to Version 3.6.23 where I found

import com.github.javaparser.ast.stmt.ForeachStmt 
import com.github.javaparser.ast.stmt.SwitchEntryStmt 

are supporting but

import com.github.javaparser.StaticJavaParser 

is not supported!

Can anyone share other resources that gives clear picture about creating code using com.github.javaparser with clear example to create method and VariableDeclarationExpr within the class.

VA splash
  • 553
  • 1
  • 8
  • 25
  • 1
    This doesn't answer the question, but it looks to me like a project that migrated from Google Code (the Nth dead Google service) to GitHub, hence the different package names. The [github project repository](https://github.com/javaparser/javaparser) has links to example projects, in case it helps. – Federico klez Culloca Aug 11 '21 at 08:16

0 Answers0