unreported exception ,exception to be caught r declared ,error is this

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhagya B N

    unreported exception ,exception to be caught r declared ,error is this

    public static boolean hasRole(long userId, String role) {

    try {
    List<Role> roles = RoleServiceUtil .getUserRoles(u serId);

    for (Role tmpRole : roles) {

    if (tmpRole.getNam e().equalsIgnor eCase(role)) {
    return true;
    }
    }

    } catch (PortalExceptio n e) {

    e.printStackTra ce();

    }

    catch (SystemExceptio n e) {

    e.printStackTra ce();

    } catch (RemoteExceptio n e) {

    e.printStackTra ce();
    }

    return false;

    }

    }
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    Sorry. I did not understood your question. Can you elaborate the question and what is expected out of this code?

    Regards
    Dheeraj Joshi

    Comment

    • pbrockway2
      Recognized Expert New Member
      • Nov 2007
      • 151

      #3
      It is also a good idea to copy and post the entire error message. And indicate which lines of your code it is referring to.

      Comment

      Working...