zooming in on the mac

At my JavaOne Session on mutation testing, I needed to show both code and “other materials” to a large room on the Mac.

In Eclipse

Increasing the font size for the editor pane in Eclipse is easy. Cmd = makes the code bigger and Cmd – makes the code smaller.

Elsewhere

I also needed to show the problems view and the report. For this, I used the magnifying glass.

The initial set up was

  • Settings
  • Accessibility
  • Zoom
  • Check “Use Scroll gesture with modifier keys to zoom. I had mine set to control for the modifier, but you can change this.

Then I could zoom in on anything by holding control and moving two fingers away from me (up) on the trackpad.

To get rid of the magnifier is also easy; just hold control and two finger scroll down.

Speaking at JavaOne!

This year was my first visit to JavaOne and I got to go as a speaker! This wasn’t my first year applying, but it was my first year being accepted. If you are looking for my live blog posts, see the table of contents.

Applying

In addition to the usual (summary/abstract and bio), you had to submit a description of the session. You also had to submit a video of you speaking. I used the Mutation Testing talk from the NY Java User Group.

Getting accepted

On July 28th, I got an email saying my “JUnit 5 Hands On Lab” was accepted and I had two weeks to accept/decline. (I know people who got accepted two weeks earlier so I had originally thought I was rejected rather than being in “Phase 2.”) Then in later August, I got accepted for my “Intro to Mutation Testing” talk. This was about 5 weeks before the conference; luckily the mutation testing talk already existed and just needed minor edits/review. The on August 25th, I got the date/time of my sessions. Here’s my two sessions!

Picking Sessions

Before the conference, you have the opportunity to pre-register for sessions. Some fill up; especially hands on labs. If you don’t pre-register for a session, you can still try to attend off a physical wait list. But you get in earlier (and guaranteed) if you sign up. If a session got cancelled or changed rooms after pre-registering, you also got an email.

Getting Ready

I had done the mutation testing session before (well a shorter version of it). The JUnit 5 lab was new. It was fun to write. Like writing a chapter in a book (see it in github). But easier because I’d get to meet my audience. Steve Moyer from Penn State University and his two teammates offered to help me proctor the lab. This was immensely helpful. I practice both sessions a few times. Then I was ready!

There was some confusion about the Hands On Lab. Originally we were told that all labs would use VMs. After setting up my VM and submitting it, they said JavaOne sessions would use attendee laptop. Oh well, at least I got to play with Windows 10.

At the event

I got there and saw Duke inviting us in. Well, a cardboard Duke!

I also saw the JavaOne bookstore and took pictures with Scott and my books. I even went back later to see them with less books there.

Oh, and outside the conference, I rode a Segway. First time on a city street.

During a JUnit 5 session, Steve Moyer plugged my session:

And then there were my sessions:

 

 

 

 

 

 

 

 

 

After hours, I was on the winning team at IBM’s escape room with Sai (from the NY Java Sig) and three people we just met from Canada.

And of course I got to give Duke a hug!

After the conference
Shortly after each session, you could see the number of people who came to your session. I was at room capacity (or one under) for both sessions. I had a physical wait list line for both. For the JUnit 5 lab, someone even got on line 30 minutes early to ensure he’d get in!

In about a month, we get feedback from attendee surveys. Neither of my rooms was in a room with a thumbs up/side/down button so I’ll only get feedback from those who filled out the survey online. I got good feedback out loud though!

JavaOne – How to Make a Project Java 9 Compatible

“How to Make a Project Java 9 Compatible”

Speaker: Nikhil Nanivadekar

For more blog posts from JavaOne, see the table of contents


Examples use Eclipse Collections

Examples from:
https://github.com/nikhilnanivadekar/Java9Compatibility
https://github.com/nikhilnanivadekar/Java9Modules

Reflection

  • Used ArrayListAdapter which uses reflection
  • Got illegal-access warning (when default was warn; now it is permit
  • If run with illegal-access=deny, it fails
  • Lesson: have lots of regression tests so know about such errors
  • Lesson: Allow a lot of time to migrate. Don’t start Friday evening. Long sequence of “just one more compilation error to fix”

Infering types

  • Compler error because can’t assume generictype to return
  • Comes up when class doesn’t have a generic type and try to store it in one that does.
  • Compiler not supposed to infer type
  • Fix is to cast or store in a local variable
  • Similarly need to declare types on class instatiation if not diamond operator usage

NullPointerException

  • collect() now calls Objects.requireNotNull(combiner).
  • In Java 8, a null combiner worked in serial mode because not used.

“I love compiler errors vs runtime exceptions”

Migrating a Java 8 Maven project to Java 9

  • Migrated a maze solving project. Was written recently so not legacy code
  • Switch source/target of maven-compiler-plugin to “9”.
  • Changed JDK in IntelliJ.
  • Maven itself works fine with Java 9. Compiling works. JavaDoc and Enforcer plugins work fine with milestone version; not yet for released versions. Seewiki on support for Java 9 in Maven plugins
  • Looking at modularizing library in future
  • Runs without adding module info file or doing anything else
  • Once add module file, more enforcement happens. ex: error on unnamed packages
  • Eclipse and IntelliJ have quick tip to add requires
  • Important: start with base module
  • If not using a build tool, need to ensure no cyclic dependencies. (build tool takes care of this for you)
  • Add exports clause for module. The compiler error just says the class isn’t found. It doesn’t say it is because the export is missing.
  • Move code in split package to another package updating all callers
  • Delete empty package; can’t have empty package
  • Hide internal packages by not exporting sub-packages

My take: Nice to see issues by example. And nice to see that it wasn’t “all about Jigsaw.” It was a good mix of problem types!