billroper: (Default)
Finished up the Java code for a fix I was making and fired things up so I could see how it was working. Opened up a model to give it a try.

It was *then* that I realized that the UI for this feature has not yet been ported to Java. It's still in C++ only.

Of course, I haven't ported my code to the C++ side yet. And one library that I was using that made it simple to write a particular routine I need doesn't have any C++ equivalent. I can write the necessary code to do what I need done, but it will take a little time to get it right.

So we'll see how this works next week.

*sigh*

In Bounds

Apr. 22nd, 2020 11:11 pm
billroper: (Default)
Today I had another occasion to use bounded type parameters in Java, which turn out to be a remarkably useful construct. A little refactoring here, a little refactoring there, and suddenly all of the classes are exposing the same interface, which is a *very* handy thing.

It Lives!

Feb. 10th, 2020 06:57 pm
billroper: (Default)
It lives! My Frankenstein's Monster of code lives!

Now, I just need to figure out how to debug it.
billroper: (Default)
My code has passed the unit tests that I have written for it and I have checked it in and written an email to the group telling them its there -- along with the new unit test facilities I wrote for testing it. :)

Time for the weekend now.
billroper: (Default)
I am working on changing the way that we handle renaming of account IDs in our product. This might seem simple, but there are a great many account IDs stored in many, many different records, all of which need to be switched over to use the new system.

And when I finish doing this in Java, I get to do it again in C++.

*sigh*
billroper: (Default)
I finished up the C# port today and checked it in.

Then I went and bothered one of my colleagues to show me how to use something that he'd mentioned in Java. After a bit of work using Jackson annotations, one of my Java classes is now happily emitting Json that the UI team should (with a bit of luck) be able to consume.

Well, that's the theory anyway.
billroper: (Default)
For someone who doesn't actually know C#, the port of this chunk of my code from Java to C# is going quite well. I think that I'm likely to finish the whole thing up tomorrow unless something goes horribly wrong.

The biggest chunk of time was spent sorting out the differences between a Java iterator and a C# IEnumerable interface. Other than that and a few scoping issues, things are going pretty well.

We'll see what happens next. :)
billroper: (Default)
Someday, I will get around to writing "A Pirate Looks at Fortran". In the meantime, I am looking at C#, because I think that the easiest way to get some things working in our C# user interface will be to port cut-down versions of my Java code over to C# so that the simple data is resident in the same process as the UI.

Today, I ported one of my ID classes and the ID caching class from Java to C#. Only the names of all the damnable methods have been changed as I move from one language to another (not *my* methods; the ones in the libraries). But it looks like it should work.
billroper: (Default)
So I wrote a new method for the project that I've been working on. It wasn't an overly complex method, but it was slightly annoying to write and might actually have been written in some "doomed to fail" way by mistake, so I said to myself, "Well, self, why don't you just write a unit test and make sure that it works?"

This was a good question with a simple answer, so I wrote the unit test. After a bit of futzing around with types (generics were in play), I got the unit test to work and determined that the new method was putting out what it was supposed to given the inputs I had given it. Good enough.

Let me go add it to the list of unit tests so that it will get run when I check this mess in again.

Hey, as long as I'm adding the unit test to the list, let's run the subset of unit tests that exercise my code.

Why are these unit tests failing?

It turns out that I had made a change that converted an ISO currency code I was using from upper case to lower case. This would seem harmless and -- in some better universe -- it would be. However, the Java Currency.getInstance() method stubbornly insists that it is only going to play nice if the currency code is in upper case.

I have patched the code so that the currency code is now upper case again.

Sheesh.

So much to my surprise, a unit test has done what it was supposed to do. This is a first in my experience...
billroper: (Default)
The smoke test passed today on both sides of the great coding divide (C++ and Java), so I have checked the last of that set of changes in.

This means that I can now start working on the *interesting* part of the project. In fact, I've already started coding up the new set of routines, so I should be able to figure out how they're going to work shortly.

