convert inject code from java