Today, I had to "reverse engineer" a Java desktop application and I got my hands on the ultimate password encryption in the process, but really. I knew most Java programmers are retards, but I never expected to see something like this in an enterprise level application (distributed around different countries).:
https://pastebin.com/9Edz8C1K
This code generates the database password If you call getCode(0).
public String getCode(int i)
{
return doGetCode(i);
}
I fucking hate java programmers
>a for loop has a dedicated method
rajesh, what are you doing?
>>61819191
This was written by either a diversity hire, or by some higher-ups nephew or son whom "needs some work experience".
Alternatively outsourcing, but that kind of code is below even pajeet tier, so I don't think so.
>>61819191
My favourite part is the forLoop method.
>>61819290
The application published a REST API for the other part that is a Chromium based front end. The server needs 30-60seconds to start up.
The code is really fucked up.
Wait so
>array of hardcoded strings
>get run through a bunch of retarded string manipulation when queried
>absolutely no reason other than to make the retrieval take more time
Am I understanding this right?
>>61820412
Yes :3
>>61819215public String getModuleToken(String moduleToken) {
return moduleToken;
}
From a cs graduate meme thread a while ago
>>61819215
I've seen constructions like this in Linux Kernel when I wondered how spinlocks worked.
http://elixir.free-electrons.com/linux/latest/source/include/linux/spinlock.hspin_lock_irqis defined asstatic __always_inline void spin_lock_irq(spinlock_t *lock)
{
raw_spin_lock_irq(&lock->rlock);
}raw_spin_lock_irqis a macro that is defined as_raw_spin_lock_irq(lock)We follow it to http://elixir.free-electrons.com/linux/latest/source/kernel/locking/spinlock.c#L165:void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock)
{
__raw_spin_lock_irq(lock); // editor note: now it's 2 fucking underscores
}
#endif
And at last http://elixir.free-electrons.com/linux/latest/source/include/linux/spinlock_api_smp.h#L124:static inline void __raw_spin_lock(raw_spinlock_t *lock)
{
preempt_disable();
spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
}
I mean, I kind of see why this is so, but it's fucking overboard.
>>61819191
Most people on /g/ writes code like this.
>>61820614
>How many levels of underscores are you on
>I dont know maybe 1 or 2
>You're like a little babby, watch thisstatic inline void ________________________________________________raw_spin_lock(raw_spinlock_t *lock)
>>61819191
What the fuck lmao why
>>61820614
Undefined behaviour.
>>61821469
kek