• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2019-05-16


2019-05-18 »

Nick Message Date
Secret-Fire [Secret-Fire!] has joined ##java [12:00]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [12:04]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [12:04]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [12:10]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [12:11]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [12:13]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [12:19]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [12:35]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [12:37]
Hanii [Hanii!~Hanii@2a00:23c5:c587:a800:dd61:adb4:8f37:56e1] has joined ##java [12:38]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [12:39]
kgrimes2 [kgrimes2!] has joined ##java [12:45]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [12:49]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [12:54]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [12:55]
deavmi [deavmi!~deavmi@] has joined ##java [12:57]
deavmiUniversity [deavmiUniversity!~deavmi@] has joined ##java [01:00]
Secret-Fire [Secret-Fire!] has joined ##java [01:00]
Secret-Fire [Secret-Fire!] has joined ##java [01:02]
Anthaas [Anthaas!~Anthaas@unaffiliated/anthaas] has joined ##java [01:04]
Galactus_ [Galactus_!~Galactus@unaffiliated/galactus] has joined ##java [01:08]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [01:16]
forgottenone [forgottenone!~forgotten@] has joined ##java [01:22]
Jantz [Jantz!~IceChat9@2407:7000:8d04:100:614d:e437:cff7:94ed] has joined ##java [01:29]
tashie [tashie!] has joined ##java [01:30]
Muzer [Muzer!] has joined ##java [01:32]
svm_invictvs [01:37]
svm_invictvs y tho? [01:37]
deavmi [deavmi!~deavmi@] has joined ##java [01:42]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [01:47]
matsurago [matsurago!~matsurago@240b:10:b3a1:1700:68f9:4cf2:caea:75d] has joined ##java [01:49]
OnceMe [OnceMe!~OnceMe@unaffiliated/onceme] has joined ##java [01:50]
nickel8448 [nickel8448!~rahul@] has joined ##java [01:56]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [01:59]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [02:04]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [02:04]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0:80d2:20d9:8517:b9d6] has joined ##java [02:06]
exonity01 [exonity01!uid364582@gateway/web/] has joined ##java [02:08]
progart [progart!~kamee@] has joined ##java [02:34]
nickel8448 Hello, I was reading a function written by someone and it was something like public void of(Integer... args) What do the 3 dots mean in this case? [02:34]
tete_ [tete_!] has joined ##java [02:37]
rruizt [rruizt!] has joined ##java [02:42]
SuperTyp [SuperTyp!] has joined ##java [02:43]
Comstock [Comstock!Comstock@gateway/vpn/privateinternetaccess/comstock] has joined ##java [02:49]
mohsen_1 [mohsen_1!uid289573@gateway/web/] has joined ##java [02:55]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [02:57]
odinsbane vararg [02:57]
odinsbane odinsbane, what does that even *mean*? [02:57]
odinsbane nickel8448: It means the method accepts an array Integer[] args, you can call it without explicitly creating the array though. [02:58]
odinsbane nickel8448: of(1,2,3) vs. of(new Integer[]{1,2,3}) [02:58]
nickel8448 odinsbane: Thank you for the clarification. That makes sense. [02:59]
odinsbane varargs [02:59]
odinsbane varargs, or Variadic functions, is a function that accepts a variable number of arguments. In java this is specified with an ellipse following the last parameter type of a method, such as String... see [02:59]
bolt [bolt!~r00t@unaffiliated/bolt] has joined ##java [03:10]
Alina-malina [Alina-malina!~Alina-mal@unaffiliated/alina-malina] has joined ##java [03:11]
nickel8448 Thank you [03:11]
deavmi [deavmi!~deavmi@] has joined ##java [03:20]
deebo anyone know how to load local data for user when using oauth2 login in spring? [03:23]
checkItOut [checkItOut!~checkitou@] has joined ##java [03:25]
very_sneaky is there a way to pass by reference in java? [03:26]
Bombe The way you worded the question: no. [03:27]
very_sneaky oof. [03:28]
mohsen_1 trying [03:29]
mohsen_1 very_sneaky, What are you trying to do? [03:29]
very_sneaky pbr haha [03:29]
very_sneaky I'm trying to update a variable out of scope [03:29]
Bombe Why? [03:30]
Bombe It?s probably out of scope for a reason. [03:30]
very_sneaky to make the values available across threads [03:30]
very_sneaky I need a shared value across threads that is defined by a child thread [03:30]
Bombe There are multiple ways to do this, hard to suggest one without knowing more. [03:32]
Bombe First question that comes to my mind is why do you start threads start running before the [03:32]
Bombe Okay, let?s try this again. [03:33]
very_sneaky So, I think I could achieve what I wanted by using the new keyword on the out-of-scope definition, and then just adjusting the values in the child thread. It feels kind of messy not to be using the constructor, though. I suppose I could make a copy constructor to copy the values from a constructed object in the child thread [03:33]
Bombe Why do you start the threads before you have collected all required data? [03:33]
odinsbane wow. [03:34]
mohsen_1 very_sneaky: are you trying to learn threads? [03:35]
very_sneaky The spawned thread is an action handling thread, which creates a `Player` object when a client provides registration details [03:35]
very_sneaky mohsen_1: I've used them in the past, but yeah learning more the more i use them i guess [03:36]
mohsen_1 very_sneaky: I think you need volatile, but don't try to make a complex multi threaded application before you take at least a fundamentals level of multithreading: [03:37]
mohsen_1 mohsen_1's title: "Lesson: Concurrency (The Java Tutorials > Essential Classes)" [03:37]
mohsen_1 volatile [03:37]
mohsen_1 mohsen_1, volatile is a modifier on a field that ensures all threads see a consistent value for the field immediately after any update. See [03:37]
Bombe Pretty sure that?s not what he needs? [03:39]
acidjnk [acidjnk!] has joined ##java [03:39]
very_sneaky So my parent thread listens for messages from the client, and enqueues them. Then the child thread actions the enqueued messages. In retrospect, this might have worked better in reverse [03:39]
indistylo [indistylo!~aruns_@] has joined ##java [03:39]
Bombe What are parent and child threads supposed to be? [03:39]
Bombe Threads in Java don?t have such relationships. [03:40]
very_sneaky aside from what I just described? [03:40]
Bombe You didn?t describe anything, you used made-up words. [03:40]
mayurvpatil [mayurvpatil!~mayurvpat@] has joined ##java [03:40]
very_sneaky ... [03:40]
very_sneaky I have a BlockedQueue, used to store "messages" sent to the server from the client. The BlockedQueue is shared between both threads. The parent thread is constantly listeneing for new messages from clients, and enqueuing them on the BlockedQueue. The child thread pops messages off the queue and triggers an appropriate method to address the message it popped [03:42]
very_sneaky I don't think i made up any words [03:42]
Bombe Oh yeah? What?s BlockedQueue? Did you mean BlockingQueue? [03:42]
very_sneaky yes [03:42]
Bombe Well, you?re still using ?parent? and ?child? in a context where they have no meaning but I think I kind of understood what you?re doing. [03:43]
Bombe There?s two threads per client. [03:44]
very_sneaky the way I'm using them I mean the parent creates the child [03:44]
Bombe One reads messages, the other processes them. [03:44]
very_sneaky yes [03:44]
sliekas99 [sliekas99!~mantas@] has joined ##java [03:44]
Bombe Yeah but who creates a thread is completely irrelevant. [03:44]
Bombe Okay, so, now you?re creating an object somewhere (where?) and you want to make it available somewhere else (where?). [03:45]
very_sneaky sure, but it is relevant in the context of object scope [03:46]
Bombe No, ?thread? is not a scope. [03:46]
rruizt [rruizt!] has joined ##java [03:47]
very_sneaky no but the runnable created with the thread is [03:47]
very_sneaky it's okay, i think i've found a solution to my issue. thanks for taking the time to try to understand [03:47]
Bombe No problem. [03:47]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [03:54]
deavmi [deavmi!~deavmi@] has joined ##java [03:55]
fairuz [fairuz!~fairuz@unaffiliated/fairuz] has joined ##java [03:56]
Secret-Fire [Secret-Fire!] has joined ##java [03:58]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [03:59]
dendazen [dendazen!] has joined ##java [04:06]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [04:11]
odinsbane very_sneaky: sometimes the queues hold objects/tasks. Eg. List<Runnable>, then you just pop the tasks off of the queue, and they have their own scope and data. [04:11]
indistylo [indistylo!~aruns_@] has joined ##java [04:12]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [04:19]
CookieM [CookieM!] has joined ##java [04:19]
questions_ [questions_!~questions@2a02:a44f:70d7:1:f845:9204:5628:c1ef] has joined ##java [04:21]
questions_ is anyone here using vim and makes it work great with java ? [04:22]
michael_mbp [michael_mbp!] has joined ##java [04:24]
hussam [hussam!uid193284@gateway/web/] has joined ##java [04:24]
adder` [adder`!~adder@gateway/tor-sasl/adder] has joined ##java [04:28]
yawkat the only way to make vim decent for java is to use eclipse :) [04:31]
yawkat eclim [04:31]
yawkat yawkat, eclim is Eclipse + vim [04:31]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [04:34]
Ekho [Ekho!~Ekho@unaffiliated/ekho] has joined ##java [04:36]
Human_G33k [Human_G33k!~HumanG33k@] has joined ##java [04:38]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [04:42]
mayurvpatil questions_, why you need vim ? [04:44]
zjett I use neovim for basically everything BUT Java. For Java I use the IdeaVim plugin on IDEA which works fairly well. [04:45]
mitch0 yawkat: how does eclim compare to vrapper? have you tried both? [04:49]
michael_mbp [michael_mbp!] has joined ##java [04:54]
shmoon [shmoon!] has joined ##java [04:55]
shmoon Let's say my application is dependant on a library (jar) called log4j and I want to make some changes to this jar/lib like adding some debugs/info logs and see the change in realtime by running the app. HOw do I do it ? [04:57]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [05:00]
magz [magz!] has joined ##java [05:02]
puppy_za [puppy_za!uid277586@gateway/web/] has joined ##java [05:02]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [05:04]
odinsbane shmoon: you want to hot-swap the library? As in switch it while the application is running? [05:05]
Gazooo [Gazooo!~Gazooo@] has joined ##java [05:07]
questions_ oke [05:09]
questions_ oke [05:09]
gurrkiin ideavim is the best vim emulator [05:17]
mbooth mitch0: I thought vrapper was dead project, but when I looked just now I found there was a new release in 2018. First words of the release announcement: "You guys just won't let this project die." [05:30]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [05:38]
puppy_za the joy of open source? [05:38]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [05:40]
Alina-malina_ [Alina-malina_!~Alina-mal@unaffiliated/alina-malina] has joined ##java [05:45]
AcTiWoRk [AcTiWoRk!] has joined ##java [05:45]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [05:46]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [05:46]
questions_ huh [05:51]
questions_ did you just stop and come from playing quake cghampions? [05:51]
rotsneg [rotsneg!~genstor@] has joined ##java [05:52]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [05:56]
genstor [genstor!~rotsneg@] has joined ##java [05:58]
sa02irc [sa02irc!] has joined ##java [06:00]
DTZUZO [DTZUZO!] has joined ##java [06:06]
deadc0de [deadc0de!~deadc0de@] has joined ##java [06:06]
Addax morning [06:07]
checkItOut [checkItOut!~checkitou@] has joined ##java [06:12]
gurrkiin does anyone know why a spring bean would get confused between 2 bean properties when referencing by name? Keep getting "required 1, found 2" when i am referencing by name/id [06:16]
Bombe Probably because there are two beans. [06:16]
gurrkiin there are two, but i am referencing them by name in the property tag, should that not be enough? [06:17]
Addax show us [06:17]
Addax Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [06:17]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [06:17]
checkItOut [checkItOut!~checkitou@] has joined ##java [06:18]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [06:19]
gurrkiin something like this - [06:21]
srm [srm!~srm@unaffiliated/srm] has joined ##java [06:27]
[twisti] gurrkiin: totally ignoring your question (i dont know spring): are you writing your own logging backend, and if so, why ? [06:27]
ZOrder [ZOrder!~shiranpur@unaffiliated/shiranpuri] has joined ##java [06:27]
gurrkiin its logging to DB table [06:28]
conan [conan!] has joined ##java [06:28]
Addax gurrkiin: you do know that other loggers can do that, of course, with configurations [06:28]
Addax but that's a secondary issue [06:28]
gurrkiin yeah probably, i am extending co-workers code though, trying to keep it as in line with that as i can [06:29]
tete_ [tete_!] has joined ##java [06:38]
very_sneaky is there a program like valgrind that i can run with java that will tell me if i'm getting memory leaks/confirm that all resources have been freed successfully? [06:42]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [06:47]
gurrkiin I even tried seperating the 2 XML DAO configs, and making another Service, each importing their own XML and I still get the found 2 problem! [06:47]
Addax gurrkiin: simplify and replicate. Create a new project, a sandbox project, and replicate the problem there. [06:50]
gurrkiin yeah thats probably the best way to find out whats going on, will try that, thanks [06:51]
Addax you can also show people who aren't part of your company the problem, too, so we can help by looking at actual code [06:51]
puppy_za gurrkiin: not sure how to do it using XML, but you can use @Qualifier annotation to pick the bean [06:52]
puppy_za [06:52]
Addax puppy_za: the ref in XML avoids the need for qualifiers [06:52]
gurrkiin puppy_za: tried Qualifier, it's because i am setting property on a Spring class I am extending [06:52]
gurrkiin Addax: was the pastebin not enough? [06:52]
Addax gurrkiin: I didn't see a problem in the pastebin. So ... I'd say no, based on that [06:54]
gurrkiin Oh, they are the only relevant files for it really [06:55]
Addax I'm sure [06:55]
Addax but I still didn't see a problem [06:55]
gurrkiin ^ [06:55]
gurrkiin It's running in WebLogic server, could that change anything? [06:56]
Addax shouldn't [06:57]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [06:58]
rruizt [rruizt!] has joined ##java [07:07]
Improvotter [Improvotter!] has joined ##java [07:07]
mayurvpatil [mayurvpatil!~mayurvpat@] has joined ##java [07:08]
royal_screwup21 [royal_screwup21!89de72f4@gateway/web/cgi-irc/] has joined ##java [07:10]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [07:11]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [07:21]
atslash [atslash!] has joined ##java [07:22]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [07:30]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [07:31]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [07:42]
Cahaan [Cahaan!] has joined ##java [07:46]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [07:48]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [07:51]
very_sneaky hey all, I'm having trouble closing a BufferedReader stream. I'm getting some really strange behaviour; I call `inputStream.close()` and it just hangs, no exception or anything - anybody have any idea what could cause this? [07:52]
very_sneaky it does it inconsistently, too [07:52]
very_sneaky though it's consistently reproducible [07:52]
Addax show us [07:53]
Addax Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [07:53]
very_sneaky Addax: this is the class; line 62 is where it hangs: [07:55]
very_sneaky if you want a test case i can put one together, but i don't have one at the moment [07:55]
Addax Hmm, I don't see anything offhand that would cause a problem in that code, although I'd use close() instead of cleanUp() (you could then make this an autocloseable resource) [07:56]
whaley [whaley!] has joined ##java [07:57]
very_sneaky if it's autocloseable, will it close if the object goes out of scope? or would it need a specific try-with-resources block or similar [07:58]
puppy_za are you accessing it from another thread? [07:58]
very_sneaky puppy_za: uh, yes actually. two threads have access to this [07:59]
Addax very_sneaky: no, it won't call close() when it goes out of scope [07:59]
Addax very_sneaky: that might be the issue, too [07:59]
puppy_za maybe it's still blocking. (although I can't remember if calling close() will unblock) [07:59]
Matthijs Note that calling close on the socket also closes the input and output streams. [08:00]
nokdoot [nokdoot!~nokdoot@] has joined ##java [08:00]
Matthijs And the other way around [08:00]
rwheadon [rwheadon!] has joined ##java [08:05]
nokdoot [nokdoot!~nokdoot@] has joined ##java [08:10]
sagax [sagax!~sagax_nb@] has joined ##java [08:11]
rruizt [rruizt!] has joined ##java [08:19]
very_sneaky I think it might have still been blocking. Closing the socket and handling the resulting exception fixed the issue [08:19]
LearnAllTheTime [LearnAllTheTime!~LearnAllT@2600:1700:e560:21e0:15fd:7cdf:31a7:843e] has joined ##java [08:20]
indistylo [indistylo!~aruns_@] has joined ##java [08:20]
nokdoot [nokdoot!~nokdoot@] has joined ##java [08:24]
VegetarianFalcon [VegetarianFalcon!uid258908@gateway/web/] has joined ##java [08:26]
tuskkk____ [tuskkk____!uid18470@gateway/web/] has joined ##java [08:27]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [08:30]
livcd [livcd!mewmew@unaffiliated/livcd] has joined ##java [08:34]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [08:42]
Aireil [Aireil!551a6de9@gateway/web/freenode/ip.] has joined ##java [08:46]
t2mkn [t2mkn!~t2mkn@] has joined ##java [08:49]
Aireil Hello, when I want to modify the value of an instance variable from a superclass, should I use =... or =... ? Both seems to give the same result. Thank you. [08:51]
Addax super would refer to a shadowed instance if one exists (otherwise the instance' reference) [08:53]
Addax so would be the right reference to use [08:53]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [08:53]
yawkat or dont make fields anything but private. [08:54]
Addax and don't use accessors or mutators either, ever [08:54]
Addax ^^^ this is sarcasm, BTW [08:54]
db [db!uid18678@gateway/web/] has joined ##java [08:54]
mluser-home [mluser-home!] has joined ##java [08:55]
Aireil Why should I use accessors when the class extends the superclass? [08:55]
Addax Aireil: it depends. [08:56]
yawkat why not? [08:56]
Aireil It's the reunion of 2 classes, because my superclass is abstract and the implementation of the superclass comes from my class. So I view them a bit like the "same" class [08:57]
Addax they're not [08:57]
yawkat if theyre the same class, why are they two classes [08:58]
Aireil Because the implementation varies at runtime, I'm trying to learn the "abstract factory" design pattern [09:00]
yawkat if the implementation varies at runtime theyre not the same class [09:00]
Aireil I didn't mean the same class in that way, more like the instance variable belong to both classes [09:02]
Aireil Maybe that's also wrong ^^" [09:02]
Addax it does not [09:02]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [09:02]
Addax class Foo { int bar; } class Baz extends Foo {} // bar is *in* foo, belongs to foo, is accessible to both Baz and Foo and whatever else extends Foo [09:03]
Addax unless Baz overrides or shadows bar, Baz can use and refer to the "right" bar. Access rules apply, and there's absolutely nothing wrong with Baz using getBar() to access it (assuming it's in Foo's definition.) [09:04]
Aireil Addax: Nothing wrong, but why would it be "better" to use getBar() instead of [09:07]
Aireil Other than setting the "bar" visibility marker to private? [09:07]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [09:08]
matsurago [matsurago!~matsurago@240b:10:b3a1:1700:6024:e83b:37ae:c4b5] has joined ##java [09:08]
Addax consistency, control [09:09]
Addax consistency because every other access to bar outside of Foo's access will be through the accessor [09:09]
indistylo [indistylo!~aruns_@] has joined ##java [09:09]
Addax control because getBar() means you actually CAN control bar, to set default values, ranges, etc [09:09]
Addax I don't know about you, maybe you're a genius, but I'm not smart enough to want to evaluate appropriate access every fucking time I want to use an instance variable: I want that consistency [09:10]
yawkat trustin lee is working on a new netty-based REST/gRPC/Thrift application framework: [09:10]
yawkat yawkat's title: "Server basics Armeria 0.86.0 documentation" [09:10]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [09:10]
yawkat since it seems relevant, here's my opinion on netty-based HTTP frameworks [09:10]
Aireil Didn't think about it like, that, it makes sense now, thank you :) [09:11]
matsurago I think you incorrectly define what a framework is [09:12]
sbeex [sbeex!~sbeex@] has joined ##java [09:12]
matsurago It is not about opinionated/not opinionated, but rather you call it or it calls you [09:12]
sbeex Hi, i'm evaluating a few reporting libraries for java. For now I see a lot about JasperReport do you have other good lib you would suggest ? or if you have exprience with jasper do you have some advice before using it ? [09:13]
sbeex thank you in advance [09:13]
[rg] [[rg]!d8df4f72@gateway/web/freenode/ip.] has joined ##java [09:14]
freeone3000 I think we've (as a collectively) mostly moved to reporting-as-a-service to encompass other metrics. I personally use Application Insights, previously Looker, previously Carbon. [09:15]
ernimril sbeex, we looked at it and tried it out a few years ago, we are not using it anymore [09:15]
[rg] what do yo guys use for depency graphs in java? [09:19]
freeone3000 "Due to higher traffic than anticpated, the 12th floor is no longer for your use during renovations. The 10th floor restrooms are now available for your use." [09:19]
freeone3000 Err sorry wrong channel. [09:19]
LunarJetman [LunarJetman!] has joined ##java [09:19]
[rg] need to figure out how many classes my changes are going to affect [09:19]
freeone3000 [rg]: Is this... a concern? [09:20]
[rg] also vscode makes java more fun [09:20]
[rg] freeone3000: what do you mean? [09:20]
Addax [rg]: your tests won't show you? [09:21]
Addax Why are you worried about how many classes your changes will affect? [09:21]
[rg] well im gonna update the code heavily so stuff that relies on it will break [09:22]
[rg] would be nice to find out before building [09:22]
Addax ... why? [09:22]
Addax Why not build often enough that you find out immediately? [09:22]
Addax Eclipse, IDEA make this easy (and will show you immediately anyway) [09:22]
ernimril [rg], how long time does your build take? [09:22]
[rg] hmm ~14 I think [09:23]
[rg] seconds [09:23]
ernimril [rg], so about 2000 source files then? [09:24]
[rg] i'd like to do that so I have an idea already of what needs to be changed instead of just millon compile errors [09:24]
[rg] ernimril: not 2000 but a good amount [09:24]
Addax not using a good Java IDE, then? [09:25]
mbooth [rg]: Use an IDE that has sane refactoring tools, so you can the make a change in all necessary files at the same time, in a single action [09:26]
ernimril [rg], well, we compile 17k source files in 45 seconds. I quite often just change files and get a few hundred errors (then work through the problems) [09:26]
paddyez [paddyez!~paddyez@wikipedia/paddyez] has joined ##java [09:26]
[rg] hm ok [09:27]
ernimril mbooth, not always possible, consider adding a new argument to an interface method [09:28]
[rg] mbooth: refactoring will have to be manual since the changes are completely different to the previous version [09:28]
mbooth Then use an IDE with sane incremental compilation to get immediate feedback on what your change breaks [09:29]
mbooth I'm not a mind reader ;-) [09:29]
mayurvpatil [mayurvpatil!~mayurvpat@] has joined ##java [09:29]
mbooth Eclipse and IDEA both have these features [09:30]
Addax indeed [09:30]
Addax but you're ... using vscode for java? [09:30]
[rg] yeah [09:31]
Addax and vscode has no refactoring support for java? [09:32]
mbooth Or increment compilation? [09:32]
mbooth IIRC Java support for VSCode is a thin wrapper around the Eclipse JDT Plug-in [09:36]
mbooth Might as well just use Eclipse ;-) [09:36]
sbeex ernimril: what are you using now then ? [09:39]
sbeex freeone3000: I'll have a look at Application insights thank you [09:39]
[rg] Addax: it does have those features [09:40]
ernimril sbeex, using for what? I run a mix of eclipse, emacs a few different build tools (depending on project, from make! to maven) [09:41]
mbooth [rg]: Then you should have no problem. Incremental compilation means the IDE knows the graph of the project and will only try to compile the units affected by your change. It's not recompiling your whole project [09:42]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [09:43]
ernimril but most large projects tend to have quite large interconnected things so incremental recompilation tend to affect a large part of the code. Eclipse is pretty bad at this [09:44]
mindCrime [mindCrime!~mindCrime@] has joined ##java [09:44]
ernimril (as in often recompiling everything) [09:44]
mbooth My experience differs, but the plural of anecdote is not anecdata :-) [09:44]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [09:45]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [09:46]
Aireil If I have a class that implements a method in the superclass. When I use class.method(); Is the method executed from the class (concrete) or from the superclass (abstract)? [09:46]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [09:47]
ernimril tias [09:47]
ernimril Aireil, Try it and see. You learn much more by experimentation than by asking without having even tried. [09:47]
progart [progart!~kamee@] has joined ##java [09:48]
[rg] that qoute irks me a bit [09:49]
Addax why [09:49]
ernimril try it first then ask questions about why [09:49]
Addax Aireil: plus, you're missing information for us to use when answering [09:50]
mluser-home [mluser-home!] has joined ##java [09:51]
[rg] Addax: because that follows more with the nature of repls, sometimes you have an idea that's dependent on another and you want to get going instead of doing pointless discovery [09:51]
[rg] and potentially learning something incorrectly [09:52]
[rg] might not be as bad in java [09:52]
Addax [rg]: but it's never pointless discovery unless you're a moron [09:52]
Addax are you a moron? [09:52]
[rg] but certainly the case in c/c++ [09:52]
Addax it is not the case in C/C++ either [09:52]
[rg] yeah, you make a discovery but oh well it's ub [09:53]
Addax what does "ub" mean? [09:53]
Aireil Undefined behavior [09:53]
mbooth Addax: "What if I learn something and it's all for nothing?" [09:54]
mbooth [rg]: You still learned something [09:54]
odinsbane tias has its place. It isn't always appropriate, but what is? [09:55]
Addax ... you still learned something [09:55]
Addax odinsbane ++ [09:55]
Addax odinsbane has a karma level of 67, Addax [09:55]
Addax I'd say TIAS is nearly always a good starting point [09:55]
Addax I don't mind people asking first - I do! - but if the answer's "tias" that means that it's something I should have been able to try first, and should have done so [09:55]
[rg] if you go away thinking something works, well a conept that builds on it breaks, it's pretty much a waste, yes I know learning for learning etc [09:56]
[rg] s/well/and [09:56]
[rg] but yeah good points [09:56]
Aireil Why is an abstract method executed from the concrete class that implements it rather than the class of the abstract method? [09:59]
Addax it's not. [09:59]
Addax But it has the context of the actual instance. [09:59]
Aireil Not sure what you mean by "it has the context of the actual instance." [10:00]
Addax okay. abstract class Foo { int bar; void baz() { } } class Quux extends Foo { int bletch; } // with me? [10:01]
Addax When I do Quux quux=new Quux(); quux.baz(); // the CALLING INSTANCE is quux; the method body is from Foo.baz() because Quux doesn't override it. With me? [10:02]
greggerz [greggerz!~greggerz@unaffiliated/greggerz] has joined ##java [10:02]
Addax inside of baz(), if you were to look at what the value of "this" was, it'd be a Quux, because that's what the instance is [10:02]
Aireil What's the point of Foo as abstract if it doesn't have any abstract method? [10:03]
Addax Aireil: Foo is a meta-class anyway, it's not a concrete example [10:04]
Addax the whole example is meta, that's why I used metawords! [10:04]
Gugi [Gugi!] has joined ##java [10:05]
Aireil So this would be the same if Quux overrides baz() from Foo right? [10:05]
Addax well, if Quux overrides baz(), Quux' version of baz() would be executed... again from the context of this being a Quux [10:06]
Aireil OK I see, make sense, thank you. [10:07]
Addax methods are dispatched to the "nearest" version of the code, so if Quux doesn't have one, it'd go to the superclass and use that one [10:07]
Addax but at no point would the instance not be a Quux [10:07]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [10:08]
Aireil I thought that when you have an abstract method, it would execute in that class, even if the instance is different (regarding visibility markers) [10:10]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [10:11]
Addax if it's the nearest version it will [10:14]
Addax java uses virtual methods for everything but static [10:14]
very_sneaky is anybody able to help me understand why this basic logger creates multiple files, one for each thread it's instantiated in? [10:14]
very_sneaky I've used a singleton, so i don't understand why it would create a new file `user_input.log.1` [10:15]
very_sneaky rather than just write to `user_input.log` [10:15]
Addax It's a singleton? Then it's not being instantiated in each thread. [10:16]
Addax Show the usage, please. [10:16]
Addax It's not written like a decent singleton. [10:16]
odinsbane no synchronization. Are the threads being started at once or with some delays? [10:17]
Addax class InputLogger { private InputLogger() {}; private static final InputLogger instance=new InputLogger(); public static InputLogger getInstance() { return instance; } } [10:17]
very_sneaky Addax: the class at the bottom, `InputListener` is a cut down version of the usage, without the other noise [10:17]
Addax well, line 51, then [10:17]
Addax why are you using j.u.l? You should use logback + slf4j, or something like that [10:17]
Addax java.util.logging blows [10:17]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [10:18]
Addax you can do better, and others can do WAY better and already have [10:18]
odinsbane Also, new InputLogger() creates a new inputlogger, but doesn't change the static reference. [10:18]
very_sneaky odinsbane: with delays, but iirc all methods on Logger() are threadsafe, arent they? [10:18]
Addax yeah, that's... not a singleton at all :) [10:18]
odinsbane very_sneaky: Every InputListener has a different inLog. [10:19]
very_sneaky Addax: yeah, i should be using slf4j - I was running into configuration issues so just decided to opt for something that I knew worked for the moment (for the most part) [10:19]
Addax very_sneaky: this is not how you use j.u.l, either. First, you don't use j.u.l. If you DO, reconsider this. If you STILL use j.u.l, then use an initializer to configure it, and then get the logger from j.u.l; there's known idiom for this. [10:20]
shmoon odinsbane: yuo [10:20]
shmoon yup [10:20]
odinsbane singleton [10:20]
odinsbane odinsbane, singleton is a controversial pattern where you enforce only one instance of a class. Singletons often make non-trivial programs clunky and difficult to maintain. Read and before implementing one yourself, and consider dependency injection as a modern alternative. [10:20]
Addax and note that Logger logger=LoggerFactory.getLogger(this); // is idiomatic even for j.u.l [10:21]
Addax the classes change slightly but it's still the way to do it [10:22]
very_sneaky this is going to be a silly question [10:24]
very_sneaky i'm sure [10:24]
very_sneaky but at line 17: this return from the constructor, doesn't this prevent the creation of another instance and maintain a singleton? [10:24]
odinsbane no, it doesn't. [10:25]
Addax nope. [10:25]
odinsbane very_sneaky: you should make the constructor private and use a factory method. [10:25]
Addax I showed you how to "do a singleton." [10:25]
cheeser use an enum! [10:25]
cheeser D [10:25]
freeone3000 oh return's allowed in constructors? huh. [10:25]
very_sneaky Addax: appreciated, just trying to understand [10:26]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [10:26]
very_sneaky I derived this from a SO post [10:26]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [10:26]
Addax bites tongue [10:26]
lucid-lullaby [lucid-lullaby!lucid-lull@gateway/vpn/privateinternetaccess/lucid-lullaby] has joined ##java [10:27]
freeone3000 Lots of people can be wrong, all at the same time! [10:28]
very_sneaky I like your implementation better, this is much more straight forward [10:28]
Addax some people say that [10:28]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [10:29]
Addax trump the power of mass delusion [10:29]
Addax <drumpf>Are you asking me about the power of mass delusion? Let me tell you about the power of mass delusion. I know the power of mass delusion. I like the power of mass delusion. I donated money for the power of mass delusion. We're gonna be the power of mass delusion, let me tell you, it'll be great, it'll be yuge. Next question.</drumpf> [10:29]
Addax very_sneaky: note that if you use loggers, the logging framework ALREADY DOES THAT FOR YOU [10:30]
Addax do not use that pattern for loggers! [10:30]
very_sneaky Addax: noted, I realise it's a bit of a hack [10:31]
matsurago [matsurago!~matsurago@240b:10:b3a1:1700:227c:8fff:fe9b:7ad6] has joined ##java [10:31]
[rg] why are private memebers so heavliy recommended? [10:32]
[rg] isnt the default scope fine for most cases? [10:33]
Addax [rg]: prevents incorrect access [10:33]
[rg] i guess [10:34]
Addax ... really? [10:34]
LSCody [LSCody!] has joined ##java [10:39]
Rapture [Rapture!] has joined ##java [10:42]
tang^ [tang^!~tang^@] has joined ##java [10:43]
conan [conan!~conan@] has joined ##java [10:45]
very_sneaky hmm, acknowledging that implementing a logger this way is bad practice, that didn't fix it - multiple files are still produced [10:45]
Addax show us [10:46]
Addax Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [10:46]
very_sneaky [10:48]
cheeser "new InputLogger()" [10:49]
very_sneaky cheeser: that's the definition, I'm assuming a call to the constructor has to happen at least once [10:49]
cheeser are you really building your own logging? am i missing that much context? i thought i was up to speed but that's all full of wtf. :) [10:49]
very_sneaky cheeser: i followed the advice of a SO post, which aprently led me down the garden path. This is more for understanding at this point [10:50]
Addax very_sneaky: damn it, GET THE LOGGER FROM j.u.l!!!! [10:50]
Addax I showed you code that would PREVENT you from getting a singleton incorrectly [10:50]
Diablo-D3 why cant he just use slf4j and follow the given examples? [10:54]
Diablo-D3 this is seriously not hard [10:55]
Addax Diablo-D3: dunno [10:55]
Addax already raised the point to him with prejudice [10:55]
puppy_za it takes a bit time to get all the information, initially [10:55]
very_sneaky ^ [10:55]
Addax should be like five minutes [10:56]
Addax add logback to the classpath, read the introduction for logback, done [10:56]
cheeser Diablo-D3: "This is more for understanding at this point" why can't you just read what he's said? [10:56]
Addax Logger logger=LoggerFactory.getLogger(this); // the five-second intro once logback is in your classpath, but he's already seen this [10:56]
cheeser is it dumb to do this "for reals?" definitely. is it a good learning experience? why the fuck not? [10:57]
Addax cheeser ++ [10:57]
Addax cheeser has a karma level of 1,497, Addax [10:57]
Diablo-D3 \_(?)_/ [10:57]
tdutra [tdutra!bd474c59@gateway/web/freenode/ip.] has joined ##java [11:00]
tdutra parted the channel: [11:00]
HumanG33k [HumanG33k!~HumanG33k@] has joined ##java [11:01]
[rg] [rg] ++ [11:02]
[rg] You can't increment your own karma. [11:02]
[rg] [rg], you have a karma level of -1 [11:02]
[rg] lol [11:02]
cheeser bitch [11:02]
cheeser D [11:02]
[rg] the lowest wins [11:03]
tang^ you have a long way to go [11:03]
tang^ karma eclipse [11:03]
tang^ eclipse has a karma level of -685, tang^ [11:03]
very_sneaky okay so, Addax: your insistence on using `Logger logger=LoggerFactory.getLogger(this)` - I'm assuming that this is the slf4j facade; is `Logger logger = Logger.getLogger()` not "getting the logger from j.u.l"? [11:03]
benJIman 9 [11:03]
Addax very_sneaky: yes, it would be equivalent [11:05]
very_sneaky Addax: and I'm doing that; your suggestion is just to move this into my `InputHandler` class directly as a static field? My thought was that using a singleton could keep things tidier as far as initialisation of the logger goes [11:06]
Addax no [11:07]
Addax the static is in Logger.getLogger(), not in your class; your class would use an instance variable [11:07]
very_sneaky huh. That was how I had it configured originally, it had the same behaviour as now - multiple files; one for each instance of `InputHandler` in its own thread [11:08]
Addax this sounds like the configuration of the logger is wrong [11:08]
very_sneaky that could definitely be it [11:09]
RedSoxFan07 [RedSoxFan07!] has joined ##java [11:12]
livepan [livepan!~test@unaffiliated/livepan] has joined ##java [11:17]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [11:18]
ravenousmoose_ [ravenousmoose_!~ravenousm@] has joined ##java [11:18]
rruizt [rruizt!] has joined ##java [11:18]
AcTiWoRk [AcTiWoRk!] has joined ##java [11:22]
very_sneaky I'm trying to work out the best way to implement keep alive and timeout for all the tcp connections between my server and clients. It seems like timeout can be done using Socket.setSoTimeout, but it doens't seem like theres an easy way to set the keep-alive time programmatically without changing OS level environment variables.. Is implementing my own in the application the best way to achieve effective keep-alive or is there another wa [11:24]
very_sneaky y? [11:24]
cheeser raw TCP? or a protocol like HTTP or websockets? [11:27]
conan_ [conan_!~conan@] has joined ##java [11:27]
very_sneaky cheeser: raw TCP [11:27]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [11:27]
cheeser i don't think there is from the java api [11:27]
cheeser you'd need something like irc's ping/pong [11:28]
yawkat the only reliable way to implement timeouts with tcp is to do it manually [11:29]
yawkat tcp keepalive is inadequate [11:29]
very_sneaky yeah okay. thanks guys [11:29]
very_sneaky ping/pong looks like it could be a good way to do it [11:30]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [11:32]
upgrdman [upgrdman!~upgrdman@blender/artist/upgrdman] has joined ##java [11:36]
Gugi [Gugi!] has joined ##java [11:46]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [11:53]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [11:57]
Aireil When I print the value of a string, there's nothing in the console, but when I use if(str == ""){} it doesn't catch it. Am I doing something wrong? [11:58]
Addax Aireil: you don't compare objects with == [11:59]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [11:59]
Addax use str.equals("") [12:00]
Aireil Oh right, I'm comparing the references, thank you ^^" [12:00]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:02]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [12:04]
mindCrime_ [mindCrime_!~mindCrime@] has joined ##java [12:07]
tassee [tassee!] has joined ##java [12:07]
fizzie (Or `str.isEmpty()` if you find that more readable.) [12:08]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [12:11]
bolverkr [bolverkr!] has joined ##java [12:12]
ravenousmoose_ [ravenousmoose_!] has joined ##java [12:14]
Nightwing52 [Nightwing52!~Thunderbi@] has joined ##java [12:15]
Addax fizzie: ... and the API version supports it, yes [12:19]
avalchev [avalchev!~Thunderbi@] has joined ##java [12:20]
learningc [learningc!~learningc@] has joined ##java [12:22]
learning [learning!~learningc@] has joined ##java [12:25]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [12:26]
DTZUZO [DTZUZO!] has joined ##java [12:27]
[rg] why would you override appaches daemon init() ? [12:29]
[rg] when* [12:29]
Addax "when you need to" [12:31]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [12:34]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:36]
wisey [wisey!] has joined ##java [12:36]
[rg] yeah, guess I was thinking out loud [12:38]
t2mkn [t2mkn!~t2mkn@] has joined ##java [12:40]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [12:40]
kirua Can the difference between <library-name>minfin.ccff.fwk.struts1.war.skinny</library-name> and <library-name>minfin.ccff.fwk.struts1.war.libs</library-name> provoke a java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet ? [12:40]
Addax kirua: uh... what? [12:41]
kirua in other words, whats the difference between a 'skinny' war and a 'normal' one ? [12:41]
Addax dunno offhand [12:41]
kirua i found this : [12:42]
Addax well, what does it tell you [12:42]
kirua idont get it, my english is bad [12:43]
Addax well, it looks like using the .ear's dependencies instead of local .war dependencies [12:43]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [12:43]
tete_ the first paragraph reads like... its more or less the same like: "normal" jar vs fatjar [12:44]
Addax sort of is, I guess [12:44]
tete_ but my english is also bad :) and i am not that familiar with maven [12:44]
indistylo [indistylo!~aruns_@] has joined ##java [12:44]
Addax maven's not that important for the concept the page is talking about [12:44]
tete_ thats true, and the xml "commands" talk quiet clearly what they do [12:45]
tete_ or xml configuration parts ... no idea what the term for this is [12:45]
Addax just leverages the idea that a war's classpath delegates to the .ear, so you can put the war's dependencies at the .ear level and not duplicate them in the .wars. If you only have one .war, I don't know what the point would be. [12:45]
tete_ Addax, maybe to change the dependency, e.g. if you require version 5.1.4 instead of 5.1.5 because 5.1.5 contains a evil bug or so...? [12:46]
Addax tete_: How would that change based on where the actual .jar was located? [12:46]
Addax The classpath's still the classpath [12:46]
tete_ i am not familiar with war/ear, unfortunately. but i thought when i deploy a war, the managment of dependencies is also done by the webserver (e.g. glassfish) and it prioritizes the dependencies given by the server more than of the war? [12:47]
tete_ just a guess.. no idea ;) [12:47]
Addax sure, and that's the whole idea of the "skinny war" - the classpath uses the server libs first, then the .ear libs, then the war libs [12:48]
Addax so the "skinny war" locates the war's dependencies at the .ear level instead of the .war level [12:48]
Addax so if you have multiple .wars and they all use foo-1.1.jar, you put foo-1.1.jar in the .ear once instead of in both wars [12:49]
[rg] do you leave non primitves objects uninitialized aand set in the constructor or do you just declare and assign? [12:51]
[rg] seems like more of a style thing than performance [12:51]
indistylo [indistylo!~aruns_@] has joined ##java [12:52]
Addax it depends. Primitives have different initialization rules than objects do. (Well, not really, but the defaults are different.) [12:52]
kirua Addax, so if you happen to only use the .war instead of the .ear, you may find yourself missing the dependencies? [12:52]
Addax kirua: um, it probably wouldn't deploy unless the dependencies are available at the server level, I guess [12:53]
Addax why are you asking about this? [12:55]
royal_screwup21 [royal_screwup21!89de72f4@gateway/web/cgi-irc/] has joined ##java [12:56]
Nightwing52 [Nightwing52!~Thunderbi@] has joined ##java [12:57]
tete_ [rg], as long as the object is in itself valid and usable.. i prefer private final's because then i don't have to think about if the object is in a valid state or not [12:57]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:57]
tete_ and when i have 2 or more constructor params, i see that i probably need another class, because the current one is doing too much [12:58]
ricky_clarkson I have a higher tolerance for constructor parameter number as I rarely actually call the constructor directly thanks to DI. [12:59]
ricky_clarkson but when it gets much larger then it's likely there's another class asking to be created [01:00]
Diablo-D3 [Diablo-D3!] has joined ##java [01:00]
Addax Yeah, it's usually a case-by-case evaluation though [01:00]
BluesBoy [BluesBoy!] has joined ##java [01:01]
tete_ of course, if it sounded like its wrong to have a constructor with 2 or more params then that was not my intend. just wanted to express that this could be a sign of a missing class, but not must be a sign of a missing class :) [01:01]
msiism [msiism!~msiism@2001:16b8:570d:6a00:ee08:6bff:fe1c:ed28] has joined ##java [01:02]
msiism parted the channel: [01:02]
Addax sure, you used weasel words as you should have [01:03]
Addax "weasel words" are words like "likely" and "probably" - things that make it where it's not a formal "hard" declaration, but instead suggest that there's room to consider [01:03]
tete_ good ;) [01:03]
cheeser two parameters is an awfully low bar for needing another class. [01:04]
[rg] cheeser: whats your limit? [01:04]
cheeser i don't have one [01:04]
ricky_clarkson If the constructor plus field declarations is bigger than my head, it's too big. [01:04]
Addax I don't have a number in mind either, I just look at the class. If it's too long, I'll know it. [01:04]
cheeser i find such rules overly ambiguous and so ultimately useless. [01:04]
Addax cheeser ++ [01:05]
Addax cheeser has a karma level of 1,498, Addax [01:05]
cheeser entity classes, e.g., could like have a number of valid parameters. [01:05]
cheeser service classes perhaps not [01:05]
learning [learning!~learningc@] has joined ##java [01:05]
tete_ i also have a constructor with 3 params: - but i guess thats the only one :) [01:05]
tete_ tete_'s title: "src/main/java/matrixregistration/controller/dto/ master Oliver Z. / MatrixRegistration GitLab" [01:05]
Addax and hell, I use data classes in kotlin, some of those have lists of 30+ parameters [01:05]
[rg] phew [01:07]
ravenousmoose [ravenousmoose!] has joined ##java [01:07]
indistylo [indistylo!~aruns_@] has joined ##java [01:09]
[rg] tete_: nice, mostly clean code :) [01:09]
gelignite [gelignite!] has joined ##java [01:10]
tete_ [rg], thanks, except that it does not work and i dont understand why ... :D [01:11]
Buliarous [Buliarous!~gypsydang@unaffiliated/buliarous] has joined ##java [01:11]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [01:12]
ravenousmoose [ravenousmoose!] has joined ##java [01:14]
Gugi [Gugi!] has joined ##java [01:15]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [01:17]
wisey [wisey!] has joined ##java [01:20]
zjett Addax: Kotlin has support for default parameters though. I am still waiting for this in Java (please please please) [01:22]
cheeser probably never going to happen [01:26]
[rg] lol [01:28]
forgottenone [forgottenone!~forgotten@] has joined ##java [01:28]
Addax zjett: oddly enough, IMO kotlin's presence (and support for such features) makes it less likely that java will get them [01:30]
progart [progart!~kamee@] has joined ##java [01:37]
SuperTyp [SuperTyp!] has joined ##java [01:40]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [01:41]
cheeser well, we'll see. java got var in part, i'm guessing, because of pressure from scala/kotlin [01:44]
SuperTyp [SuperTyp!] has joined ##java [01:48]
sbeex [sbeex!~sbeex@] has joined ##java [01:50]
[rg] i tried using it but only for local scope is annoying [01:52]
cheeser the compiler can better reason about the local scope [01:53]
cheeser but yeah [01:53]
ricky_clarkson Named parameters seem much more useful than default ones. [01:53]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [01:53]
sbeex Hi, I try to enforce Request/Response paradigm in one of our API. Assume I have TimeRequestEvent -> it implements Request and I would like it must declare the response in that way: TimeRequestEvent implements Request<TimeRequestResponse> (that way it guarantee that the response class is also implemented. Is there a simple syntaxical way to force this ? (I can't extends it's already used..) (alternative: [01:54]
cheeser for readability for sure. [01:54]
sbeex write reflections tests that will check it) If you have a solution please share it :) thank you [01:54]
ricky_clarkson tete_: You have pointless null checks, none of the fields you're checking are @Nullable. [01:54]
ricky_clarkson tete_: If you're really sure you need those they should be in the constructor instead, but you should not be passing null in if the parameter isn't @Nullable. [01:55]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [01:56]
ricky_clarkson tete_: Doing it via foo != null && bar != null etc., is okay and fairly readable, but makes it more likely you'll write dumb test cases that do things production code should never do. Preconditions.checkNotNull(foo); Preconditions.checkNotNull(bar); is arguably less readable, but doesn't look like branches in a coverage tool, so you don't end up with those dumb tests. [01:57]
tete_ ricky_clarkson, can you tell me which class? [01:57]
ricky_clarkson You only linked to one, right? LoginForm. [01:57]
tete_ ah ok, thanks, i let the IDE create the equals/hashcode [01:57]
tete_ oh you mean the isValid() ? [01:58]
ricky_clarkson Yes. [01:58]
tete_ this is stuff that comes in from outside, i do not know what is inside that field [01:58]
ricky_clarkson I don't use Spring, I see this comes from a Spring @ModelAttribute. [01:59]
tete_ to be honest, i dont know how jackson handles such behaviour, but to be sure if jackson uses null (or whatever library is used for serialization/deserialization) i check that [01:59]
tete_ because loginform does not know anything of it [01:59]
tete_ it is not a valid object if any of those fields is null, so i check it in a separate method. you mean i should somehow do that test when the object is created? [02:00]
ricky_clarkson Well, it's worth knowing if a library would be a source of nulls. [02:00]
cheeser if it's not in the json doc, jackson will use null [02:00]
cheeser you can configure it to shit itself on missing fields, iirc [02:00]
ricky_clarkson And even if it's not, you can check that in the constructor and throw an exception. [02:00]
ricky_clarkson tete_: shit itself = reject [02:01]
baconology [baconology!gb@unaffiliated/baconology] has joined ##java [02:01]
tete_ thanks, would save some code validation in my controller. i will make a TODO because atm i am fighting with some other wierd behaviour where i have no clue why spring does what it does [02:01]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [02:02]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:02]
tete_ hm thats a good point, just wondering why i did not requireNonNull in the constructor [02:03]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [02:05]
tete_ just noticed its the dto - i could imagine that i put it there because if someone tries to register i would like to add the registration attempt. guess i have to read the jackson doc if they provide some kind of interception so i can add my "logging"-logic [02:07]
tete_ if i just throw the exception, i would miss that [02:07]
tete_ s/if i/if jackson [02:08]
[rg] im not too familar with javas functional interface, but I should be able to have a map of <string, lamda> right? [02:10]
cheeser tried [02:10]
cheeser What happened when you tried? [02:10]
EgonX [EgonX!] has joined ##java [02:11]
[rg] i have not, just thinking [02:11]
indistylo [indistylo!~aruns_@] has joined ##java [02:11]
Addax and yes, lambdas are just classes [02:11]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [02:12]
ogradyd [ogradyd!] has joined ##java [02:12]
SuperTyp [SuperTyp!] has joined ##java [02:17]
nfd [nfd!~nfd9001@2601:602:8500:2443:f48e:eae1:b692:7842] has joined ##java [02:18]
acidjnk [acidjnk!] has joined ##java [02:18]
Cyp_ [Cyp_!] has joined ##java [02:21]
ogradyd [ogradyd!] has joined ##java [02:23]
progart [progart!~kamee@] has joined ##java [02:25]
progart [progart!~kamee@] has joined ##java [02:25]
progart [progart!~kamee@] has joined ##java [02:26]
progart [progart!~kamee@] has joined ##java [02:28]
zjett ricky_clarkson: ctors that throw are really really annoying to deal with [02:30]
Aireil [Aireil!551a6de9@gateway/web/freenode/ip.] has joined ##java [02:31]
zjett I'd just use a factory instead so you could recover from it more gracefully [02:31]
Aireil Are you using "this." to access instance variable when it's not necessary? I read it was more about style than anything in most of cases. [02:31]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [02:33]
avalchev [avalchev!~Thunderbi@] has joined ##java [02:33]
Addax Aireil: who are you speaking to? [02:35]
ricky_clarkson zjett: If they throw in ways you need to catch, sure. [02:36]
ricky_clarkson zjett: If they only throw for things that should never happen, I'm ok with that. [02:36]
Aireil Addax: To anybody, just wondering in general ^^ [02:36]
ricky_clarkson but I have the preference of not doing the validation anyway, things that are not marked @Nullable shouldn't be set to null. [02:36]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [02:36]
Addax Aireil: Well, *I* tend to use it when necessary and not otherwise [02:37]
[rg] i only use this when I have parameters with the same name [02:38]
indistylo [indistylo!~aruns_@] has joined ##java [02:39]
Aireil I guess it makes sense to not do something when it's not needed ^^" [02:41]
orbyt_ [orbyt_!~orbyt@] has joined ##java [02:42]
CookieM [CookieM!] has joined ##java [02:43]
[rg] its too bad _ is getting depricated for variable names [02:45]
Addax ... what? [02:45]
cheeser it's going to be a reserved keyword in the nextish version [02:46]
Addax what is? "this"? [02:47]
cheeser but if you actively use _ as a variable name you should never stop punching yourself in the crotch [02:47]
cheeser _ is [02:47]
Addax ahhhh, I see [02:47]
Addax I don't think I've ever used it standalone for a variable name - I use it in Kotlin but that's about it [02:47]
ricky_clarkson Can you remind me the expected use of it as a keyword? [02:48]
Addax in python I'll use ____ and _____ and ______ and _______ though [02:48]
[rg] sometimes you just dont care about variable name :P [02:48]
Addax I mostly try to choose names to actively frustrate my team when they use python [02:49]
cheeser adding insult to injury, eh? [02:49]
ricky_clarkson Some languages use _ to mean no name, e.g., in Scala _ * 2 is the same as Java's x -> x * 2 [02:49]
Addax cheeser: yes [02:49]
ricky_clarkson I guess there'll be some Java people emulating that somewhere. [02:49]
Addax and in scala I mostly commit and push compilation errors, hopefully with extra and subtly wrong implicit conversions [02:50]
Addax I'll have test-only implicits to convert to the right values and types, so the tests pass, because scala [02:50]
[rg] why? [02:50]
Addax Because I love scala so much [02:51]
Addax I try to train people at work to never ask me for help with scala, but they learn slowly [02:51]
Zarthus interesting keyword to reseve... i've used `_` before to indicate a variable that is never going to get used, though `_somevarname` would probably have been better [02:52]
Zarthus that's probably going to break so many codebases [02:53]
Addax Zarthus: well, it'll be like enum but less impactful, really [02:53]
ricky_clarkson Addax's Scala pushes are there as a negative test case for continuous integration services [02:53]
Addax ricky_clarkson: anything to slow scala adoption down, you know [02:54]
ricky_clarkson and to see if performance review processes work - minimising the time from Addax hire to fire is a goal [02:54]
Addax I'm a fan of keeping scala as virginal as it can be, much like its users [02:54]
zjett Banning _ is saving Java devs from themselves [02:56]
zjett I love functional programming but it's generally a horror in pure Java so I avoid it [02:57]
Addax it has its uses, to be sure [02:57]
yawkat it's already reserved since java 9 or something [03:01]
cheeser i was thinking so but I couldn't remember [03:02]
t2mkn [t2mkn!~t2mkn@] has joined ##java [03:05]
Gazooo [Gazooo!~Gazooo@] has joined ##java [03:07]
[rg] yeah fp in java sucks [03:07]
[rg] they abandoned their design goals :/ [03:07]
Addax uhhh [03:08]
Addax until you know java you might want to hold off on the judgement [03:08]
Addax note that FP was a late addition to java [03:08]
Addax so the "design goals" got bolted on, if you like [03:09]
[rg] "It must be "simple, object-oriented, and familiar". [03:09]
zjett Yeah I don't think Java was ever designed for FP [03:09]
Addax sighs [03:10]
Addax It's a testament to java that it can be used for FP in the first place [03:10]
Diablo-D3 hey, at least java was designed [03:10]
Diablo-D3 stares at C++ [03:10]
Addax it's going to have some oddities [03:10]
[rg] lol [03:10]
learning [learning!~learningc@] has joined ##java [03:10]
plitter [plitter!~plitter@] has joined ##java [03:13]
indistylo [indistylo!~aruns_@] has joined ##java [03:13]
keepLearning512 [keepLearning512!~keepLearn@] has joined ##java [03:14]
zjett Diablo-D3: C++ has been trying to implement std::range for like 20 years [03:15]
zjett Java at least has streams and made it work [03:15]
nickel8448 [nickel8448!~rahul@] has joined ##java [03:21]
cet [cet!uid207478@gateway/web/] has joined ##java [03:26]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [03:26]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [03:33]
Aireil I'm trying to clone a class, but I want to keep the same reference for an instance variable (String). So that if I modify the variable (set a new string), the clone "also get modify". The issue is that String is immutable, is there a way around this? [03:47]
cheeser no [03:47]
Aireil Oh... [03:48]
Aireil And if I wrap the string around an object, I could keep the same reference right? [03:50]
Aireil I mean, the string in the wrap object [03:50]
Addax you could have your own indirection, i guess, but ... why are you wanting this? [03:50]
Aireil Addax: I'd like to create a type of copy of the class that just changes some variables and that keeps this instance variable linked to the "original" [03:53]
Addax then do an observable/observer thing.... or a proxy [03:55]
Addax This still sounds somewhat suspect in design though [03:55]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [03:56]
Aireil Good idea, thank you! Yes, it's a bit weird ^^" [03:58]
indistylo [indistylo!~aruns_@] has joined ##java [03:58]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [04:03]
kirua [kirua!~kirua@unaffiliated/kirua] has joined ##java [04:04]
wisey [wisey!] has joined ##java [04:05]
deavmi [deavmi!~deavmi@] has joined ##java [04:24]
AcTiVaTe [AcTiVaTe!] has joined ##java [04:25]
_xor [_xor!] has joined ##java [04:27]
Addax recruiter sends me an email: "senior scala developer - competitive compensation!" and I'm thinking "what, seven figures? eight?" [04:31]
indistylo [indistylo!~aruns_@] has joined ##java [04:31]
Addax hah, and they want relo as well... to SF [04:31]
Addax which pretty much axes their "competitive compensation" [04:32]
Diablo-D3 lol [04:37]
Diablo-D3 "we will pay you in drugs and gay sex" [04:37]
rwheadon [rwheadon!~rwheadon@2600:1700:17a0:58ef:81c6:970:1622:fd20] has joined ##java [04:37]
sbalmos "unlimited supply of reusable needles" [04:38]
Diablo-D3 knows so many bay area devs, _so maaannnyyyyyyy_ [04:38]
Diablo-D3 if I didnt know better, I'd think the only place you could get hired as a dev is somewhere over in that god forsaken state [04:39]
sbalmos you don't know better [04:39]
Diablo-D3 I know devs who arent even in the US [04:40]
sbalmos we all do [04:40]
Diablo-D3 yeah, but they too, "man, I should move to the bay area and get a job" [04:41]
Diablo-D3 its like wtf bro, you already won the lottery, you dont live in the US! [04:41]
Diablo-D3 sf has some serious sort of cult astroturfing going on [04:42]
wisey [wisey!] has joined ##java [04:46]
Addax I like SF, for the most part [04:49]
Addax I just wouldn't want to live there [04:49]
freeone3000 Addax: why would seven figures be incorrect? [04:54]
Addax freeone3000: If they aren't offering seven figures, it ain't happening [04:55]
Addax and instead they were offering roughly ordinary six [04:55]
freeone3000 you can get six east coast. [04:57]
nebulae [nebulae!] has joined ##java [04:58]
Kol [Kol!] has joined ##java [05:00]
Sina [Sina!uid230776@gateway/web/] has joined ##java [05:01]
Nightwing52 [Nightwing52!~Thunderbi@] has joined ##java [05:02]
Revan- [Revan-!] has joined ##java [05:02]
Nightwing53 [Nightwing53!~Thunderbi@2600:100c:b209:cd0c:f8de:d10c:a8c4:1270] has joined ##java [05:05]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [05:10]
Addax freeone3000: indeed [05:17]
Addax and he's all "this is competitive" and ... it's not [05:17]
bn_work [bn_work!uid268505@gateway/web/] has joined ##java [05:17]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [05:17]
Nightwing52 [Nightwing52!~Thunderbi@2600:100c:b209:cd0c:391a:ea76:b81f:6ea7] has joined ##java [05:18]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [05:27]
deavmiLaptop [deavmiLaptop!~deavmi@] has joined ##java [05:31]
Nightwing52 [Nightwing52!~Thunderbi@] has joined ##java [05:37]
indistylo [indistylo!~aruns_@] has joined ##java [05:43]
conan [conan!] has joined ##java [05:46]
orbyt_ [orbyt_!~orbyt@] has joined ##java [05:48]
ogradyd [ogradyd!] has joined ##java [06:01]
nonconvergent [nonconvergent!c72f2503@gateway/web/freenode/ip.] has joined ##java [06:01]
kgrimes2 [kgrimes2!] has joined ##java [06:02]
bluezone [bluezone!uid104970@gateway/web/] has joined ##java [06:03]
computeiro [computeiro!~computeir@] has joined ##java [06:07]
nonconvergent I have two methods of the same name, overloaded. The input parameters of both extend a common superclass, and the return types of both extend a different common superclass. [06:09]
mindCrime_ [mindCrime_!] has joined ##java [06:11]
t2mkn [t2mkn!~t2mkn@] has joined ##java [06:17]
mindCrime [mindCrime!] has joined ##java [06:18]
altious [altious!~altious@] has joined ##java [06:21]
nonconvergent Screwing up my erasure somehow. [06:30]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [07:24]
wisey [wisey!] has joined ##java [07:31]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [07:35]
nokdoot [nokdoot!~nokdoot@] has joined ##java [07:42]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [07:43]
wedr [wedr!484a82af@gateway/web/freenode/ip.] has joined ##java [07:45]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [07:52]
javango [javango!~javango@] has joined ##java [07:54]
mindCrime [mindCrime!] has joined ##java [07:54]
pioto [pioto!~pioto@unaffiliated/pioto] has joined ##java [07:57]
piklu- [piklu-!~piklu@] has joined ##java [08:20]
rruizt [rruizt!] has joined ##java [08:21]
whaley [whaley!~whaley@] has joined ##java [08:26]
yawkat [yawkat!] has joined ##java [08:32]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [08:33]
orbyt_ [orbyt_!~orbyt@] has joined ##java [08:36]
wisey [wisey!] has joined ##java [08:38]
RedSoxFan07 [RedSoxFan07!] has joined ##java [08:39]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [08:43]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [08:55]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [08:58]
wisey [wisey!] has joined ##java [09:06]
maxel [maxel!] has joined ##java [09:06]
fairuz [fairuz!~fairuz@unaffiliated/fairuz] has joined ##java [09:06]
fairuz [fairuz!~fairuz@unaffiliated/fairuz] has joined ##java [09:09]
Kestrel-029 [Kestrel-029!~Nicmavr@unaffiliated/nicmavr] has joined ##java [09:11]
x000 [x000!~x000@unaffiliated/x000] has joined ##java [09:15]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [09:15]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [09:18]
wisey [wisey!] has joined ##java [09:18]
singhyuvraj122 [singhyuvraj122!~singhyuvr@] has joined ##java [09:27]
orbyt_ [orbyt_!~orbyt@] has joined ##java [09:27]
wisey [wisey!] has joined ##java [09:33]
mindCrime [mindCrime!] has joined ##java [09:49]
mindCrime [mindCrime!] has joined ##java [10:01]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [10:11]
Psybur [Psybur!~Psybur@unaffiliated/psybur] has joined ##java [10:11]
wisey [wisey!] has joined ##java [10:23]
tasse [tasse!] has joined ##java [10:34]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [10:34]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [10:44]
wisey [wisey!] has joined ##java [10:47]
wedr Anyone here? [10:56]
wedr Asking if anyone knew how to set up a simple JUnit 5 Java "Hello world" project with tests? [10:56]
Cyp_ [Cyp_!] has joined ##java [10:57]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [11:02]
wisey [wisey!] has joined ##java [11:03]
Addax wedr: junit's website should be able to show you that [11:05]
wedr Addax: Oh I have been there, and not once does it teaches you how to set it up [11:07]
wedr It just links you straight to [11:08]
wedr wedr's title: "junit5-samples/junit5-jupiter-starter-gradle at r5.4.2 junit-team/junit5-samples GitHub" [11:08]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [11:11]
t2mkn [t2mkn!~t2mkn@] has joined ##java [11:15]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [11:21]
acidjnk [acidjnk!] has joined ##java [11:50]
rruizt [rruizt!] has joined ##java [11:51]
RoguePointer [RoguePointer!~jigen@unaffiliated/roguepointer] has joined ##java [11:54]
wisey [wisey!] has joined ##java [11:57]
t2mkn [t2mkn!~t2mkn@] has joined ##java [11:58]