diff mbox

[java,mingw] Fix (typos) compile errors.

Message ID m3tymz4x90.fsf@fleche.redhat.com
State New
Headers show

Commit Message

Tom Tromey Aug. 12, 2010, 4:22 p.m. UTC
>>>>> "Dmitrijs" == Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> writes:

Dmitrijs> +  {
Dmitrijs> +      jstring oserr = JvNewStringLatin1 (strerror (errno));
Dmitrijs> +      throw new ::java::lang::UnsupportedOperationException
Dmitrijs> +         (JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target.")->concat(oserr));
Dmitrijs> +  }


Andrew> OK.

Actually, I don't think this is ok.

Nothing sets errno here, so using it is incorrect.
And, even if it were correct, the error message would be formatted
strangely.

Based on the error messages, I think all that is needed here is the
addition of a "::" before "java".

Dmitrijs, could you test the appended?

Tom

Comments

Dmitrijs Ledkovs Aug. 12, 2010, 5:19 p.m. UTC | #1
Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Dmitrijs" == Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> writes:
>
> Dmitrijs> +  {
> Dmitrijs> +      jstring oserr = JvNewStringLatin1 (strerror (errno));
> Dmitrijs> +      throw new ::java::lang::UnsupportedOperationException
> Dmitrijs> +         (JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target.")->concat(oserr));
> Dmitrijs> +  }
>
>
> Andrew> OK.
>
> Actually, I don't think this is ok.
>

I was just copying from the natVMSecureRandomPosix.cc

> Nothing sets errno here, so using it is incorrect.
> And, even if it were correct, the error message would be formatted
> strangely.
>
> Based on the error messages, I think all that is needed here is the
> addition of a "::" before "java".
>
> Dmitrijs, could you test the appended?
>

Works fine with target i686-w64-mingw32. Please apply.

> Tom
>
> Index: natVMSecureRandomWin32.cc
> ===================================================================
> --- natVMSecureRandomWin32.cc	(revision 162345)
> +++ natVMSecureRandomWin32.cc	(working copy)
> @@ -1,6 +1,6 @@
>  // natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
>  
> -/* Copyright (C) 2009 Free Software Foundation
> +/* Copyright (C) 2009, 2010 Free Software Foundation
>  
>     This file is part of libgcj.
>  
> @@ -26,7 +26,7 @@
>  gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
>  {
>    if (length != 0)
> -    throw new java::lang::UnsupportedOperationException (
> +    throw new ::java::lang::UnsupportedOperationException (
>        JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
>    return 0;
>  }
diff mbox

Patch

Index: natVMSecureRandomWin32.cc
===================================================================
--- natVMSecureRandomWin32.cc	(revision 162345)
+++ natVMSecureRandomWin32.cc	(working copy)
@@ -1,6 +1,6 @@ 
 // natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
 
-/* Copyright (C) 2009 Free Software Foundation
+/* Copyright (C) 2009, 2010 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -26,7 +26,7 @@ 
 gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
 {
   if (length != 0)
-    throw new java::lang::UnsupportedOperationException (
+    throw new ::java::lang::UnsupportedOperationException (
       JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
   return 0;
 }