auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { return "Outcome{" + "nextRole=" + nextRole + ", term=" + term + ", leader=" + leader + ", leaderCommit=" + leaderCommit + ", logCommands=" + logCommands + ", outgoingMessages=" + outgoingMessages + ", commitIndex=" + commitIndex + ", votedFor=" + votedFor + ", renewElectionTimeout=" + renewElectionTimeout + ", needsFreshSnapshot=" + needsFreshSnapshot + ", votesForMe=" + votesForMe + ", preVotesForMe=" + preVotesForMe + ", lastLogIndexBeforeWeBecameLeader=" + lastLogIndexBeforeWeBecameLeader + ", followerStates=" + followerStates + ", shipCommands=" + shipCommands + ", electedLeader=" + electedLeader + ", steppingDown=" + steppingDownInTerm.map( t -> "true, steppingDownInTerm=" + t ).orElse( "false" ) + '}'; }

Target:
public String toString() { return "Outcome{" + "nextRole=" + nextRole + ", term=" + term + ", leader=" + leader + ", leaderCommit=" + leaderCommit + ", logCommands=" + logCommands + ", outgoingMessages=" + outgoingMessages + ", commitIndex=" + commitIndex + ", votedFor=" + votedFor + ", renewElectionTimeout=" + renewElectionTimeout + ", needsFreshSnapshot=" + needsFreshSnapshot + ", votesForMe=" + votesForMe + ", preVotesForMe=" + preVotesForMe + ", lastLogIndexBeforeWeBecameLeader=" + lastLogIndexBeforeWeBecameLeader + ", followerStates=" + followerStates + ", shipCommands=" + shipCommands + ", electedLeader=" + electedLeader + ", steppingDownInTerm=" + steppingDownInTerm + '}'; }
Source:
public void testDeserialize() throws IOException { final String json = "{\n" + " \"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")); }

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:
public ItemCameraTransforms getItemCameraTransforms() { return base.getItemCameraTransforms(); }

Target:
public ItemCameraTransforms getItemCameraTransforms() { return internalBase.getItemCameraTransforms(); }
Source:
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++; } assert (100 == count); scanner.close(); } finally { UTIL.getAdmin().deleteSnapshot(snapshotName); UTIL.deleteTable(tableName); tearDownCluster(); } }

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:
public Object getStyledText(Object object) { StyledString styledString = new StyledString(getText(object)); if (LayerHelper.isTransientLayer((Layer) object)) { styledString.append(" (" + getString("AdditionalLayerItemProvider_transientLayer") + ")", TRANSIENT_LAYER_STYLE); } return styledString; }

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:
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; } Double time = Simulator.getTime() + interval.get(); Simulator.pushEvent(new GenerateEvent(time)); ready = false; return ProcessStatus.SUCCESS; }

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:
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); graphQLRequest = "{ " + "author(ids: [\"1\"]) { " + "id " + "type " + "books { " + "id " + "} " + "} " + "}"; expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"type\":\"EXCLUSIVE\"," + "\"books\":[{" + "\"id\":\"1\"" + "},{" + "\"id\":\"2\"" + "}]" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); }

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:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put(HttpWhiteboardConstants.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)); }

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:
public String toString() { return "AssetEvent [assetRecord=" + this.channelRecord + "]"; }

Target:
public String toString() { return "ChannelEvent [channeRecord=" + this.channelRecord + "]"; }
Source:
private static PackageInfo buildPackageInfo(boolean hasSystemPermission, int uid) { final PackageInfo packageInfo = new PackageInfo(); if (hasSystemPermission) { packageInfo.requestedPermissions = new String[] { CHANGE_NETWORK_STATE, NETWORK_STACK, 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; }

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:
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<>(); for (DatasetLinkingDataverse datasetLinkingDataverse : linkedDataset.getDatasetLinkingDataverses()) { 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; }

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:
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); 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(); }

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:
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(clusterUrl, other.clusterUrl); }

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:
public void visitSetLiteral(PySetLiteralTree pySetLiteralTree) { scan(new ArrayList<>(pySetLiteralTree.elements())); }

Target:
public void visitSetLiteral(PySetLiteralTree pySetLiteralTree) { scan((pySetLiteralTree.elements())); }
Source:
public synchronized boolean contains(Long tableId) { return pages.containsKey(tableId) && numberOfRows.containsKey(tableId); }

Target:
public synchronized boolean contains(Long tableId) { return tables.containsKey(tableId); }
Source:
protected static ClassificationRequest createClassificationRequest(NetflowDocument document) { final ClassificationRequest request = new ClassificationRequest(); request.setProtocol(ProtocolType.createFrom(document.getIpProtocol())); request.setLocation(document.getLocation()); if (isInitiator(document)) { request.setIpAddress(document.getIpv4DestAddress()); request.setPort(document.getDestPort()); } else { request.setIpAddress(document.getIpv4SourceAddress()); request.setPort(document.getSourcePort()); } return request; }

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:
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); } }

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:
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()) { return null; } 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; }

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:
default @Nullable String getSyscallExitName(String eventName) { for (String prefix : syscallEntryPrefixes()) { if (eventName.startsWith(prefix)) { if (eventName.equals(prefix + eventExitSyscallSuffix())) { return null; } return eventName.substring(prefix.length()).intern(); } } return null; }

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:
public void execute(final Talks talks) throws IOException { if (talks == null) { 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; } } }

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:
protected TypedTransaction(Transaction tx, Encoder encoder, TypeLayer tl) { super((Snapshot)tx, encoder, tl); this.tx = tx; this.encoder = encoder; this.tl = tl; }

Target:
protected TypedTransaction(Transaction tx, Encoder encoder, TypeLayer tl) { super(tx, encoder, tl); this.tx = tx; this.encoder = encoder; this.tl = tl; }
Source:
public static String getRelativePath(String url) { try { return new Url(url).toString(); } catch (AssertionError e) { return url; } }

Target:
public static String getRelativePath(String url) throws MalformedURLException { new URL(url); return new Url(url).toString(); }
Source:
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(); cppFile.printf("std::optional<%s> %s::getFirst%s() {\n" + "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); }

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:
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 { IOUtils.closeQuietly(fos); } infoCache.put(transform, file); }

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:
public boolean isValid(CharSequence value, ConstraintValidatorContext context) { if ( value == null ) { return true; } if ( value.toString().contains( "." ) ) { return firstMod11CheckWithSeparator.isValid( value, context ) && secondMod11CheckWithSeparator.isValid( value, context ); } else { return firstMod11CheckWithoutSeparator.isValid( value, context ) && secondMod11CheckWithoutSeparator.isValid( value, context ); } }

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:
public static List<Breadcrumb> getBreadcrumbs() { Queue<Breadcrumb> store = getClient().getBreadcrumbState().getStore(); return new ArrayList<>(store); }

Target:
public static List<Breadcrumb> getBreadcrumbs() { return getClient().getBreadcrumbs(); }
Source:
public void stopUsingSecurityAndSave() { try { open(); Control use = control("/useSecurity"); if(use.resolve().isSelected()) { use.click(); control("/Submit").click(); } } catch (UnhandledAlertException e) { LOGGER.info("Data you have entered may not be saved."); } }

Target:
public void stopUsingSecurityAndSave() { open(); Control use = control("/useSecurity"); if(use.resolve().isSelected()) { use.click(); control("/Submit").click(); } }
Source:
public void setUp() { migrationExtractor = new MigrationExtractor(TestStorageRootFactory.create(), database, filePersistence, "base"); }

Target:
public void setUp() { migrationExtractor = new MigrationExtractor(storageRoot, database, filePersistence, "base"); }
Source:
public Builder setSSHDirectory(final File sshDirectory) { this.sshDirectory = sshDirectory; return this; }

Target:
public Builder setSSHDirectory(final File sshDirectory) { Assert.assertNotNull(sshDirectory); this.sshDirectory = sshDirectory; return this; }
Source:
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)); 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()); }

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:
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 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)); }

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:
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(); } a[i] = (T) next; } return a; }

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:
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 payload"); throw new InvalidKeyException("Error while trying to decrypt apple payload"); } }

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:
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(); } } }

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:
public ModelAndView InternalServerHandleException(Exception e) { ModelAndView mav = new ModelAndView("error-page"); mav.addObject("exceptionMessage", e.getMessage()); return mav; }

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:
private void validateConfigLevelConnectionTypes(Multimap<ConfigurationModel, ConnectionProviderModel> configLevelConnectionProviders, ProblemsReporter problemsReporter) { configLevelConnectionProviders.asMap().forEach((configModel, providerModels) -> { for (ConnectionProviderModel providerModel : providerModels) { if (providerModel.getModelProperty(SyntheticModelModelProperty.class).isPresent()) { continue; } Type connectionType = MuleExtensionUtils.getConnectionType(providerModel); configModel.getOperationModels() .forEach(operationModel -> validateConnectionTypes(providerModel, operationModel, connectionType, problemsReporter)); } }); }

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:
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) .enabled(true); 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; }

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:
public void ClearTasks() { synchronized (_listTasks) { java.util.ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks(); for (CommandAsyncTask task : CurrentActionTypeTasks) { if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished || task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.aborting) { task.clearAsyncTask(); } } } }

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:
public Step partitionStep() { return myStepBuilderFactory.get("partitionStep") .partitioner("bulkExportGenerateResourceFilesStep", partitioner(null)) .step(bulkExportGenerateResourceFilesStep()) .taskExecutor(myTaskExecutor) .build(); }

Target:
public Step partitionStep() { return myStepBuilderFactory.get("partitionStep") .partitioner("bulkExportGenerateResourceFilesStep", bulkExportResourceTypePartitioner()) .step(bulkExportGenerateResourceFilesStep()) .build(); }
Source:
protected boolean canDoAction() { boolean retValue = super.canDoAction(); if (getParameters().getParentCommand() == VdcActionType.Unknown) { if (getVds() != null && getVds().getstatus() != VDSStatus.Maintenance) { addCanDoActionMessage(VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP); retValue = false; } } return retValue; }

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:
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"); assertNotNull(response); String content = response.asString(); assertNotNull(content); }

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)); }
Source:
private void setupUI() { setContentView(R.layout.screen_form_entry); setNavBarVisibility(); ImageButton nextButton = (ImageButton)this.findViewById(R.id.nav_btn_next); ImageButton prevButton = (ImageButton)this.findViewById(R.id.nav_btn_prev); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!"done".equals(v.getTag())) { FormEntryActivity.this.showNextView(); } else { saveDataToDisk(EXIT, true, getDefaultFormTitle(), false); } } }); prevButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!"quit".equals(v.getTag())) { FormEntryActivity.this.showPreviousView(); } else { FormEntryActivity.this.triggerUserQuitInput(); } } }); mViewPane = (ViewGroup)findViewById(R.id.form_entry_pane); mBeenSwiped = false; mAlertDialog = null; mCurrentView = null; mInAnimation = null; mOutAnimation = null; mGestureDetector = new GestureDetector(this); }

