Info

Login

Channels

APIs

Credits

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

« 2020-06-30

2020-07-01

2020-07-02 »

Nick Message Date
Devastator morning [12:01]
iminheaven hai [12:04]
Hanii [Hanii!~Hanii@2a00:23c5:c587:6d00:d19d:6765:9f5a:15ce] has joined ##java [12:24]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [12:27]
tasse [tasse!~tasse@55d41a6e.access.ecotel.net] has joined ##java [12:37]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [01:03]
maryo_t [maryo_t!~Maryo@unaffiliated/maryo] has joined ##java [01:13]
bamdad [bamdad!~bamdad@gateway/tor-sasl/bamdad] has joined ##java [01:19]
nikkal [nikkal!~nikos@46.12.96.39.dsl.dyn.forthnet.gr] has joined ##java [01:27]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [01:27]
pmercado [pmercado!~pmercado@152.172.30.253] has joined ##java [01:40]
bocaneri [bocaneri!sauvin@about/linux/staff/sauvin] has joined ##java [02:06]
Zee- [Zee-!~Zee-@94.189.43.76] has joined ##java [02:08]
dengbojing [dengbojing!~dengbojin@125.80.140.146] has joined ##java [02:10]
bolovanos [bolovanos!~bolovanos@host-213-235-140-105.ip.topnet.cz] has joined ##java [02:20]
RazielXYZ [RazielXYZ!~Raziel@unaffiliated/raziel] has joined ##java [02:27]
deebo generic'ish: we almost never make rest calls with a single param, but on the other hand i'd prefer api's like /resource/{id} due to the simplicity, apart from http/2, is there some sort of batching/multiplexing avaialble for jax-rs? [02:29]
iam730 [iam730!~iam730@104.143.92.254] has joined ##java [02:30]
deebo we will have a central graphql api, but if someone wants 100 resources, it makes no sense to do 100 rest calls do a /{id} api, rather post [id1, id2, id3 ...] [02:30]
yawkat some people make central batching endpoints that accept collections of requests [02:33]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [02:37]
eckman parted the channel: [02:38]
nagoya [nagoya!~lukovszki@77-234-85-146.pool.digikabel.hu] has joined ##java [02:38]
mitch0 [mitch0!~mitch@84-236-29-252.pool.digikabel.hu] has joined ##java [02:49]
wyoung [wyoung!~wyoung@wesleyy.com] has joined ##java [02:49]
RazielZ [RazielZ!~Raziel@unaffiliated/raziel] has joined ##java [03:11]
Me4502 [Me4502!~quassel@unaffiliated/me4502] has joined ##java [03:18]
Maxdamantus [Maxdamantus!~Maxdamant@unaffiliated/maxdamantus] has joined ##java [03:18]
sl33k [sl33k!~sl33k@host86-188-35-14.range86-188.btcentralplus.com] has joined ##java [03:19]
nsaunders [nsaunders!~nicholas@208.110.107.226] has joined ##java [03:23]
dodobrain [dodobrain!~dodobrain@unaffiliated/freakabcd] has joined ##java [03:23]
sl33k [sl33k!~sl33k@host86-188-35-14.range86-188.btcentralplus.com] has joined ##java [03:27]
freebds [freebds!6f7ddd3e@111.125.221.62] has joined ##java [03:32]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [03:39]
exonity01 [exonity01!uid364582@gateway/web/irccloud.com/x-fjoydinjhbbsdleq] has joined ##java [03:48]
sigdk [sigdk!~sigdk@2a02:a210:2300:a180:15fe:ea1b:9ce0:7b8b] has joined ##java [03:52]
devish [devish!345f4b1e@unaffiliated/devish] has joined ##java [03:55]
sigdk Hello. I'm having trouble in authenticating with my Kafka consumer but I don't think the problem is in my code cause it runs ok in other machines. Question: does Java have it's own kerberos implementation or uses something like libkrb5? [04:07]
deavmi [deavmi!~tbk@165.0.49.28] has joined ##java [04:09]
Aquazi [Aquazi!uid312403@gateway/web/irccloud.com/x-aasqqxicyepxhnyw] has joined ##java [04:10]
devish I am having connection not being closed for rest calls . This exception https://stackoverflow.com/questions/40343005/resteasy-client-keeping-connection-allocated-after-a-method-throws-an-exception/45463985#45463985 [04:16]
devish I have a response.close() also I am retrying after 3 seconds of interval, 4 times but none of them seems to work [04:17]
devish any suggestion [04:17]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [04:32]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [04:34]
nfd9001 [nfd9001!~nfd9001@c-67-183-38-33.hsd1.wa.comcast.net] has joined ##java [04:37]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [04:52]
Maldivia devish: well, are you actually getting a response? if not, then your request is just hanging there [05:09]
devish I got the issue, I throw exception before closing connection [05:09]
Maldivia well, that would also do it [05:10]
devish closing connection is in another try..catch ...sigh :( [05:10]
Gazooo [Gazooo!~Gazooo@097-101-147-050.res.spectrum.com] has joined ##java [05:10]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [05:13]
vy [vy!~vy@vpn-019.bol.com] has joined ##java [05:15]
vy Good morning! How does one specify a Maven parameter receiving a path (e.g., `--global-toolchains`) on Windows? Using backslashes? Or regular slashes? [05:16]
sonOfRa iirc both should work [05:18]
mbooth vy: What did you try so far? [05:18]
devish can I initialise javax.ws.rs.core.Response with null ? [05:18]
vy mbooth: Given I don't have access to a Windows environment, none. I was just curious if somebody knows. [05:20]
gelignite [gelignite!~gelignite@55d4b3a9.access.ecotel.net] has joined ##java [05:25]
mbooth vy: Okay, it's just something that can be figured out trivially through experimentation ;-) Pretty sure Java on windows will interpret /forward/slashes and \back\slashes correctly. [05:25]
tortru [tortru!~joecool76@226-132-073-109.ip-addr.inexio.net] has joined ##java [05:36]
darkapex parted the channel: "Leaving" [05:44]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [05:52]
IoannisJVM [IoannisJVM!4fa7db70@ppp079167219112.access.hol.gr] has joined ##java [05:54]
IoannisJVM parted the channel: [05:54]
chris64 [chris64!~chris@unaffiliated/chris64] has joined ##java [05:59]
olle [olle!~olle@p5b3461e6.dip0.t-ipconnect.de] has joined ##java [06:00]
olle Did any ownership types ever make it into Java? [06:00]
mbooth olle: What is an ownership type? [06:00]
Diablo-D3 a type of ownership [06:00]
olle rust and C++ have own/borrow, but for java there's also universe types: https://www.pm.inf.ethz.ch/research/universe-type-system.html [06:01]
mbooth You can't, like, just *own* types, maaan. [06:01]
olle olle's title: "Universe Type System ? Programming Methodology Group | ETH Zurich" [06:01]
Diablo-D3 yeah, java doesnt have that model [06:03]
Diablo-D3 doesnt stop you from doing it [06:03]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined ##java [06:08]
olle depends [06:20]
olle i was hoping for some progress or research in this regard [06:20]
olle or typestate [06:25]
Diablo-D3 the jvm doesnt stop you from building such a model [06:26]
Diablo-D3 but I cant honestly tell you thats the best model to use anyways [06:26]
mbooth olle: If there's no JEP for it, there is certainly no *official* work being done. [06:28]
yawkat well, theres often work done without jeps :) [06:29]
yawkat but not this probably [06:29]
mbooth olle: You probably would be better asking the authors of that paper [06:30]
Nitrousoxide [Nitrousoxide!~quassel@unaffiliated/nitrousoxide] has joined ##java [06:36]
wyoung Is amazon java any good? [06:39]
Maldivia wyoung: if you mean the Corretto distribution -- it's basically the same as all the other OpenJDK distributions [06:40]
Diablo-D3 its just their build of openjdk for their support service [06:42]
Diablo-D3 and sometimes has optimizations just for aws's weirdness [06:42]
olle mbooth: what's a JEP? [06:43]
wyoung Maldivia: ah ok, so non-oracle java support? [06:43]
Maldivia wyoung: if you want to call it that, sure [06:44]
wyoung Yeah AWS is weird but I wouldn't mind trying out Java AWS Lambdas [06:44]
Maldivia olle: Java Enhancement Proposal [06:44]
Maldivia jeps [06:44]
Maldivia Maldivia, what does that even *mean*? [06:44]
Maldivia jep 0 [06:44]
Maldivia Maldivia, what does that even *mean*? [06:44]
Diablo-D3 aws lambdas kind of miss the point [06:44]
Diablo-D3 jep [06:45]
Diablo-D3 The JDK Enhancement Proposal (or JEP) is a process drafted by Oracle Corporation for collecting proposals for enhancements to the Java Development Kit and OpenJDK. [06:45]
Maldivia https://openjdk.java.net/jeps/0 for a list of current JEPs [06:45]
beatbrot [beatbrot!~beatbrot@p54913866.dip0.t-ipconnect.de] has joined ##java [06:46]
olle Maldivia: k, thanks [06:50]
dreamreal morning [06:52]
dreamreal what is a universal type? [06:52]
dreamreal I mean, explain it to me like I'm an idiot [06:52]
cmk_zzz [cmk_zzz!~cmk_zzz@163.47.237.172] has joined ##java [06:57]
bolovanos [bolovanos!~bolovanos@host-213-235-140-105.ip.topnet.cz] has joined ##java [07:01]
Cmaj6 [Cmaj6!~Cmaj6@77-41-20-31.ftth.glasoperator.nl] has joined ##java [07:02]
maryo_s [maryo_s!~Maryo@unaffiliated/maryo] has joined ##java [07:02]
olle dreamreal: you add aspects to type whether they are owned or borrowed and such [07:04]
olle rep, peer [07:04]
dreamreal What does that mean? [07:04]
olle that only the owner of a variable can change it [07:05]
dreamreal so like an extra level of access control? [07:05]
olle yes, exactly [07:05]
olle to avoid leaky abstractions [07:05]
dreamreal What languages suppport that? [07:05]
olle none :) it's academic only [07:05]
dreamreal gah, nice typing this morning, my eyes haven't adjusted [07:05]
dreamreal well, chances are such a feature has a looooong, long, long, long, long road to get into java, then [07:06]
dreamreal if it's not proven even in academic languages, well, java's an industrial language [07:06]
dreamreal "When is cobol going to get universal type ownership? geez, come on, cobol" [07:07]
olle linear types are slowly getting accepted into FP [07:09]
olle OOP need to have something similar [07:09]
olle But yeah, Scala can do it, I guess. :) [07:09]
Maldivia " only the owner of a variable can change it " -- so a private field? [07:10]
dreamreal Scala doesn't really have type ownership like that unless you're describing it poorly [07:10]
olle Maldivia: no, it can be public but read-only for non-owners [07:11]
dreamreal I haven't really looked at Scala in a while - but I've also not heard of it supporting anything like that. What is an "owner"? [07:11]
rasay [rasay!~rasay@p200300f8d3c203008d812b01691e783f.dip0.t-ipconnect.de] has joined ##java [07:15]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [07:15]
irrgit [irrgit!~ch33se@192.241.175.183] has joined ##java [07:22]
banisterfiend [banisterfiend!~textual@ruby/staff/banisterfiend] has joined ##java [07:23]
Jonopoly [Jonopoly!~Jonopoly@unaffiliated/jonopoly] has joined ##java [07:28]
CookieM [CookieM!~tomek@r-45-155-148-237.gpon.bialnet.pl] has joined ##java [07:28]
maryo_t [maryo_t!~Maryo@unaffiliated/maryo] has joined ##java [07:42]
maryo_t [maryo_t!~Maryo@unaffiliated/maryo] has joined ##java [07:43]
maryo_t [maryo_t!~Maryo@unaffiliated/maryo] has joined ##java [07:44]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [07:48]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [07:49]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [07:51]
Swish [Swish!cvakin@pool-71-163-99-97.washdc.fios.verizon.net] has joined ##java [07:53]
shreerama [shreerama!~shreerama@157.33.184.119] has joined ##java [07:56]
shreerama hi guys, i am trying to build a java project with gradle , i have kept a json file under a 'dao' folder like dao/sql/query.json but after building jar file when examined same folder inside jar its not found [07:58]
shreerama please help [07:58]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [07:59]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [07:59]
nagoya [nagoya!~nagoya@77-234-85-146.pool.digikabel.hu] has joined ##java [08:00]
nagoya [nagoya!~nagoya@77-234-85-146.pool.digikabel.hu] has joined ##java [08:01]
dreamreal shreerama: what's the full path to the JSON from the project root? src/main/java/dao/sql/query.json? [08:02]
dreamreal man, people can be so stupid... I'm in a forum where someone is doing the *equivalent* of saying that IDEA's going to fail unless it incorporates some feature from NetBeans :) [08:03]
shreerama @dreamreal yes [08:04]
dreamreal shreerama: well, src/main/java is where *files to be compiled* go. Put it in src/main/resources/dao/sql/query.json instead. [08:04]
nagoya [nagoya!~nagoya@77-234-85-146.pool.digikabel.hu] has joined ##java [08:04]
mbooth dreamreal: What is the netbeans feature that IDEA is missing? [08:05]
shreerama @dreamreal is it possible to include such files [08:05]
mbooth shreerama: dreamreal just told you how to include such files [08:06]
dreamreal mbooth: it's not actually IDEs, it's just funny: "If $SUCCESSFUL_PRODUCT doesn't emulate $DEAD_PROJECT, people are going to use $DEAD_PROJECT instead!" ... then why did it die? [08:08]
shreerama @dreamreal @mbooth i mean is it possible to force the build tool to include such files with classes [08:08]
dreamreal shreerama: yes [08:08]
dreamreal shreerama: don't [08:08]
Maldivia dreamreal: NetBeans isn't dead, it's Apache's flagship Java IDE :D [08:09]
mbooth shreerama: Yes, by putting it in src/main/resources as already suggested. Does this fail for you? [08:09]
dreamreal Maldivia: i.e., it's dead. And it's still an ANALOGY. [08:09]
shreerama @dreamreal @mbooth thanks alot [08:09]
dreamreal shreerama: in your build.gradle you can ALSO do: sourceSets { main { resources { srcDirs "src/main/resources", "src/main/java" } } } # I *think* but DO NOT DO THIS [08:11]
Maldivia yeah, don't do that [08:15]
nagoya [nagoya!~nagoya@77-234-85-146.pool.digikabel.hu] has joined ##java [08:15]
Maxdamantus [Maxdamantus!~Maxdamant@unaffiliated/maxdamantus] has joined ##java [08:16]
wyoung parted the channel: "BBL" [08:24]
nagoya [nagoya!~nagoya@77-234-85-146.pool.digikabel.hu] has joined ##java [08:26]
gabizou [gabizou!~gabizou@69.147.207.130] has joined ##java [08:30]
devish [devish!345f4b0e@unaffiliated/devish] has joined ##java [08:35]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [08:48]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [08:50]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [08:53]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [08:54]
ludocode [ludocode!~quassel@23-233-62-100.cpe.pppoe.ca] has joined ##java [08:58]
banisterfiend [banisterfiend!~textual@ruby/staff/banisterfiend] has joined ##java [09:02]
RazielXYZ [RazielXYZ!~Raziel@unaffiliated/raziel] has joined ##java [09:05]
albethere` [albethere`!~albethere@cpe-74-65-149-93.maine.res.rr.com] has joined ##java [09:08]
wedr [wedr!~tom_mai78@pool-108-20-128-8.bstnma.fios.verizon.net] has joined ##java [09:08]
Jonopoly [Jonopoly!~Jonopoly@unaffiliated/jonopoly] has joined ##java [09:20]
Atlenohen [Atlenohen!~Walter@cpe2-23-244.cable.triera.net] has joined ##java [09:21]
dob1 [dob1!~dob1@unaffiliated/dob1] has joined ##java [09:23]
FNetSec [FNetSec!~FNetSec@unaffiliated/fnetsec] has joined ##java [09:31]
Fleck [Fleck!~fleck@unaffiliated/fleck] has joined ##java [09:37]
gelignite [gelignite!~gelignite@55d4b3a9.access.ecotel.net] has joined ##java [09:38]
V-Vega [V-Vega!~vincent@pool-100-35-222-120.nwrknj.fios.verizon.net] has joined ##java [09:39]
nfd [nfd!~nfd9001@c-67-183-38-33.hsd1.wa.comcast.net] has joined ##java [09:40]
orbyt_ [orbyt_!~orbyt@172.92.4.78] has joined ##java [09:54]
Nitrousoxide [Nitrousoxide!~quassel@unaffiliated/nitrousoxide] has joined ##java [09:58]
algun [algun!~algun@unaffiliated/algun] has joined ##java [10:03]
Feuermagier [Feuermagier!~Feuermagi@154.28.188.178] has joined ##java [10:05]
tortru [tortru!~joecool76@226-132-073-109.ip-addr.inexio.net] has joined ##java [10:07]
tortru_ [tortru_!~joecool76@227-132-073-109.ip-addr.inexio.net] has joined ##java [10:12]
qwedfg [qwedfg!~qwedfg@194.177.28.178] has joined ##java [10:16]
tortru [tortru!~joecool76@226-132-073-109.ip-addr.inexio.net] has joined ##java [10:17]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [10:25]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [10:29]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [10:30]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [10:35]
ludocode [ludocode!~quassel@23-233-62-100.cpe.pppoe.ca] has joined ##java [10:37]
vveer [vveer!~veer@unaffiliated/bhlh] has joined ##java [10:41]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [10:46]
Dev0n [Dev0n!~Dev0n@unaffiliated/dev0n] has joined ##java [10:52]
mniip [mniip!~mniip@freenode/staff/mniip] has joined ##java [11:01]
amicable [amicable!~wfaithful@2a00:23c5:c492:4100:c06f:15b2:597f:dab6] has joined ##java [11:13]
amicable Hi all, does anyone know why a GC log might print out a huge number of nulls (^@^@^@^@^@) on the first line? We've had this recently and it blew up logstash because the JVM printed 97MB of nulls into the first line of the GC log. [11:15]
cheeser nice [11:16]
cheeser no idea. [11:16]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [11:16]
amicable At least, we assumed it's the JVM. Maybe it's logrotate [11:17]
yawkat logrotate can do that [11:18]
Maldivia amicable: it's very common if you have two processes writing to the same file without a lock -- one will open and truncate it, then the other will null everything up to its position [11:19]
amicable Interesting, I've been banging my head against this most of the day, had previously pointed the finger at logrotate but wasn't entirely sure of the mechanism [11:21]
RazielZ [RazielZ!~Raziel@unaffiliated/raziel] has joined ##java [11:30]
amicable Maldivia: I think this explanation makes sense. If the JVM keeps a handle to it's position in the log file, logrotate comes along and truncates the whole file, and the JVM blissfully unaware, just nulls all the way up to it's location and keeps writing [11:32]
amicable Then logstash comes along and tries to fit however many megabytes of \u0000 into it's jackson TextBuffer, goes OOM and crashes [11:33]
shicks_ [shicks_!shicks2525@gateway/vpn/privateinternetaccess/shicks2525] has joined ##java [11:34]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [11:34]
steven__ [steven__!~shicks252@70.241.96.106] has joined ##java [11:34]
eckman [eckman!~eckman@2606-a000-1019-850f-b83c-a0e0-e295-2194.inf6.spectrum.com] has joined ##java [11:36]
knited [knited!~knited@unaffiliated/knited] has joined ##java [11:48]
conan [conan!~conan@85.255.233.136] has joined ##java [11:59]
nfd9001 [nfd9001!~nfd9001@c-67-183-38-33.hsd1.wa.comcast.net] has joined ##java [12:02]
chris64 [chris64!~chris@unaffiliated/chris64] has joined ##java [12:03]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [12:03]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [12:04]
xa0s_ [xa0s_!~xa0s@mab.sdf.org] has joined ##java [12:27]
CodePoint [CodePoint!~CodePoint@99-89-92-208.lightspeed.tukrga.sbcglobal.net] has joined ##java [12:28]
Swish [Swish!cvakin@pool-71-163-99-97.washdc.fios.verizon.net] has joined ##java [12:31]
Nitrousoxide [Nitrousoxide!~quassel@unaffiliated/nitrousoxide] has joined ##java [12:42]
Sheilong [Sheilong!uid293653@gateway/web/irccloud.com/x-hflpgeoclgcjnzid] has joined ##java [12:44]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [12:45]
ricky_clarkson amicable: Seems relevant and has a fix: https://serverfault.com/questions/71341/why-do-jboss-and-logrotate-create-log-files-full-of-nul-characters [12:47]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [12:47]
devish [devish!345f4b0e@unaffiliated/devish] has joined ##java [01:09]
devish Is there a way to test two Responses itself. I used assertEquals for Response.serverError().build() but since both have different object so returned an error [01:10]
level3 [level3!level3@gateway/shell/tilde.team/x-infcwsqqzdheduse] has joined ##java [01:10]
devish I can check status(int) but it would be good to check overall Response [01:11]
dreamreal what does Response.equals() do [01:11]
devish trying unit test Assert.assertEquals [01:11]
dreamreal yes, I guessed, because you said so [01:12]
devish checking [01:12]
devish return this==other; [01:12]
dreamreal well, there you go [01:12]
dreamreal that's a crappy equals() [01:12]
devish So I go back to checking primitives then [01:14]
asymptotically [asymptotically!~asymptoti@gateway/tor-sasl/asymptotically] has joined ##java [01:14]
ricky_clarkson Bah, isn't that what Object's equals does, are you saying the root of all Java classes is crappy? removes tongue from cheek [01:14]
dreamreal or write a responsesEqual(Response, Response) method and use assertTrue [01:14]
devish responseEqual in my test class? [01:15]
devish is it possible [01:15]
dreamreal sure, why not, it's just a class [01:16]
devish ooo... I think it's a good idea [01:16]
devish thanks [01:16]
Disconsented [Disconsented!~quassel@disconsented.com] has joined ##java [01:18]
int32 [int32!~int32@unaffiliated/xero-] has joined ##java [01:18]
troydm [troydm!~troydm@unaffiliated/troydm] has joined ##java [01:18]
wrmsr [wrmsr!~ubuntu@ec2-54-193-61-240.us-west-1.compute.amazonaws.com] has joined ##java [01:18]
pioto [pioto!~pioto@unaffiliated/pioto] has joined ##java [01:18]
Lindrian [Lindrian!~Lindrian@unaffiliated/lindrian] has joined ##java [01:18]
DTZUZU [DTZUZU!~DTZUZU@S0106bcd165662a4d.vs.shawcable.net] has joined ##java [01:18]
shalok [shalok!~shalok@ec2-35-163-73-10.us-west-2.compute.amazonaws.com] has joined ##java [01:18]
devish dreamreal: at the end it would be like, assertTrue(responseEqual(r1, r2)) ? [01:18]
ollien [ollien!~ollien@ollien.com] has joined ##java [01:18]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined ##java [01:19]
dreamreal sure, something like that: the assertion would be to determine if the boolean value was what was expected, and you'd be able to do whatever you wanted to r1 and r2 to examine their results [01:19]
merkazu [merkazu!sid148003@gateway/web/irccloud.com/x-ofhnyvcroaeiqcvu] has joined ##java [01:19]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [01:20]
dreamreal could be as simple as boolean responsesEqual(Response r1, Response r2) { return r1.getStatus()==r2.getStatus(); } but could be whatever you wanted [01:20]
devish yeah... I will add few spices :P [01:21]
ricky_clarkson devish: A common approach is also to override equals in your Response class, and if you do you should override hashCode per the method contracts. [01:21]
ricky_clarkson but responsesEqual is fine [01:22]
dreamreal he may not have control over Response though [01:22]
Frobozz_ [Frobozz_!~Frobozz@unaffiliated/frobozz] has joined ##java [01:22]
devish Yes, no control [01:22]
ricky_clarkson ok [01:23]
michael_mbp [michael_mbp!~michael_m@ec2-52-76-80-88.ap-southeast-1.compute.amazonaws.com] has joined ##java [01:24]
AmVarPG [AmVarPG!~amvarpg@pool-100-36-151-163.washdc.fios.verizon.net] has joined ##java [01:26]
CodePoint [CodePoint!~CodePoint@99-89-92-208.lightspeed.tukrga.sbcglobal.net] has joined ##java [01:29]
CookieM [CookieM!~tomek@r-45-155-148-237.gpon.bialnet.pl] has joined ##java [01:29]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [01:29]
ludocode [ludocode!~quassel@23-233-62-100.cpe.pppoe.ca] has joined ##java [01:29]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [01:29]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [01:29]
bionade24 [bionade24!~oskar@server2.oscloud.info] has joined ##java [01:29]
fstd [fstd!~fstd@unaffiliated/fisted] has joined ##java [01:29]
BitShack [BitShack!~BitShack@unaffiliated/bitshack] has joined ##java [01:29]
Jonas__ [Jonas__!~Jonas__@unaffiliated/jonas/x-7723671] has joined ##java [01:29]
pppingme [pppingme!~pppingme@unaffiliated/pppingme] has joined ##java [01:29]
Jigsy [Jigsy!~Jigsy@unaffiliated/jigsy] has joined ##java [01:29]
_tjr_ [_tjr_!~tjr@unaffiliated/-tjr-/x-7847713] has joined ##java [01:29]
veegee [veegee!~veegee@ipagstaticip-3d3f7614-22f3-5b69-be13-7ab4b2c585d9.sdsl.bell.ca] has joined ##java [01:29]
karstensrage [karstensrage!~karstensr@unaffiliated/karstensrage] has joined ##java [01:29]
sagax [sagax!~sagax_nb@213.138.71.146] has joined ##java [01:29]
Devastator [Devastator!~devas@unaffiliated/devastator] has joined ##java [01:29]
noahmg123 [noahmg123!sid89117@gateway/web/irccloud.com/x-gajpigtglnbkezea] has joined ##java [01:29]
Renari [Renari!~Renari@70.44.83.129.res-cmts.bgr.ptd.net] has joined ##java [01:29]
Viciouss [Viciouss!~viciouss@unaffiliated/viciouss] has joined ##java [01:29]
javango [javango!~javango@188.113.176.117] has joined ##java [01:29]
plitter [plitter!~plitter@78.31.86.243] has joined ##java [01:29]
Squarism [Squarism!~someone@unaffiliated/squarism] has joined ##java [01:29]
coalado1 [coalado1!~Thomas@unaffiliated/coalado] has joined ##java [01:29]
sim590 [sim590!~sim590@modemcable090.207-203-24.mc.videotron.ca] has joined ##java [01:29]
perrier-jouet [perrier-jouet!~perrier-j@modemcable012.251-130-66.mc.videotron.ca] has joined ##java [01:29]
iam730 [iam730!~iam730@104.143.92.65] has joined ##java [01:30]
kspalaiologos [kspalaiologos!~kspalaiol@176.221.122.71] has joined ##java [01:30]
conan [conan!~conan@85.255.233.136] has joined ##java [01:31]
gabizou [gabizou!~gabizou@69.147.207.130] has joined ##java [01:31]
noahmg123 [noahmg123!sid89117@gateway/web/irccloud.com/x-jaowogxxspkbqcha] has joined ##java [01:31]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [01:32]
hussam [hussam!uid193284@gateway/web/irccloud.com/x-pybgpnsgmzbihofo] has joined ##java [01:33]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [01:34]
noahmg123 [noahmg123!sid89117@gateway/web/irccloud.com/x-ancmirannkzxxewq] has joined ##java [01:35]
stryek [stryek!uid332574@gateway/web/irccloud.com/x-ftsqhpoqjnccytww] has joined ##java [01:35]
Enissay [Enissay!~Enissay@unaffiliated/enissay] has joined ##java [01:36]
markmarkmark [markmarkmark!~mark@167.99.235.46] has joined ##java [01:48]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [01:55]
LiftLeft [LiftLeft!~LiftLeft@2001:19f0:5c01:755:5400:2ff:fe62:b1d9] has joined ##java [01:58]
zeeba [zeeba!~zeeba@173.239.197.109] has joined ##java [02:13]
Hanii [Hanii!~Hanii@2a00:23c5:c587:6d00:d19d:6765:9f5a:15ce] has joined ##java [02:18]
paddyez [paddyez!~Patrick-E@wikipedia/paddyez] has joined ##java [02:21]
Devastator I have a domain class Product which have brand, model, serialNumber and propertyTag, the last 2 are optionals, how do you deal with optionals in a class? I'm thinking about having overloaded constructor, like Product(brand, model), Product(brand, model, serialNumber) and Product(brand, model, serialNumber, propertyTag), then verify which attributes are not null and use the most suitable [02:22]
Devastator constructor, makes sense? [02:22]
cheeser sure [02:24]
kspalaiologos [kspalaiologos!~kspalaiol@176.221.122.71] has joined ##java [02:27]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [02:27]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [02:28]
edd_lc [edd_lc!~edd_lc@85-250-101-70.bb.netvision.net.il] has joined ##java [02:29]
Devastator found a problem already.. I've created public Product(Brand brand, String model, String serialNumber) and public Product(Brand brand, String model, String propertyTag), IDE says I already have a constructor Brand, String, String defined, let's see what Google have [02:31]
algun [algun!~algun@unaffiliated/algun] has joined ##java [02:31]
cheeser google? what? [02:32]
cheeser you can't define that constructor twice. [02:32]
cheeser you have Product(Brand, String, String) twice. [02:32]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [02:35]
Devastator cheeser yes, that's the problem, I can have cases where serialNumber is filled but propertyTag is not and vice-versa, what are my options? [02:35]
dreamreal validate in the constructor. [02:36]
dreamreal They have code in them, you can actually do things IN the constructor, you know? [02:36]
cheeser use factory methods. Product.withSerialNumber(Brand, String, String) and Product.withTag(Brand, String, String) [02:36]
cheeser e.g. [02:36]
cheeser dreamreal: he wants optional parameters [02:36]
dreamreal then... yeah [02:37]
Devastator thank you [02:38]
sizeof_void34 [sizeof_void34!~sizeof_vo@ppp91-79-133-235.pppoe.mtu-net.ru] has joined ##java [02:38]
sbalmos what's so evil about setters? [02:40]
dreamreal mutators [02:40]
sbalmos that's going to be a shit ton of factory methods [02:41]
llorllale [llorllale!~llorllale@2607:9880:1078:ce:bc56:5a89:88da:43a4] has joined ##java [02:42]
juuandyy [juuandyy!~juuandyy@90.166.144.29] has joined ##java [02:51]
ricky_clarkson Devastator: https://github.com/google/auto/blob/master/value/userguide/builders.md [02:56]
ricky_clarkson ricky_clarkson's title: "auto/builders.md at master google/auto GitHub" [02:56]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [02:57]
ricky_clarkson You could also just hand-roll your builder, or use setters (there are some negatives to having mutable objects but at the level you're at you probably won't see those) [02:58]
ricky_clarkson more generally, this looks a bit like the parameter object design pattern [02:59]
acidjnk_new [acidjnk_new!~acidjnk@p200300d0c71a4b20b0e19c34bc7ce9e4.dip0.t-ipconnect.de] has joined ##java [03:08]
Devastator I'm studying factory methods here: https://stackify.com/optional-parameters-java/ [03:14]
Devastator Devastator's title: "Optional Parameters in Java: Common Strategies and Approaches" [03:14]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [03:14]
Devastator sorry for not answering earlier, I'm ~tias like hell [03:14]
ricky_clarkson Devastator++ [03:15]
ricky_clarkson devastator has a karma level of 5, ricky_clarkson [03:15]
ricky_clarkson My preference in that article is builders but the other options are valid too. [03:16]
Devastator find an article, reading it, trying is one thing, getting it right is another heheh [03:16]
zalt [zalt!~devp@unaffiliated/lambda443] has joined ##java [03:21]
jeddo- [jeddo-!~jeddo@unaffiliated/jeddo] has joined ##java [03:34]
Devastator builder does seem more flexible, let me try to implement it instead [03:36]
Benett- [Benett-!~Benett@unaffiliated/benett] has joined ##java [03:38]
dreamreal Devastator: the best way is to use jackson for all object construction [03:40]
dreamreal create an object mapper and pass it strings to get objects out [03:40]
g00s_ [g00s_!~g00s@unaffiliated/g00s] has joined ##java [03:41]
dreamreal so class Foo { String baz; } ... Foo foo=new ObjectMapper.readValue("{\"bar\":\"baz\:}", Foo.class); [03:42]
dreamreal except with valid JSON obviously *shrug* [03:43]
Devastator dreamreal I'm using it like this: a class ProductForm with primitives, which is actually a DTO but for data ARRIVING the api, the controller PostMapping calls a convert() method from ProductForm to convert a ProductForm into a Product, I'm not using ObjectMapper directly [03:49]
Dev0n [Dev0n!~Dev0n@unaffiliated/dev0n] has joined ##java [03:50]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [03:50]
Cyp_ [Cyp_!~Cyp_@192038140180.mbb.telenor.dk] has joined ##java [03:51]
dreamreal shrugs. What is convert() using? [03:52]
mikey3 [mikey3!~mikey@64.227.23.214] has joined ##java [03:52]
mikey3 Hello, I am familiar with class syntax and packages in other languages [03:53]
mikey3 I am pivoting to java, and trying to import a package ino another file [03:53]
mikey3 I have Pet.java, and test.java in the same directory [03:53]
mikey3 in Pet.java I have package PetLib; class Pet { ... } [03:53]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [03:53]
mikey3 in text.java I have import PetLib.*; [03:54]
mikey3 then my mainclass and main method [03:54]
mikey3 then Pet pet = new Pet(): [03:54]
mikey3 when I compile I get bad class file: ./Pet.class [03:54]
mikey3 'class file contains wrong class: PetLib.Pet [03:54]
mikey3 when I import, is it grabbing the file name, or the exported value from the class I am trying to import? [03:55]
dreamreal classpath [03:55]
dreamreal The classpath tells Java or the compiler which jar files and folders to search for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see http://bit.ly/15InVZQ [cheeser's blog], http://bit.ly/19MnH5C [oracle.com], or http://bit.ly/2aJ5MoG for more information. [03:55]
dreamreal mikey3: ^^^^ [03:55]
dreamreal explains all of that [03:56]
wedr mikey3, When importing, you're grabbing the directory folder into your Java file. the "package" refers to the directory you're importing. [03:56]
dreamreal wedr: it does not [03:56]
wedr ( oh [03:56]
dreamreal packages are namespaces. They often map to directories, but they're NOT directories. [03:56]
mikey3 ok so I cannot have the packaage i want in the same dir as my main class [03:56]
dreamreal sure you can [03:56]
wedr You can [03:56]
mikey3 if I do that, is the package statement not required? [03:57]
dreamreal it's just... if they're not in the same namespace, you're going to have to do some stupid compiler tricks. Don't do stupid compiler tricks. [03:57]
dreamreal There's a default (unnamed) namespace as well. [03:57]
mikey3 I basically want to write my class, and have a separate test.java where I can init the class constructor and test the different methods [03:57]
dreamreal mikey3: you don't NEED a package statement: in that case, they're all in the same unnamed package [03:58]
dreamreal but you really should check out the classpath factoid, it explains much you will need [03:58]
mikey3 in that case, would the import statement just look in my current working dir? [03:58]
dreamreal if they're in the same namespace you don't need to import at all [03:58]
dreamreal after all, they're in the same namespace! [03:59]
mikey3 understood thanks! [03:59]
dreamreal which language(s) are you coming from? [03:59]
mikey3 javascript es6, and vala [03:59]
mikey3 written come ansi c too, but .h's seem different [04:00]
dreamreal I'm not familiar with vala at all, but boy are you in for a ride compared to es6 [04:00]
dreamreal they are, yes [04:00]
mikey3 vala is a superset of c++ [04:00]
mikey3 the gtk guys use it [04:00]
dreamreal well, java namespaces and C++ namespaces aren't too far removed, although the resolution mechanism is VERY different (see the ~classpath factoid) [04:00]
xiculan [xiculan!95220b11@149.34.11.17] has joined ##java [04:12]
xiculan hello [04:12]
dreamreal hi [04:12]
deltreey [deltreey!~deltreey@68-68-213-182-static.t3com.net] has joined ##java [04:13]
donalsd [donalsd!9d282bd3@157.40.43.211] has joined ##java [04:15]
xiculan I have a trouble, i'm in debian 10 with eclipse and openjdk, I'm doing a little project, with "file.exists()==true", i export to .jar, and when i execute from console, all works, but when I execute from graphic system, It doesnt recognize the file, like it doesnt recognize his path. Can u help me? [04:18]
cheeser aolbonics [04:18]
cheeser cheeser, aolbonics is using unnecessary abbreviations such as 'u', 'r', 'ur', 'thx', etc. Using this kind of abbreviation is annoying and pointless. You have a full keyboard. Please use it. If you want intelligent answers, the least you can do is speak intelligently. [04:18]
cheeser show us [04:18]
cheeser 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. [04:18]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [04:19]
Devastator this code makes me throw up, but seems to be working: https://dpaste.org/P2XH [04:27]
Devastator dreamreal sorry for the delay, you asked about what convert() is using, I've pasted the whole code/logic above [04:28]
dreamreal pretty standard builder -- does the productbuilder require that either a property tag or a serial number be set? [04:29]
Devastator no [04:29]
dreamreal *nod* [04:29]
somazero [somazero!~somazero@2600:8805:b00:307b::1af3] has joined ##java [04:29]
Devastator I'm using brand and model as mandatory [04:29]
dreamreal sure [04:29]
Devastator I mean the checks, I don't know if I'm checking null properly, it is ugly [04:30]
dreamreal I mean, I'd probably have "with" for brand and model and throw exceptions if they weren't set, as part of a validation cycle [04:30]
Devastator I didn't start bean validation yet [04:30]
dreamreal not relevant [04:30]
Devastator can I validate that with bean validation? [04:31]
dreamreal sure [04:31]
Devastator or is it some other kind of validation? [04:31]
somazero [somazero!~somazero@2600:8805:b00:307b:800b:75af:3627:a54f] has joined ##java [04:31]
dreamreal in ProductBuilder.build(): if(brand==null) { throw new RuntimeException("WHERE'S THE BRAND YOU MORAN"); } [04:31]
Devastator hahaha! [04:33]
dreamreal the validator API actually has a list of failures, the model's pretty strong but you don't have to go that route [04:33]
dreamreal get it done, getting it done is a lot better than not getting it done [04:33]
dreamreal leave the "this code makes me vomit" crap to the scala/haskell people [04:34]
Devastator I'm pretty happy with how much I've done so far, as I said, the code looks meh, but.. [04:34]
dreamreal how does it look "meh"? It's verbose. So what? You're using Java. Java is by its nature rather explicit. This is a GOOD THING in most cases. [04:34]
dreamreal I don't like ProductBuilder being a static class in Product, but *shrug* [04:34]
Devastator I basically copied the example here: https://www.baeldung.com/creational-design-patterns#builder [04:35]
cheeser that convert is ... creative [04:35]
cheeser are tag and serialNumber exclusive? [04:35]
dreamreal yeah, gross :) [04:35]
dreamreal but if it works... [04:35]
cheeser it would still merit derision [04:36]
somazero [somazero!~somazero@2600:8805:b00:307b:800b:75af:3627:a54f] has joined ##java [04:36]
Devastator cheeser not really, I forgot a case where both can be null [04:36]
cheeser can they both be set? [04:36]
dreamreal Devastator: personally, I'd do something like ProductBuilder builder=new ProductBuilder(brand, model); if(serialNumber!=null) { builder.setSerial(serialNumber); } if(propertyTag!=null) { builder.setPropertyTage(propertyTag); } return builder.build(); } [04:37]
Devastator yes, let me update the paste [04:37]
cheeser then just create a Builder. set the tag. set the serialNumber. build() [04:37]
dreamreal Devastator: ^^^ [04:37]
cheeser your if check is unnecessary [04:37]
cheeser if they're mutually exclusive, check that the other is null in each setter on the Builder [04:38]
dreamreal cheeser: he said they weren't though [04:38]
Devastator here is the updated snippet: https://dpaste.org/HWqZ [04:38]
cheeser he's said and written a lot of things. [04:38]
dreamreal true :) [04:39]
cheeser Devastator: this isn't really how the builder pattern is supposed to work [04:39]
Devastator hum, I guess I understand it wrong from the guide I followed [04:40]
dreamreal Devastator: also see lombok [04:40]
Devastator dreamreal you mean lombok for checking nulls? [04:42]
dreamreal Devastator: one other thing to watch out for, because it's not you don't have enough of those already: DO NOT GET DISTRACTED by some platonic ideal. Get what you're trying to do done. [04:42]
dreamreal Lombok has a builder annotation - you can have it to generate the whole builder for you [04:43]
Devastator ah! [04:43]
Devastator it must be funny to see a project like mine which have lombok, but I'm currently only using @EqualsAndHashCode [04:43]
junktext [junktext!junktext@fsf/member/junktext] has joined ##java [04:44]
dreamreal why? [04:44]
dreamreal Dude, people who behind others' code and white-glove everything... there's a term for them [04:44]
dreamreal wanna know what it is? [04:44]
Devastator morons? [04:44]
dreamreal "assholes." [04:45]
Devastator close.. [04:45]
dreamreal Every question you have, MY first thought is "does it work?" [04:46]
dreamreal if the answer is "yes" everything else pales [04:46]
Devastator cheeser out of curiosity, how the builder pattern is supposed to work? I'm curious if you mean my implementation or the guide I've followed: https://www.baeldung.com/creational-design-patterns#builder [04:47]
cheeser in each of your ifs you create a new one. create *one*. then just set, set, set, build() [04:48]
Devastator ok! [04:48]
dreamreal although since they're very short-lived, the *real* impact of that is gonna be pretty minor [04:48]
dreamreal but he ain't wrong... and consider using a different mode of builder anyway [04:48]
cheeser with those if checks you might was not use a builder at all really. [04:48]
cheeser dreamreal: "if it works..." :) [04:48]
Devastator I like concepts, if I'm using a concept wrong, it might bite me in the ass sometime.. [04:49]
dreamreal cheeser: yeah [04:50]
Devastator "I did this before and it worked, why it is not working now?" because you were using it wrong, dumbass :D [04:50]
dreamreal Devastator: well, that's basic philosophy for you: if you don't understand scope and basic metaphysics it's easy to get confused [04:50]
dreamreal "I'm a democrat so all conservative concepts are wrong because republicans are conservative and they're the enemy" --- whoops [04:51]
dreamreal anyone who uses that logic is failing, drastically. Programming's the same way. [04:51]
cheeser politics [04:52]
cheeser Take it elsewhere, like ##politics , or if it's really heavy, ###politics [04:52]
dreamreal it's an illustration, not politics [04:52]
cheeser it was both and you know it. :) [04:52]
dreamreal so screw you, commie! [04:52]
ricky_clarkson Is there anything like Math.addExact for shift-left? I've not found anything so far.. someone had a 1 << 62 vs 1L << 62 bug.. [04:53]
ricky_clarkson to throw an exception for a nonsensical shift left (they didn't intend to lose bits) [04:54]
ernimril ricky_clarkson, not that I know of, would probably be a setting in some lint tool. I also think that shifting to drop digits is not that rare that such a setting would have to be tuned for your project [04:56]
albethere` [albethere`!~albethere@cpe-74-65-149-93.maine.res.rr.com] has joined ##java [04:57]
ricky_clarkson Yeah, I see findbugs (which we don't use) has it. [04:59]
svm_invictvs Does a data structure (list or set) that lets me put the value X in the set, and know X's position in the list? [04:59]
svm_invictvs I guess an ARrayList lets you do that, but you have to scan the whole list to find its position [05:00]
mikey3 dreamreal: Thanks for the help and the links, I feel I understand it quite well now and can just pump out code :) [05:00]
dreamreal svm_invictvs: so a priorityqueue type thing? [05:00]
dreamreal mikey3: no worries [05:00]
ricky_clarkson ernimril: I don't think a linter would have caught this one, as the right hand side was an int [05:01]
Devastator much better huh? https://dpaste.org/Bxf2 [05:01]
ricky_clarkson 1L << someRank [05:01]
cheeser Devastator: "better" [05:01]
cheeser actually no. [05:01]
ernimril ricky_clarkson, int with shift > 32 ought to be a lint warning [05:01]
cheeser just a different kind of bad [05:01]
Devastator ( [05:01]
svm_invictvs dreamreal, Yeah that may work. [05:02]
ricky_clarkson ernimril: It's not statically clear that it could be >32. [05:02]
Devastator I thought I nailed this time.. [05:02]
cheeser get rid of all the ifs [05:02]
ernimril ricky_clarkson, yeah, it can obviously only work with constants [05:02]
ricky_clarkson I imagine the linters want to avoid too many false positives. [05:02]
ricky_clarkson ernimril: That's why I looked for a runtime check like multiplyExact [05:02]
ernimril nah, they want to provide lots of options and then tell you to trim it down. Sadly this makes a lot of them useless [05:03]
ricky_clarkson anyway, it's highly unlikely to happen again and I caught it in code review [05:03]
ricky_clarkson I found the interaction amusing. Why does your test assert equality to 1073741824? Well, that's 2^62. No, no it isn't. [05:04]
ernimril hmm, looks like a few digits too little [05:05]
ernimril it is a bit sad how many programmers have no idea of number ranges [05:05]
ricky_clarkson it's 2^30 [05:06]
dreamreal numbers don't have ranges, what's wrong with you [05:06]
ricky_clarkson because 1 << x == 1 << (x % 32) [05:06]
LiftLeft2 [LiftLeft2!~LiftLeft@2001:19f0:5c01:755:5400:2ff:fe62:b1d9] has joined ##java [05:11]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [05:15]
tete_ [tete_!~John@2a02:168:859e::ff9] has joined ##java [05:20]
tete_ hi, i would like to create a small client for a chat system. the chat system has a user/pass field and a login button. i use htmlunit to fill in these fields and to press the login button. unfortunately, then it hangs because the frame is loading all the time. someone familiar with that? can i somehow register an eventHandler that executes when the DOM is manipulated? anyone familiar with that? [05:21]
runlevel7 [runlevel7!~runlevel7@unaffiliated/runlevel7] has joined ##java [05:26]
dodobrain [dodobrain!~dodobrain@unaffiliated/freakabcd] has joined ##java [05:30]
zeeba [zeeba!~zeeba@173.239.197.109] has joined ##java [05:33]
maxxe http://nifty-networks.net:6969/playQuiz?id=6dd851a7-d0c0-4c2b-8166-49d7260f24f4 [05:39]
wad [wad!~wad@c-76-27-7-52.hsd1.ut.comcast.net] has joined ##java [05:53]
wad I'm confused.... I opened up the .war, and inside I find this file: [05:53]
wad ./WEB-INF/classes/inventory-order-email-template.html [05:53]
wad In my code, I call this: [05:54]
wad InputStream inputStream = ClassLoader.getSystemResourceAsStream("inventory-order-email-template.html"); [05:54]
wad Aaaaaaand it's null. >_< [05:54]
wad Shouldn't it be finding the file in there?? [05:54]
llorllale [llorllale!~llorllale@CPEac202e24ff83-CMac202e24ff80.cpe.net.fido.ca] has joined ##java [05:55]
ernimril wad, /inventory... [05:59]
wad Oh, does it need a `/` prefix?? [05:59]
wad tries it. [05:59]
ernimril wad, it depends on what you want to do.... [05:59]
ernimril wad, do you want to put that file in the top of the classpath or do you want to put it next to your class? [06:00]
wad I don't even care where the damn thing is, I just want to be able to read it into a String! :) [06:00]
wad Also, the amount of code needed to read it into a string is pretty crazy. :( [06:02]
galex-713 [galex-713!~quassel@portable.galex-713.eu] has joined ##java [06:03]
wad Hmm, when I put the leading / on it, the unit test fails. If I deploy this, it might work, but I don't want to have to specify it differently in the test config vs the prod config. [06:04]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [06:06]
wad I think the unit test is looking in the file system for the file, maybe? Instead of in the .war file. [06:07]
ernimril resources [06:07]
ernimril getResourceAsStream is a mechanism to read files from the same place your class files are stored - even from jars. Use it for data files that go with your app, like icon png files or a list of states in the US. For sample code and a tutorial, along with more explanation: http://javachannel.org/posts/how-to-access-static-resources/ [06:07]
ernimril wad, ^^^ go read that to figure out how to deal with it [06:07]
wad thanks [06:08]
Devastator how can I get rid of all these ifs? check for them in builder? use Optional somewhere? https://dpaste.org/Bxf2 [06:10]
Devastator I don't think I can just.. remove them without checking [06:11]
vveer [vveer!~veer@unaffiliated/bhlh] has joined ##java [06:11]
wymillerlinux [wymillerlinux!~wymillerl@097-084-004-094.res.spectrum.com] has joined ##java [06:13]
tomboy65 [tomboy65!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [06:17]
dmiles [dmiles!dmiles@c-73-67-179-188.hsd1.wa.comcast.net] has joined ##java [06:17]
fizzie Devastator: You don't *have* to chain builder method calls, so you can certainly reduce them by a lot by just doing https://dpaste.org/essh [06:20]
fizzie (Potentially without the `product =` parts, assuming it's the normal sort of builder that just returns `this` from its setters. I'm just hardwired to assume any method that has a name like `.withFoo(x)` will return a new immutable object.) [06:21]
Devastator fizzie I can paste the builder for you to take a look as well, one second [06:25]
EgonX [EgonX!~Egon@2601:2c6:47f:98f4:d08:a992:2160:bbbb] has joined ##java [06:27]
Devastator fizzie you can see the builder here: https://dpaste.org/HWqZ line 35, latest version of convert() method is on the paste above [06:33]
fizzie Right, in that case you could also make it simply https://dpaste.org/9xUd -- I'd call those methods .setFoo(x) instead of .withFoo(x), but I'm sure both conventions exist. [06:34]
Devastator I see, I don't have to check if they are null, I should only return it if they aren't [06:35]
Devastator makes sense [06:35]
bn_work [bn_work!uid268505@gateway/web/irccloud.com/x-qfuyzdpjpgcueshf] has joined ##java [06:35]
fizzie IOW, you'd be returning `product.build()` always, and the differences are whether you called any methods on the builder before that. This avoids the combinatorial explosion of trying to handle each case ("A and B", "A and !B", "!A and B", "!A and !B") separately. [06:38]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [06:40]
Devastator exactly [06:42]
Devastator "get rid of all the ifs" made me think I had to literally remove ALL the ifs [06:44]
zulutango [zulutango!~zulutango@d58-105-160-58.dsl.vic.optusnet.com.au] has joined ##java [06:45]
Devastator great! I can't believe I've learned how to build a class with optional attributes :D [06:49]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [06:53]
tassee [tassee!~tasse@55d41a6e.access.ecotel.net] has joined ##java [06:53]
beatbrot3 [beatbrot3!~beatbrot@p54913407.dip0.t-ipconnect.de] has joined ##java [07:10]
LiftLeft2 [LiftLeft2!~LiftLeft@2001:19f0:5c01:755:5400:2ff:fe62:b1d9] has joined ##java [07:14]
Cmaj6 [Cmaj6!~Cmaj6@77-41-20-31.ftth.glasoperator.nl] has joined ##java [07:15]
junktext [junktext!junktext@fsf/member/junktext] has joined ##java [07:33]
svm_invictvs Is there a library that makes working with Unsafe easier if you're like me and stuck on Java 8 [07:35]
svm_invictvs (Yes yes, I know) [07:35]
Cmaj66 [Cmaj66!~Cmaj6@77-41-20-31.ftth.glasoperator.nl] has joined ##java [07:35]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [07:49]
matsurago [matsurago!~matsurago@240b:10:b3a1:1700:b208:b72c:53fc:819f] has joined ##java [08:07]
Hanii [Hanii!~Hanii@2a00:23c5:c587:6d00:dd2c:d01b:77be:f9c1] has joined ##java [08:15]
black_ant [black_ant!~antilope@unaffiliated/black-ant/x-1505394] has joined ##java [08:28]
galex-713 [galex-713!~quassel@portable.galex-713.eu] has joined ##java [08:35]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [08:39]
Nightwing52 [Nightwing52!~Thunderbi@71-221-241-10.cdrr.qwest.net] has joined ##java [08:51]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [08:55]
yuljk [yuljk!~yuljk@unaffiliated/yuljk] has joined ##java [09:00]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [09:06]
KidBeta [KidBeta!~Kidbeta@hpavc/kidbeta] has joined ##java [09:21]
nfd9001 [nfd9001!~nfd9001@c-67-183-38-33.hsd1.wa.comcast.net] has joined ##java [09:42]
db [db!uid18678@gateway/web/irccloud.com/x-fpvufdpnesgtbljr] has joined ##java [09:42]
murd0c [murd0c!~murd0c@2800:810:492:ee:c5d0:4eac:e41d:b88b] has joined ##java [10:04]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [10:06]
Hanii [Hanii!~Hanii@2a00:23c5:c587:6d00:a595:ecd8:e2b4:9a15] has joined ##java [10:15]
dfee [dfee!~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net] has joined ##java [10:22]
ZoKs [ZoKs!~z@gateway/tor-sasl/zoks] has joined ##java [10:39]
dmlloyd I was going to write one called "Safe" which was a nice frontend to a bytecode transform that would convert things neatly for you [11:05]
dmlloyd e.g. you'd do `if (Safe.compareAndSwap(this.fieldName, expected, update)) { ...` and so forth, and the Unsafe bits would be wired in automatically for you [11:05]
dmlloyd but... no time [11:06]
Candle [Candle!~candle@25.254.187.81.in-addr.arpa] has joined ##java [11:08]
Nightwing53 [Nightwing53!~Thunderbi@71-221-241-10.cdrr.qwest.net] has joined ##java [11:12]
immibis_ [immibis_!~immibis@x4e3639ac.dyn.telefonica.de] has joined ##java [11:31]
WBILL [WBILL!~WBILL@unaffiliated/wbill] has joined ##java [11:33]
Nightwing52 [Nightwing52!~Thunderbi@71-221-241-10.cdrr.qwest.net] has joined ##java [11:39]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [11:55]