From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Top 10 mistakes in eclipse plug in development
1. Whats wrong with the snippet?
public boolean isNegative(int number) {
// use 10 as radix
String stringVal = Long.toString(number, 10);
char minusSign = stringVal.charAt(0);
if(minusSign == '-')
return true; //Yes, its -ve number
else
return false; //Nope, its +ve number
}
1
2. Top 10 mistakes in Eclipse plug-in
development
Prakash G.R.
Eclipse Platform UI Team
IBM ISL
www.eclipse-tips.com
2
3. Agenda
✗ Teach Eclipse plug-in development
✗ Educate about the mistakes
✗ Improve the code quality
✔ Just try to keep you awake
3
4. Top 10 mistakes
10. Not reading the javadoc
9. Not having a default constructor
8. One plugin – do – it – all problem
7. Using 'internal' code
6. Directly setting the classpath
4
5. Top 10 mistakes contn...
5. Ignoring build.properties
4. Empty dispose method
3. Not honoring monitor cancellation
2. I-am-important contributions
1. Long running operations in UI thread
5
6. Back to the question
public boolean isNegative(int number) {
// use 10 as radix
String stringVal = Long.toString(number, 10);
char minusSign = stringVal.charAt(0);
if(minusSign == '-')
return true; //Yes, its a -ve number
else
return false; //Nope, its a +ve number
}
6
7. Back to the question
public boolean isNegative(int number) {
return number < 0;
}
7
8. Bonus
Looking into the details is important, but ..
Never, ever loose
focus on the
bigger picture
8