hydroptic

joined 1 year ago
[–] [email protected] 2 points 6 months ago* (last edited 6 months ago)

If you want to be able to eg. (de)serialize non-public fields of a type for any reason, you'll need some way to get around the access restriction. Mocking is another use case – although it's a philosophical discussion whether you should be mocking non-public fields.

And this isn't just a Java thing, the comment you're responding to has an example in C#, and you can do something similar in a lot of languages that support runtime reflection. Barring runtime reflection support you can do pointer math if the language supports it. Access restrictions on fields are there to stop casual misuse of private fields, but sometimes you actually may want to be able to step over those restrictions if you really know what you're doing.

[–] [email protected] 4 points 6 months ago

Rapid unplanned cranial disassembly

[–] [email protected] 3 points 6 months ago

Frankly it's been a while since I wrote either one. I just assumed Java because of the naming convention, and I didn't see anything I took as obviously un-Java in the class definition

[–] [email protected] 34 points 6 months ago (10 children)

Where are your gods now?

public static Joke getTheJoke(Meme yourMeme) {
  Field jokeField = Meme.class.getDeclaredField("joke");
  jokeField.setAccessible(true);
  return (Joke) jokeField.get(yourMeme);
}
[–] [email protected] 8 points 6 months ago

Murder fits reich-wing values just fine. Consensual sex, gay or otherwise, doesn't.

[–] [email protected] 0 points 6 months ago

It wasn't supposed to narrow it down, quite the opposite

[–] [email protected] 4 points 6 months ago* (last edited 6 months ago)

Meet the new Gilded Age, same as the old Gilded Age.

[–] [email protected] 5 points 6 months ago (2 children)

Good point, I should probably have said "working for a fascist billionaire manbaby"

[–] [email protected] 28 points 6 months ago (7 children)

With skills like this you too could be working for the fascist billionaire manbaby's personal vanity social media service

[–] [email protected] 40 points 6 months ago (12 children)

Well, they can be, but fucking this particular one up took outright ineptitude

[–] [email protected] 0 points 6 months ago

There better be some fucking profanity in the source

[–] [email protected] 19 points 6 months ago* (last edited 6 months ago) (1 children)

It was an actual icon:

(found the image here https://mastodon.social/@benjedwards/11031604817437112)

I don't remember what it did though. I think it wasn't the browser, and I have a vague memory it wasn't for dial up either, but my memory's shit so I personally wouldn't trust me on that

Edit: had to look this up, it was IE. I think I didn't remember it because I never really used IE since I started off with NCSA Mosaic and then Netscape

view more: ‹ prev next ›