--- old/make/GensrcModuleInfo.gmk 2016-10-31 17:34:54.000000000 -0700 +++ new/make/GensrcModuleInfo.gmk 2016-10-31 17:34:54.000000000 -0700 @@ -92,10 +92,12 @@ # Returns non empty if the package exists in the current module # Param 1 - Name of package with dots PackageExists = \ - $(strip $(wildcard $(addsuffix $(subst .,/,/$(strip $1)), \ - $(MODULE_CLASSES_DIRS) \ - $(addsuffix /$(MODULE), $(IMPORT_MODULES_CLASSES)) \ - $(JDK_OUTPUTDIR)/modules/$(MODULE) \ + $(strip $(wildcard $(foreach s, $(subst .,/,/$(strip $1)) $(subst .,/,/*/src/$(strip $1)), \ + $(addsuffix $s, \ + $(MODULE_CLASSES_DIRS) \ + $(addsuffix /$(MODULE), $(IMPORT_MODULES_CLASSES)) \ + $(JDK_OUTPUTDIR)/modules/$(MODULE) \ + ) \ ))) # Convert the modification lines into arguments for the modification tool. @@ -119,7 +121,12 @@ $(eval class := $(patsubst %;,%,$(word 4, $(split_line)))) \ $(eval ARGS += -$(command) $(provider)/$(class)) \ , \ - $(error A module-info.extra in $(MODULE) contains invalid command $(command)) \ + $(if $(filter $(command), uses), \ + $(eval provider := $(patsubst %;,%,$(word 2, $(split_line)))) \ + $(eval ARGS += -$(command) $(provider)) \ + , \ + $(error A module-info.java.extra in $(MODULE) contains invalid command $(command)) \ + ) \ ) \ ) \ )