Question: Which statements about the following class are correct? (Choose three.) A. Line h1 properly validates security. B. Line h1 presents an unacceptable security risk. C.

Which statements about the following class are correct? (Choose three.) 

import java. security. *; import java.util.*; public class User Profile { private

A. Line h1 properly validates security.

B. Line h1 presents an unacceptable security risk.

C. Line h2 elevates security privileges.

D. Line h2 does not elevate security privileges.

E. Line h3 violates security guidelines by allowing security information to be cached.

F. Line h3 does not violate security guidelines.

import java. security. *; import java.util.*; public class User Profile { private static class User Entry { private final User Profile value; private final Permission permission; // Constructors/Getters Omitted } public static Permission getPermission (String check) { // Implementation Omitted } private static Map data = new HashMap (); public static User Profile getProfile (String check) { var securityRecord = data.get (check); if (securityRecord != null) return security Record.getValue(); var permission = getPermission (check); var permCol = permission.newPermission Collection(); permCol.add(permission); var prof = Access Controller.doPrivileged ( new PrivilegedAction () { public UserProfile run () { return new User Profile(); // h1 }}, new Access ControlContext( new ProtectionDomain[] { new ProtectionDomain (null, permCol) })); }} // h2 data.put (check, new User Entry (prof, permission)); // h3 return prof;

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the provided code snippet from a Java class which seems to involve Java security concepts lets evaluate each of the statements you provided A Line h1 properly validates security The code at l... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!