auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDeserialize() throws IOException { <START> final String json = "{\n" + <END> " \"taskState\" : {\n" + " \"msg\" : \"ok message\",\n" + " \"status\" : \"OK\"\n" + " }\n" + "}"; TaskState taskState = new ObjectMapper().readValue(json, TaskState.class); assertThat(taskState.getStatus(), is("OK")); assertThat(taskState.getMessage(), is("ok message")); }</code><technical_language>please embedded json</technical_language>

Target:
public void testDeserialize() throws IOException { final InputStream stream = getClass().getResourceAsStream("/dataset/taskStateOK.json"); TaskState taskState = new ObjectMapper().readValue(stream, TaskState.class); assertThat(taskState.getStatus(), is("OK")); assertThat(taskState.getMessage(), is("ok message")); }
Source:
<code>public ItemCameraTransforms getItemCameraTransforms() { <START> return base.getItemCameraTransforms(); <END> }</code><technical_language>transforming subparts individually is in future. :P</technical_language>

Target:
public ItemCameraTransforms getItemCameraTransforms() { return internalBase.getItemCameraTransforms(); }
Source:
<code>public void testScanLimit() throws Exception { setupCluster(); TableName tableName = TableName.valueOf("testScanLimit"); String snapshotName = "testScanLimitSnapshot"; try { createTableAndSnapshot(UTIL, tableName, snapshotName, 50); Path restoreDir = UTIL.getDataTestDirOnTestFS(snapshotName); Scan scan = new Scan().withStartRow(bbb).setLimit(100); TableSnapshotScanner scanner = new TableSnapshotScanner(UTIL.getConfiguration(), restoreDir, snapshotName, scan); int count = 0; while (true) { Result result = scanner.next(); if (result == null) { break; } count++; } <START> assert (100 == count); <END> scanner.close(); } finally { UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } }</code><technical_language>Please assertTrue assertEquals</technical_language>

Target:
public void testScanLimit() throws Exception { setupCluster(); final TableName tableName = TableName.valueOf(name.getMethodName()); final String snapshotName = tableName + "Snapshot"; TableSnapshotScanner scanner = null; try { createTableAndSnapshot(UTIL, tableName, snapshotName, 50); Path restoreDir = UTIL.getDataTestDirOnTestFS(snapshotName); Scan scan = new Scan().withStartRow(bbb).setLimit(100); scanner = new TableSnapshotScanner(UTIL.getConfiguration(), restoreDir, snapshotName, scan); int count = 0; while (true) { Result result = scanner.next(); if (result == null) { break; } count++; } Assert.assertEquals(100, count); } finally { if (scanner != null) { scanner.close(); } UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } }
Source:
<code>public Object getStyledText(Object object) { StyledString styledString = new StyledString(getText(object)); if (LayerHelper.isTransientLayer((Layer) object)) { <START> styledString.append(" (" + getString("AdditionalLayerItemProvider_transientLayer") + ")", TRANSIENT_LAYER_STYLE); END> } return styledString; }</code><technical_language>like: styledString.append(MessageFormat.format("( {0})", getString("AdditionalLayerItemProvider_transientLayer")), TRANSIENT_LAYER_STYLE); //$NON-NLS-1$ //$NON-NLS-2$ Do if is combinate MessageFormat StyledString? For example, in this case, a full translatable message label (transient)</technical_language>

Target:
public Object getStyledText(Object object) { StyledString styledString = new StyledString(getText(object)); if (LayerHelper.isTransientLayer((Layer) object)) { styledString.append(MessageFormat.format(" ({0})", getString("AdditionalLayerItemProvider_transientLayer")), TRANSIENT_LAYER_STYLE); } return styledString; }
Source:
<code>public ProcessStatus check() { if (!ready) return ProcessStatus.NOTHING_TO_DO; Transact newTransact = new Transact(); newTransact.register(); System.out.println(Simulator.getTime() + ": generate body " + newTransact.getNumber()); if (!outputDock.pushTransact(newTransact)) { Transact.eraseTransact(newTransact); System.out.println(Simulator.getTime() + ": generate failed to give " + newTransact.getNumber()); return ProcessStatus.FAILURE; <START> } <END> Double time = Simulator.getTime() + interval.get(); Simulator.pushEvent(new GenerateEvent(time)); ready = false; return ProcessStatus.SUCCESS; }</code><technical_language>java if (outputDock.hasTransact()) { return ProcessStatus.CHECK_AGAIN; } Transact transact = new Transact(); ..</technical_language>

Target:
public BlockStatus check() { if (!ready) return BlockStatus.NOTHING_TO_DO; if (outputDock.hasTransact()) { return BlockStatus.CHECK_AGAIN; } Transact transact = new Transact(); transact.register(); outputDock.pushTransact(transact); System.out.println(Simulator.getTime() + ": generate body " + transact.getNumber()); Double time = Simulator.getTime() + interval.get(); Simulator.pushEvent(new GenerateEvent(time)); ready = false; return BlockStatus.SUCCESS; }
Source:
<code>public void testRootSingleWithId() throws JsonProcessingException { String graphQLRequest = "mutation { " + "author(op:UPSERT, data: {id: \"1\", name: \"abc\" }) { " + "id " + "name " + "} " + "}"; String expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"name\":\"abc\"" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); <START> graphQLRequest = <END> "{ " + "author(ids: [\"1\"]) { " + "id " + "type " + "books { " + "id " + "} " + "} " + "}"; expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"type\":\"EXCLUSIVE\"," + "\"books\":[{" + "\"id\":\"1\"" + "},{" + "\"id\":\"2\"" + "}]" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); }</code><technical_language>remove (and including) this line</technical_language>

Target:
public void testRootSingleWithId() throws JsonProcessingException { String graphQLRequest = "mutation { " + "author(op:UPSERT, data: {id: \"1\", name: \"abc\" }) { " + "id " + "name " + "} " + "}"; String expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"name\":\"abc\"" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); }
Source:
<code>private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, <START> "/VAADIN/static/push/*"); <END> servletPushRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new ResourceServlet(pushBundle, "/META-INF/resources/VAADIN/static/push"), properties)); }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Replace synchronized class "Hashtable" unsynchronized "HashMap". [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put("osgi.http.whiteboard.servlet.pattern", "/VAADIN/static/push/*"); servletPushRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new ResourceServlet(pushBundle, "/META-INF/resources/VAADIN/static/push"), properties)); }
Source:
<code>public String toString() { <START> return "AssetEvent [assetRecord=" + this.channelRecord + "]"; <END> }</code><technical_language>channelRecord</technical_language>

Target:
public String toString() { return "ChannelEvent [channeRecord=" + this.channelRecord + "]"; }
Source:
<code>private static PackageInfo buildPackageInfo(boolean hasSystemPermission, int uid) { final PackageInfo packageInfo = new PackageInfo(); if (hasSystemPermission) { packageInfo.requestedPermissions = new String[] { <START> CHANGE_NETWORK_STATE, NETWORK_STACK, <END> CONNECTIVITY_USE_RESTRICTED_NETWORKS }; } else { packageInfo.requestedPermissions = new String[0]; } packageInfo.applicationInfo = new ApplicationInfo(); packageInfo.applicationInfo.privateFlags = 0; packageInfo.applicationInfo.uid = UserHandle.getUid(UserHandle.USER_SYSTEM, UserHandle.getAppId(uid)); return packageInfo; }</code><technical_language>Remove NETWORK_STACK, apps it</technical_language>

Target:
private static PackageInfo buildPackageInfo(boolean hasSystemPermission, int uid) { final PackageInfo packageInfo = new PackageInfo(); if (hasSystemPermission) { packageInfo.requestedPermissions = new String[] { CHANGE_NETWORK_STATE, CONNECTIVITY_USE_RESTRICTED_NETWORKS }; } else { packageInfo.requestedPermissions = new String[0]; } packageInfo.applicationInfo = new ApplicationInfo(); packageInfo.applicationInfo.privateFlags = 0; packageInfo.applicationInfo.uid = UserHandle.getUid(UserHandle.USER_SYSTEM, UserHandle.getAppId(uid)); return packageInfo; }
Source:
<code>public DatasetLinkingDataverse execute(CommandContext ctxt) throws CommandException { if (!linkedDataset.isReleased() && !linkedDataset.isHarvested()) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.available"), this); } if (linkedDataset.getOwner().equals(linkingDataverse)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.to.owner"), this); } if (linkedDataset.getOwner().getOwners().contains(linkingDataverse)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.to.parent.dataverse"), this); } List<Dataverse> existingLinksToDataverses = new ArrayList<>(); <START> for (DatasetLinkingDataverse datasetLinkingDataverse : linkedDataset.getDatasetLinkingDataverses()) { <END> existingLinksToDataverses.add(datasetLinkingDataverse.getLinkingDataverse()); } if (existingLinksToDataverses.contains(linkingDataverse)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.already.linked"), this); } DatasetLinkingDataverse datasetLinkingDataverse = new DatasetLinkingDataverse(); datasetLinkingDataverse.setDataset(linkedDataset); datasetLinkingDataverse.setLinkingDataverse(linkingDataverse); datasetLinkingDataverse.setLinkCreateTime(new Timestamp(new Date().getTime())); ctxt.dsLinking().save(datasetLinkingDataverse); ctxt.em().flush(); return datasetLinkingDataverse; }</code><technical_language>this efficient enough, instead of adding a find method specific for existing link</technical_language>

Target:
public DatasetLinkingDataverse execute(CommandContext ctxt) throws CommandException { if (!linkedDataset.isReleased() && !linkedDataset.isHarvested()) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.available"), this); } if (linkedDataset.getOwner().equals(linkingDataverse)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.to.owner"), this); } if (linkedDataset.getOwner().getOwners().contains(linkingDataverse)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.to.parent.dataverse"), this); } if (ctxt.dsLinking().alreadyLinked(linkingDataverse, linkedDataset)) { throw new IllegalCommandException(BundleUtil.getStringFromBundle("dataset.link.not.already.linked"), this); } DatasetLinkingDataverse datasetLinkingDataverse = new DatasetLinkingDataverse(); datasetLinkingDataverse.setDataset(linkedDataset); datasetLinkingDataverse.setLinkingDataverse(linkingDataverse); datasetLinkingDataverse.setLinkCreateTime(new Timestamp(new Date().getTime())); ctxt.dsLinking().save(datasetLinkingDataverse); ctxt.em().flush(); return datasetLinkingDataverse; }
Source:
<code>public static Script updateScriptWithSignature(Script scriptSig, byte[] signature, int targetIndex, int sigsPrefixCount, int sigsSuffixCount) { ScriptBuilder builder = new ScriptBuilder(); List<ScriptChunk> inputChunks = scriptSig.getChunks(); int totalChunks = inputChunks.size(); <START> boolean hasMissingSigs = inputChunks.get(totalChunks - sigsSuffixCount - 1).equalsOpCode(OP_0); <END> if (!hasMissingSigs) return scriptSig; for (ScriptChunk chunk: inputChunks.subList(0, sigsPrefixCount)) builder.addChunk(chunk); int pos = 0; boolean inserted = false; for (ScriptChunk chunk: inputChunks.subList(sigsPrefixCount, totalChunks - sigsSuffixCount)) { if (pos == targetIndex) { inserted = true; builder.data(signature); pos++; } if (!chunk.equalsOpCode(OP_0)) { builder.addChunk(chunk); pos++; } } while (pos < totalChunks - sigsPrefixCount - sigsSuffixCount) { if (pos == targetIndex) { inserted = true; builder.data(signature); } else { builder.addChunk(new ScriptChunk(OP_0, null)); } pos++; } for (ScriptChunk chunk: inputChunks.subList(totalChunks - sigsSuffixCount, totalChunks)) builder.addChunk(chunk); checkState(inserted); return builder.build(); }</code><technical_language>this is a good idea, caused root (extra signer) hidden. fail loudly early</technical_language>

Target:
public static Script updateScriptWithSignature(Script scriptSig, byte[] signature, int targetIndex, int sigsPrefixCount, int sigsSuffixCount) { ScriptBuilder builder = new ScriptBuilder(); List<ScriptChunk> inputChunks = scriptSig.getChunks(); int totalChunks = inputChunks.size(); boolean hasMissingSigs = inputChunks.get(totalChunks - sigsSuffixCount - 1).equalsOpCode(OP_0); checkArgument(hasMissingSigs, "ScriptSig is already filled with signatures"); for (ScriptChunk chunk: inputChunks.subList(0, sigsPrefixCount)) builder.addChunk(chunk); int pos = 0; boolean inserted = false; for (ScriptChunk chunk: inputChunks.subList(sigsPrefixCount, totalChunks - sigsSuffixCount)) { if (pos == targetIndex) { inserted = true; builder.data(signature); pos++; } if (!chunk.equalsOpCode(OP_0)) { builder.addChunk(chunk); pos++; } } while (pos < totalChunks - sigsPrefixCount - sigsSuffixCount) { if (pos == targetIndex) { inserted = true; builder.data(signature); } else { builder.addChunk(new ScriptChunk(OP_0, null)); } pos++; } for (ScriptChunk chunk: inputChunks.subList(totalChunks - sigsSuffixCount, totalChunks)) builder.addChunk(chunk); checkState(inserted); return builder.build(); }
Source:
<code>public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final EsClientConfiguration other = (EsClientConfiguration) obj; <START> return Objects.equals(clusterUrl, other.clusterUrl); <END> }</code><technical_language>Cluster name included in equals(Object) hashCode() checks. client pool is this configuration object a map key</technical_language>

Target:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final EsClientConfiguration other = (EsClientConfiguration) obj; return Objects.equals(clusterName, other.clusterName) && Objects.equals(clusterUrl, other.clusterUrl); }
Source:
<code>public void visitSetLiteral(PySetLiteralTree pySetLiteralTree) { <START> scan(new ArrayList<>(pySetLiteralTree.elements())); <END> }</code><technical_language>need instantiate a new list if a set in interface</technical_language>

Target:
public void visitSetLiteral(PySetLiteralTree pySetLiteralTree) { scan((pySetLiteralTree.elements())); }
Source:
<code>public synchronized boolean contains(Long tableId) { <START> return pages.containsKey(tableId) && numberOfRows.containsKey(tableId); <END> }</code><technical_language>check state instead</technical_language>

Target:
public synchronized boolean contains(Long tableId) { return tables.containsKey(tableId); }
Source:
<code>protected static ClassificationRequest createClassificationRequest(NetflowDocument document) { final ClassificationRequest request = new ClassificationRequest(); request.setProtocol(ProtocolType.createFrom(document.getIpProtocol())); request.setLocation(document.getLocation()); <START> if (isInitiator(document)) { <END> request.setIpAddress(document.getIpv4DestAddress()); request.setPort(document.getDestPort()); } else { request.setIpAddress(document.getIpv4SourceAddress()); request.setPort(document.getSourcePort()); } return request; }</code><technical_language>worthwhile perform this logic if is a cache miss opposed every-time is a cache lookup</technical_language>

