Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hooah
Feb 6, 2006
WTF?

fletcher posted:

What's a good way of identifying 3rd party Java dependencies that are no longer actively maintained?

It's pretty straightforward with maven to find out which dependencies are out of date, meaning there is a newer version available.

What about for the case when you are on the latest version of a dependency, but there hasn't been a new version in a while and the project is no longer maintained?

I go to the source (e.g. GitHub or GitLab) if it's a public project. It'd be nice to know if there's a better way, though!

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

hooah posted:

I go to the source (e.g. GitHub or GitLab) if it's a public project. It'd be nice to know if there's a better way, though!

Yup, same here. The release dates are on maven central as well (if the dependency is there, of course). But with dozens of projects and hundreds of dependencies, a big manual tedious recurring effort is tough to deal with.

It would come up in a security scan if there's a CVE, but of course at that point you are scrambling to rip out a library in a very short amount of time...

Ocean of Milk
Jun 25, 2018

oh yeah
Do you have dozens of projects that each have different versions of the same dozen dependencies, or do you actually have hundreds of differents deps, i.e. each of the dozen projects does a wildly different thing from the other and therefore doesn't need the same deps? Or are you talking about transitive deps, i.e. the dependencies of your dependencies?
I think that if you want it automated (which you should because you should be able to do this check in regular interval), you want to measure some kind of proxy related to activity and try to reason about frequency and recency. How many commits, how many released versions how many responses to github issues, how many mailing list posts by the maintainer... have been made in the last year relative to last year. Ofc some of these are gonna be easier to measure than others.
Though I think that there's a few catches. Generally one would expect better and more mature libs to require less maintenance work. Though perhaps there's maintenance work that has to happen regardless, like making use of new language features and whatnot.

imnotinsane
Jul 19, 2006
I can't seem to wrap my head around how I am meant to solve this issue, I think I am coming from the wrong angle.

If I have an class object that contains 3 values, for example Student() and it holds firstName, lastName, studentId.

I have then created an array of Student[] objects, so now i am holding something like
code:
Student[] list = new Student("John", "Smith", 123), new Student("George", "Citizen", 567), new Student("Alan", "Bates", 789);
Now if i wanted to sort them by say student id i can't really loop through the array list because all three values are held in the same object. I was thinking maybe I am meant to use a 2d array of objects, so that i have list[0][1-3] but then that would still leave me with the same problem as I am not really storing the actual value just the object it self that contains those three associated variables.

The other way I was thinking was to make a method that returned the values explicitly as array, for example, Student.getArrayValues() and I guess create a new 2d array list on the fly and then manually sort that through a loop and print the results but it feels like I'm doubling up my work for nothing and there should be a simpler method.

Any help would be appreciated

ivantod
Mar 27, 2010

Mahalo, fuckers.

imnotinsane posted:

I can't seem to wrap my head around how I am meant to solve this issue, I think I am coming from the wrong angle.

If I have an class object that contains 3 values, for example Student() and it holds firstName, lastName, studentId.

I have then created an array of Student[] objects, so now i am holding something like
code:
Student[] list = new Student("John", "Smith", 123), new Student("George", "Citizen", 567), new Student("Alan", "Bates", 789);
Now if i wanted to sort them by say student id i can't really loop through the array list because all three values are held in the same object. I was thinking maybe I am meant to use a 2d array of objects, so that i have list[0][1-3] but then that would still leave me with the same problem as I am not really storing the actual value just the object it self that contains those three associated variables.

The other way I was thinking was to make a method that returned the values explicitly as array, for example, Student.getArrayValues() and I guess create a new 2d array list on the fly and then manually sort that through a loop and print the results but it feels like I'm doubling up my work for nothing and there should be a simpler method.

Any help would be appreciated

Maybe this will help you: https://www.baeldung.com/java-8-comparator-comparing.

By using the Arrays.sort(...) method you can give it a lambda function telling it how to compare the objects. This allows you to compare by one (or more) chosen fields (e.g. in your case student id).

imnotinsane
Jul 19, 2006

ivantod posted:

Maybe this will help you: https://www.baeldung.com/java-8-comparator-comparing.

By using the Arrays.sort(...) method you can give it a lambda function telling it how to compare the objects. This allows you to compare by one (or more) chosen fields (e.g. in your case student id).

