MCPcopy Create free account
hub / github.com/Syncleus/aparapi / same

Method same

src/test/java/com/aparapi/codegen/Diff.java:256–280  ·  view source on GitHub ↗
(String left, String right)

Source from the content-addressed store, hash-verified

254 }
255
256 public static boolean same(String left, String right) {
257 StringBuilder leftAll = new StringBuilder();
258
259 for (String s : left.replace("\n", "").split(" *")) {
260 leftAll.append(s);
261 }
262
263 StringBuilder rightAll = new StringBuilder();
264 for (String s : right.replace("\n", " ").split(" *")) {
265 rightAll.append(s);
266 }
267 boolean same = leftAll.toString().equals(rightAll.toString());
268 if (!same) {
269 String[] lhs = left.split("\n");
270 for (int i = 0; i < lhs.length; i++) {
271 lhs[i] = lhs[i].trim();
272 }
273 String[] rhs = right.split("\n");
274 for (int i = 0; i < rhs.length; i++) {
275 rhs[i] = rhs[i].trim();
276 }
277 diff(lhs, rhs);
278 }
279 return (same);
280 }
281
282}

Callers 1

testMethod · 0.95

Calls 3

diffMethod · 0.95
equalsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected