Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2014-10-16 02:40:34 +0000
committerJayaprakash Arthanareeswaran2014-11-20 16:38:23 +0000
commite27be48ee11d57346cc42f5ceea57f2f158d38a8 (patch)
tree3f1fd92ad46203bffecf088068d6156b0bd9f651
parent9bbd1c75c3645a901e87d8dd5657f584792bbe64 (diff)
downloadeclipse.jdt.core-e27be48ee11d57346cc42f5ceea57f2f158d38a8.tar.gz
eclipse.jdt.core-e27be48ee11d57346cc42f5ceea57f2f158d38a8.tar.xz
eclipse.jdt.core-e27be48ee11d57346cc42f5ceea57f2f158d38a8.zip
Fix for [Bug 447062] [1.8][dom/ast] lambda as a class member -
IllegalArgumentException
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java32
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java3
2 files changed, 35 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
index 7cc7d6f053..6586982525 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
@@ -4720,4 +4720,36 @@ public void testBug435348() throws JavaModelException {
"}\n";
buildAST(contents, this.workingCopy, false);
}
+/**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=447062
+ *
+ * @throws JavaModelException
+ */
+public void testBug447062() throws JavaModelException {
+ String contents =
+ "public class X {\n" +
+ " Runnable foo = () -> {\n" +
+ " \n" +
+ " }\n" +
+ "}\n";
+ this.workingCopy = getWorkingCopy("/Converter18/src/test447062/X.java", contents, true/*computeProblems*/);
+ IJavaProject javaProject = this.workingCopy.getJavaProject();
+ class BindingRequestor extends ASTRequestor {
+ ITypeBinding _result = null;
+ public void acceptBinding(String bindingKey, IBinding binding) {
+ if (this._result == null && binding != null && binding.getKind() == IBinding.TYPE)
+ this._result = (ITypeBinding) binding;
+ }
+ }
+ final BindingRequestor requestor = new BindingRequestor();
+ final ASTParser parser = ASTParser.newParser(AST.JLS8);
+ parser.setResolveBindings(false);
+ parser.setProject(javaProject);
+ parser.setIgnoreMethodBodies(true);
+ try {
+ parser.createASTs(new ICompilationUnit[] {this.workingCopy}, new String[0], requestor, null);
+ } catch (IllegalArgumentException e) {
+ assertTrue("Test Failed", false);
+ }
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index f9f4de763b..146a819f94 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -7969,7 +7969,10 @@ protected void consumeLambdaExpression() {
Statement body = (Statement) this.astStack[this.astPtr--];
if (body instanceof Block) {
if (this.options.ignoreMethodBodies) {
+ Statement oldBody = body;
body = new Block(0);
+ body.sourceStart = oldBody.sourceStart;
+ body.sourceEnd = oldBody.sourceEnd;
}
((Block) body).lambdaBody = true; // for consistency's sakes.
}

Back to the top

td colspan='2'>3 years R4_1_maintenanceIncreased bundle version to fix wrong tagDani Megert12 years R4_20_maintenanceTouch documentation bundles for javadoc regeneration for 4.20RC2aEclipse Releng Bot3 years R4_21_maintenanceTouch documentation bundles for javadoc regenerationEclipse Releng Bot3 years R4_22_maintenanceTouch documentation bundles for javadoc regenerationEclipse Releng Bot2 years R4_23_maintenanceTouch documentation bundles for javadoc regenerationEclipse Releng Bot2 years R4_2_maintenancebug 435328 - update buildDoc.xml for jdt.doc.isv bundleSteve Francisco10 years R4_3_maintenanceFixed bug 427076: Touch documentation plug-ins to regenerate examples, Javado...Dani Megert10 years R4_4_maintenanceFixed bug 458954: Touch ISV doc to force Javadoc regeneration for 4.4.2Dani Megert9 years R4_5_maintenanceIncreased bundle versions for ISV bundles (trigger doc generation)Dani Megert8 years R4_6_maintenanceForce Javadoc re-generation for Neon.3 RC3Markus Keller7 years R4_7_maintenanceJetty upgradeEclipse Releng Bot3 years R4_8_maintenanceJetty upgradeEclipse Releng Bot3 years R4_9_maintenanceBug 538766 - Platform porting guide for 4.9 is missing in the helpKalyan Prasad Tatavarthi6 years RC1_32_branch135107 [Help] Allow users to use .html/.htm file extension for XHTML contentCurtis D'Entremont18 years SSQ_build'new version v3554a'Felipe Heidrich15 years accessibility_work_R3_6This commit was manufactured by cvs2svn to create branchcvs2svn14 years branch34M6aThis commit was manufactured by cvs2svn to create branch 'branch34M6a'.cvs2svn16 years branch_I20101102-0800This commit was manufactured by cvs2svn to create branchcvs2svn13 years bug305747Bug 305747 - 3.4 legacy org.eclipse.equinox.p2.metadata.generator.EclipseGene...DJ Houghton14 years fri_I20080422-0800update sat4j to stable and non-deleted urlKim Moir16 years generic_variable_supportBug 36930 - Support variables in launch configurationsjburns21 years git_testsync with headKim Moir13 years git_test_37xBug 349460 - Git Migration: need proof that we can build 3.7.1 against GitKim Moir13 years icu481testTesting 3.7 build with com.ibm.icu_4.5.1.v20100830.jarPaul Webster14 years masterMigration to GithubSravan Kumar Lakkimsetti2 years p2integration*** empty log message ***Pascal Rapicault16 years perf_213*** empty log message ***Jerome Lanneluc19 years perf_30*** empty log message ***Sonia Dimitrov19 years perf_301*** empty log message ***Sonia Dimitrov19 years perf_31x*** empty log message ***Darin Wright18 years perf_32xBug 229782 - Performance tests for ICU Collatorkhorne15 years perf_33xBug 229782 - Performance tests for ICU Collatorkhorne15 years perf_34x Bug 285680 No perfs results for perf_34x baseline since 06/12Kim Moir15 years perf_35xContribution for perf_35 - Fix for 322325Satyam Kandula13 years perf_36xBackport patch for bug 343242: CodeCompletionPerformanceTest#testApplicationW...Deepak Azad13 years perf_37xdisable p2.discovery tests for perf 3.8 runKim Moir12 years pre_restructureThis commit was manufactured by cvs2svn to create branch 'pre_restructure'.cvs2svn21 years pwebster/R3_8_maintenanceBump pom versions.Thanh Ha12 years pwebster/R4_2_maintenanceBump pom versionsThanh Ha12 years pwebster/bug390982Bug 390982 - Build documentation in CBI buildThanh Ha11 years refs/remotes/origin/R3_7_maintenanceBug 364980 - org.eclipse.platform.doc.user ships different binarykmoir12 years releng_testBug 183958 Source lost due to Orbit migrationKim Moir17 years unlabeled-1.246.2.5.2perf_31 - Initial branch content based on v_570 (aka R3_1)Jerome Lanneluc19 years v20090820_e4mergerevert for test build for SzymonKim Moir15 years v33M4_patches*** empty log message ***Grant Gayed17 years v33M5aReverting M5a fixBoris Bokowski17 years