Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Java 2.0.1 binding] TimeOutException name collision

Featured Replies

Geschrieben

In the 2.0.1 Java bindings (and maybe before, don't know), we have two public TimeOutException classes:

 

com.tinkerforge.TimeoutException

 

and

 

com.tinkerforge.IPConnection.TimeOutException

 

If your program requires both (as is typically the case), then Java requires you to fully qualify both class names so that the compiler can differentiate the two.

 

This is pretty awkward. Historically, Java APIs have tried to avoid such name collisions.

 

Renaming the simple name of one, or both, would solve this.

Geschrieben

It was com.tinkerforge.IPConnection.TimeoutException in bindings version 1.x.y. I moved the TimeoutException to com.tinkerforge.TimeoutException in version 2.0.0, but missed to remove it from com.tinkerforge.IPConnection. The inner version of TimeoutException is not used anymore in the bindings and I just remove it in version 2.0.2.

 

You only need com.tinkerforge.TimeoutException in your program. Sorry for this oversight.

Geschrieben
  • Autor

On the subject of exceptions, maybe you should create a hierarchy rooted in TinkerForgeException. Having an exception hierarchy allows you (and clients) to specify much shorter throws clauses or catch blocks. The same approach is used by lots of APIs throwing IOException and SQLException. Both of these have many different sub-exceptions, but clients are not obliged to specify them everywhere in their code.

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.