SlideShare a Scribd company logo
Java problems   Raw type parameters     Working with the Java compiler     Logging         Static analysis




                                          CS/SE Individual Practical


                                                      Stephen Gilmore
                                                     November 11, 2011
                                      School of Informatics, University of Edinburgh




                                                                         CS/SE Individual Practical
                                                                                                      1 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                Common Java problems: raw types




                                                                       CS/SE Individual Practical
                                                                                                    2 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                Quick fix: a bad suggestion




                                                                       CS/SE Individual Practical
                                                                                                    3 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                Check the constructor documentation




                                                                       CS/SE Individual Practical
                                                                                                    4 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                Check the class documentation




                                                                       CS/SE Individual Practical
                                                                                                    5 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                What type of array are we adapting?




                                                                       CS/SE Individual Practical
                                                                                                    6 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Java problems


                Type parameter added




                                                                       CS/SE Individual Practical
                                                                                                    7 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Raw type in method header




                                                                       CS/SE Individual Practical
                                                                                                    8 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Consult the Java documentation




                                                                       CS/SE Individual Practical
                                                                                                    9 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Adapter doesn’t work here




                                                                       CS/SE Individual Practical
                                                                                                    10 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Adapter is an interface




                                                                       CS/SE Individual Practical
                                                                                                    11 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                T is not a class




                                                                       CS/SE Individual Practical
                                                                                                    12 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Object: the goto class




                                                                       CS/SE Individual Practical
                                                                                                    13 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                T extends Adapter doesn’t work




                                                                       CS/SE Individual Practical
                                                                                                    14 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                “?” — the wild card parameter




                                                                       CS/SE Individual Practical
                                                                                                    15 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                “Quick fix” would have worked here




                                                                       CS/SE Individual Practical
                                                                                                    16 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Raw type parameters


                Same result




                                                                       CS/SE Individual Practical
                                                                                                    17 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Working with the Java compiler


                Setting Java compiler preferences




                                                                       CS/SE Individual Practical
                                                                                                    18 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Working with the Java compiler


                Changing defaults




                                                                       CS/SE Individual Practical
                                                                                                    19 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Working with the Java compiler


                Potential programming problems




                                                                       CS/SE Individual Practical
                                                                                                    20 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Working with the Java compiler


                Tighter checking




                                                                       CS/SE Individual Practical
                                                                                                    21 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Working with the Java compiler


                Bug found




                                                                       CS/SE Individual Practical
                                                                                                    22 / 24
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                    Logging


                    Don’t forget to add logging . . .




                                                                           CS/SE Individual Practical
                                                                                                        23 / 24
.41.02.png
Java problems   Raw type parameters   Working with the Java compiler     Logging         Static analysis
                Static analysis


                Deeper analysis (resource leaks . . . )




                                                                       CS/SE Individual Practical
                                                                                                    24 / 24
Ad

Recommended

Testing Tools Classroom Training
Testing Tools Classroom Training
Srihitha Technologies
 
Windows NAS on cloud storage using CloudArray software
Windows NAS on cloud storage using CloudArray software
TwinStrata
 
Cloud Computing And Android Apps For The Indian
Cloud Computing And Android Apps For The Indian
Sanjay Chitnis
 
Cloud Compiler
Cloud Compiler
Being Topper
 
Ppt on cloud storage application 2015
Ppt on cloud storage application 2015
Amit Kumar Prasad
 
Brocade EMC vdx connectrix 발표자료 20150212
Brocade EMC vdx connectrix 발표자료 20150212
JunSeok Seo
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
vipin kumar
 
compiler vs interpreter
compiler vs interpreter
Faculty of Science , portsaid Univeristy
 
Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
baabtra.com - No. 1 supplier of quality freshers
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
Md Hossen
 
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
TwinStrata
 
cloud computing and android
cloud computing and android
Mohit Singh
 
Seminar on cloud computing by Prashant Gupta
Seminar on cloud computing by Prashant Gupta
Prashant Gupta
 
