Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created April 7, 2022 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/304cc9e4234ca46d463e505690e93e42 to your computer and use it in GitHub Desktop.
Save AdamBien/304cc9e4234ca46d463e505690e93e42 to your computer and use it in GitHub Desktop.
98thAirhacksQ&A.md

Ask questions and see you at May, 2nd, 8.PM. CET: youtube.com/c/bienadam

Also checkout recent episode:

97 airhacks.tv

Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions. Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks

@haglo
Copy link

haglo commented May 2, 2022

Hi Adam, how can i optimize nested ArrayList of Objects?
I have 3 Classes

  • Class: People
  • Class: Drug
  • Class: Substance

From every Class i create an ArrayList

  • PeopleList
  • DrugList
  • SubstanveList

Every ArrayList has 200.000 Elements

I want know which Substances takes a people?
therefore i need iterate over all 3 ArrayLists

Code-Example:
Substance detectSubstance(People people) {
// Must iterate over 200.000
for (Drug drug : drugList){
if (people.getDrugID == drug.getDrugId) {
// Must again iterate over 200.000
for (Substance substance : substanceList){
if (drug.getSubstanceID = substance.getSubstanceId) {
....

How can i optimize it?

@arjantijms
Copy link

@jefrog1844

Does Jakarta EE have any place in securing JAX-RS end points. (See link below for reference).

Yes, absolutely. See this for a test which you can use as an example as well:

https://github.com/jakartaee/security/tree/master/tck/app-jaxrs

Quite a number of MP JWT implementations are based on Jakarta Security, for instance:

https://github.com/omnifaces/jwt

@mkwapisz
Copy link

mkwapisz commented Jul 6, 2022

Hi Adam,
can you explain/comment lack of consistent API/tools for testing Jakarta EE based applications? I do not know why specifications are prepared without testing in mind. You have to prepare your own project configurations (maven) like for example for rest endpoints: jetty+jersey+mockito. Or you have to use proprietary maven plugins for application servers to control their lifecycle during maven build. The only good solution I know is Weld Junit which nicely allows you to test cdi components. But this is not a standard and covers only one technology and implementation out of hundred. I hate arquillian which always generates many problems for me and I have to fight with project configurtation instead of a project itself.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment