@@ -69,7 +69,7 @@ public boolean hasRho() {
69
69
70
70
@ Override
71
71
public Phi take (final String name ) {
72
- final String obj = this . eoPackage ( name );
72
+ final String obj = String . join ( "." , this . pkg , name );
73
73
final String key = new JavaPath (obj ).toString ();
74
74
return this .objects .computeIfAbsent (
75
75
key ,
@@ -109,23 +109,16 @@ public byte[] delta() {
109
109
throw new ExFailure ("Can't take #data() from package object \" %s\" " , this .pkg );
110
110
}
111
111
112
- /**
113
- * Creates eo-package path by name.
114
- * @param name The name of an en object.
115
- * @return Eo-package path.
116
- */
117
- private String eoPackage (final String name ) {
118
- return String .join ("." , this .pkg , name );
119
- }
120
-
121
112
/**
122
113
* Load phi object by package name from ClassLoader.
123
114
* @param path Path to directory or .java file
124
115
* @param object Object FQN
125
116
* @return Phi
126
117
*/
127
118
private Phi loadPhi (final String path , final String object ) {
128
- final Path pth = Paths .get ("target/classes" , path .replace ("." , File .separator ));
119
+ final Path pth = new File (
120
+ this .getClass ().getProtectionDomain ().getCodeSource ().getLocation ().getPath ()
121
+ ).toPath ().resolve (path .replace ("." , File .separator ));
129
122
final Phi phi ;
130
123
if (Files .exists (pth ) && Files .isDirectory (pth )) {
131
124
phi = new PhPackage (object );
0 commit comments