First adoption hackathon at BGJUG

Ivan Ivanov
Ivan IvanovSAP Labs Bulgaria
Adopt OpenJDK 
Hackathon, 11 Dec. 2014
Agenda of the hackathon 
 Build OpenJDK 
 Improve OpenJDK 
 Write some tests 
 Create patch 
 Submit patch
Agenda of the hackathon 
 Build OpenJDK 
 Improve OpenJDK 
 Write some tests 
 Create patch 
 Submit patch 
 While building… 
◦ Intro to OpenJDK
Let’s get it going 
 Import VM and login 
 Change to openjdk directory 
cd $SOURCE_CODE/jdk9 
 Get the sources 
bash get_sources.sh 
 Configure 
bash configure 
 Make images 
make clean images
OpenJDK overview 
 Free and open-source implementation of 
the Java Platform, Standard Edition 
 Base for the Oracle VM 
 GPL v2 for the VMs and GPL v2 + 
classpath exception for class libraries 
 Major contributors: 
◦ IBM 
◦ Apple 
◦ RedHat 
◦ SAP 
◦ A lot of JUGs
Why bother? 
 Move Java forward 
 Give back something to the platform 
 Help our JUG gain its own identity and 
focus 
 Acquire new knowledge 
 Have some fun and socialize
How can we help? 
 Introductory level 
◦ Fix compiler warnings 
◦ Generify, coinify and labdify internal APIs 
◦ Add new tests, convert existing tests 
◦ Fix typos, add javadoc 
 Next level 
◦ Affiliate with an existing project (Jigsaw, 
Nashorn) 
◦ Help with new stuff in project Valhalla
Development process 
 Sign OCA 
 Find interesting bug or enhancement 
 Discuss with sponsoring project 
mailing list 
 Get together and create a patch 
◦ Don’t forget the tests! 
 Upload the patch and contact ML 
again 
 Be proud of yourself!
Task selection (1) 
 Add getStackTraceString() to 
Throwable 
 Usually people do: 
catch (MyException e) { 
StringWriter sw = new StringWriter(); 
e.printStackTrace( 
new PrintWriter(sw)); 
} 
 Look at existing solutions (Apache 
Commons) 
 https://bugs.openjdk.java.net/browse/JD 
K-5050783
Task selection (2) 
 Generic support to Collection bulk 
methods 
 addAll, containsAll, removeAll, 
retainAll can only receive other 
collections 
 You have to an intermediate 
Arrays.asList: 
collection.addAll(Arrays.asList("a", "b", 
"c")); 
 Consider using default methods 
 https://bugs.openjdk.java.net/browse/J 
DK-6201180
Task selection (3) 
 Replace array parameters with 
varargs 
 Look throughout all internal APIs 
 Supported since JDK 1.5 
 Discuss with Joe Darcy and team 
 https://bugs.openjdk.java.net/browse/J 
DK-4974893
Write some tests 
 JTreg: the legacy 
◦ Java program with main method 
◦ If test fails, testcase should throw an exception 
◦ If it succeeds, testcase should return normally 
/* @test 
* @summary StringBuffer.isEmpty(); 
* @run main IsEmptyTest 
*/ 
public class IsEmptyTest { 
public static void main(String[] args) { 
StringBuffer buffer = new StringBuffer(); 
if (!buffer.isEmpty()) { 
throw new RuntimeException("StringBuffer isEmpty on new 
object failed"); 
} 
} 
}
Test “docklets” 
@test – defines a test. Mandatory. 
@run – tells how to perform a test. 
@summary – text description. 
@library – reference library source files. 
@build – compile class or library before 
running test 
@bug – bug number reference 
@key – keywords
TestNG support 
 TestNG is cool and nicely supported 
 TestNG test cases are run through jtreg 
 Two types of tests 
 Type 1 
◦ Describe the test in JTreg “docklets” 
◦ No main method required 
/* @test 
* @summary comments about your test; 
* @run testng YourTest 
*/ 
 Type 2 
◦ Describe the test in TEST.ROOT or TESTS.properties 
TestNG.dirs = . 
othervm.dirs = tck/java/time/chrono 
test/java/time/chrono test/java/time/format
Create a patch 
 Let’s contribute 
cd $SOURCE_CODE/jdk9 
 Commit in Mercurial 
hg status 
hg commit 
 Run webrev 
ksh ../webrev.ksh 
 Upload to web server 
$SOURCE_CODE/jdk9/webrev
1 of 15

Recommended

We Are All Testers Now: The Testing Pyramid and Front-End Development by
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
375 views60 slides
Automated php unit testing in drupal 8 by
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Jay Friendly
2.1K views30 slides
Unit testing with Spock Framework by
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock FrameworkEugene Dvorkin
6.7K views28 slides
Php unit for drupal 8 by
Php unit for drupal 8Php unit for drupal 8
Php unit for drupal 8valuebound
3.7K views8 slides
Javascript TDD with Jasmine, Karma, and Gulp by
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpAll Things Open
4.6K views38 slides
Just in Time Resourcing by
Just in Time ResourcingJust in Time Resourcing
Just in Time ResourcingESUG
431 views12 slides

More Related Content

What's hot

Idiomatic Gradle Plugin Writing by
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
1.3K views44 slides
Implementing Quality on Java projects by
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projectsVincent Massol
12.1K views40 slides
20111018 boost and gtest by
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtestWill Shen
1.5K views28 slides
Testcontainers - Geekout EE 2017 presentation by
Testcontainers - Geekout EE 2017 presentationTestcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentationRichard North
2.4K views83 slides
Google C++ Testing Framework in Visual Studio 2008 by
Google C++ Testing Framework in Visual Studio 2008Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008Andrea Francia
4.8K views22 slides
Gradle For Beginners (Serbian Developer Conference 2013 english) by
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Joachim Baumann
2.6K views24 slides

What's hot(20)

Idiomatic Gradle Plugin Writing by Schalk Cronjé
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
Schalk Cronjé1.3K views
Implementing Quality on Java projects by Vincent Massol
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projects
Vincent Massol12.1K views
20111018 boost and gtest by Will Shen
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtest
Will Shen1.5K views
Testcontainers - Geekout EE 2017 presentation by Richard North
Testcontainers - Geekout EE 2017 presentationTestcontainers - Geekout EE 2017 presentation
Testcontainers - Geekout EE 2017 presentation
Richard North2.4K views
Google C++ Testing Framework in Visual Studio 2008 by Andrea Francia
Google C++ Testing Framework in Visual Studio 2008Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008
Andrea Francia4.8K views
Gradle For Beginners (Serbian Developer Conference 2013 english) by Joachim Baumann
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)
Joachim Baumann2.6K views
Integration tests: use the containers, Luke! by Roberto Franchini
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
Roberto Franchini1.9K views
Unit Testing in SharePoint 2010 by Chris Weldon
Unit Testing in SharePoint 2010Unit Testing in SharePoint 2010
Unit Testing in SharePoint 2010
Chris Weldon1.6K views
Basic Gradle Plugin Writing by Schalk Cronjé
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
Schalk Cronjé1.7K views
Java Deserialization Vulnerabilities - The Forgotten Bug Class by CODE WHITE GmbH
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH18.2K views
Java Heap Dump Analysis Primer by Kyle Hodgson
Java Heap Dump Analysis PrimerJava Heap Dump Analysis Primer
Java Heap Dump Analysis Primer
Kyle Hodgson2.5K views
Advance java kvr -satya by Satya Johnny
Advance java  kvr -satyaAdvance java  kvr -satya
Advance java kvr -satya
Satya Johnny435 views
Resting on your laurels will get you powned by Dinis Cruz
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
Dinis Cruz4.9K views

Similar to First adoption hackathon at BGJUG

Oscon Java Testing on the Fast Lane by
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
3.9K views39 slides
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUC by
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUCDevelopment of Java tools using SWT and WALA af Hans Søndergaard, ViaUC
Development of Java tools using SWT and WALA af Hans Søndergaard, ViaUCInfinIT - Innovationsnetværket for it
631 views13 slides
Java 7 & 8 New Features by
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New FeaturesLeandro Coutinho
280 views60 slides
New Features Of JDK 7 by
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7Deniz Oguz
10.5K views41 slides
What to expect from Java 9 by
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
717 views71 slides
PostgreSQL and PL/Java by
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/JavaPeter Eisentraut
11.2K views33 slides

Similar to First adoption hackathon at BGJUG(20)

Oscon Java Testing on the Fast Lane by Andres Almiray
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
Andres Almiray3.9K views
New Features Of JDK 7 by Deniz Oguz
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
Deniz Oguz10.5K views
What to expect from Java 9 by Ivan Krylov
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
Ivan Krylov717 views
Atlassian Groovy Plugins by Paul King
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
Paul King2.3K views
Java For beginners and CSIT and IT students by Partnered Health
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
Partnered Health556 views
Boosting Your Testing Productivity with Groovy by James Williams
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
James Williams1.2K views
Javaone2008 Bof 5101 Groovytesting by Andres Almiray
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
Andres Almiray960 views
Java 7 Whats New(), Whats Next() from Oredev by Mattias Karlsson
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson2.2K views
Core Java- An advanced review of features by vidyamittal
Core Java- An advanced review of featuresCore Java- An advanced review of features
Core Java- An advanced review of features
vidyamittal609 views
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded... by Peter Pilgrim
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Peter Pilgrim3.6K views
Arquillian by nukeevry1
ArquillianArquillian
Arquillian
nukeevry13.2K views
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ... by JAXLondon2014
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
JAXLondon2014338 views
Java Programming and J2ME: The Basics by tosine
Java Programming and J2ME: The BasicsJava Programming and J2ME: The Basics
Java Programming and J2ME: The Basics
tosine1.6K views

