diff --git a/.idea/libraries/Groovy.xml b/.idea/libraries/Groovy.xml
index e396e496812e..3df0b5fbd6bc 100644
--- a/.idea/libraries/Groovy.xml
+++ b/.idea/libraries/Groovy.xml
@@ -1,46 +1,11 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/bin/idea.properties b/bin/idea.properties
index a9cd05389fd5..9e8524cd8523 100644
--- a/bin/idea.properties
+++ b/bin/idea.properties
@@ -1,4 +1,4 @@
-# Use ${idea.home} macro to specify location relative to IDE installation home.
+# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes (e.g. c:/idea/system).
diff --git a/build/conf/classVersions.txt b/build/conf/classVersions.txt
index 7ca31d1d871c..377431bd105c 100644
--- a/build/conf/classVersions.txt
+++ b/build/conf/classVersions.txt
@@ -36,6 +36,9 @@
1.5 => plugins/Groovy/lib/groovy_rt.jar
1.5 => lib/annotations.jar
+1.7 => lib/groovy-all-2.3.7.jar!org/codehaus/groovy/runtime/WritablePath.class
+1.7 => lib/groovy-all-2.3.7.jar!org/codehaus/groovy/runtime/NioGroovyMethods.class
+
1.6 => plugins/gradle/lib/gradle-jps-plugin.jar
1.3 => plugins/junit/lib/junit-rt.jar
\ No newline at end of file
diff --git a/build/conf/ideaCE64-launcher.properties b/build/conf/ideaCE64-launcher.properties
index 2277afab3863..0567cc288251 100644
--- a/build/conf/ideaCE64-launcher.properties
+++ b/build/conf/ideaCE64-launcher.properties
@@ -4,5 +4,5 @@ IDS_APP_TITLE=__IDE-NAME__ Launcher
IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__
IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER
IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES
-IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME___VM_OPTIONS
+IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME__64_VM_OPTIONS
IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__
diff --git a/build/lib/gant/README_Install.txt b/build/lib/gant/README_Install.txt
index 179af7832043..5f6cc4ae2aa6 100644
--- a/build/lib/gant/README_Install.txt
+++ b/build/lib/gant/README_Install.txt
@@ -1,27 +1,30 @@
Gant -- A Groovy way of scripting Ant tasks.
+
This is Gant, a Groovy way of working with Ant tasks -- no more XML :-)
The method of installation depends on whether you have downloaded a tarball or
-zipfile distribution, or you have a Bazaar branch -- or a Subversion checkout,
-or even a Git clone -- of the source.
+zipfile distribution, or you have a Git clone -- or even a Bazaar branch -- of
+the source.
+
Distribution
------------
The Gant distributions contain a ready-made install directory hierarchy.
Untar the tarball or unzip the zipfile to the location where you want the Gant
-installation to reside. A directory with the name structured
+installation to reside. A directory with the name structured
gant- will be created in the location specified for the
untar or unzip.
There are a number of distinct distributions:
- 1. Requires a separate Groovy installation. There are builds:
- a. compiled against Groovy 1.6.7; and
- b. compiled against Groovy 1.7-rc-2.
+ 1. Requires a separate Groovy installation. There are builds:
+ a. compiled against Groovy 1.7.10; and
+ b. compiled against Groovy 1.8.6; and
+ c. compiled against Groovy 2.0.0-beta-2
- 2. Self-contained, includes all dependent jars.
+ 2. Self-contained, includes all dependent jars.
You might like to set up an environment variable GANT_HOME set to the
directory created by the untar or unzip, though this is not essential, it is
@@ -30,33 +33,31 @@ just an efficiency.
The script $GANT_HOME/bin/gant for systems with a Posix shell, or
$GANT_HOME/bin/gant.bat on Windows is the mechanism for launching a Gant run.
-Distributions 1a and 1b only include the direct Gant materials. The Maven
+Distributions 1a, 1b and 1c only include the direct Gant materials. The Maven
target set depends on use of the Maven Ant tasks, and the Ivy tool depends on
the Ivy jar, these will have to be downloaded and installed into
$GANT_HOME/lib unless they are already available on on your CLASSPATH.
-Using a Bazaar Branch
----------------------
-You first need to get a source tree. Bazaar is the version control system
-used for developing Gant. For reasons that are unlikely to become apparent
-quickly, the master branch is actually held in the Subversion repository at
-Codehaus. However the effective mainline is a branch on Launchpad. So to get
-a branch:
+Using a Git Clone
+-----------------
- bzr branch lp:gant Gant_Trunk
+Gant's mainline is a Git repository on GitHub, see
-or
+ https://github.com/Gant/Gant
- bzr branch http://svn.codehaus.org/gant/gant/trunk Gant_Trunk
+you should fork this on GitHub and then clone to give you a local repository.
-(If you are going to actively develop Gant, you almost certainly want to have
-a shared repository in which this mirror branch is kept so that you can then
-make feature branches from it.)
+The repository on Codehaus at:
+
+ git://git.codehaus.org/gant.git
+
+is an administrative clone of the GitHub mainline and should not be used in
+normal circumstances.
Gradle is used as the build system for Gant, so you will need to set the
gant_installPath property in ~/.gradle/gradle.properties so you can install
-Gant. So for example:
+Gant. So for example:
gant_installPath = ${System.properties.'user.home'}/lib/JavaPackages/gant-trunk
@@ -64,22 +65,45 @@ Then you type:
./gradlew :gant:install
-and all the necessary magic happens. The first time you use the Gradle
+and all the necessary magic happens. The first time you use the Gradle
Wrapper, it will connect to the Internet to download the various jars that
-comprise Gradle. This takes a while. However this is only needed the first
+comprise Gradle. This takes a while. However this is only needed the first
time, thereafter it uses the version you downloaded.
-
You probably want to set the GROOVY_HOME environment variable to point at the
Groovy installation that the Gant installation is to work with.
+
+Using a Bazaar Branch
+---------------------
+
+For anyone prefering to use Bazaar rather than Git, there is an automated
+bridge of the master branch of the Git clone on Launchpad.
+
+To get a branch:
+
+ bzr branch lp:gant Gant
+
+or if you want to use bzr-git directly:
+
+ bzr branch git://github.com/Gant/Gant.git Gant
+
+(If you are going to actively develop Gant, you almost certainly want to have
+a shared repository in which this mirror branch is kept so that you can then
+make feature branches from it.)
+
+All the information in the previous section about Gradle and building Gant
+apply when using Bazaar.
+
+
Contact
-------
If you have any problems using Gant, or have any ideas for improvements,
please make use of the Gant users mailing list: user@gant.codehaus.org
-Russel Winder
+Russel Winder
+
;;; Local Variables: ***
;;; fill-column: 78 ***
diff --git a/build/lib/gant/bin/gant b/build/lib/gant/bin/gant
index 3389ea635a30..327e4542ac51 100755
--- a/build/lib/gant/bin/gant
+++ b/build/lib/gant/bin/gant
@@ -2,7 +2,7 @@
# Gant -- A Groovy way of scripting Ant tasks.
#
-# Copyright © 2006-9 Russel Winder
+# Copyright © 2006–2010, 2013 Russel Winder
#
# 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
@@ -14,12 +14,9 @@
# implied. See the License for the specific language governing permissions and limitations under the
# License.
#
-# Author : Russel Winder
+# Author : Russel Winder
-# Gant initiation script for Linux and UNIX -- stand alone version.
-
-# This version does not require a GROOVY_HOME to be set since it has all the necessary jars in the
-# $GANT_HOME/lib directory.
+# Gant initiation script for Linux and UNIX -- requires Groovy version.
# Solaris 10 does not have readlink as standard -- though some people will have the version from
# Sunfreeware which is the same as the version on Ubuntu, Cygwin, MSYS, etc. Mac OS X has a version of
@@ -27,9 +24,9 @@
#
# This function attempts to just do the right thing.
-doReadLink ( ) {
+doReadLink() {
case `uname` in
- Darwin )
+ Darwin)
gantLocation=`dirname $1`
gantPath=`readlink "$1"`
if [ "$gantPath" = "" ]
@@ -46,7 +43,7 @@ doReadLink ( ) {
cd $currentDirectory
fi
;;
- SunOS )
+ SunOS)
readlinkPath=`which readlink`
if [ `expr "$readlinkPath" : '\([^ ]*\)'` = "no" ]
then
@@ -56,7 +53,7 @@ doReadLink ( ) {
readlinkValue=`readlink -f $1`
fi
;;
- * )
+ *)
readlinkValue=`readlink -f $1`
;;
esac
@@ -77,9 +74,20 @@ then
GANT_HOME=`dirname $GANT_HOME`
fi
-# Force GROOVY_HOME to be GANT_HOME so that the startGroovy code does the right thing.
+# If GROOVY_HOME is not set, deduce a path -- this is needed in order to discover the location of the
+# startGroovy script. Assume the executable is in $GROOVY_HOME/bin.
-GROOVY_HOME="$GANT_HOME"
+if [ -z "$GROOVY_HOME" ]
+then
+ GROOVY_HOME=`which groovy`
+ if [ -h $GROOVY_HOME ]
+ then
+ doReadLink $GROOVY_HOME GROOVY_HOME
+ GROOVY_HOME=$readlinkValue
+ fi
+ GROOVY_HOME=`dirname "$GROOVY_HOME"`
+ GROOVY_HOME=`dirname "$GROOVY_HOME"`
+fi
# If ANT_HOME is not set, deduce a path -- this is needed in order to discover the location of the jars
# associated with the Ant installation. Assume the executable is in $ANT_HOME/bin.
diff --git a/build/lib/gant/bin/gant.bat b/build/lib/gant/bin/gant.bat
index e77c247d8734..ccd28602158e 100755
--- a/build/lib/gant/bin/gant.bat
+++ b/build/lib/gant/bin/gant.bat
@@ -14,7 +14,7 @@
@rem implied. See the License for the specific language governing permissions and limitations under the
@rem License.
@rem
-@rem Author : Russel Winder
+@rem Author : Russel Winder
@rem Gant initiation script for Windows.
@@ -27,12 +27,20 @@ if "%DIRNAME%" == "" set DIRNAME=.\
@rem If GANT_HOME is not set, deduce a path.
if not "%GANT_HOME%" == "" goto endSetGantHome
- set GANT_HOME=%DIRNAME%..
+ set GANT_HOME="%DIRNAME%.."
:endSetGantHome
-@rem Force GROOVY_HOME to be GANT_HOME so that the startGroovy code does the right thing.
+@rem If GROOVY_HOME is not set, deduce a path -- this is needed in order to discover the location of the
+@rem startGroovy script.
-set GROOVY_HOME=%GANT_HOME%
+if not "%GROOVY_HOME%" == "" goto endSetGroovyHome
+ for %%P in ( %PATH% ) do if exist %%P\groovy.exe set GROOVY_HOME=%%P\..
+ if not "%GROOVY_HOME%" == "" goto endSetGroovyHome
+ for %%P in ( %PATH% ) do if exist %%P\groovy.bat set GROOVY_HOME=%%P\..
+ if not "%GROOVY_HOME%" == "" goto endSetGroovyHome
+ call :environmentVariableError GROOVY_HOME
+ goto :EOF
+:endSetGroovyHome
@rem If ANT_HOME is not set, deduce a path -- this is needed in order to discover the location of the jars
@rem asscoiated with the Ant installation.
@@ -46,15 +54,15 @@ if not "%ANT_HOME%" == "" goto endSetAntHome
set PROGNAME=gant.bat
set GROOVY_SCRIPT_NAME=gant.bat
-set STARTER_CONF=%GANT_HOME%\conf\gant-starter.conf
+set STARTER_CONF="%GANT_HOME%\conf\gant-starter.conf"
set JAVA_OPTS=%JAVA_OPTS% -Dgant.home="%GANT_HOME%" -Dant.home="%ANT_HOME%"
-%GANT_HOME%\bin\startGroovy.bat %DIRNAME% gant.Gant lib %*
+"%GANT_HOME%\bin\startGroovy.bat" "%DIRNAME%" gant.Gant %*
@rem End local scope for the variables with windows NT shell
if "%OS%" == "Windows_NT" endlocal
-exit /B %ERRORLEVEL%
+%COMSPEC% /C exit /B %ERRORLEVEL%
:environmentVariableError
echo.
diff --git a/build/lib/gant/bin/startGroovy b/build/lib/gant/bin/startGroovy
deleted file mode 100755
index 9e9ccf35b11b..000000000000
--- a/build/lib/gant/bin/startGroovy
+++ /dev/null
@@ -1,272 +0,0 @@
-# -*- mode:sh -*-
-
-##############################################################################
-## ##
-## Groovy JVM Bootstrap for UN*X ##
-## ##
-##############################################################################
-
-##
-## $Revision$
-## $Date$
-##
-
-PROGNAME=`basename "$0"`
-
-#DIRNAME=`dirname "$0"`
-
-SCRIPT_PATH="$0"
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "${PROGNAME}: $*"
-}
-
-die ( ) {
- warn "$*"
- exit 1
-}
-
-earlyInit ( ) {
- return
-}
-
-lateInit ( ) {
- return
-}
-
-GROOVY_STARTUP="$HOME/.groovy/startup"
-if [ -r "$GROOVY_STARTUP" ] ; then
- . "$GROOVY_STARTUP"
-fi
-
-earlyInit
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-if [ "$1" = "-cp" -o "$1" = "-classpath" ] ; then
- CP=$2
- shift 2
-fi
-
-# Attempt to set JAVA_HOME if it's not already set.
-if [ -z "$JAVA_HOME" ] ; then
- if $darwin ; then
- [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home"
- [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
- else
- javaExecutable="`which javac`"
- [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME."
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
-
- fi
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$GROOVY_HOME" ] && GROOVY_HOME=`cygpath --unix "$GROOVY_HOME"`
- [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CP" ] && CP=`cygpath --path --unix "$CP"`
-else
- if [ -n "$GROOVY_HOME" -a `expr "$GROOVY_HOME":'\/$'` ] ; then
- GROOVY_HOME=`echo $GROOVY_HOME | sed -e 's/\/$//'`
- fi
-fi
-
-# For MSYS, ensure paths are in appropriate format.
-if $msys
-then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`( cd "$JAVA_HOME" ; pwd )`
-fi
-
-# Attempt to set GROOVY_HOME if it is not already set.
-if [ -z "$GROOVY_HOME" -o ! -d "$GROOVY_HOME" ] ; then
- # Resolve links: $0 may be a link to groovy's home.
- PRG="$0"
- # Need this for relative symlinks.
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
- done
- SAVED="`pwd`"
- cd "`dirname \"$PRG\"`/.."
- GROOVY_HOME="`pwd -P`"
- cd "$SAVED"
-fi
-
-# Set the default Groovy config if no specific one is mentioned.
-if [ -z "$GROOVY_CONF" ] ; then
- GROOVY_CONF="$GROOVY_HOME/conf/groovy-starter.conf"
-fi
-STARTER_CLASSPATH="$GROOVY_HOME/lib/groovy-all-2.2.1.jar"
-
-# Create the final classpath. Setting a classpath using the -cp or -classpath option means not to use the
-# global classpath. Groovy behaves then the same as the java interpreter
-if [ -n "$CP" ] ; then
- CP="$CP":.
-elif [ -n "$CLASSPATH" ] ; then
- CP="$CLASSPATH":.
-else
- CP=.
-fi
-
-# Determine the Java command to use to start the JVM.
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="java"
- fi
-fi
-if [ ! -x "$JAVACMD" ] ; then
- die "JAVA_HOME is not defined correctly, can not execute: $JAVACMD"
-fi
-if [ -z "$JAVA_HOME" ] ; then
- warn "JAVA_HOME environment variable is not set"
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# Setup Profiler
-useprofiler=false
-if [ "$PROFILER" != "" ] ; then
- if [ -r "$PROFILER" ] ; then
- . $PROFILER
- useprofiler=true
- else
- die "Profiler file not found: $PROFILER"
- fi
-fi
-
-# For Darwin, use classes.jar for TOOLS_JAR
-TOOLS_JAR="$JAVA_HOME/lib/tools.jar"
-#if $darwin; then
-# TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar"
-#fi
-
-# For Darwin, add GROOVY_APP_NAME to the JAVA_OPTS as -Xdock:name
-if $darwin; then
- JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GROOVY_APP_NAME"
-# we may also want to set -Xdock:image
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- GROOVY_HOME=`cygpath --mixed "$GROOVY_HOME"`
- JAVA_HOME=`cygpath --mixed "$JAVA_HOME"`
- GROOVY_CONF=`cygpath --mixed "$GROOVY_CONF"`
- CP=`cygpath --path --mixed "$CP"`
- TOOLS_JAR=`cygpath --mixed "$TOOLS_JAR"`
- STARTER_CLASSPATH=`cygpath --path --mixed "$STARTER_CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GROOVY_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GROOVY_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- if [ $CHECK -ne 0 ] ; then
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=`expr $i + 1`
- done
- case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-
-fi
-
-startGroovy ( ) {
- CLASS=$1
- shift
- # Start the Profiler or the JVM
- if $useprofiler ; then
- runProfiler
- else
- exec "$JAVACMD" $JAVA_OPTS \
- -classpath "$STARTER_CLASSPATH" \
- -Dscript.name="$SCRIPT_PATH" \
- -Dprogram.name="$PROGNAME" \
- -Dgroovy.starter.conf="$GROOVY_CONF" \
- -Dgroovy.home="$GROOVY_HOME" \
- -Dtools.jar="$TOOLS_JAR" \
- $STARTER_MAIN_CLASS \
- --main $CLASS \
- --conf "$GROOVY_CONF" \
- --classpath "$CP" \
- "$@"
- fi
-}
-
-STARTER_MAIN_CLASS=org.codehaus.groovy.tools.GroovyStarter
-
-lateInit
diff --git a/build/lib/gant/bin/startGroovy.bat b/build/lib/gant/bin/startGroovy.bat
index d2b1436b0bed..5f4540b22c7e 100755
--- a/build/lib/gant/bin/startGroovy.bat
+++ b/build/lib/gant/bin/startGroovy.bat
@@ -10,7 +10,7 @@
@rem
@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
+if "%OS%"=="Windows_NT" setlocal enabledelayedexpansion
set DIRNAME=%~1
shift
@@ -18,9 +18,6 @@ shift
set CLASS=%~1
shift
-set JARSPATH=%~1
-shift
-
if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"
@rem Determine the command interpreter to execute the "CD" later
@@ -36,7 +33,24 @@ if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find
:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
-for %%P in (%PATH%) do if exist %%P\..\bin\java.exe set JAVA_HOME=%%P\..
+set PATHTMP=%PATH%
+:loop
+for /f "delims=; tokens=1*" %%i in ("!PATHTMP!") do (
+ if exist "%%i\..\bin\java.exe" (
+ set "JAVA_HOME=%%i\.."
+ goto found_JAVA_HOME
+ )
+ set PATHTMP=%%j
+ goto loop
+)
+goto check_default_JAVA_EXE
+
+:found_JAVA_HOME
+@rem Remove trailing \bin\.. from JAVA_HOME
+if "%JAVA_HOME:~-7%"=="\bin\.." SET "JAVA_HOME=%JAVA_HOME:~0,-7%"
+set JAVA_EXE=%JAVA_HOME%\bin\java.exe
+
+:check_default_JAVA_EXE
if not "%JAVA_HOME%" == "" goto valid_JAVA_HOME
java -version 2>NUL
if not ERRORLEVEL 1 goto default_JAVA_EXE
@@ -170,8 +184,8 @@ if "x1" == "x%_SKIP%" goto skip_1
rem now unescape -q, -s, -d
set _ARG=%_ARG:-s=*%
-set _ARG=%_ARG:-d=-%
set _ARG=%_ARG:-q="%
+set _ARG=%_ARG:-d=-%
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %_ARG%
set _ARG=
@@ -203,7 +217,7 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
-set STARTER_CLASSPATH=%GROOVY_HOME%\%JARSPATH%\groovy-all-2.2.1.jar;%STARTER_CLASSPATH%
+set STARTER_CLASSPATH=%GROOVY_HOME%\lib\groovy-all-2.3.0.jar
if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"
@@ -221,19 +235,19 @@ set CP=%CLASSPATH%;%CP%
:after_cp
set STARTER_MAIN_CLASS=org.codehaus.groovy.tools.GroovyStarter
-if "%STARTER_CONF%" == "" set STARTER_CONF=%GROOVY_HOME%\conf\groovy-starter.conf
+set STARTER_CONF=%GROOVY_HOME%\conf\groovy-starter.conf
-if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"
-set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
-set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.home="%GROOVY_HOME%"
-if not "%TOOLS_JAR%" == "" set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
-set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
-set JAVA_OPTS=%JAVA_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%"
+set GROOVY_OPTS="-Xmx128m"
+set GROOVY_OPTS=%GROOVY_OPTS% -Dprogram.name="%PROGNAME%"
+set GROOVY_OPTS=%GROOVY_OPTS% -Dgroovy.home="%GROOVY_HOME%"
+if not "%TOOLS_JAR%" == "" set GROOVY_OPTS=%GROOVY_OPTS% -Dtools.jar="%TOOLS_JAR%"
+set GROOVY_OPTS=%GROOVY_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
+set GROOVY_OPTS=%GROOVY_OPTS% -Dscript.name="%GROOVY_SCRIPT_NAME%"
if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"
@rem Execute Groovy
-"%JAVA_EXE%" %JAVA_OPTS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" %CMD_LINE_ARGS%
+"%JAVA_EXE%" %GROOVY_OPTS% %JAVA_OPTS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
@@ -241,5 +255,4 @@ if "%OS%"=="Windows_NT" endlocal
@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause
-
-exit /B %ERRORLEVEL%
+%COMSPEC% /C exit /B %ERRORLEVEL%
diff --git a/build/lib/gant/conf/gant-starter.conf b/build/lib/gant/conf/gant-starter.conf
index 154d5fe1fb94..75aef0043c9a 100644
--- a/build/lib/gant/conf/gant-starter.conf
+++ b/build/lib/gant/conf/gant-starter.conf
@@ -1,6 +1,6 @@
# Gant -- A Groovy way of scripting Ant tasks.
#
-# Copyright © 2008 Russel Winder
+# Copyright © 2008, 2010, 2013 Russel Winder
#
# 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
@@ -12,17 +12,17 @@
# implied. See the License for the specific language governing permissions and limitations under the
# License.
#
-# Author : Russel Winder
+# Author : Russel Winder
# Load user specific libraries that are Gant specific.
load !{user.home}/.gant/lib/*.jar
-
+
# Load user specific libraries that are Ant specific.
load !{user.home}/.ant/lib/*.jar
-
+
# Load user specific libraries that are for Groovy.
load !{user.home}/.groovy/lib/*.jar
-
+
# Load required libraries
load !{gant.home}/lib/*.jar
diff --git a/build/lib/gant/gant_groovy2.1-1.9.10-sources.jar b/build/lib/gant/gant_groovy2.1-1.9.10-sources.jar
deleted file mode 100644
index 776f88897d0b..000000000000
Binary files a/build/lib/gant/gant_groovy2.1-1.9.10-sources.jar and /dev/null differ
diff --git a/build/lib/gant/lib/gant_groovy2.1-1.9.10.jar b/build/lib/gant/lib/gant-1.9.11_groovy-2.3.0.jar
similarity index 56%
rename from build/lib/gant/lib/gant_groovy2.1-1.9.10.jar
rename to build/lib/gant/lib/gant-1.9.11_groovy-2.3.0.jar
index 8f8fc1e009f2..f3d98426914a 100644
Binary files a/build/lib/gant/lib/gant_groovy2.1-1.9.10.jar and b/build/lib/gant/lib/gant-1.9.11_groovy-2.3.0.jar differ
diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant
index 59e7c9a0beb0..d61a0b8d2899 100644
--- a/build/scripts/dist.gant
+++ b/build/scripts/dist.gant
@@ -85,6 +85,8 @@ target('default': 'The default target') {
system_selector: "IdeaIC${p("component.version.major")}",
tools_jar: true],
home, null, paths, true)
+ String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
+ notifyArtifactBuilt(macZip)
}
target('build-dist-jars' : 'Target to build jars from locally compiled classes') {
@@ -99,6 +101,8 @@ target('build-dist-jars' : 'Target to build jars from locally compiled classes')
system_selector: "IdeaIC${p("component.version.major")}",
tools_jar: true],
home, null, paths)
+ String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
+ notifyArtifactBuilt(macZip)
}
private void indexSearchableOptions() {
@@ -152,7 +156,6 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps =
String macZip = "$paths.artifacts/idea${args.buildNumber}.mac.zip"
buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac)
- notifyArtifactBuilt(macZip)
buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}.tar", [paths.distAll, paths.distUnix])
}
diff --git a/build/scripts/libLicenses.gant b/build/scripts/libLicenses.gant
index 4437ffa0a753..99d0257e0906 100644
--- a/build/scripts/libLicenses.gant
+++ b/build/scripts/libLicenses.gant
@@ -133,7 +133,7 @@ binding.setVariable("generateLicensesTable", {String filePath, Set usedM
// projectBuilder.info(" $lib.name")
//}
- lines.sort(String.CASE_INSENSITIVE_ORDER)
+ lines.sort(true, String.CASE_INSENSITIVE_ORDER)
File file = new File(filePath)
file.parentFile.mkdirs()
FileWriter out = new FileWriter(file)
@@ -175,13 +175,13 @@ libraryLicense(name: "Apache Lucene", libraryName: "lucene-core-2.4.1.jar", vers
libraryLicense(name: "Apache Sanselan", libraryName: "Sanselan", version: "0.98", license: "Apache 2.0", url: "http://commons.apache.org/sanselan/")
libraryLicense(name: "Automaton", libraryName: "automaton.jar", version: "1.11", license: "BSD", url: "http://www.brics.dk/automaton/", licenseUrl: "http://www.opensource.org/licenses/bsd-license.php")
libraryLicense(name: "DTDParser", version: "1.13", license: "LGPL", url: "http://sourceforge.net/projects/dtdparser/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1")
-libraryLicense(name: "Gant", version: "1.9.8", libraryName: "gant_groovy2.0-1.9.8.jar", license: "Apache 2.0", url: "http://gant.codehaus.org/", licenseUrl: "http://gant.codehaus.org/Licence")
+libraryLicense(name: "Gant", version: "1.9.8", libraryName: "gant-1.9.11_groovy-2.3.0.jar", license: "Apache 2.0", url: "http://gant.codehaus.org/", licenseUrl: "http://gant.codehaus.org/Licence")
libraryLicense(name: "sqljet", version: "bundled with SVNKit", libraryName: "sqljet.jar", license: "link (commercial license)", url: "http://sqljet.com", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "svnkit-javahl", version: "bundled with SVNKit", libraryName: "svnkit-javahl.jar", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
libraryLicense(name: "Antlr", libraryName: "antlr.jar", version: "3.4", license: "BSD", url: "http://www.antlr.org", licenseUrl: "http://www.antlr.org/license.html")
libraryLicense(name: "Guava", version: "17.0", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
libraryLicense(name: "Guava", libraryName: "guava-tools", version: "14.0.1", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/", licenseUrl: "http://ant.apache.org/license.html")
-libraryLicense(name: "Groovy", version: "2.2.1", license: "Apache 2.0", url: "http://groovy.codehaus.org/")
+libraryLicense(name: "Groovy", version: "2.3.7", license: "Apache 2.0", url: "http://groovy.codehaus.org/")
libraryLicense(name: "Gson", version: "2.2.4", libraryName: "gson", license: "Apache 2.0", url: "http://code.google.com/p/google-gson/")
libraryLicense(name: "ini4j", libraryName: "ini4j-0.5.2-patched", version: "0.5.2 (with a patch by JetBrains)", license: "Apache 2.0", url: "http://ini4j.sourceforge.net/", attachedTo: "git4idea")
libraryLicense(name: "ISO RELAX", libraryName: "isorelax.jar", license: "MIT License", url: "http://sourceforge.net/projects/iso-relax/", licenseUrl: "http://www.opensource.org/licenses/mit-license.html")
@@ -278,7 +278,6 @@ libraryLicense(name: "json-smart", libraryName: "json-smart-1.1.1.jar", version:
libraryLicense(name: "fxg-utils", libraryName: "fxg-utils", version: "4.9.1", license: "Apache 2.0", url: "http://flex.apache.org", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
libraryLicense(name: "jayatana", libraryName: "jayatana", version: "1.2.4", license: "MIT License", url: "https://code.google.com/p/java-swing-ayatana/", licenseUrl: "http://opensource.org/licenses/mit-license.php")
libraryLicense(name: "ForkJoin", version: "", license: "Creative Commons Public Domain Dedication", url: "http://gee.cs.oswego.edu/dl/concurrency-interest/index.html", licenseUrl: "http://creativecommons.org/publicdomain/zero/1.0/")
-libraryLicense(name: "ANTLR 4 Runtime", libraryName: "antlr-runtime-4.1.jar", version: "4.1", license: "BSD", url: "http://www.antlr.org", licenseUrl: "http://www.antlr.org/license.html")
libraryLicense(name: "minlog", libraryName: "minlog-1.2.jar", version: "1.2", license: "BSD", url: "https://github.com/EsotericSoftware/minlog", licenseUrl: "http://opensource.org/licenses/BSD-3-Clause")
libraryLicense(name: "ReflectASM", libraryName: "reflectasm-1.0.7.jar", version: "1.0.7", license: "BSD", url: "https://github.com/EsotericSoftware/reflectasm", licenseUrl: "http://opensource.org/licenses/BSD-3-Clause")
libraryLicense(name: "Objenesis", libraryName: "objenesis-1.2.jar", version: "1.2", license: "Apache 2.0", url: "http://objenesis.org/", licenseUrl: "http://apache.org/licenses/LICENSE-2.0")
@@ -290,4 +289,4 @@ jetbrainsLibrary("CoverageReport")
jetbrainsLibrary("JPS")
jetbrainsLibrary("Maven Embedder")
jetbrainsLibrary("tcServiceMessages")
-jetbrainsLibrary("optimizedFileManager.jar")
\ No newline at end of file
+jetbrainsLibrary("optimizedFileManager.jar")
diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/AdjustArrayRangeAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/AdjustArrayRangeAction.java
index 93673cceb2ff..8f16bc164433 100644
--- a/java/debugger/impl/src/com/intellij/debugger/actions/AdjustArrayRangeAction.java
+++ b/java/debugger/impl/src/com/intellij/debugger/actions/AdjustArrayRangeAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class AdjustArrayRangeAction extends DebuggerAction {
return;
}
- XValue container = node.getValueContainer();
+ final XValue container = node.getValueContainer();
if (!(container instanceof JavaValue)) {
return;
}
@@ -79,17 +79,14 @@ public class AdjustArrayRangeAction extends DebuggerAction {
public void contextAction() throws Exception {
final Renderer lastRenderer = descriptor.getLastRenderer();
if (lastRenderer instanceof ArrayRenderer) {
- descriptor.setRenderer(clonedRenderer);
- refreshViews(node);
- //selectedNode.setRenderer(clonedRenderer);
+ ((JavaValue)container).setRenderer(clonedRenderer, node);
}
else if (lastRenderer instanceof CompoundNodeRenderer) {
final CompoundNodeRenderer compoundRenderer = (CompoundNodeRenderer)lastRenderer;
final ChildrenRenderer childrenRenderer = compoundRenderer.getChildrenRenderer();
if (childrenRenderer instanceof ExpressionChildrenRenderer) {
ExpressionChildrenRenderer.setPreferableChildrenRenderer(descriptor, clonedRenderer);
- refreshViews(node);
- //selectedNode.calcRepresentation();
+ ((JavaValue)container).reBuild(node);
}
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java b/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java
index 16f0647ecec1..04694c844592 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -249,13 +249,13 @@ public class JVMNameUtil {
}
public static JVMName getJVMQualifiedName(PsiClass psiClass) {
- if (!PsiUtil.isLocalOrAnonymousClass(psiClass)) {
- final String name = getNonAnonymousClassName(psiClass);
- if (name != null) {
- return getJVMRawText(name);
- }
+ final String name = getNonAnonymousClassName(psiClass);
+ if (name != null) {
+ return getJVMRawText(name);
+ }
+ else {
+ return new JVMClassAt(SourcePosition.createFromElement(psiClass));
}
- return new JVMClassAt(SourcePosition.createFromElement(psiClass));
}
@Nullable
@@ -264,17 +264,18 @@ public class JVMNameUtil {
if (psiClass == null) {
return null;
}
- if (!PsiUtil.isLocalOrAnonymousClass(psiClass)) {
- final String name = getNonAnonymousClassName(psiClass);
- if (name != null) {
- return getJVMRawText(name);
- }
+ final String name = getNonAnonymousClassName(psiClass);
+ if (name != null) {
+ return getJVMRawText(name);
}
return new JVMClassAt(pos);
}
@Nullable
public static String getNonAnonymousClassName(PsiClass aClass) {
+ if (PsiUtil.isLocalOrAnonymousClass(aClass)) {
+ return null;
+ }
String name = aClass.getName();
if (name == null) {
return null;
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
index 0d33050e1f38..b58e35e2ab78 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
@@ -540,6 +540,11 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
public void setRenderer(NodeRenderer nodeRenderer, final XValueNodeImpl node) {
DebuggerManagerThreadImpl.assertIsManagerThread();
myValueDescriptor.setRenderer(nodeRenderer);
+ reBuild(node);
+ }
+
+ public void reBuild(final XValueNodeImpl node) {
+ DebuggerManagerThreadImpl.assertIsManagerThread();
myCurrentChildrenStart = 0;
node.getTree().getLaterInvocator().offer(new Runnable() {
@Override
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java
index 1c3fef202b77..e6122f0a38b0 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java
@@ -84,7 +84,8 @@ public class PositionManagerImpl implements PositionManager {
return;
}
- if (!classHasName(psiClass)) {
+ String className = JVMNameUtil.getNonAnonymousClassName(psiClass);
+ if (className == null) {
final PsiClass parent = JVMNameUtil.getTopLevelParentClass(psiClass);
if (parent == null) {
@@ -107,7 +108,7 @@ public class PositionManagerImpl implements PositionManager {
});
}
else {
- waitPrepareFor.set(JVMNameUtil.getNonAnonymousClassName(psiClass));
+ waitPrepareFor.set(className);
waitRequestor.set(requestor);
}
}
@@ -118,10 +119,6 @@ public class PositionManagerImpl implements PositionManager {
return myDebugProcess.getRequestsManager().createClassPrepareRequest(waitRequestor.get(), waitPrepareFor.get());
}
- private static boolean classHasName(PsiClass psiClass) {
- return !PsiUtil.isLocalOrAnonymousClass(psiClass) && JVMNameUtil.getNonAnonymousClassName(psiClass) != null;
- }
-
public SourcePosition getSourcePosition(final Location location) throws NoDataException {
DebuggerManagerThreadImpl.assertIsManagerThread();
if(location == null) {
@@ -244,7 +241,8 @@ public class PositionManagerImpl implements PositionManager {
final PsiClass psiClass = JVMNameUtil.getClassAt(position);
if (psiClass != null) {
classAtPositionRef.set(psiClass);
- if (!classHasName(psiClass)) {
+ String className = JVMNameUtil.getNonAnonymousClassName(psiClass);
+ if (className == null) {
isLocalOrAnonymous.set(Boolean.TRUE);
final PsiClass topLevelClass = JVMNameUtil.getTopLevelParentClass(psiClass);
if (topLevelClass != null) {
@@ -259,10 +257,7 @@ public class PositionManagerImpl implements PositionManager {
}
}
else {
- final String className = JVMNameUtil.getNonAnonymousClassName(psiClass);
- if (className != null) {
- baseClassNameRef.set(className);
- }
+ baseClassNameRef.set(className);
}
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
index 89cd2bd89ef5..c7e682f200a5 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
@@ -671,7 +671,7 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
@NotNull
@Override
public Navigatable createNavigatable(@NotNull Project project) {
- return XSourcePositionImpl.createOpenFileDescriptor(project, this);
+ return XSourcePositionImpl.doCreateOpenFileDescriptor(project, this);
}
}
diff --git a/java/idea-ui/idea-ui.iml b/java/idea-ui/idea-ui.iml
index 4a549c503788..2a6932c91115 100644
--- a/java/idea-ui/idea-ui.iml
+++ b/java/idea-ui/idea-ui.iml
@@ -13,6 +13,6 @@
+
-
-
+
\ No newline at end of file
diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/NewProjectFromVCSGroup.java b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/NewProjectFromVCSGroup.java
new file mode 100644
index 000000000000..2c8d75704317
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/NewProjectFromVCSGroup.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.vcs.checkout;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vcs.CheckoutProvider;
+import com.intellij.openapi.vcs.VcsKey;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.platform.PlatformProjectOpenProcessor;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+
+public class NewProjectFromVCSGroup extends CheckoutActionGroup {
+
+ @NotNull
+ @Override
+ protected AnAction createAction(CheckoutProvider provider) {
+ return new CheckoutAction(provider) {
+ @Override
+ protected CheckoutProvider.Listener getListener(Project project) {
+ return new CheckoutProvider.Listener() {
+ @Override
+ public void directoryCheckedOut(File directory, VcsKey vcs) {
+ final VirtualFile dir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(directory);
+ if (dir != null) {
+ PlatformProjectOpenProcessor.getInstance().doOpenProject(dir, null, false);
+ }
+ }
+
+ @Override
+ public void checkoutCompleted() {
+
+ }
+ };
+ }
+ };
+ }
+}
diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java
index f7bc32e0be00..2621e2461659 100644
--- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java
+++ b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java
@@ -32,6 +32,10 @@ import java.io.FilenameFilter;
* @author yole
*/
public class ProjectCheckoutListener implements CheckoutListener {
+
+ public ProjectCheckoutListener() {
+ }
+
@Override
public boolean processCheckedOutDirectory(Project project, File directory) {
File[] files = directory.listFiles((FilenameFilter) new GlobFilenameFilter("*" + ProjectFileType.DOT_DEFAULT_EXTENSION));
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java
index 46175c5d55a5..ebd364b26965 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/AnnotationsHighlightUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -137,11 +137,13 @@ public class AnnotationsHighlightUtil {
formatReference(nameRef), JavaHighlightUtil.formatType(expectedType));
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(value).descriptionAndTooltip(description).create();
}
+
if (value instanceof PsiArrayInitializerMemberValue) {
if (expectedType instanceof PsiArrayType) return null;
String description = JavaErrorMessages.message("annotation.illegal.array.initializer", JavaHighlightUtil.formatType(expectedType));
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(value).descriptionAndTooltip(description).create();
}
+
if (value instanceof PsiExpression) {
PsiExpression expr = (PsiExpression)value;
PsiType type = expr.getType();
@@ -160,8 +162,7 @@ public class AnnotationsHighlightUtil {
String description = JavaErrorMessages.message("annotation.incompatible.types",
JavaHighlightUtil.formatType(type), JavaHighlightUtil.formatType(expectedType));
- final HighlightInfo info =
- HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(value).descriptionAndTooltip(description).create();
+ HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(value).descriptionAndTooltip(description).create();
QuickFixAction.registerQuickFixAction(info, QuickFixFactory.getInstance().createSurroundWithQuotesAnnotationParameterValueFix(value, expectedType));
return info;
}
@@ -185,8 +186,7 @@ public class AnnotationsHighlightUtil {
String containedElementFQN = contained == null ? null : contained.getQualifiedName();
if (containedElementFQN != null) {
- PsiClass container = annotationType;
- String containerName = container.getQualifiedName();
+ String containerName = annotationType.getQualifiedName();
if (isAnnotationRepeatedTwice(owner, containedElementFQN)) {
String description = JavaErrorMessages.message("annotation.container.wrong.place", containerName);
return annotationError(annotationToCheck, description);
@@ -197,8 +197,8 @@ public class AnnotationsHighlightUtil {
String description = JavaErrorMessages.message("annotation.duplicate.annotation");
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(element).descriptionAndTooltip(description).create();
}
- PsiAnnotation metaAnno = PsiImplUtil.findAnnotation(annotationType.getModifierList(), CommonClassNames.JAVA_LANG_ANNOTATION_REPEATABLE);
+ PsiAnnotation metaAnno = PsiImplUtil.findAnnotation(annotationType.getModifierList(), CommonClassNames.JAVA_LANG_ANNOTATION_REPEATABLE);
if (metaAnno == null) {
String explanation = JavaErrorMessages.message("annotation.non.repeatable", annotationType.getQualifiedName());
String description = JavaErrorMessages.message("annotation.duplicate.explained", explanation);
@@ -223,15 +223,6 @@ public class AnnotationsHighlightUtil {
}
}
- for (PsiAnnotation annotation : owner.getAnnotations()) {
- if (annotation == annotationToCheck) continue;
- PsiJavaCodeReferenceElement nameRef = annotation.getNameReferenceElement();
- if (nameRef == null) continue;
- PsiElement aClass = nameRef.resolve();
- if (!resolved.equals(aClass)) continue;
-
- }
-
return null;
}
@@ -252,15 +243,14 @@ public class AnnotationsHighlightUtil {
return contained;
}
- private static boolean isAnnotationRepeatedTwice(@NotNull PsiAnnotationOwner owner, @NotNull String qualifiedName) {
+ private static boolean isAnnotationRepeatedTwice(@NotNull PsiAnnotationOwner owner, @Nullable String qualifiedName) {
int count = 0;
for (PsiAnnotation annotation : owner.getAnnotations()) {
PsiJavaCodeReferenceElement nameRef = annotation.getNameReferenceElement();
if (nameRef == null) continue;
PsiElement resolved = nameRef.resolve();
- if (!(resolved instanceof PsiClass) || !qualifiedName.equals(((PsiClass)resolved).getQualifiedName())) continue;
- count++;
- if (count == 2) return true;
+ if (!(resolved instanceof PsiClass) || !Comparing.equal(qualifiedName, ((PsiClass)resolved).getQualifiedName())) continue;
+ if (++count == 2) return true;
}
return false;
}
@@ -721,7 +711,7 @@ public class AnnotationsHighlightUtil {
if (field instanceof PsiEnumConstant) {
String name = ((PsiEnumConstant)field).getName();
try {
- return RetentionPolicy.valueOf(RetentionPolicy.class, name);
+ return Enum.valueOf(RetentionPolicy.class, name);
}
catch (Exception e) {
LOG.warn("Unknown policy: " + name);
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
index 6832f9d226db..de9876b0e81d 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
@@ -32,6 +32,7 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
+import com.intellij.psi.impl.PsiClassImplUtil;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.PsiShortNamesCache;
import com.intellij.psi.search.searches.ReferencesSearch;
@@ -346,17 +347,21 @@ public class GenericsHighlightUtil {
Map inheritedClasses = new HashMap();
final TextRange textRange = HighlightNamesUtil.getClassDeclarationTextRange(aClass);
return checkInterfaceMultipleInheritance(aClass,
+ aClass,
PsiSubstitutor.EMPTY, inheritedClasses,
new HashSet(), textRange);
}
private static HighlightInfo checkInterfaceMultipleInheritance(PsiClass aClass,
+ PsiElement place,
PsiSubstitutor derivedSubstitutor,
Map inheritedClasses,
Set visited,
TextRange textRange) {
final PsiClassType[] superTypes = aClass.getSuperTypes();
for (PsiClassType superType : superTypes) {
+ superType = PsiClassImplUtil.correctType(superType, place.getResolveScope());
+ if (superType == null) continue;
final PsiClassType.ClassResolveResult result = superType.resolveGenerics();
final PsiClass superClass = result.getElement();
if (superClass == null || visited.contains(superClass)) continue;
@@ -381,7 +386,7 @@ public class GenericsHighlightUtil {
}
inheritedClasses.put(superClass, superTypeSubstitutor);
visited.add(superClass);
- final HighlightInfo highlightInfo = checkInterfaceMultipleInheritance(superClass, superTypeSubstitutor, inheritedClasses, visited, textRange);
+ final HighlightInfo highlightInfo = checkInterfaceMultipleInheritance(superClass, place, superTypeSubstitutor, inheritedClasses, visited, textRange);
visited.remove(superClass);
if (highlightInfo != null) return highlightInfo;
@@ -1185,6 +1190,23 @@ public class GenericsHighlightUtil {
return null;
}
+ public static HighlightInfo checkEnumWithoutConstantsCantHaveAbstractMethods(final PsiClass aClass) {
+ if (!aClass.isEnum()) return null;
+ for (PsiField field : aClass.getFields()) {
+ if (field instanceof PsiEnumConstant) {
+ return null;
+ }
+ }
+ for (PsiMethod method : aClass.getMethods()) {
+ if (method.hasModifierProperty(PsiModifier.ABSTRACT)) {
+ final String description = "Enum declaration without enum constants cannot have abstract methods";
+ final TextRange textRange = HighlightNamesUtil.getClassDeclarationTextRange(aClass);
+ return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(textRange).descriptionAndTooltip(description).create();
+ }
+ }
+ return null;
+ }
+
public static HighlightInfo checkSelectStaticClassFromParameterizedType(final PsiElement resolved, final PsiJavaCodeReferenceElement ref) {
if (resolved instanceof PsiClass && ((PsiClass)resolved).hasModifierProperty(PsiModifier.STATIC)) {
final PsiElement qualifier = ref.getQualifier();
@@ -1329,5 +1351,60 @@ public class GenericsHighlightUtil {
}
return null;
}
+
+ public static HighlightInfo areSupersAccessible(@NotNull PsiClass aClass) {
+ return areSupersAccessible(aClass, aClass.getResolveScope(), HighlightNamesUtil.getClassDeclarationTextRange(aClass));
+ }
+
+ public static HighlightInfo areSupersAccessible(@NotNull PsiClass aClass, PsiElement ref) {
+ return areSupersAccessible(aClass, ref.getResolveScope(), ref.getTextRange());
+ }
+
+ private static HighlightInfo areSupersAccessible(@NotNull PsiClass aClass,
+ GlobalSearchScope resolveScope,
+ TextRange range) {
+ final JavaPsiFacade factory = JavaPsiFacade.getInstance(aClass.getProject());
+ for (PsiClassType superType : aClass.getSuperTypes()) {
+ final String notAccessibleErrorMessage = isSuperTypeAccessible(superType, new HashSet(), resolveScope, factory);
+ if (notAccessibleErrorMessage != null) {
+ return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
+ .descriptionAndTooltip(notAccessibleErrorMessage)
+ .range(range)
+ .create();
+ }
+ }
+ return null;
+ }
+
+ @Nullable
+ private static String isSuperTypeAccessible(PsiType superType,
+ HashSet classes,
+ GlobalSearchScope resolveScope,
+ JavaPsiFacade factory) {
+ final PsiClass aClass = PsiUtil.resolveClassInType(superType);
+ if (aClass != null && classes.add(aClass)) {
+ final String qualifiedName = aClass.getQualifiedName();
+ if (qualifiedName != null && factory.findClass(qualifiedName, resolveScope) == null) {
+ return "Cannot access " + HighlightUtil.formatClass(aClass);
+ }
+
+ if (superType instanceof PsiClassType) {
+ for (PsiType psiType : ((PsiClassType)superType).getParameters()) {
+ final String notAccessibleMessage = isSuperTypeAccessible(psiType, classes, resolveScope, factory);
+ if (notAccessibleMessage != null) {
+ return notAccessibleMessage;
+ }
+ }
+ }
+
+ for (PsiClassType type : aClass.getSuperTypes()) {
+ final String notAccessibleMessage = isSuperTypeAccessible(type, classes, resolveScope, factory);
+ if (notAccessibleMessage != null) {
+ return notAccessibleMessage;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java
index 83ec3affc36b..8d913644794f 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java
@@ -34,6 +34,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
+import com.intellij.psi.impl.PsiSuperMethodImplUtil;
import com.intellij.psi.infos.CandidateInfo;
import com.intellij.psi.infos.MethodCandidateInfo;
import com.intellij.psi.util.*;
@@ -1147,25 +1148,22 @@ public class HighlightMethodUtil {
PsiClass aClass = method.getContainingClass();
if (aClass == null) return null;
- PsiClass superClass = aClass.getSuperClass();
- PsiMethod superMethod = superClass == null
- ? null
- : MethodSignatureUtil.findMethodBySignature(superClass, method, true);
-
- boolean isStatic = method.hasModifierProperty(PsiModifier.STATIC);
- HighlightInfo highlightInfo = checkStaticMethodOverride(aClass, method, isStatic,superClass, superMethod,containingFile);
- if (highlightInfo != null) return highlightInfo;
- if (!isStatic) {
- // all methods in interface are instance, so no possible errors in this case
+ final HierarchicalMethodSignature methodSignature = PsiSuperMethodImplUtil.getHierarchicalMethodSignature(method);
+ final List superSignatures = methodSignature.getSuperSignatures();
+ if (superSignatures.isEmpty()) {
return null;
}
- PsiClass[] interfaces = aClass.getInterfaces();
- for (PsiClass aInterfaces : interfaces) {
- superClass = aInterfaces;
- superMethod = MethodSignatureUtil.findMethodInSuperClassBySignatureInDerived(aClass, superClass, method.getSignature(PsiSubstitutor.EMPTY), true);
- highlightInfo = checkStaticMethodOverride(aClass, method, true, superClass, superMethod,containingFile);
- if (highlightInfo != null) return highlightInfo;
+
+ boolean isStatic = method.hasModifierProperty(PsiModifier.STATIC);
+ for (HierarchicalMethodSignature signature : superSignatures) {
+ final PsiMethod superMethod = signature.getMethod();
+ final PsiClass superClass = superMethod.getContainingClass();
+ if (superClass == null) continue;
+ final HighlightInfo highlightInfo = checkStaticMethodOverride(aClass, method, isStatic, superClass, superMethod,containingFile);
+ if (highlightInfo != null) {
+ return highlightInfo;
}
+ }
return null;
}
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
index 7c9c1d9e9f63..2791ed73bbda 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
@@ -381,8 +381,10 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
super.visitClass(aClass);
if (aClass instanceof PsiSyntheticClass) return;
if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkInterfaceMultipleInheritance(aClass));
+ if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.areSupersAccessible(aClass));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkDuplicateTopLevelClass(aClass));
if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkEnumMustNotBeLocal(aClass));
+ if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkEnumWithoutConstantsCantHaveAbstractMethods(aClass));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkImplicitThisReferenceBeforeSuper(aClass, myJavaSdkVersion));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkClassAndPackageConflict(aClass));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkPublicClassInRightFile(aClass));
@@ -1220,7 +1222,14 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
}
if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkAccessStaticFieldFromEnumConstructor(expression, result));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkClassReferenceAfterQualifier(expression, resolved));
- myHolder.add(HighlightUtil.checkUnqualifiedSuperInDefaultMethod(myLanguageLevel, expression, expression.getQualifierExpression()));
+ final PsiExpression qualifierExpression = expression.getQualifierExpression();
+ myHolder.add(HighlightUtil.checkUnqualifiedSuperInDefaultMethod(myLanguageLevel, expression, qualifierExpression));
+ if (!myHolder.hasErrorResults() && qualifierExpression != null) {
+ final PsiClass psiClass = PsiUtil.resolveClassInType(qualifierExpression.getType());
+ if (psiClass != null) {
+ myHolder.add(GenericsHighlightUtil.areSupersAccessible(psiClass, qualifierExpression));
+ }
+ }
}
@Override
diff --git a/java/java-impl/src/com/intellij/application/options/CodeStyleGenerationConfigurable.java b/java/java-impl/src/com/intellij/application/options/CodeStyleGenerationConfigurable.java
index 91b40d12a837..5f0ee4f20e85 100644
--- a/java/java-impl/src/com/intellij/application/options/CodeStyleGenerationConfigurable.java
+++ b/java/java-impl/src/com/intellij/application/options/CodeStyleGenerationConfigurable.java
@@ -25,6 +25,7 @@ import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.ui.JavaVisibilityPanel;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.ToolbarDecorator;
@@ -67,7 +68,7 @@ public class CodeStyleGenerationConfigurable implements Configurable {
mySettings = settings;
myMembersOrderList = new MembersOrderList();
myPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 2, 2, 2));
- myJavaVisibilityPanel = new JavaVisibilityPanel(false, true);
+ myJavaVisibilityPanel = new JavaVisibilityPanel(false, true, RefactoringBundle.message("default.visibility.border.title"));
}
public JComponent createComponent() {
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java
index d68e683de6ce..44d50a239da8 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java
@@ -128,6 +128,11 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
return "IntroduceVariable";
}
+ @Override
+ protected String getRefactoringId() {
+ return "refactoring.extractVariable";
+ }
+
@Override
protected void restoreState(@NotNull PsiVariable psiField) {
if (myDeleteSelf) return;
@@ -159,6 +164,15 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
}
}
+ @Override
+ protected PsiExpression getBeforeExpr() {
+ final PsiVariable variable = getVariable();
+ if (variable != null) {
+ return variable.getInitializer();
+ }
+ return super.getBeforeExpr();
+ }
+
@Override
protected void performIntroduce() {
final PsiVariable psiVariable = getVariable();
diff --git a/java/java-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteJavaCallerChooser.java b/java/java-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteJavaCallerChooser.java
index 7a3ec7efc825..85bbd0fe4436 100644
--- a/java/java-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteJavaCallerChooser.java
+++ b/java/java-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteJavaCallerChooser.java
@@ -105,7 +105,7 @@ abstract class SafeDeleteJavaCallerChooser extends JavaCallerChooser {
/**
* @return parameter if it is used inside method only as argument in nodeMethod call at parameterIndex
*/
- static PsiParameter isTheOnlyOneParameterUsage(PsiElement call, int parameterIndex, final PsiMethod nodeMethod) {
+ static PsiParameter isTheOnlyOneParameterUsage(PsiElement call, final int parameterIndex, final PsiMethod nodeMethod) {
if (call instanceof PsiCallExpression) {
final PsiExpressionList argumentList = ((PsiCallExpression)call).getArgumentList();
if (argumentList != null) {
@@ -129,6 +129,7 @@ abstract class SafeDeleteJavaCallerChooser extends JavaCallerChooser {
if (parameter != null && !parameter.isVarArgs()) {
final PsiElement scope = parameter.getDeclarationScope();
if (scope instanceof PsiMethod && ((PsiMethod)scope).findDeepestSuperMethods().length == 0) {
+ final int scopeParamIdx = ((PsiMethod)scope).getParameterList().getParameterIndex(parameter);
final Ref ref = new Ref(false);
if (ReferencesSearch.search(parameter, new LocalSearchScope(scope)).forEach(new Processor() {
@Override
@@ -139,11 +140,11 @@ abstract class SafeDeleteJavaCallerChooser extends JavaCallerChooser {
while (parent != null) {
final PsiMethod resolved = parent.resolveMethod();
if (scope.equals(resolved)) {
- if (usedInQualifier(element, parent)) return false;
+ if (usedInQualifier(element, parent, scopeParamIdx)) return false;
return true;
}
if (nodeMethod.equals(resolved)) {
- if (usedInQualifier(element, parent)) return false;
+ if (usedInQualifier(element, parent, parameterIndex)) return false;
ref.set(true);
return true;
}
@@ -154,7 +155,7 @@ abstract class SafeDeleteJavaCallerChooser extends JavaCallerChooser {
return true;
}
- private boolean usedInQualifier(PsiElement element, PsiCallExpression parent) {
+ private boolean usedInQualifier(PsiElement element, PsiCallExpression parent, int parameterIndex) {
PsiExpression qualifier = null;
if (parent instanceof PsiMethodCallExpression) {
qualifier = ((PsiMethodCallExpression)parent).getMethodExpression();
@@ -162,7 +163,13 @@ abstract class SafeDeleteJavaCallerChooser extends JavaCallerChooser {
else if (parent instanceof PsiNewExpression) {
qualifier = ((PsiNewExpression)parent).getQualifier();
}
- return PsiTreeUtil.isAncestor(qualifier, element, true);
+
+ if (PsiTreeUtil.isAncestor(qualifier, element, true)) {
+ return true;
+ }
+
+ final PsiExpressionList list = parent.getArgumentList();
+ return list != null && !PsiTreeUtil.isAncestor(list.getExpressions()[parameterIndex], element, false);
}
}) && ref.get()) {
return parameter;
diff --git a/java/java-impl/src/com/intellij/refactoring/ui/JavaVisibilityPanel.java b/java/java-impl/src/com/intellij/refactoring/ui/JavaVisibilityPanel.java
index 414c44212367..641e6d92d9d9 100644
--- a/java/java-impl/src/com/intellij/refactoring/ui/JavaVisibilityPanel.java
+++ b/java/java-impl/src/com/intellij/refactoring/ui/JavaVisibilityPanel.java
@@ -46,7 +46,13 @@ public class JavaVisibilityPanel extends VisibilityPanelBase {
private final JRadioButton myRbPublic;
public JavaVisibilityPanel(boolean hasAsIs, final boolean hasEscalate) {
- setBorder(IdeBorderFactory.createTitledBorder(RefactoringBundle.message("visibility.border.title"), true,
+ this(hasAsIs, hasEscalate, RefactoringBundle.message("visibility.border.title"));
+ }
+
+ public JavaVisibilityPanel(boolean hasAsIs,
+ final boolean hasEscalate,
+ String visibilityTitle) {
+ setBorder(IdeBorderFactory.createTitledBorder(visibilityTitle, true,
new Insets(IdeBorderFactory.TITLED_BORDER_TOP_INSET,
UIUtil.DEFAULT_HGAP,
IdeBorderFactory.TITLED_BORDER_BOTTOM_INSET,
diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
index 667e808bfc8d..f2b71bf36955 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java
@@ -823,8 +823,9 @@ public final class PsiUtil extends PsiUtilCore {
@Nullable
public static PsiMember findEnclosingConstructorOrInitializer(PsiElement expression) {
- PsiMember parent = PsiTreeUtil.getParentOfType(expression, PsiClassInitializer.class, PsiEnumConstantInitializer.class, PsiMethod.class);
+ PsiMember parent = PsiTreeUtil.getParentOfType(expression, PsiClassInitializer.class, PsiEnumConstantInitializer.class, PsiMethod.class, PsiField.class);
if (parent instanceof PsiMethod && !((PsiMethod)parent).isConstructor()) return null;
+ if (parent instanceof PsiField && parent.hasModifierProperty(PsiModifier.STATIC)) return null;
return parent;
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java
index c410b37dcb91..0e572d7f4f9f 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/PsiClassImplUtil.java
@@ -33,10 +33,7 @@ import com.intellij.psi.scope.NameHint;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.scope.processor.FilterScopeProcessor;
import com.intellij.psi.scope.processor.MethodResolverProcessor;
-import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.psi.search.LocalSearchScope;
-import com.intellij.psi.search.PackageScope;
-import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.search.*;
import com.intellij.psi.util.*;
import com.intellij.ui.IconDeferrer;
import com.intellij.ui.RowIcon;
@@ -61,7 +58,7 @@ import java.util.*;
*/
public class PsiClassImplUtil {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.PsiClassImplUtil");
- private static final Key> MAP_IN_CLASS_KEY = Key.create("MAP_KEY");
+ private static final Key, PsiClass>> MAP_IN_CLASS_KEY = Key.create("MAP_KEY");
private static final String VALUES_METHOD = "values";
private static final String VALUE_OF_METHOD = "valueOf";
@@ -215,13 +212,13 @@ public class PsiClassImplUtil {
public enum MemberType {CLASS, FIELD, METHOD}
private static Map>> getMap(@NotNull PsiClass aClass, @NotNull MemberType type) {
- ParameterizedCachedValue value = getValues(aClass);
- return value.getValue(aClass).get(type);
+ ParameterizedCachedValue