Skip to content

Commit

Permalink
Eclipse 4.12 (M3) JDT Patch for Groovy-Eclipse: JDT commit 3d670fe
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed May 25, 2019
1 parent 7a98723 commit 2567539
Show file tree
Hide file tree
Showing 90 changed files with 2,262 additions and 686 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2009-2018 the original author or authors.
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -15,8 +15,10 @@
*/
package org.codehaus.groovy.eclipse.refactoring.core.utils;

import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -51,11 +53,13 @@
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.ImportDeclaration;
import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
import org.eclipse.jdt.core.formatter.CodeFormatter;
import org.eclipse.jdt.core.formatter.IndentManipulation;
import org.eclipse.jdt.groovy.core.util.ReflectionUtils;
import org.eclipse.jdt.internal.core.manipulation.util.Strings;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedConstructorsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
Expand Down Expand Up @@ -464,7 +468,16 @@ private void buildTypeMembers(IType type, int indent, IProgressMonitor monitor)
}

if (buildConstructors) {
AddUnimplementedConstructorsOperation operation = new AddUnimplementedConstructorsOperation(astRoot, binding, null, -1, false, true, false);
// constructor changes in Eclipse IDE 4.12
AddUnimplementedConstructorsOperation operation;
Constructor<AddUnimplementedConstructorsOperation> ctor;
try {
ctor = ReflectionUtils.getConstructor(AddUnimplementedConstructorsOperation.class, new Class[] {CompilationUnit.class, ITypeBinding.class, IMethodBinding[].class, int.class, boolean.class, boolean.class, boolean.class, Map.class});
operation = ReflectionUtils.invokeConstructor(ctor, astRoot, binding, null, Integer.valueOf(-1), Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, null);
} catch (RuntimeException e) {
ctor = ReflectionUtils.getConstructor(AddUnimplementedConstructorsOperation.class, new Class[] {CompilationUnit.class, ITypeBinding.class, IMethodBinding[].class, int.class, boolean.class, boolean.class, boolean.class});
operation = ReflectionUtils.invokeConstructor(ctor, astRoot, binding, null, Integer.valueOf(-1), Boolean.FALSE, Boolean.TRUE, Boolean.FALSE);
}
operation.setOmitSuper(false);
operation.setCreateComments(addComments);
operation.run(((SubMonitor) monitor).split(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</license>

<requires>
<import feature="org.eclipse.jdt" version="3.18.0.v20190411-0625" patch="true"/>
<import feature="org.eclipse.jdt" version="3.18.0.v20190522-1800" patch="true"/>
</requires>

<plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ private static Class[] getAllTestClasses() {
GetResourcesTests.class,
FriendDependencyTests.class,
ReferenceCollectionTest.class,
StateTest.class,
TestAttributeBuilderTests.class,
Bug530366Test.class,
Bug531382Test.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2019 Sebastian Zarnekow and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
* Sebastian Zarnekow - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.tests.builder;

Expand Down Expand Up @@ -77,8 +77,7 @@ char[][] getRootReferences() {
}
}

// Disabled due bug 545491 comment 15
public void XtestInternQualifiedNamesSorts_01() {
public void testInternQualifiedNamesSorts_01() {
char[][][] qualifiedNames = new char[][][] {
CharOperation.splitOn('.', "java.lang.RuntimeException".toCharArray()),
CharOperation.splitOn('.', "a.a.a".toCharArray()),
Expand All @@ -97,8 +96,7 @@ public void XtestInternQualifiedNamesSorts_01() {
toStringArray(internQualifiedNames));
}

// Disabled due bug 545491 comment 15
public void XtestInternQualifiedNamesSorts_02() {
public void testInternQualifiedNamesSorts_02() {
char[][][] qualifiedNames = new char[][][] {
CharOperation.splitOn('.', "java.lang.RuntimeException".toCharArray()),
CharOperation.splitOn('.', "a.a.a".toCharArray()),
Expand All @@ -124,8 +122,7 @@ public void XtestInternQualifiedNamesSorts_02() {
toStringArray(internQualifiedNames));
}

// Disabled due bug 545491 comment 15
public void XtestInternSimpleNamesSorts_01() {
public void testInternSimpleNamesSorts_01() {
char[][] simpleNames = new char[][] {
"Throwable".toCharArray(),
"aaa".toCharArray(),
Expand All @@ -142,8 +139,7 @@ public void XtestInternSimpleNamesSorts_01() {
toStringArray(internSimpleNames));
}

// Disabled due bug 545491 comment 15
public void XtestInternSimpleNamesSorts_02() {
public void testInternSimpleNamesSorts_02() {
char[][] simpleNames = new char[][] {
"aaa".toCharArray(),
"bbb".toCharArray(),
Expand Down Expand Up @@ -291,8 +287,7 @@ public void testIncludesNot() {
assertFalse(other.includes(refColl.getQualifiedNameReferences(), refColl.getSimpleNameReferences(), refColl.getRootReferences()));
}

// Disabled due bug 545491 comment 15
public void XtestAddDependencies() {
public void testAddDependencies() {
TestableReferenceCollection refColl = new TestableReferenceCollection(null, null, null);

String[] array = new String[] {"a.b.c.D"};
Expand Down
Loading

0 comments on commit 2567539

Please sign in to comment.