mardi 20 février 2018

Modifying final static variable within final public class Java

I have a quick question regarding modifying a final public class. Based on some researches, it seems like final public class cannot be inherited or implemented. My goal is to change one final static variable within this final public class.

class name is: public final class Utils

private static final Set<String> DISALLOWED_HEADERS_SET = Set.of(
    "authorization", "connection", "cookie", "content-length",
    "date", "expect", "from", "host", "origin", "proxy-authorization",
    "referer", "user-agent", "upgrade", "via", "warning");

I want to get rid of "authorization" field from this DISALLOWED_HEADERS_SET. Is there any ways to doing this?

I heard reflection is one way to modify classes. This is a link to a github that seems to reveal what's inside of the class

Thank you in advance for your time and help





Aucun commentaire:

Enregistrer un commentaire