java - How could possibly a project runs well when its Classpath is lack of some classes used in it? -
it's interesting find out multitenantconnectionprovider.java
doesn't exists in project, project can maven build , runs well.
.
i use intellij idea 2016.2. class packed in mysql-connector-java-5.1.31.jar
. tried connect mysql db , query out data test if works well. turns out missing of class doesn't influence project runs well. seems unlogical, isn't it?
not @ all. jvm implementations lazy classloading. means: class doesn't loaded class loader until really needed; example when other code instantiates object of such class.
in other words: when application not throwing classnotfoundexception resp. noclassdeffounderror ... conclusion is: code paths executed not require 1 class loaded.
like in: might notice lost keys @ party point when home , try open front door.
in other words: if program builds , runs without class, that class isn't used much.
Comments
Post a Comment