jdk/src/share/classes/java/util/ServiceLoader.java
changeset 14191 01f4a54604a6
parent 14016 56be5085fc31
child 14229 40fbffe104bd
--- a/jdk/src/share/classes/java/util/ServiceLoader.java	Wed Oct 17 12:03:20 2012 -0700
+++ b/jdk/src/share/classes/java/util/ServiceLoader.java	Wed Oct 17 20:34:04 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -214,7 +214,7 @@
 
     private ServiceLoader(Class<S> svc, ClassLoader cl) {
         service = Objects.requireNonNull(svc, "Service interface cannot be null");
-        loader = cl;
+        loader = (cl == null) ? ClassLoader.getSystemClassLoader() : cl;
         reload();
     }