Cloud computing simple ppt
Cloud computing simple ppt
Agarwaljay
 
Introduction of Cloud computing
Introduction of Cloud computing
Rkrishna Mishra
 
cloud computing ppt
cloud computing ppt
himanshuawasthi2109
 
Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLP
Stephen Gilmore
 
Feedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large Practical
Stephen Gilmore
 
Arrays in Objective-C
Arrays in Objective-C
Stephen Gilmore
 
More Stochastic Simulation Examples
More Stochastic Simulation Examples
Stephen Gilmore
 
Testing Android apps with Robotium
Testing Android apps with Robotium
Stephen Gilmore
 
Common Java problems when developing with Android
Common Java problems when developing with Android
Stephen Gilmore
 
Quick quiz on Objective-C
Quick quiz on Objective-C
Stephen Gilmore
 
Getting started with Xcode
Getting started with Xcode
Stephen Gilmore
 
Working with databases in Android
Working with databases in Android
Stephen Gilmore
 
Crash Course in Objective-C
Crash Course in Objective-C
Stephen Gilmore
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
Stephen Gilmore
 
The Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
Stephen Gilmore
 
Beginning Android Development
Beginning Android Development
Stephen Gilmore
 
Computer Science Large Practical coursework
Computer Science Large Practical coursework
Stephen Gilmore
 

More Related Content

Viewers also liked (8)

Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
baabtra.com - No. 1 supplier of quality freshers
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
Md Hossen
 
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
TwinStrata
 
cloud computing and android
cloud computing and android
Mohit Singh
 
Seminar on cloud computing by Prashant Gupta
Seminar on cloud computing by Prashant Gupta
Prashant Gupta
 
Cloud computing simple ppt
Cloud computing simple ppt
Agarwaljay
 
Introduction of Cloud computing
Introduction of Cloud computing
Rkrishna Mishra
 
cloud computing ppt
cloud computing ppt
himanshuawasthi2109
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
Md Hossen
 
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
Overview of Cloud Storage Enablement and Intelligent Storage Clouds
TwinStrata
 
cloud computing and android
cloud computing and android
Mohit Singh
 
Seminar on cloud computing by Prashant Gupta
Seminar on cloud computing by Prashant Gupta
Prashant Gupta
 
Cloud computing simple ppt
Cloud computing simple ppt
Agarwaljay
 
Introduction of Cloud computing
Introduction of Cloud computing
Rkrishna Mishra
 

More from Stephen Gilmore (20)

Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLP
Stephen Gilmore
 
Feedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large Practical
Stephen Gilmore
 
Arrays in Objective-C
Arrays in Objective-C
Stephen Gilmore
 
More Stochastic Simulation Examples
More Stochastic Simulation Examples
Stephen Gilmore
 
Testing Android apps with Robotium
Testing Android apps with Robotium
Stephen Gilmore
 
Common Java problems when developing with Android
Common Java problems when developing with Android
Stephen Gilmore
 
Quick quiz on Objective-C
Quick quiz on Objective-C
Stephen Gilmore
 
Getting started with Xcode
Getting started with Xcode
Stephen Gilmore
 
Working with databases in Android
Working with databases in Android
Stephen Gilmore
 
Crash Course in Objective-C
Crash Course in Objective-C
Stephen Gilmore
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
Stephen Gilmore
 
The Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
Stephen Gilmore
 
Beginning Android Development
Beginning Android Development
Stephen Gilmore
 
Computer Science Large Practical coursework
Computer Science Large Practical coursework
Stephen Gilmore
 
Software Engineering Large Practical coursework
Software Engineering Large Practical coursework
Stephen Gilmore
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELP
Stephen Gilmore
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual Practical
Stephen Gilmore
 
Creating and working with databases in Android
Creating and working with databases in Android
Stephen Gilmore
 
Continuing Android development
Continuing Android development
Stephen Gilmore
 
Project management for the individual practical
Project management for the individual practical
Stephen Gilmore
 
Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLP
Stephen Gilmore
 
