Skip to content

Commit

Permalink
Merge branch 'R4_4-branch' into master-luna-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
azachar committed Aug 14, 2014
2 parents 786af2c + d255e0b commit 7afe0ce
Show file tree
Hide file tree
Showing 194 changed files with 5,928 additions and 711 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.astview/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.astview; singleton:=true
Bundle-Version: 1.1.9.qualifier
Bundle-Version: 1.1.100.qualifier
Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git;path="org.eclipse.jdt.astview";tag=R4_4
Bundle-Activator: org.eclipse.jdt.astview.ASTViewPlugin
Bundle-Vendor: %providerName
Expand Down
28 changes: 28 additions & 0 deletions org.eclipse.jdt.astview/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>June 2, 2006</p>
<h3>License</h3>

<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>

<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>

</body>
</html>
6 changes: 3 additions & 3 deletions org.eclipse.jdt.astview/build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2001, 2009 IBM Corporation and others.
# Copyright (c) 2001, 2014 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
Expand All @@ -9,13 +9,13 @@
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = plugin.xml,\
about.html,\
icons/,\
buildnotes_astview.html,\
plugin.properties,\
META-INF/,\
.
src.includes = buildnotes_astview.html

source.. = src/
output.. = bin/
jre.compilation.profile = J2SE-1.4
javacDefaultEncoding.. = UTF-8
4 changes: 2 additions & 2 deletions org.eclipse.jdt.astview/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2013 Eclipse Foundation and others.
Copyright (c) 2012, 2014 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
Expand All @@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.astview</artifactId>
<version>1.1.9-SNAPSHOT</version>
<version>1.1.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
6 changes: 4 additions & 2 deletions org.eclipse.jdt.jeview/build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2005, 2009 IBM Corporation and others.
# Copyright (c) 2005, 2014 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
Expand All @@ -14,5 +14,7 @@ bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
plugin.properties
plugin.properties,\
about.html
src.includes = icons/
javacDefaultEncoding.. = UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ private static void addTypeProperties() {
return ((IType) element).isMember();
}
});
addProperty(new Property(IType.class, "isLambda") {
@Override public Object compute(IJavaElement element) throws JavaModelException {
return ((IType) element).isLambda();
}
});
}