(Yes, I know how they're going to work, but I don't necessarily know what the best *way* for them to work is yet. For example, I have a bunch of data to pass in to one of the methods. After a very brief false start -- just long enough to type the less-useful thing -- I said, "Oh! I should do this with a Map
billroper: (Default)
I have nearly finished a big change to the Java code base. Unfortunately, as I near the end of the process, I realize that I am going to need to make a similar change to the C++ code base.

Sadly, changing the C++ code base is a much more annoying process.

Ah, well.

Weirdness

Oct. 21st, 2019 06:57 pm
billroper: (Default)
My feature branch line of code is exhibiting a failure mode that the main line doesn't. I don't think I've actually *changed* any code in that neighborhood and am now scratching my head after a lot of mucking about.

I am about to pull out the *large* hammer.

If that doesn't work, I'm looking for Mjolnir.
billroper: (Default)
I built a new JUnit test framework using JMockit and now have a good place to stand to write lots and lots of unit tests as I build out my new code.

This makes me happy. It makes my bosses happy too, which is also a good thing.
billroper: (Default)
One of the nice things about Java is that our debugging tools are a bit easier to use than the ones in the old version of Visual Studio that we're using. I saw that a data value was being set to some incorrect value. We had no idea of how it was happening, but I was pretty sure that only two methods could be setting it. So we set a breakpoint that would go off when this particular value was set using either of the two methods.

The breakpoint fired with the incorrect value heading for storage, we looked at the call stack, and the culprit was easily identified and neutralized. Yay, team!
billroper: (Default)
Things should be simpler.

Because a chunk of our application is still coded using an obsolete library that is not supported by modern versions of JDeveloper, we are mired on an older version of JDev. This means that the standard methods for installing JDeveloper extensions don't work, because the website that you'd get the updates from has been retired. But there is a place that you can go to get JDeveloper extensions for older versions of the development system, assuming that you can find it, and then you can download the package to your local hard drive and install it from there.

Because we had upgraded to a slightly newer version of JDev a while back, all of the extensions that I had loaded into the older version were no longer available. And I needed the extension that would allow me to run JUnit tests from inside JDev so that I could do some fresh test development. This resulted in my swearing, finding the package I needed, downloading it, and discovering that the package wouldn't install.

You see, the package insisted on having a particular *exact* version of JDev to install against and *our* version of JDev has been patched with some fixes, so it is slightly newer than the version that the package wants to install against. This is now starting to tick me off.

Well, the package to install is distributed as a Zip file, so let's open it up and see what's inside it. Ah, there's a likely looking XML file. Let's see what's there. Yup, there are the oldest and newest versions that you can install against. Let's bump that newest version up to the same one as mine, zip the archive back up, and see how this works.

Happily, it did and I can now run JUnit tests again from inside JDev.

As I said, things should be simpler.
billroper: (Default)
Well, my new code *almost* works.

Maybe on Monday, I can get it past the "almost" stage.
billroper: (Default)
We had some code that was running slowly across a list of some 20K members. It turns out that the reason it was running slowly was that rather than just adding new members, we checked each member of the list to make sure that we weren't adding a *duplicate* member with the new add. This works fine for short lists, but is pretty much abominable by the time you're adding 20K members.

"Well," I said to myself. That's easy enough to fix. I can just add a hashCode() (and matching equals()) method to the class for the members that are being added to the list; then add a HashSet to keep track of what's already in the list, because that will look things up in a hurry. In fact, we should just make a class that welds a HashSet to the side of our ArrayList, because I know I've solved a similar problem before and we may as well not have to *keep* solving it."

I then paused and ran a brief search.

Right. ListOrderedSet in Apache Commons. I figured someone else had had this problem before...

Did I mention how nice it is to be working in a language with modern libraries available?
billroper: (Default)
So I'm working on a project at work where I'm porting some more C++ code to Java. I looked at the original code and said, "Well, let's see if we can streamline that." And I wrote a set of classes to support the behaviors that I wanted and which would generate the XML that I needed that C++ had been handling by writing exquisitely hand-crafted XML.

And I looked at the classes and said, "That could be simpler." And so I refactored the class structure I had written.

And I looked at the classes and said, "That could really be simpler." And I refactored the class structure into a set of Java enums.

It's a lot simpler now. :)
billroper: (Default)
Ah, there's nothing like going back to work on a section of the Java code that I haven't played with in a year or so. Now how does this work? :)
billroper: (Default)
I think I've gotten my current project under control on the Java side.

Now, I just need to port the code back to C++ and get it working there. :)

Profile

billroper: (Default)
billroper

September 2025

S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
282930    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 29th, 2025 07:05 am
Powered by Dreamwidth Studios