public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: mauve-patches@sources.redhat.com
Subject: FYI: Tweaked throwpoint checks for java.io.FileInputStream
Date: Mon, 26 Jun 2006 09:38:00 -0000	[thread overview]
Message-ID: <20060626093804.GA3668@redhat.com> (raw)
In-Reply-To: <20060621100429.GC23387@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Morning all,

This commit makes some small changes to the throwpoint checks for
java.io.FileInputStream.  Hardly worth bothering with except that
it's the testcase I point people at who want a simple one to base
things on, so it makes sense to have it perfect.

Cheers,
Gary

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2537 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/mauve/mauve/ChangeLog,v
retrieving revision 1.1732
diff -u -r1.1732 ChangeLog
--- ChangeLog	25 Jun 2006 16:55:59 -0000	1.1732
+++ ChangeLog	26 Jun 2006 09:32:53 -0000
@@ -1,3 +1,7 @@
+2006-06-26  Gary Benson  <gbenson@redhat.com>
+
+	* gnu/testlet/java/io/FileInputStream/security.java: Minor tweaks.
+
 2006-06-25  Mark Wielaard  <mark@klomp.org>
 
 	* gnu/testlet/java/lang/Class/newInstance.java: Add checks for
Index: gnu/testlet/java/io/FileInputStream/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/io/FileInputStream/security.java,v
retrieving revision 1.5
diff -u -r1.5 security.java
--- gnu/testlet/java/io/FileInputStream/security.java	3 Feb 2006 10:21:46 -0000	1.5
+++ gnu/testlet/java/io/FileInputStream/security.java	26 Jun 2006 09:32:53 -0000
@@ -1,4 +1,4 @@
-// Copyright (C) 2005 Red Hat, Inc.
+// Copyright (C) 2005, 2006 Red Hat, Inc.
 // Written by Gary Benson <gbenson@redhat.com>
 
 // This file is part of Mauve.
@@ -37,18 +37,19 @@
     File file = new File(harness.getSourceDirectory(), "ChangeLog");
     String path = file.getPath();
     
-    Permission perm = new FilePermission(path, "read");
-    Permission fdPerm = new RuntimePermission("readFileDescriptor");
+    Permission[] perm = new Permission[] {
+	new FilePermission(path, "read")};
+    Permission[] fdPerm = new Permission[] {
+	new RuntimePermission("readFileDescriptor")};
     
     TestSecurityManager2 sm = new TestSecurityManager2(harness);
-
     try {
       sm.install();
 	
       // throwpoint: java.io.FileInputStream-FileInputStream(File)
       harness.checkPoint("File constructor");
       try {
-	sm.prepareChecks(new Permission[] {perm});
+	sm.prepareChecks(perm);
 	new FileInputStream(file);
 	sm.checkAllChecked(harness);
       }
@@ -60,7 +61,7 @@
       // throwpoint: java.io.FileInputStream-FileInputStream(String)
       harness.checkPoint("String constructor");
       try {
-	sm.prepareChecks(new Permission[] {perm});
+	sm.prepareChecks(perm);
 	new FileInputStream(path);
 	sm.checkAllChecked(harness);
       }
@@ -72,7 +73,7 @@
       // throwpoint: java.io.FileInputStream-FileInputStream(FileDescriptor)
       harness.checkPoint("FileDescriptor constructor");
       try {
-	sm.prepareChecks(new Permission[] {fdPerm});
+	sm.prepareChecks(fdPerm);
 	new FileInputStream(FileDescriptor.in);
 	sm.checkAllChecked(harness);
       }

      reply	other threads:[~2006-06-26  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 10:04 FYI: Throwpoint checks for java.lang.reflect.AccessibleObject Gary Benson
2006-06-26  9:38 ` Gary Benson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060626093804.GA3668@redhat.com \
    --to=gbenson@redhat.com \
    --cc=mauve-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).