6668802: javac handles diagnostics for last line badly, if line not terminated by newline
Summary: use CharBuffer.limit(), not the length of the backing array
Reviewed-by: mcimadamore
@echo offREMREM Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.REMREM This code is free software; you can redistribute it and/or modify itREM under the terms of the GNU General Public License version 2 only, asREM published by the Free Software Foundation.REMREM This code is distributed in the hope that it will be useful, but WITHOUTREM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY orREM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public LicenseREM version 2 for more details (a copy is included in the LICENSE file thatREM accompanied this code).REMREM You should have received a copy of the GNU General Public License versionREM 2 along with this work; if not, write to the Free Software Foundation,REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.REMREM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,REM CA 95054 USA or visit www.sun.com if you need additional information orREM have any questions.REM REMREM This is the interactive build setup script (as opposed to the batchREM build execution script). It creates $HotSpotBuildSpace if necessary,REM copies the appropriate files out of $HotSpotWorkSpace into it, andREM builds and runs MakeDeps in it. This has the side-effect of creatingREM the vm.vcproj file in the buildspace, which is then used in Visual C++.REM REM The generated project file depends upon the include databases. IfREM those are changed then MakeDeps is rerun.REMREM Since we don't have uname and we could be cross-compiling,REM Use the compiler to determine which ARCH we are buildingREM cl 2>&1 | grep "IA-64" >NULif %errorlevel% == 0 goto isia64cl 2>&1 | grep "AMD64" >NULif %errorlevel% == 0 goto amd64set ARCH=x86set BUILDARCH=i486set Platform_arch=x86set Platform_arch_model=x86_32goto end:amd64set ARCH=x86set BUILDARCH=amd64set Platform_arch=x86set Platform_arch_model=x86_64goto end:isia64set ARCH=ia64set BUILDARCH=ia64set Platform_arch=ia64set Platform_arch_model=ia64:endsetlocalif "%1" == "" goto usageif not "%4" == "" goto usageset HotSpotWorkSpace=%1set HotSpotBuildSpace=%2set HotSpotJDKDist=%3REM figure out MSC versionfor /F %%i in ('sh %HotSpotWorkSpace%/build/windows/get_msc_ver.sh') do set %%iecho **************************************************************if "%MSC_VER%" == "1200" (set ProjectFile=vm.dspecho Will generate VC6 project {unsupported}) else (set ProjectFile=vm.vcprojecho Will generate VC7 project)echo %ProjectFile%echo **************************************************************REM Test all variables to see whether the directories theyREM reference existif exist %HotSpotWorkSpace% goto test1echo Error: directory pointed to by HotSpotWorkSpaceecho does not exist, or the variable is not set.echo.goto usage:test1if exist %HotSpotBuildSpace% goto test2if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace%if exist %HotSpotBuildSpace% goto test2echo Error: directory pointed to by HotSpotBuildSpaceecho does not exist, or the variable is not set.echo.goto usage:test2if exist %HotSpotJDKDist% goto test3echo Error: directory pointed to by %HotSpotJDKDist%echo does not exist, or the variable is not set.echo.goto usage:test3if not "%HOTSPOTMKSHOME%" == "" goto makedirecho Warning: please set variable HOTSPOTMKSHOME to place where echo your MKS/Cygwin installation isecho.goto usage:makedirecho NOTE: Using the following settings:echo HotSpotWorkSpace=%HotSpotWorkSpace%echo HotSpotBuildSpace=%HotSpotBuildSpace%echo HotSpotJDKDist=%HotSpotJDKDist%REM This is now safe to do.:copyfilesfor /D %%i in (compiler1, compiler2, tiered, core, kernel) do (if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%icopy %HotSpotWorkSpace%\build\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL)REM force regneration of ProjectFileif exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (echo # Generated file! > %HotSpotBuildSpace%\%%i\local.makeecho # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.makeecho # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.makeecho # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.makeecho. >> %HotSpotBuildSpace%\%%i\local.makeecho HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.makeecho HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.makeecho HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.makeecho ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.makeecho BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.makeecho Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.makeecho Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.makeREM build config specific stuffpushd %HotSpotBuildSpace%\%%inmake /nologopopd)goto end:usageecho Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDistecho.echo This is the interactive build setup script (as opposed to the batchecho build execution script). It creates HotSpotBuildSpace if necessary,echo copies the appropriate files out of HotSpotWorkSpace into it, andecho builds and runs MakeDeps in it. This has the side-effect of creatingecho the %ProjectFile% file in the build space, which is then used in Visual C++.echo The HotSpotJDKDist defines place where JVM binaries should be placed.echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.echo.echo The generated project file depends upon the include databases. Ifecho those are changed then MakeDeps is rerun.echo.echo NOTE that it is now NOT safe to modify any of the files in the buildecho space, since they may be overwritten whenever this script is run orecho nmake is run in that directory.:endendlocal