From a56a606d540e2453c419687ced722020306952c7 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Wed, 11 Apr 2012 14:59:48 +0200 Subject: fix for get-scala-commit-* on Windows (tested with Windows 7) --- build.xml | 2 ++ tools/get-scala-commit-date.bat | 33 +++++++++------------------------ tools/get-scala-commit-sha.bat | 30 +++++++++--------------------- 3 files changed, 20 insertions(+), 45 deletions(-) diff --git a/build.xml b/build.xml index 6f3e4a8d19..6a3bc1d4c7 100644 --- a/build.xml +++ b/build.xml @@ -283,7 +283,9 @@ INITIALISATION + + diff --git a/tools/get-scala-commit-date.bat b/tools/get-scala-commit-date.bat index a07155533f..2a75073633 100644 --- a/tools/get-scala-commit-date.bat +++ b/tools/get-scala-commit-date.bat @@ -1,24 +1,9 @@ -@echo off -rem -rem Usage: get-scala-revison.bat [dir] -rem Figures out current scala commit date of a git clone. -rem -rem If no dir is given, current working dir is used. - -@setlocal -set _DIR= -if "%*"=="" ( - for /f "delims=;" %%i in ('cd') do set "_DIR=%%i" -) else ( - set "_DIR=%~1" -) -cd %_DIR% - -rem TODO - Check with a real windows user that this works! -if exist .git\NUL ( - for /f "tokens=1delims= " in ('git log --format="%ci" -1') do set commitdate=%%a - echo %commitdate% -) - -:end -@endlocal +@echo off +for %%X in (bash.exe) do (set FOUND=%%~$PATH:X) +if defined FOUND ( + bash "%~dp0\get-scala-commit-date" +) else ( + rem echo this script does not work with cmd.exe. please, install bash + echo unknown + exit 1 +) \ No newline at end of file diff --git a/tools/get-scala-commit-sha.bat b/tools/get-scala-commit-sha.bat index 7a5afa11b1..390e2d99d0 100644 --- a/tools/get-scala-commit-sha.bat +++ b/tools/get-scala-commit-sha.bat @@ -1,21 +1,9 @@ -@echo off -rem -rem Usage: get-scala-commit-drift.bat [dir] -rem Figures out current scala commit drift, of a clone. -rem -rem If no dir is given, current working dir is used. - -@setlocal -set _DIR= -if "%*"=="" ( - for /f "delims=;" %%i in ('cd') do set "_DIR=%%i" -) else ( - set "_DIR=%~1" -) -cd %_DIR% - -rem TODO - truncate chars. -git log -1 --format="%H - -:end -@endlocal +@echo off +for %%X in (bash.exe) do (set FOUND=%%~$PATH:X) +if defined FOUND ( + bash "%~dp0\get-scala-commit-sha" +) else ( + rem echo this script does not work with cmd.exe. please, install bash + echo unknown + exit 1 +) \ No newline at end of file -- cgit v1.2.3 From 9ea4ca3c80ece5c3c9ce6573aabc1920cf519507 Mon Sep 17 00:00:00 2001 From: gakuzzzz Date: Thu, 12 Apr 2012 00:36:38 +0900 Subject: This change enables the alphanumeric method to be called from SecureRandom --- src/library/scala/util/Random.scala | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index 791582c9ec..62cba1fc5b 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -120,15 +120,6 @@ class Random(val self: java.util.Random) { bf(xs) ++= buf result } -} - -/** The object `Random` offers a default implementation - * of scala.util.Random and random-related convenience methods. - * - * @since 2.8 - */ -object Random extends Random { - /** Returns a Stream of pseudorandomly chosen alphanumeric characters, * equally chosen from A-Z, a-z, and 0-9. * @@ -141,3 +132,14 @@ object Random extends Random { } } + +/** The object `Random` offers a default implementation + * of scala.util.Random and random-related convenience methods. + * + * @since 2.8 + */ +object Random extends Random { + + implicit def javaRandomToRandom(r: java.util.Random): Random = new Random(r) + +} -- cgit v1.2.3 From d4d8f15ad121edfc0b924deaeb9c30a9d9b71e84 Mon Sep 17 00:00:00 2001 From: Dominik Gruntz Date: Wed, 11 Apr 2012 18:03:30 +0200 Subject: changed applyDynamic explanation in trait Dynamic --- src/library/scala/Dynamic.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/scala/Dynamic.scala b/src/library/scala/Dynamic.scala index 32b57ee88f..dcf7599742 100644 --- a/src/library/scala/Dynamic.scala +++ b/src/library/scala/Dynamic.scala @@ -11,7 +11,7 @@ package scala /** A marker trait that enables dynamic invocations. Instances `x` of this * trait allow calls `x.meth(args)` for arbitrary method names `meth` and * argument lists `args`. If a call is not natively supported by `x`, it - * is rewritten to `x.applyDynamic("meth", args)`. + * is rewritten to `x.applyDynamic("meth")(args)`. * * As of scala 2.9, `scalac` must receive the `-Xexperimental` option for * `Dynamic` to receive this treatment. -- cgit v1.2.3