Target:
private void setupUI() { setContentView(R.layout.screen_form_entry); setNavBarVisibility(); ImageButton nextButton = (ImageButton)this.findViewById(R.id.nav_btn_next); ImageButton prevButton = (ImageButton)this.findViewById(R.id.nav_btn_prev); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!"done".equals(v.getTag())) { FormEntryActivity.this.showNextView(); } else { triggerUserFormComplete(); } } }); prevButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!"quit".equals(v.getTag())) { FormEntryActivity.this.showPreviousView(); } else { FormEntryActivity.this.triggerUserQuitInput(); } } }); mViewPane = (ViewGroup)findViewById(R.id.form_entry_pane); mBeenSwiped = false; mAlertDialog = null; mCurrentView = null; mInAnimation = null; mOutAnimation = null; mGestureDetector = new GestureDetector(this); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_viptab_bar); final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE); actionBar.setDisplayHomeAsUpEnabled(true); mViewPager = new ViewPager(this); mViewPager.setId(R.id.pager); setContentView(mViewPager); mTabsAdapter = new TabsAdapter(this, mViewPager); mTabsAdapter.addTab(actionBar.newTab().setText("Ballot"), BallotFragment.class, null); mTabsAdapter.addTab(actionBar.newTab().setText("Where Do I Vote"), BallotFragment.class, null); mTabsAdapter.addTab(actionBar.newTab().setText("Details"), BallotFragment.class, null); if (savedInstanceState != null) { actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0)); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_viptab_bar); final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE); actionBar.setDisplayHomeAsUpEnabled(true); mViewPager = new ViewPager(this); mViewPager.setId(R.id.pager); setContentView(mViewPager); mTabsAdapter = new TabsAdapter(this, mViewPager); mTabsAdapter.addTab(actionBar.newTab().setText(R.string.tabbar_ballot_tab), BallotFragment.class, null); mTabsAdapter.addTab(actionBar.newTab().setText(R.string.tabbar_where_to_vote_tab), BallotFragment.class, null); mTabsAdapter.addTab(actionBar.newTab().setText(R.string.tabbar_details_tab), BallotFragment.class, null); if (savedInstanceState != null) { actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0)); } }
Source:
public boolean shouldShutdown() { LOG.debug( "ContainerProcessManager state: Completed containers: {}, Configured containers: {}, Are there too many failed containers: {}, Is allocator thread alive: {}, Is the ContainerPlacementHandler thread alive: {}", state.completedProcessors.get(), state.processorCount, jobFailureCriteriaMet ? "yes" : "no", allocatorThread.isAlive() ? "yes" : "no", containerPlacementHandlerThread.isAlive() ? "yes" : "no"); if (exceptionOccurred != null) { LOG.error("Exception in container process manager", exceptionOccurred); throw new SamzaException(exceptionOccurred); } return jobFailureCriteriaMet || state.completedProcessors.get() == state.processorCount.get() || !allocatorThread.isAlive() || !containerPlacementHandlerThread.isAlive(); }

Target:
public boolean shouldShutdown() { LOG.debug("ContainerProcessManager state: Completed containers: {}, Configured containers: {}, Are there too many failed containers: {}, Is allocator thread alive: {}", state.completedProcessors.get(), state.processorCount, jobFailureCriteriaMet ? "yes" : "no", allocatorThread.isAlive() ? "yes" : "no"); if (exceptionOccurred != null) { LOG.error("Exception in container process manager", exceptionOccurred); throw new SamzaException(exceptionOccurred); } return jobFailureCriteriaMet || state.completedProcessors.get() == state.processorCount.get() || !allocatorThread.isAlive(); }
Source:
public String enchantment$getId() { return this.id; }

Target:
public String getId() { return this.id; }
Source:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, "druid.null.handling", NullValueHandlingConfig.class); binder.requestStaticInjection(NullHandlingHelper.class); }

Target:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, "druid.generic", NullValueHandlingConfig.class); binder.requestStaticInjection(NullHandling.class); binder.requestStaticInjection(NullHandling.class); }
Source:
protected void activate(ComponentContext componentContext, Map<String, Object> properties) { s_logger.info("Bundle " + APP_ID + " has started with config!"); updated(properties); }

Target:
protected void activate(ComponentContext componentContext, Map<String, Object> properties) { logger.info("Bundle has started with config!", APP_ID); updated(properties); }
Source:
public String dismissButtonText() { return "No, thanks"; }

Target:
public String dismissButtonText() { return NodeL10n.getBase().getString("Toadlet.no"); }