Feedback on Part 1 of the Software Engineering Large Practical
Feedback on Part 1 of the Software Engineering Large Practical
Stephen Gilmore
 
More Stochastic Simulation Examples
More Stochastic Simulation Examples
Stephen Gilmore
 
Testing Android apps with Robotium
Testing Android apps with Robotium
Stephen Gilmore
 
Common Java problems when developing with Android
Common Java problems when developing with Android
Stephen Gilmore
 
Quick quiz on Objective-C
Quick quiz on Objective-C
Stephen Gilmore
 
Getting started with Xcode
Getting started with Xcode
Stephen Gilmore
 
Working with databases in Android
Working with databases in Android
Stephen Gilmore
 
Crash Course in Objective-C
Crash Course in Objective-C
Stephen Gilmore
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
Stephen Gilmore
 
The Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
Stephen Gilmore
 
Beginning Android Development
Beginning Android Development
Stephen Gilmore
 
Computer Science Large Practical coursework
Computer Science Large Practical coursework
Stephen Gilmore
 
Software Engineering Large Practical coursework
Software Engineering Large Practical coursework
Stephen Gilmore
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELP
Stephen Gilmore
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual Practical
Stephen Gilmore
 
Creating and working with databases in Android
Creating and working with databases in Android
Stephen Gilmore
 
Continuing Android development
Continuing Android development
Stephen Gilmore
 
Project management for the individual practical
Project management for the individual practical
Stephen Gilmore
 
Ad

Recently uploaded (20)

Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Ad

Fixing errors in Android Java applications

  • 1. Java problems Raw type parameters Working with the Java compiler Logging Static analysis CS/SE Individual Practical Stephen Gilmore November 11, 2011 School of Informatics, University of Edinburgh CS/SE Individual Practical 1 / 24
  • 2. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems Common Java problems: raw types CS/SE Individual Practical 2 / 24
  • 3. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems Quick fix: a bad suggestion CS/SE Individual Practical 3 / 24
  • 4. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems Check the constructor documentation CS/SE Individual Practical 4 / 24
  • 5. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems Check the class documentation CS/SE Individual Practical 5 / 24
  • 6. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems What type of array are we adapting? CS/SE Individual Practical 6 / 24
  • 7. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Java problems Type parameter added CS/SE Individual Practical 7 / 24
  • 8. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Raw type in method header CS/SE Individual Practical 8 / 24
  • 9. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Consult the Java documentation CS/SE Individual Practical 9 / 24
  • 10. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Adapter doesn’t work here CS/SE Individual Practical 10 / 24
  • 11. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Adapter is an interface CS/SE Individual Practical 11 / 24
  • 12. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters T is not a class CS/SE Individual Practical 12 / 24
  • 13. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Object: the goto class CS/SE Individual Practical 13 / 24
  • 14. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters T extends Adapter doesn’t work CS/SE Individual Practical 14 / 24
  • 15. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters “?” — the wild card parameter CS/SE Individual Practical 15 / 24
  • 16. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters “Quick fix” would have worked here CS/SE Individual Practical 16 / 24
  • 17. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Raw type parameters Same result CS/SE Individual Practical 17 / 24
  • 18. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Working with the Java compiler Setting Java compiler preferences CS/SE Individual Practical 18 / 24
  • 19. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Working with the Java compiler Changing defaults CS/SE Individual Practical 19 / 24
  • 20. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Working with the Java compiler Potential programming problems CS/SE Individual Practical 20 / 24
  • 21. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Working with the Java compiler Tighter checking CS/SE Individual Practical 21 / 24
  • 22. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Working with the Java compiler Bug found CS/SE Individual Practical 22 / 24
  • 23. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Logging Don’t forget to add logging . . . CS/SE Individual Practical 23 / 24 .41.02.png
  • 24. Java problems Raw type parameters Working with the Java compiler Logging Static analysis Static analysis Deeper analysis (resource leaks . . . ) CS/SE Individual Practical 24 / 24