Jump to content

Snippet expansion misbehaves in NetBeans [issue with Java, not Alfred]


HotHead

Recommended Posts

I hate to post bug reports, because it makes me sound dissatisfied.

However, I am not. I absolutely adore Alfred. There, I said it!
But I thought it worth to report this:


Expansion works correctly until text has been copied within NetBeans
After that, the keyword expands into the copied text instead of the desired snippet


So, to put it as an example

 

  • I open NetBeans
  • I place my cursor in a document
  • I type my keyword
  • The keyword expands and my snippet appears

Good

  • I then copy something from the document I’m working on, say “$my_lovely_variable = 3;”
  • I type my keyword
  • The keywords expands to say “$my_lovely_variable = 3;” instead of my snippet

Not so good


I don’t know if NetBeans being a Java application is relevant to this issue, and I haven’t got any other Java apps lying about to test with.


Everything is the latest build:

Alfred 3.4, Build 850, Monday 19th June 2017

OSX 10.12.5 (16F73)

NetBeans IDE 8.1 (Build 201510222201)

Java version 8 Update 131

Link to comment
Share on other sites

1 hour ago, HotHead said:

I don’t know if NetBeans being a Java application is relevant to this issue

 

That is the most likely cause: Java apps have caused a lot of issues with snippet expansion apps. Java has its own clipboard and doesn't do a good job of keeping it in sync with the system clipboard.

 

Do snippets start working again once you switch to a different application and then back again?

Link to comment
Share on other sites

38 minutes ago, deanishe said:

 

That is the most likely cause: Java apps have caused a lot of issues with snippet expansion apps. Java has its own clipboard and doesn't do a good job of keeping it in sync with the system clipboard.

 

Do snippets start working again once you switch to a different application and then back again?


Ah, what do you know, it does!!!

Yes, simply setting focus on another application and back again re-enables expansion

(cmd+tab away and cmd+tab back again isn't quite enough - I have to physically click another app before switching back)

I suppose that's just something I'll have to learn to live with, Java being rubbish and all?

Link to comment
Share on other sites

It's not unfixable: I had the same issue with OmegaT (another Java app) for years, but after a recent update to the app, snippets work as they should. I've no idea what exactly they changed, but I'm 90% certain it's something app developers can fix themselves.

 

As best I can tell, the root problem is that NetBeans only checks whether the system clipboard has changed when the app is activated. It incorrectly assumes that another application can't change the clipboard while it's active.

 

Link to comment
Share on other sites

39 minutes ago, deanishe said:

As best I can tell, the root problem is that NetBeans only checks whether the system clipboard has changed when the app is activated. It incorrectly assumes that another application can't change the clipboard while it's active.

 


That makes sense.

Thank you so much for your time, and for the explanation!!!

Link to comment
Share on other sites

  • deanishe changed the title to Snippet expansion misbehaves in NetBeans [issue with Java, not Alfred]
2 hours ago, HotHead said:

I hate to post bug reports, because it makes me sound dissatisfied.

 

It doesn’t. A detailed and researched bug report (like yours) shows the exact opposite: that you care about the app and want it to work perfectly.

 

Bad bug reports are the ones where the reporter did not try to fix/diagnose/reproduce, and as such give a lot of extra work to the developer to even try to figure out why it happens. A lot of the time it’s due to user error, not a problem with the app. Good bug reports, however, give enough information to make the developer predisposed to fix it, and help them reach a cause sooner.

 

Bad bug reports cause developers to burnout and the app to die. Good bug reports make the app thrive and be better for everyone.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...