private static void addPackageFragmentProperties() {
Expand Down
4 changes: 0 additions & 4 deletions org.eclipse.jdt.junit.runtime/.template

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ public final class JUnitMessages extends NLS {
public static String OpenEditorAction_error_dialog_title;
public static String OpenEditorAction_message_cannotopen;
public static String OpenTestAction_error_methodNoFound;
public static String OpenTestAction_error_title;
public static String OpenTestAction_dialog_title;
public static String OpenTestAction_select_element;
public static String RerunAction_label_debug;
public static String RerunAction_label_run;
public static String RerunAction_label_rerun;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ OpenEditorAction_error_dialog_title=Error
OpenEditorAction_error_dialog_message=Cannot open editor
OpenEditorAction_message_cannotopen=Cannot open editor

OpenTestAction_error_title=Go To Test
OpenTestAction_dialog_title=Go to Test
OpenTestAction_error_methodNoFound=Method ''{0}'' not found. Opening the test class.
OpenTestAction_select_element=&Select or enter the element to open:


TestRunnerViewPart_jobName=Update JUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Andreas Schmid, [email protected] - Locate test method even if it contains parameters - http://bugs.eclipse.org/343935
*******************************************************************************/
package org.eclipse.jdt.internal.junit.ui;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand All @@ -24,6 +27,7 @@

import org.eclipse.ui.texteditor.ITextEditor;

import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
Expand All @@ -40,6 +44,8 @@
import org.eclipse.jdt.internal.junit.model.TestCaseElement;
import org.eclipse.jdt.internal.junit.model.TestElement;

import org.eclipse.jdt.internal.ui.actions.SelectionConverter;

/**
* Open a class on a Test method.
*/
Expand Down Expand Up @@ -117,7 +123,7 @@ protected IJavaElement findElement(IJavaProject project, String className) throw
}
}
if (method == null) {
String title= JUnitMessages.OpenTestAction_error_title;
String title= JUnitMessages.OpenTestAction_dialog_title;
String message= Messages.format(JUnitMessages.OpenTestAction_error_methodNoFound, BasicElementLabels.getJavaElementName(fMethodName));
MessageDialog.openInformation(getShell(), title, message);
return type;
Expand All @@ -134,6 +140,35 @@ private IMethod findMethod(IType type) {
IMethod method= type.getMethod(fMethodName, new String[0]);
if (method != null && method.exists())
return method;

// search just by name, if method not found yet (for custom runner with test methods having parameters)
try {
List<IMethod> foundMethods= new ArrayList<IMethod>();
for (IMethod method2 : type.getMethods()) {
String methodName= method2.getElementName();
IAnnotation methodAnnotation= method2.getAnnotation("Test"); //$NON-NLS-1$

// JUnit3 test method starts with "test" or JUnit4 test method is annotated with "@Test"
if (!(methodName.startsWith("test") || (methodAnnotation != null && methodAnnotation.exists()))) //$NON-NLS-1$
continue;

if (fMethodName.equals(methodName))
foundMethods.add(method2);
}
if (foundMethods.isEmpty())
return null;
else if (foundMethods.size() > 1) {
IMethod[] elements= foundMethods.toArray(new IMethod[foundMethods.size()]);
String title= JUnitMessages.OpenTestAction_dialog_title;
String message= JUnitMessages.OpenTestAction_select_element;

return (IMethod)SelectionConverter.selectJavaElement(elements, getShell(), title, message);
} else
return foundMethods.get(0);
} catch (JavaModelException e) {
// if type does not exist or if an exception occurs while accessing its resource => ignore (no method found)
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package defaultMethods_in;

import java.io.IOException;

@FunctionalInterface
interface FI {
int foo(int i) throws IOException;

default FI method1(FI i1) {
/*[*/return FI::fun;/*]*/
}

static int fun(int i) throws IOException {
return i++;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package defaultMethods_in;

import java.io.IOException;

@FunctionalInterface
interface FI {
int foo(int i) throws IOException;

default FI method1(FI i1) {
return extracted();
}

default FI extracted() {
/*[*/return FI::fun;/*]*/
}

static int fun(int i) throws IOException {
return i++;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package lambdaExpression18_in;

import java.io.IOException;

@FunctionalInterface
interface FI {
int foo(int i) throws IOException;

default FI method(FI i1) throws InterruptedException {
/*[*/if (i1 == null)
throw new InterruptedException();
return x -> {
throw new IOException();
};/*]*/
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package lambdaExpression18_in;

import java.io.IOException;

@FunctionalInterface
interface FI {
int foo(int i) throws IOException;

default FI method(FI i1) throws InterruptedException {
return extracted(i1);
}

default FI extracted(FI i1) throws InterruptedException {
/*[*/if (i1 == null)
throw new InterruptedException();
return x -> {
throw new IOException();
};/*]*/
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// 5, 28 -> 5, 30 replaceAll = true, removeDeclaration = true
package p;

class TestInlineLambda {
public static final FI fi = x -> x++;

static {
FI a = fi; // [1]
FI b;
b = fi; // [2]
}

private FI fun1() {
return fi; // [3]
}

FI[] c = new FI[] {fi, fi}; // [4]
FI[][] d = new FI[][] {{fi, fi}, {fi}}; // [5]
FI[] e = {fi, fi}; // [6]
FI[][] f = {{fi}, {fi}}; // [7]

int g = fun2(fi); // [8]
TestInlineLambda h = new TestInlineLambda(fi); // [9]
private int fun2(FI fi) {return 0;}
public TestInlineLambda(FI fi) {}

private void fun3() {
F f1 = (fi_p) -> fi; // [10]
F f2 = (fi_p) -> {
return fi; // [11]
};
boolean flag = true;
FI fi4 = flag ? fi : fi; // [12]
}

enum E {
E_C1(fi); // [13]
E(FI fi) {
}
}

}

enum E1 {
E_C1(TestInlineLambda.fi); // [14]
E1(FI fi) {
}
}

@FunctionalInterface
interface FI {
int foo(int x);
}

@FunctionalInterface
interface F {
FI bar(Object o);
}
Loading

0 comments on commit 7afe0ce

Please sign in to comment.