Win a copy of Event Streams in Action this week in the Java in General forum!

Stephan van Hulst

Saloon Keeper
+ Follow
since Sep 20, 2010
Cologne, Germany
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephan van Hulst

This pisses me off so badly.

My suggestion: create a simple text file in the user folder with the user name and password in plain text. Admin account can modify, the user account can read. Then simply perform a text comparison.

Functional requirements fulfilled, and security is provided by the operating system. Job well done.
10 minutes ago
To clarify, I know about SNAPSHOT versions, but I don't know what OP means by "SNAPSHOT cycle".
3 hours ago
Well, they could have returned an object like I demonstrated with SortedSequenceSearchResult, and they could have done it all the way back in Java 1.2.

It's not about whether I CAN produce code that uses the offset negative int correctly. It's about how it makes MY code look. Let's reprise the ListBasedSortedSet.add() method I wrote earlier:

Not terrible, but definitely much less fluent than the first version.
6 hours ago
You will want to perform a GroupBy. This is what it looks like:
10 hours ago
I don't know what you mean by "SHAPSHOT cycle" and what you mean by "RELEASE cycle". Are these phases in Jenkins' release pipeline?

Do you have profiles configured in your POMs? Again, we can't do much to help if you if you don't show us your POMs. The devil is often in the details, and even a "simple parent POM" can harbor tricky gotchas.

Also, have you spoken to DevOps about Jenkins yet?
11 hours ago
I'm not sure this is a Maven issue. Your pipeline is probably set up that it refuses to release artifacts that have a dependency on pre-release artifacts. You probably have to create full release versions of your dependencies before you can release the dependent artifact.

I think you have to talk to your DevOps person for more info. MAYBE we can help you some more if you show us your POM?
15 hours ago
Because they don't catch the exception in the calling method. They just declare another throws clause in that method.

It's okay to let some exceptions bubble up the call stack until they reach the appropriate method to handle them, but many programmers just let exceptions bubble all the way up, or even worse, handle the exception too soon by just logging a message (or sometimes not even that!)
1 day ago

Monica Shiralkar wrote:Why is it poor form? Is it because it is not written as below?

Yes, that would have been the correct way to do it in Java if you had declared the field as private. In C#, the correct way is:

Note the following differences:

  • C# uses IList instead of List.
  • C# uses List instead of ArrayList.
  • In C# you write built-in reference types (like object and string) with a lowercase letter.
  • C# doesn't support generic type inference for constructor calls; there's nothing similar to the diamond operator in Java.

  • Private fields should be written with a lowercase letter. I don't know what the convention is for internal, protected or public fields, but it doesn't matter: Fields should be private. The default visibility in C# for fields is private, but it's better to state it explicitly.
    1 day ago
    Right click the package in your project explorer and select "New -> Other...". Under "Categories", select "Other" and then under "File Types" select "Empty File".
    2 days ago
    No. In this context, 'system' refers to the JVM instance + all loaded modules. Services that your module provides are available to the NetBeans platform and all other loaded modules.
    2 days ago
    Be careful that you don't forget how to write Java properly as you're learning C#. The String class' name starts with an uppercase letter, and variable names should start with a lowercase letter.

    In C# you also have to decide what kind of list you want to use. You chose to use the C# version of an ArrayList, which is called List. The common list interface is called IList, not List. So essentially you wrote the C# equivalent of:

    This is poor form.
    2 days ago

    Monica Shiralkar wrote:C# has only the concept of checked exceptions.

    I think you mean, C# only has unchecked exceptions.

    Like Brecht, I don't know what you mean by liability.

    Personally I'm a big fan of checked exceptions, because the compiler reminds me I have to take care of them. Many others consider checked exceptions a "failed experiment", because lazy programmers don't care to handle them properly and just declare a throws clause on all their method signatures.
    2 days ago