forked from javaparser/javaparser
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
# By jlerbsc (15) and others # Via GitHub (13) and jlerbsc (1) * upstream/master: Fix issues on unit tests Fix: Issue 3045 Unexpected exception when solving type inside an Anonymous class chore(deps): update dependency maven-wrapper to v3.1.1 chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.0.0-m8 chore(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.0 Improved search for functional interfaces An interface is not functional, while it only declares one abstract method which is not a member of Object, if it declares two abstract methods which are not public members of Object Throw an unsupported operation exception when the bound type of a scope, which is a constraint type, is not a reference type Creating a static method to instanciate LeastUpperBoundLogic Fix: Issue 1883 Finding lambda return type Fix: unit test resources Fix: issue 1815 ArrayIndexOutOfBoundsException when resolving lambda parameter. This fix is offered by Blackgen Refactor: cleanup/refactor code after fixing javaparser#3859 chore(deps): bump checkstyle from 10.6.0 to 10.7.0 [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release javaparser-parent-3.25.0 update readme Update changelog Revert checkstyle rule related to import from error to warning First part of the implementation of least upper bound logic # Conflicts: # changelog.md # javaparser-core-generators/pom.xml # javaparser-core-metamodel-generator/pom.xml # javaparser-core-serialization/pom.xml # javaparser-core-testing-bdd/pom.xml # javaparser-core-testing/pom.xml # javaparser-core/pom.xml # javaparser-core/src/main/java/com/github/javaparser/resolution/MethodUsage.java # javaparser-core/src/main/java/com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java # javaparser-core/src/main/java/com/github/javaparser/resolution/model/SymbolReference.java # javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedReferenceType.java # javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeVariable.java # javaparser-symbol-solver-core/pom.xml # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/resolution/promotion/BooleanConditionalExprHandler.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/resolution/promotion/ConditionalExprResolver.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/resolution/promotion/NumericConditionalExprHandler.java # javaparser-symbol-solver-core/src/main/java/com/github/javaparser/symbolsolver/resolution/promotion/ReferenceConditionalExprHandler.java # javaparser-symbol-solver-testing/pom.xml # javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/ConditionalExprTest.java # pom.xml # readme.md
- Loading branch information
Showing
61 changed files
with
1,901 additions
and
399 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...core-testing/src/test/java/com/github/javaparser/ast/nodeTypes/NodeWithArgumentsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. | ||
* Copyright (C) 2011, 2013-2023 The JavaParser Team. | ||
* | ||
* This file is part of JavaParser. | ||
* | ||
* JavaParser can be used either under the terms of | ||
* a) the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* b) the terms of the Apache License | ||
* | ||
* You should have received a copy of both licenses in LICENCE.LGPL and | ||
* LICENCE.APACHE. Please refer to those files for details. | ||
* | ||
* JavaParser is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
*/ | ||
|
||
package com.github.javaparser.ast.nodeTypes; | ||
|
||
import com.github.javaparser.ast.expr.Expression; | ||
import com.github.javaparser.ast.expr.MethodCallExpr; | ||
import com.github.javaparser.printer.lexicalpreservation.AbstractLexicalPreservingTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static com.github.javaparser.ast.expr.Expression.EXCLUDE_ENCLOSED_EXPR; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class NodeWithArgumentsTest extends AbstractLexicalPreservingTest { | ||
|
||
@Test | ||
void testGetArgumentPosition() { | ||
considerCode("" + | ||
"class Foo {\n" + | ||
" Map<Integer,String> map = new HashMap<>();\n" + | ||
" public String bar(int i) {\n" + | ||
" return map.put(((i)),((\"baz\")));\n" + | ||
" } \n" + | ||
"}"); | ||
MethodCallExpr mce = cu.findFirst(MethodCallExpr.class).get(); | ||
Expression arg0 = mce.getArgument(0); | ||
Expression arg1 = mce.getArgument(1); | ||
Expression innerExpr0 = arg0.asEnclosedExpr().getInner() | ||
.asEnclosedExpr().getInner(); | ||
Expression innerExpr1 = arg1.asEnclosedExpr().getInner() | ||
.asEnclosedExpr().getInner(); | ||
|
||
assertEquals(0, mce.getArgumentPosition(arg0)); // with no conversion | ||
assertEquals(0, mce.getArgumentPosition(innerExpr0, EXCLUDE_ENCLOSED_EXPR)); // with a conversion skipping EnclosedExprs | ||
assertEquals(1, mce.getArgumentPosition(arg1)); // with no conversion | ||
assertEquals(1, mce.getArgumentPosition(innerExpr1, EXCLUDE_ENCLOSED_EXPR)); // with a conversion skipping EnclosedExprs | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.