Recently uploaded

Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... by
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...TomHalpin9
5 views29 slides
Keep by
KeepKeep
KeepGeniusee
75 views10 slides
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
37 views83 slides
Sprint 226 by
Sprint 226Sprint 226
Sprint 226ManageIQ
5 views18 slides
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...Deltares
6 views15 slides
Navigating container technology for enhanced security by Niklas Saari by
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
13 views34 slides

Recently uploaded(20)

Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... by TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin95 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller37 views
Sprint 226 by ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ5 views
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy13 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke28 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 views
Headless JS UG Presentation.pptx by Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor7 views
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... by Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares7 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j6 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik5 views

First adoption hackathon at BGJUG

  • 2. Agenda of the hackathon  Build OpenJDK  Improve OpenJDK  Write some tests  Create patch  Submit patch
  • 3. Agenda of the hackathon  Build OpenJDK  Improve OpenJDK  Write some tests  Create patch  Submit patch  While building… ◦ Intro to OpenJDK
  • 4. Let’s get it going  Import VM and login  Change to openjdk directory cd $SOURCE_CODE/jdk9  Get the sources bash get_sources.sh  Configure bash configure  Make images make clean images
  • 5. OpenJDK overview  Free and open-source implementation of the Java Platform, Standard Edition  Base for the Oracle VM  GPL v2 for the VMs and GPL v2 + classpath exception for class libraries  Major contributors: ◦ IBM ◦ Apple ◦ RedHat ◦ SAP ◦ A lot of JUGs
  • 6. Why bother?  Move Java forward  Give back something to the platform  Help our JUG gain its own identity and focus  Acquire new knowledge  Have some fun and socialize
  • 7. How can we help?  Introductory level ◦ Fix compiler warnings ◦ Generify, coinify and labdify internal APIs ◦ Add new tests, convert existing tests ◦ Fix typos, add javadoc  Next level ◦ Affiliate with an existing project (Jigsaw, Nashorn) ◦ Help with new stuff in project Valhalla
  • 8. Development process  Sign OCA  Find interesting bug or enhancement  Discuss with sponsoring project mailing list  Get together and create a patch ◦ Don’t forget the tests!  Upload the patch and contact ML again  Be proud of yourself!
  • 9. Task selection (1)  Add getStackTraceString() to Throwable  Usually people do: catch (MyException e) { StringWriter sw = new StringWriter(); e.printStackTrace( new PrintWriter(sw)); }  Look at existing solutions (Apache Commons)  https://bugs.openjdk.java.net/browse/JD K-5050783
  • 10. Task selection (2)  Generic support to Collection bulk methods  addAll, containsAll, removeAll, retainAll can only receive other collections  You have to an intermediate Arrays.asList: collection.addAll(Arrays.asList("a", "b", "c"));  Consider using default methods  https://bugs.openjdk.java.net/browse/J DK-6201180
  • 11. Task selection (3)  Replace array parameters with varargs  Look throughout all internal APIs  Supported since JDK 1.5  Discuss with Joe Darcy and team  https://bugs.openjdk.java.net/browse/J DK-4974893
  • 12. Write some tests  JTreg: the legacy ◦ Java program with main method ◦ If test fails, testcase should throw an exception ◦ If it succeeds, testcase should return normally /* @test * @summary StringBuffer.isEmpty(); * @run main IsEmptyTest */ public class IsEmptyTest { public static void main(String[] args) { StringBuffer buffer = new StringBuffer(); if (!buffer.isEmpty()) { throw new RuntimeException("StringBuffer isEmpty on new object failed"); } } }
  • 13. Test “docklets” @test – defines a test. Mandatory. @run – tells how to perform a test. @summary – text description. @library – reference library source files. @build – compile class or library before running test @bug – bug number reference @key – keywords
  • 14. TestNG support  TestNG is cool and nicely supported  TestNG test cases are run through jtreg  Two types of tests  Type 1 ◦ Describe the test in JTreg “docklets” ◦ No main method required /* @test * @summary comments about your test; * @run testng YourTest */  Type 2 ◦ Describe the test in TEST.ROOT or TESTS.properties TestNG.dirs = . othervm.dirs = tck/java/time/chrono test/java/time/chrono test/java/time/format
  • 15. Create a patch  Let’s contribute cd $SOURCE_CODE/jdk9  Commit in Mercurial hg status hg commit  Run webrev ksh ../webrev.ksh  Upload to web server $SOURCE_CODE/jdk9/webrev