Target:
protected static ClassificationRequest createClassificationRequest(NetflowDocument document) { final ClassificationRequest request = new ClassificationRequest(); request.setProtocol(Protocols.getProtocol(document.getIpProtocol())); request.setLocation(document.getLocation()); if (document.isInitiator()) { request.setIpAddress(document.getIpv4DestAddress()); request.setPort(document.getDestPort()); } else { request.setIpAddress(document.getIpv4SourceAddress()); request.setPort(document.getSourcePort()); } return request; }
Source:
<code>public static void statObject_test3() throws Exception { if (!mintEnv) { <START> System.out.println("Test: statObject(String bucketName, '/')"); <END> } long startTime = System.currentTimeMillis(); try { client.statObject(bucketName, "/"); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_KEY) { mintFailedLog("statObject(String bucketName, '/')", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } } catch (Exception e) { mintFailedLog("statObject(String bucketName, '/')", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } finally { mintSuccessLog("statObject(String bucketName, '/')", null, startTime); } }</code><technical_language>'/' is a character, string</technical_language>

Target:
public static void statObject_test3() throws Exception { if (!mintEnv) { System.out.println("Test: statObject(String bucketName, \"/\")"); } long startTime = System.currentTimeMillis(); try { client.statObject(bucketName, "/"); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_KEY) { mintFailedLog("statObject(String bucketName, \"/\")", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } } catch (Exception e) { mintFailedLog("statObject(String bucketName, \"/\")", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } finally { mintSuccessLog("statObject(String bucketName, \"/\"`)", null, startTime); } }
Source:
<code>public List<OntologyTerm> getDiagnosis(List<String> phenotypes, int limit) { Observations o = new Observations(); o.observations = new boolean[this.boqa.getOntology().getNumberOfTerms()]; for (String hpo : phenotypes) { Term t = this.boqa.getOntology().getTerm(hpo); addTermAndAncestors(t, o); } if (o.isEmpty()) { <START> return null; <END> } final BOQA.Result res = this.boqa.assignMarginals(o, false, 1); Integer[] order = new Integer[res.size()]; for (int i = 0; i < order.length; i++) { order[i] = i; } Arrays.sort(order, new Comparator<Integer>() { @Override public int compare(Integer o1, Integer o2) { if (res.getMarginal(o1) < res.getMarginal(o2)) { return 1; } if (res.getMarginal(o1) > res.getMarginal(o2)) { return -1; } return 0; } }); List<OntologyTerm> results = new ArrayList<OntologyTerm>(); for (int id : order) { if (results.size() >= limit) { break; } String termId = String.valueOf(this.omimMap.get(id)); String ontologyId = StringUtils.substringBefore(termId, ":"); if (!"OMIM".equals(ontologyId)) { continue; } termId = termId.substring(1); OntologyTerm term = this.ontology.resolveTerm(termId); if (term == null) { this.logger.warn(String.format( "Unable to resolve OMIM term '%s' due to outdated OMIM ontology.", termId)); continue; } Pattern pattern = Pattern.compile("[*+^]"); if (pattern.matcher(term.getName().substring(0, 1)).matches()) { continue; } results.add(term); } this.logger.debug(String.valueOf(results)); return results; }</code><technical_language>Return empty list (Collections.emptyList())</technical_language>

Target:
public List<OntologyTerm> getDiagnosis(List<String> phenotypes, int limit) { Observations o = new Observations(); o.observations = new boolean[this.boqa.getOntology().getNumberOfTerms()]; boolean searchIsEmpty = true; for (String hpo : phenotypes) { Term t = this.boqa.getOntology().getTerm(hpo); searchIsEmpty = !addTermAndAncestors(t, o) && searchIsEmpty; } if (searchIsEmpty) { return Collections.emptyList(); } final BOQA.Result res = this.boqa.assignMarginals(o, false, 1); Integer[] order = new Integer[res.size()]; for (int i = 0; i < order.length; i++) { order[i] = i; } Arrays.sort(order, new Comparator<Integer>() { @Override public int compare(Integer o1, Integer o2) { if (res.getMarginal(o1) < res.getMarginal(o2)) { return 1; } if (res.getMarginal(o1) > res.getMarginal(o2)) { return -1; } return 0; } }); List<OntologyTerm> results = new ArrayList<OntologyTerm>(); for (int id : order) { if (results.size() >= limit) { break; } String termId = String.valueOf(this.omimMap.get(id)); String ontologyId = StringUtils.substringBefore(termId, ":"); if (!"OMIM".equals(ontologyId)) { continue; } termId = termId.substring(1); OntologyTerm term = this.ontology.resolveTerm(termId); if (term == null) { this.logger.warn(String.format( "Unable to resolve OMIM term '%s' due to outdated OMIM ontology.", termId)); continue; } Pattern pattern = Pattern.compile("[*+^]"); if (pattern.matcher(term.getName().substring(0, 1)).matches()) { continue; } results.add(term); } this.logger.debug(String.valueOf(results)); return results; }
Source:
<code>default @Nullable String getSyscallExitName(String eventName) { for (String prefix : <START> syscallEntryPrefixes()) <END> { if (eventName.startsWith(prefix)) { if (eventName.equals(prefix + eventExitSyscallSuffix())) { return null; } return eventName.substring(prefix.length()).intern(); } } return null; }</code><technical_language>ugh</technical_language>

Target:
default @Nullable String getSyscallExitName(String eventName) { for (String prefix : syscallExitPrefixes()) { if (eventName.startsWith(prefix)) { if (eventName.equals(prefix + eventExitSyscallSuffix())) { return null; } if (eventName.equals(prefix + eventEnterSyscallSuffix())) { return null; } return eventName.substring(prefix.length()).intern(); } } return null; }
Source:
<code>public void execute(final Talks talks) throws IOException { <START> if (talks == null) { <END> return; } int maxTalkIndex = this.getMaxTalkIndex(talks); for (final Talk talk : talks.active()) { final List<String> requests = talk.read().xpath(" if (requests.isEmpty()) { int indexValue = 0; final List<XML> logs = talk.read().nodes(ARCHIVE_LOG); if (logs.isEmpty()) { indexValue = maxTalkIndex + 1; } else { final int maxLogIndex = this.getMaxLogIndex(logs); indexValue = Math.max(maxLogIndex, maxTalkIndex) + 1; } this.addIndex(talk, indexValue); maxTalkIndex += 1; } } }</code><technical_language>Talks null. This check is redundant</technical_language>

Target:
public void execute(final Talks talks) throws IOException { int max = this.max(talks); for (final Talk talk : talks.active()) { max = this.update(talk, max); } }
Source:
<code>protected TypedTransaction(Transaction tx, Encoder encoder, TypeLayer tl) { <START> super((Snapshot)tx, encoder, tl); <END> this.tx = tx; this.encoder = encoder; this.tl = tl; }</code><technical_language>TypedSnapshotBase constructor SnapshotBase instead of Snapshot</technical_language>

Target:
protected TypedTransaction(Transaction tx, Encoder encoder, TypeLayer tl) { super(tx, encoder, tl); this.tx = tx; this.encoder = encoder; this.tl = tl; }
Source:
<code>public static String getRelativePath(String url) { try { return new Url(url).toString(); } catch (AssertionError e) { return url; } <START> } <END></code><technical_language>1. support Firefox for _testing_ right? I assume difference in behavior affects testing only? In case production code clean apply workaround in test code. e.g. do if-else based WebDriver. 2. Yes, I some point stopped Chrome for testing. other quirks versions in of comparing html. check if is Chrome</technical_language>

Target:
public static String getRelativePath(String url) throws MalformedURLException { new URL(url); return new Url(url).toString(); }
Source:
<code>private void printGetterAndSetter(String name, CppType type, String variableName, boolean isMultiple, boolean isMultipleType) { String typeName = isMultiple ? String.format("std::vector<%s>", type.getName()) : type.getName(); headerFile.printf("%s& get%s();\n", typeName, Utils.capitalize(variableName)); cppFile.println(); cppFile.printf("%s& %s::get%s() {\n" + "return %s;\n}\n", typeName, name, Utils.capitalize(variableName), variableName); if (isMultiple || isMultipleType) { String elementTypeName = type instanceof CppComplexType ? type.getName() : ((CppSimpleType)type).getTypeName(); headerFile.printf("std::optional<%s> getFirst%s();\n", elementTypeName, Utils.capitalize(variableName)); cppFile.println(); <START> cppFile.printf("std::optional<%s> %s::getFirst%s() {\n" <END> + "if (%s.empty()) {\n" + "return {};\n" + "}\n" + "return %s[0];\n" + "}\n", elementTypeName, name, Utils.capitalize(variableName), variableName, variableName); } if (isMultiple) return; headerFile.printf("void set%s(%s);\n", Utils.capitalize(variableName), typeName); cppFile.println(); cppFile.printf("void %s::set%s(%s %s) {\n" + "this->%s = std::move(%s);\n" + "}\n", name, Utils.capitalize(variableName), typeName, variableName, variableName, variableName); }</code><technical_language>BTW, I suggested a pointer originally avoid extra copy. For read want caller ownership of object (hence std::optional); want. Is a reason std::optional is chosen here</technical_language>

Target:
private void printGetterAndSetter(String name, CppType type, String variableName, boolean isMultiple, boolean isMultipleType) { String typeName = isMultiple ? String.format("std::vector<%s>", type.getName()) : type.getName(); headerFile.printf("%s& get%s();\n", typeName, Utils.capitalize(variableName)); cppFile.println(); cppFile.printf("%s& %s::get%s() {\n" + "return %s;\n}\n", typeName, name, Utils.capitalize(variableName), variableName); if (isMultiple || isMultipleType) { String elementTypeName = type instanceof CppComplexType ? type.getName() : ((CppSimpleType)type).getTypeName(); if (elementTypeName.equals("bool")) { headerFile.printf("%s getFirst%s();\n", elementTypeName, Utils.capitalize(variableName)); cppFile.println(); cppFile.printf("%s %s::getFirst%s() {\n" + "if (%s.empty()) {\n" + "return false;\n" + "}\n" + "return %s[0];\n" + "}\n", elementTypeName, name, Utils.capitalize(variableName), variableName, variableName); } else { headerFile.printf("%s* getFirst%s();\n", elementTypeName, Utils.capitalize(variableName)); cppFile.println(); cppFile.printf("%s* %s::getFirst%s() {\n" + "if (%s.empty()) {\n" + "return nullptr;\n" + "}\n" + "return &%s[0];\n" + "}\n", elementTypeName, name, Utils.capitalize(variableName), variableName, variableName); } } if (isMultiple) return; headerFile.printf("void set%s(%s);\n", Utils.capitalize(variableName), typeName); cppFile.println(); cppFile.printf("void %s::set%s(%s %s) {\n" + "this->%s = std::move(%s);\n" + "}\n", name, Utils.capitalize(variableName), typeName, variableName, variableName, variableName); }
Source:
<code>public void putTransformInfo(TransformInfo transform) throws IOException { if (transform.getName() == null) { throw new IllegalArgumentException("Transformation does not have a name set"); } Resource file = getTransformInfoFile(transform.getName()); OutputStream fos = null; try { fos = file.out(); xs.toXML(transform, fos); } finally { <START> IOUtils.closeQuietly(fos); <END> } infoCache.put(transform, file); }</code><technical_language>try-with-resources? I need understand suppressed exceptions ..</technical_language>

Target:
public void putTransformInfo(TransformInfo transform) throws IOException { if (transform.getName() == null) { throw new IllegalArgumentException("Transformation does not have a name set"); } Resource file = getTransformInfoFile(transform.getName()); try (OutputStream fos = file.out()){ xs.toXML(transform, fos); } infoCache.put(transform, file); }
Source:
<code>public boolean isValid(CharSequence value, ConstraintValidatorContext context) { if ( value == null ) { return true; } <START> if ( value.toString().contains( "." ) ) { <END> return firstMod11CheckWithSeparator.isValid( value, context ) && secondMod11CheckWithSeparator.isValid( value, context ); } else { return firstMod11CheckWithoutSeparator.isValid( value, context ) && secondMod11CheckWithoutSeparator.isValid( value, context ); } }</code><technical_language>dot trigger special handling? non-digit character</technical_language>

Target:
public boolean isValid(CharSequence value, ConstraintValidatorContext context) { if ( value == null ) { return true; } if ( DIGITS_ONLY.matcher( value ).matches() ) { return withoutSeparatorMod11Validator1.isValid( value, context ) && withoutSeparatorMod11Validator2.isValid( value, context ); } else { return withSeparatorMod11Validator1.isValid( value, context ) && withSeparatorMod11Validator2.isValid( value, context ); } }
Source:
<code>public static List<Breadcrumb> getBreadcrumbs() { <START> Queue<Breadcrumb> store = getClient().getBreadcrumbState().getStore(); <END> return new ArrayList<>(store); }</code><technical_language>this call Client.getBreadcrumbs require a separate method retrieve BreadcrumbState</technical_language>

Target:
public static List<Breadcrumb> getBreadcrumbs() { return getClient().getBreadcrumbs(); }
Source:
<code>public void stopUsingSecurityAndSave() { try { open(); Control use = control("/useSecurity"); if(use.resolve().isSelected()) { use.click(); control("/Submit").click(); } <START> } catch (UnhandledAlertException e) { <END> LOGGER.info("Data you have entered may not be saved."); } }</code><technical_language>is this handled? In case of unexpected _page-leaving_ alert is Jenkins bug logic error in test</technical_language>

Target:
public void stopUsingSecurityAndSave() { open(); Control use = control("/useSecurity"); if(use.resolve().isSelected()) { use.click(); control("/Submit").click(); } }
Source:
<code>public void setUp() { <START> migrationExtractor = new MigrationExtractor(TestStorageRootFactory.create(), database, filePersistence, "base"); <END> }</code><technical_language>TestStorageRootFactory.create() in places. extract final field</technical_language>

Target:
public void setUp() { migrationExtractor = new MigrationExtractor(storageRoot, database, filePersistence, "base"); }
Source:
<code>public Builder setSSHDirectory(final File sshDirectory) { this.sshDirectory = sshDirectory; <START> return this; <END> }</code><technical_language>this class overrides equals method, needs override hashCode method. if questions this</technical_language>

Target:
public Builder setSSHDirectory(final File sshDirectory) { Assert.assertNotNull(sshDirectory); this.sshDirectory = sshDirectory; return this; }
Source:
<code>public void testWhenSwallowingChildrenFailureDoesNotAbortSecondaryOrFailPrimary() { Task<String> t1 = monitorableTask(null, "1", new FailCallable()); Task<String> t = Tasks.<String>builder().dynamic(true) .body(monitorableJob("main")) .add(t1).add(monitorableTask("2")).swallowChildrenFailures(true).build(); ec.submit(t); releaseMonitorableJob("1"); waitForMessage("1"); Assert.assertFalse(t.blockUntilEnded(TINY_TIME)); releaseMonitorableJob("2"); Assert.assertFalse(t.blockUntilEnded(TINY_TIME)); releaseMonitorableJob("main"); Assert.assertTrue(t.blockUntilEnded(TIMEOUT)); <START> Assert.assertEquals(messages, MutableList.of("1", "2", "main")); <END> Assert.assertTrue(stopwatch.elapsed(TimeUnit.MILLISECONDS) < TIMEOUT.toMilliseconds(), "took too long: "+stopwatch); Assert.assertFalse(t.isError()); Assert.assertTrue(t1.isError()); }</code><technical_language>Is this time sensitive? release "2", wait 20ms, release "main". a slow machine (e.g. buildhive) thread for main record message thread for 2. If case, this time sensitive (if necessary increasing pauses marking groups="Integration")</technical_language>

Target:
public void testWhenSwallowingChildrenFailureDoesNotAbortSecondaryOrFailPrimary() { Task<String> t1 = monitorableTask(null, "1", new FailCallable()); Task<String> t = Tasks.<String>builder().dynamic(true) .body(monitorableJob("main")) .add(t1).add(monitorableTask("2")).swallowChildrenFailures(true).build(); ec.submit(t); releaseMonitorableJob("1"); waitForMessage("1"); Assert.assertFalse(t.blockUntilEnded(TINY_TIME)); releaseMonitorableJob("2"); waitForMessage("2"); Assert.assertFalse(t.blockUntilEnded(TINY_TIME)); releaseMonitorableJob("main"); Assert.assertTrue(t.blockUntilEnded(TIMEOUT)); Assert.assertEquals(messages, MutableList.of("1", "2", "main")); Assert.assertTrue(stopwatch.elapsed(TimeUnit.MILLISECONDS) < TIMEOUT.toMilliseconds(), "took too long: "+stopwatch); Assert.assertFalse(t.isError()); Assert.assertTrue(t1.isError()); }
Source:
<code>private void handleSetLicense(HttpPostCommand command) { final int retryCount = 100; String res; byte[] data = command.getData(); try { String[] strList = bytesToString(data).split("&"); if (authenticate(command, strList[0], strList.length > 1 ? strList[1] : null)) { String licenseKey = strList.length > 2 ? URLDecoder.decode(strList[2], "UTF-8") : null; invokeOnStableClusterSerial(textCommandService.getNode().nodeEngine, <START> () -> new SetLicenseOperation(licenseKey), retryCount).get(); <END> res = responseOnSetLicenseSuccess(); } else { res = response(ResponseType.FORBIDDEN); } } catch (Throwable throwable) { logger.warning("Error occurred while updating the license", throwable); res = exceptionResponse(throwable); } command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); }</code><technical_language>In 3.12.z stream need avoid lambdas possibility feed users Java 6 compatible binaries. $ mvn clean install -P-jdk-8 -U -B -DskipTests ... [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hazelcast --- [INFO] Compiling 4316 source files /home/kwart/projects/hazelcast/hazelcast/hazelcast/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/kwart/projects/hazelcast/hazelcast/hazelcast/src/main/java/com/hazelcast/internal/ascii/rest/HttpPostCommandProcessor.java:[908,27] error: lambda expressions supported in -source 1.6 [INFO] 1 error ..</technical_language>

Target:
private void handleSetLicense(HttpPostCommand command) { final int retryCount = 100; String res; byte[] data = command.getData(); try { String[] strList = bytesToString(data).split("&"); if (authenticate(command, strList[0], strList.length > 1 ? strList[1] : null)) { String licenseKey = strList.length > 2 ? URLDecoder.decode(strList[2], "UTF-8") : null; invokeOnStableClusterSerial(textCommandService.getNode().nodeEngine, new Supplier<Operation>() { @Override public Operation get() { return new SetLicenseOperation(licenseKey); } }, retryCount).get(); res = responseOnSetLicenseSuccess(); } else { res = response(ResponseType.FORBIDDEN); } } catch (Throwable throwable) { logger.warning("Error occurred while updating the license", throwable); res = exceptionResponse(throwable); } command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); }
Source:
<code>public <T> T[] toArray(T[] a) { int size = Math.min(a.length, fInnerElements.size()); Iterator<E> iterator = iterator(); for (int i = 0; i < size; i++) { @Nullable E next = null; while (iterator.hasNext() && next == null) { next = iterator.next(); } <START> a[i] = (T) next; <END> } return a; }</code><technical_language>catch ClassCastException rethrow ArrayStoreException</technical_language>

Target:
public <T> T[] toArray(T[] a) { try { int size = Math.min(a.length, fInnerElements.size()); Iterator<E> iterator = iterator(); for (int i = 0; i < size; i++) { @Nullable E next = null; while (iterator.hasNext() && next == null) { next = iterator.next(); } a[i] = (T) next; } return a; } catch (ClassCastException e) { throw new ArrayStoreException(e.toString()); } }
Source:
<code>public ApplePaymentData performDecryptOperation(byte[] data, byte[] ephemeralKey) { try { PrivateKey privateKey = generatePrivateKey(); Certificate certificate = generateCertificate(); AsymmetricKeyVerifier verifier = new AsymmetricKeyVerifier(privateKey, certificate.getPublicKey()); if (!verifier.verify()) { throw new InvalidKeyException("Asymmetric keys do not match!"); } byte[] rawData = decrypt(certificate, privateKey, ephemeralKey, data); return objectMapper.readValue(new String(rawData, UTF_8), ApplePaymentData.class); } catch (Exception e) { <START> LOGGER.error("Error while trying to decrypt apple payload"); <END> throw new InvalidKeyException("Error while trying to decrypt apple payload"); } }</code><technical_language>"Apple Pay payload"</technical_language>

Target:
public ApplePaymentData performDecryptOperation(byte[] data, byte[] ephemeralKey) { try { PrivateKey privateKey = generatePrivateKey(); Certificate certificate = generateCertificate(); AsymmetricKeyVerifier verifier = new AsymmetricKeyVerifier(privateKey, certificate.getPublicKey()); if (!verifier.verify()) { throw new InvalidKeyException("Asymmetric keys do not match!"); } byte[] rawData = decrypt(certificate, privateKey, ephemeralKey, data); return objectMapper.readValue(new String(rawData, UTF_8), ApplePaymentData.class); } catch (Exception e) { LOGGER.error("Error while trying to decrypt apple pay payload"); throw new InvalidKeyException("Error while trying to decrypt apple pay payload"); } }
Source:
<code>public void test_getRequestURI_trailingSlash2() throws Exception { Collection<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>(); try { final AtomicReference<String> getRequestURI = new AtomicReference<String>(); Servlet servletA = new HttpServlet() { private static final long serialVersionUID = 1L; @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { getRequestURI.set(req.getRequestURI()); } }; Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, "SA"); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/a/*"); registrations.add(getBundleContext().registerService(Servlet.class, servletA, props)); props = new Hashtable<String, Object>(); requestAdvisor.request("a/b/c/"); Assert.assertEquals("/a/b/c/", getRequestURI.get()); requestAdvisor.request("a/b/"); Assert.assertEquals("/a/b/", getRequestURI.get()); requestAdvisor.request("a/"); Assert.assertEquals("/a/", getRequestURI.get()); } finally { for (ServiceRegistration<?> registration : registrations) { registration.unregister(); } try { stopJetty(); System.setProperty("org.eclipse.equinox.http.jetty.context.path", ""); } finally { startJetty(); <START> } <END> } }</code><technical_language>copy&paste error</technical_language>

Target:
public void test_getRequestURI_trailingSlash2() throws Exception { Collection<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>(); try { final AtomicReference<String> getRequestURI = new AtomicReference<String>(); Servlet servletA = new HttpServlet() { private static final long serialVersionUID = 1L; @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { getRequestURI.set(req.getRequestURI()); } }; Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, "SA"); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/*"); registrations.add(getBundleContext().registerService(Servlet.class, servletA, props)); props = new Hashtable<String, Object>(); requestAdvisor.request("a/b/c/"); Assert.assertEquals("/a/b/c/", getRequestURI.get()); requestAdvisor.request("a/b/"); Assert.assertEquals("/a/b/", getRequestURI.get()); requestAdvisor.request("a/"); Assert.assertEquals("/a/", getRequestURI.get()); requestAdvisor.request(""); Assert.assertEquals("/", getRequestURI.get()); } finally { for (ServiceRegistration<?> registration : registrations) { registration.unregister(); } } }
Source:
<code><START> public ModelAndView InternalServerHandleException(Exception e) { <END> ModelAndView mav = new ModelAndView("error-page"); mav.addObject("exceptionMessage", e.getMessage()); return mav; }</code><technical_language>I this exists. Consider, though, endpoint is in XML, programmatically - client parse get individual fields - show error message in kind of format? show external users internal messages - logging error message in logs, "Unexpected error occurred, email if this persists"</technical_language>

Target:
public ModelAndView InternalServerHandleException(Exception e) { ModelAndView mav = new ModelAndView("error-page"); mav.addObject("exceptionMessage", "Unexpected error occurred, email us if this presists."); LOGGER.error("Error getting Differential json results.",e.getMessage()); return mav; }
Source:
<code>private void validateConfigLevelConnectionTypes(Multimap<ConfigurationModel, ConnectionProviderModel> configLevelConnectionProviders, ProblemsReporter problemsReporter) { configLevelConnectionProviders.asMap().forEach((configModel, providerModels) -> { for (ConnectionProviderModel providerModel : providerModels) { <START> if (providerModel.getModelProperty(SyntheticModelModelProperty.class).isPresent()) { <END> continue; } Type connectionType = MuleExtensionUtils.getConnectionType(providerModel); configModel.getOperationModels() .forEach(operationModel -> validateConnectionTypes(providerModel, operationModel, connectionType, problemsReporter)); } }); }</code><technical_language>extract org.mule.runtime.module.extension.internal.util.MuleExtensionUtils</technical_language>

Target:
private void validateConfigLevelConnectionTypes(Multimap<ConfigurationModel, ConnectionProviderModel> configLevelConnectionProviders, ProblemsReporter problemsReporter) { configLevelConnectionProviders.asMap().forEach((configModel, providerModels) -> { for (ConnectionProviderModel providerModel : providerModels) { if (isSynthetic(providerModel)) { continue; } Type connectionType = MuleExtensionUtils.getConnectionType(providerModel); configModel.getOperationModels() .forEach(operationModel -> validateConnectionTypes(providerModel, operationModel, connectionType, problemsReporter)); } }); }
Source:
<code>protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder configuration = getDefaultStandaloneCacheConfig(false); configuration .jmxStatistics().enable() .persistence() .passivation(false) .addStore(DummyInMemoryStoreConfigurationBuilder.class); GlobalConfigurationBuilder globalConfiguration = new GlobalConfigurationBuilder(); globalConfiguration .globalJmxStatistics() .allowDuplicateDomains(false) .jmxDomain(JMX_DOMAIN) .mBeanServerLookup(mBeanServerLookup) <START> .enabled(true); <END> cacheManager = TestCacheManagerFactory.createCacheManager(globalConfiguration, configuration, true); cacheManager.defineConfiguration("test", configuration.build()); cache = cacheManager.getCache("test"); loaderInterceptorObjName = getCacheObjectName(JMX_DOMAIN, "test(local)", "CacheLoader"); storeInterceptorObjName = getCacheObjectName(JMX_DOMAIN, "test(local)", "CacheStore"); store = TestingUtil.getFirstLoader(cache); return cacheManager; }</code><technical_language>cacheContainer().statistics(exposeGlobalJmx)</technical_language>

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder configuration = getDefaultStandaloneCacheConfig(false); configuration .jmxStatistics().enable() .persistence() .passivation(false) .addStore(DummyInMemoryStoreConfigurationBuilder.class); GlobalConfigurationBuilder globalConfiguration = new GlobalConfigurationBuilder(); globalConfiguration .cacheContainer().statistics(true) .globalJmxStatistics() .allowDuplicateDomains(false) .jmxDomain(JMX_DOMAIN).mBeanServerLookup(mBeanServerLookup); cacheManager = TestCacheManagerFactory.createCacheManager(globalConfiguration, configuration, true); cacheManager.defineConfiguration("test", configuration.build()); cache = cacheManager.getCache("test"); loaderInterceptorObjName = getCacheObjectName(JMX_DOMAIN, "test(local)", "CacheLoader"); storeInterceptorObjName = getCacheObjectName(JMX_DOMAIN, "test(local)", "CacheStore"); store = TestingUtil.getFirstLoader(cache); return cacheManager; }
Source:
<code>public void ClearTasks() { synchronized (_listTasks) { java.util.ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks(); for (CommandAsyncTask task : CurrentActionTypeTasks) { <START> if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished <END> || task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.aborting) { task.clearAsyncTask(); } } } }</code><technical_language>I agree point. Good catch. I want Ravi review well</technical_language>

Target:
public void ClearTasks() { synchronized (_listTasks) { java.util.ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks(); for (CommandAsyncTask task : CurrentActionTypeTasks) { if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished) { task.clearAsyncTask(); } } } }
Source:
<code><START> public Step partitionStep() { <END> return myStepBuilderFactory.get("partitionStep") .partitioner("bulkExportGenerateResourceFilesStep", partitioner(null)) .step(bulkExportGenerateResourceFilesStep()) .taskExecutor(myTaskExecutor) .build(); }</code><technical_language>rename</technical_language>

Target:
public Step partitionStep() { return myStepBuilderFactory.get("partitionStep") .partitioner("bulkExportGenerateResourceFilesStep", bulkExportResourceTypePartitioner()) .step(bulkExportGenerateResourceFilesStep()) .build(); }
Source:
<code>protected boolean canDoAction() { <START> boolean retValue = super.canDoAction(); <END> if (getParameters().getParentCommand() == VdcActionType.Unknown) { if (getVds() != null && getVds().getstatus() != VDSStatus.Maintenance) { addCanDoActionMessage(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP); retValue = false; } } return retValue; }</code><technical_language>super.canDoAction() is called if parent command is restart this canDoAction run for it</technical_language>

Target:
protected boolean canDoAction() { boolean retValue = true; if (getParameters().getParentCommand() == VdcActionType.Unknown) { retValue = super.canDoAction(); if (getVds() != null && getVds().getstatus() != VDSStatus.Maintenance) { addCanDoActionMessage(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP); retValue = false; } } return retValue; }
Source:
<code>public void validateConnectionUiSpecs() throws Exception { UiSpecsPropertiesDto propertiesDto = buildTestDataStoreFormData(); Response response = given().accept(APPLICATION_JSON_UTF8_VALUE) .expect() .statusCode(HttpStatus.OK.value()).log().ifError() .with().content(propertiesDto) .contentType(ServiceConstants.MLTPL_UI_SPEC_CONTENT_TYPE) .post(getVersionPrefix() + "/runtimes/check"); <START> assertNotNull(response); <END> String content = response.asString(); assertNotNull(content); }</code><technical_language>assertNotNull(response); redundant</technical_language>

Target:
public void validateConnectionUiSpecs() throws Exception { UiSpecsPropertiesDto propertiesDto = buildTestDataStoreFormData(); given().accept(APPLICATION_JSON_UTF8_VALUE) .with().content(propertiesDto) .contentType(ServiceConstants.UI_SPEC_CONTENT_TYPE) .when() .post(getVersionPrefix() + "/runtimes/check") .then() .statusCode(HttpStatus.OK.value()).log().ifError() .assertThat().body(notNullValue()) .assertThat().body(instanceOf(String.class)); }