Lines 68-79
Link Here
|
68 |
return new SSSourceFileInfoSupport(storage); |
68 |
return new SSSourceFileInfoSupport(storage); |
69 |
} |
69 |
} |
70 |
|
70 |
|
71 |
public SourceFileInfo getSourceFileInfo(final FunctionCallImpl functionCall, PathMapper pathMapper) { |
71 |
public SourceFileInfo getSourceFileInfo(final FunctionCallImpl functionCall, PathMapper pathMapper, String urlPrefix) { |
72 |
SourceFileInfo result = null; |
72 |
SourceFileInfo result = null; |
73 |
|
73 |
|
74 |
try { |
74 |
try { |
75 |
SourceFileInfoFetchTaskParams params = new SourceFileInfoFetchTaskParams( |
75 |
SourceFileInfoFetchTaskParams params = new SourceFileInfoFetchTaskParams( |
76 |
functionCall, storage, pathMapper); |
76 |
functionCall, storage, pathMapper, urlPrefix); |
77 |
result = sourceLineInfoCachedProvider.compute(params); |
77 |
result = sourceLineInfoCachedProvider.compute(params); |
78 |
} catch (Throwable ex) { |
78 |
} catch (Throwable ex) { |
79 |
} |
79 |
} |
Lines 81-96
Link Here
|
81 |
return result; |
81 |
return result; |
82 |
} |
82 |
} |
83 |
|
83 |
|
84 |
public final static class SourceFileInfoFetchTaskParams { |
84 |
final static class SourceFileInfoFetchTaskParams { |
85 |
|
85 |
|
86 |
public final FunctionCallImpl functionCall; |
86 |
public final FunctionCallImpl functionCall; |
87 |
public final PerfanDataStorage storage; |
87 |
public final PerfanDataStorage storage; |
88 |
public final PathMapper pathMapper; |
88 |
public final PathMapper pathMapper; |
|
|
89 |
public final String urlPrefix; |
89 |
|
90 |
|
90 |
SourceFileInfoFetchTaskParams(FunctionCallImpl functionCall, PerfanDataStorage storage, PathMapper pathMapper) { |
91 |
SourceFileInfoFetchTaskParams(FunctionCallImpl functionCall, PerfanDataStorage storage, PathMapper pathMapper, String urlPrefix) { |
91 |
this.functionCall = functionCall; |
92 |
this.functionCall = functionCall; |
92 |
this.storage = storage; |
93 |
this.storage = storage; |
93 |
this.pathMapper = pathMapper; |
94 |
this.pathMapper = pathMapper; |
|
|
95 |
this.urlPrefix = urlPrefix; |
94 |
} |
96 |
} |
95 |
|
97 |
|
96 |
@Override |
98 |
@Override |
Lines 114-119
Link Here
|
114 |
return false; |
116 |
return false; |
115 |
} else if (!this.pathMapper.equals(that.pathMapper)) { |
117 |
} else if (!this.pathMapper.equals(that.pathMapper)) { |
116 |
return false; |
118 |
return false; |
|
|
119 |
} else if (!this.urlPrefix.equals(that.urlPrefix)) { |
120 |
return false; |
117 |
} |
121 |
} |
118 |
|
122 |
|
119 |
return true; |
123 |
return true; |
Lines 125-130
Link Here
|
125 |
hash = (int) (17 * hash + this.functionCall.getFunctionRefID()); |
129 |
hash = (int) (17 * hash + this.functionCall.getFunctionRefID()); |
126 |
hash = 17 * hash + (this.storage != null ? this.storage.hashCode() : 0); |
130 |
hash = 17 * hash + (this.storage != null ? this.storage.hashCode() : 0); |
127 |
hash = 17 * hash + (this.pathMapper != null ? this.pathMapper.hashCode() : 0); |
131 |
hash = 17 * hash + (this.pathMapper != null ? this.pathMapper.hashCode() : 0); |
|
|
132 |
hash = 17 * hash + this.urlPrefix.hashCode(); |
128 |
return hash; |
133 |
return hash; |
129 |
} |
134 |
} |
130 |
} |
135 |
} |
Lines 147-157
Link Here
|
147 |
sourceFile = fStatistics.getSourceFile(); |
152 |
sourceFile = fStatistics.getSourceFile(); |
148 |
|
153 |
|
149 |
line = line < 0 ? fStatistics.getSrcFileLine() : line; |
154 |
line = line < 0 ? fStatistics.getSrcFileLine() : line; |
150 |
if (sourceFile != null && params.pathMapper != null && !"(unknown)".equals(sourceFile)) { // NOI18N |
155 |
if (sourceFile != null && !"(unknown)".equals(sourceFile)) { // NOI18N |
151 |
String localFile = params.pathMapper.getLocalPath(sourceFile); |
156 |
if (!params.urlPrefix.isEmpty()) { |
152 |
if (localFile != null) { |
157 |
sourceFile = params.urlPrefix + sourceFile; |
153 |
File localFileFile = new File(localFile); |
158 |
} else if (params.pathMapper != null) { |
154 |
sourceFile = localFileFile.exists() ? localFileFile.getAbsolutePath() : null; |
159 |
sourceFile = params.pathMapper.getLocalPath(sourceFile); |
155 |
} |
160 |
} |
156 |
} |
161 |
} |
157 |
|
162 |
|