Ahh that is exactly what I was looking for, thanks

Submarine Sandpaper
May 27, 2007


CmdrRiker posted:

I am very sorry, but what you are describing is a horrible nightmare of programming that I would never wish on another developer.

At that point I wouldn't even try to salvage it into "working". I would try to refactor it into a couple of objectives mapped into classes and several runtimes into routines to accomplish a certain thing?

Eclipse is just a thing to vomit boilerplate code into your project. It isn't necessary to do what you want. Please just break it apart into more pieces with more concrete objectives.

I told my boss that a mid level engineer cannot be expected to fix this, so they promoted me :toot:

So now I'll be taking your approach, I think I can leave the current integration in place and build net new.

abraham linksys
Sep 6, 2010

:darksouls:

Submarine Sandpaper posted:

I told my boss that a mid level engineer cannot be expected to fix this, so they promoted me :toot:

truly the most good news/bad news thing ive ever read in this thread

MrQueasy
Nov 15, 2005

Probiot-ICK
As always I must caution that rewriting isn’t necessarily fixing old bugs so much as it is trading them for new ones.

Submarine Sandpaper
May 27, 2007


I hope those bugs will at least be my friend vs guessing which near identical method is actually used vs copypasta from documentation or a different client.

Adbot
ADBOT LOVES YOU

mortarr
Apr 28, 2005

frozen meat at high speed
I don't know if this is a good thread to post in with my question or not -

Here's the background:
I'm using a product called OpenText appplication gateway, which is built on top of Tomcat (on windows), and I think there's a bug but trying to trace it is a bit tricky as I'm very much from a c#/IIS background.

The fault I'm seeing is an incoming HTTP DELETE that I expect to be forwarded to another system on another server (hosted in IIS) seems to be being sunk inside of tomcat, but other verbs are making it through.

I can see in the downstream server the other HTTP verbs appearing, eg. GET/POST/PUT but no DELETE.

There's no firewall/network dealio blocking (I think) because I can use powershell to make an HTTP DELETE from the tomcat server to the other server, and the DELETE shows up in the IIS logs.


What I'm trying to do now is enable more detailed logging in tomcat than normal. I've set logging to FINEST in logging.properties, and this causes the following in tomcat9-stdout.[date].log

code:
2024-05-15 13:23:53:675 +1200 [https-jsse-nio-443-exec-8] ERROR org.apache.camel.processor.errorhandler.DefaultErrorHandler - Failed delivery for (MessageId: ID-CS16TestAppworks-1715736181661-0-26 on ExchangeId: ID-CS16TestAppworks-1715736181661-0-26). Exhausted after delivery attempt: 1 caught: java.lang.ArrayIndexOutOfBoundsException: 8. Processed by failure processor: FatalFallbackErrorHandler[null]

  Message History (complete message history is disabled)
  ---------------------------------------------------------------------------------------------------------------------------------------
  RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
  [route1            ] [route1            ] [from[servlet:/?httpBinding=awgCamelHttpBinding&matchOnUriPrefix=true]         ] [        18]
    ...
  [route1            ] [to1               ] [[url]http://0.0.0.0:0000/?bridgeEndpoint=true&throwExceptionOnFailure=true&urlRewri[/url]] [         0]

  Stacktrace
  ---------------------------------------------------------------------------------------------------------------------------------------

  java.lang.ArrayIndexOutOfBoundsException: 8
This lines up with the matching entry in the localhost access log:
code:
[15/May/2024:13:23:53 +1200] "DELETE /wopi/v1/wopilocks/17172458?lock_id=eyJTIjoiYWZkZDQwNDktYjQ4Mi00ZjE4LWJkNjMtOTNlYjU5NDc0NzY0In0%3D HTTP/1.1" 500 -  
I can see the "complete message history is disabled" note, and so was wondering if there is any way to enable this in the tomcat config files (I don't have any way to control this programmatically)? I'm hoping the full message history might tell me which module things are breaking down in.

Also, I'd be keen to hear if there's anything else I could do to get more/better info into the logs. The actual app itself has pretty dire logs, so hoping tomcat might give me something helpful.

mortarr fucked around with this message at 03:36 on May 15, 2024

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply