auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DeferredPointLightsNode(Context context) { entityManager = context.get(EntityManager.class); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); playerCamera = context.get(WorldRenderer.class).getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL)); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new DisableDepthTest()); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetFboWriteMask(false, false, true, READONLY_GBUFFER, displayResolutionDependentFBOs)); initLightSphereDisplayList(); }

Target:
public DeferredPointLightsNode(Context context) { entityManager = context.get(EntityManager.class); playerCamera = context.get(WorldRenderer.class).getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL)); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new DisableDepthTest()); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetFboWriteMask(false, false, true, READONLY_GBUFFER, displayResolutionDependentFBOs)); initLightSphereDisplayList(); }
Source:
public SegmentMetadataQueryBuilder copy(SegmentMetadataQueryBuilder builder) { return new SegmentMetadataQueryBuilder() .dataSource(builder.dataSource) .intervals(builder.querySegmentSpec) .toInclude(toInclude) .analysisTypes(analysisTypes.toArray(new SegmentMetadataQuery.AnalysisType[analysisTypes.size()])) .merge(merge) .context(builder.context); }

Target:
public SegmentMetadataQueryBuilder copy(SegmentMetadataQueryBuilder builder) { final SegmentMetadataQuery.AnalysisType[] analysisTypesArray = analysisTypes != null ? analysisTypes.toArray(new SegmentMetadataQuery.AnalysisType[analysisTypes.size()]) : null; return new SegmentMetadataQueryBuilder() .dataSource(builder.dataSource) .intervals(builder.querySegmentSpec) .toInclude(toInclude) .analysisTypes(analysisTypesArray) .merge(merge) .context(builder.context); }
Source:
public static void saveClient(OwnCloudClient client, Account savedAccount, Context context) { AccountManager ac = AccountManager.get(context.getApplicationContext()); if (client != null) { String cookiesString = client.getCookiesString(); if (!cookiesString.equals("")) { ac.setUserData(savedAccount, Constants.KEY_COOKIES, cookiesString); } } }

Target:
public static void saveClient(OwnCloudClient client, Account savedAccount, Context context) { AccountManager ac = AccountManager.get(context.getApplicationContext()); if (client != null) { String cookiesString = client.getCookiesString(); if (!"".equals(cookiesString)) { ac.setUserData(savedAccount, Constants.KEY_COOKIES, cookiesString); } } }
Source:
private Map<TopicPartition, Long> readOffsets() throws CopycatException { Map<TopicPartition, Long> offsets = new HashMap<TopicPartition, Long>(); Path path = new Path(url + "/" + topicsDir); PathFilter filter = new FileFilter(); try { FileStatus[] topics = fs.listStatus(path); for (FileStatus topic: topics) { assert(topic.isDirectory()); String topicName = topic.getPath().getName(); FileStatus[] partitions = fs.listStatus(topic.getPath(), filter); for (FileStatus partition: partitions) { assert(partition.isFile()); String filename = partition.getPath().getName(); String[] parts = filename.split("\\."); int partitionNum = Integer.parseInt(parts[0]); long offset = Long.parseLong(parts[1]); TopicPartition topicPart = new TopicPartition(topicName, partitionNum); if (!offsets.containsKey(topicPart) || offset > offsets.get(topicPart)) { offsets.put(topicPart, offset); } } } return offsets; } catch (FileNotFoundException e) { throw new CopycatRuntimeException(e); } catch (IOException e) { throw new CopycatRuntimeException(e); } }

Target:
private Map<TopicPartition, Long> readOffsets() throws IOException { Map<TopicPartition, Long> offsets = new HashMap<TopicPartition, Long>(); Path path = new Path(url + "/" + topicsDir); PathFilter filter = new CommittedFileFilter(); FileStatus[] topics = fs.listStatus(path); for (FileStatus topic: topics) { if (topic.isDirectory()) { String topicName = topic.getPath().getName(); FileStatus[] partitions = fs.listStatus(topic.getPath(), filter); for (FileStatus partition : partitions) { if (partition.isFile()) { String filename = partition.getPath().getName(); String[] parts = filename.split("\\."); try { int partitionNum = Integer.parseInt(parts[0]); long offset = Long.parseLong(parts[1]); TopicPartition topicPart = new TopicPartition(topicName, partitionNum); if (!offsets.containsKey(topicPart) || offset > offsets.get(topicPart)) { offsets.put(topicPart, offset); } } catch (NumberFormatException e) { log.warn("Invalid Copycat HDFS file: {}", filename); } } } } } return offsets; }
Source:
public Long getDistance(InetAddress host, InetAddress host2) { if (host.equals(host2)) { return new Long(0); } else if (distances.get(host) != null && distances.get(host).get(host2) != null) { return distances.get(host).get(host2); } else if (distances.get(host2) != null && distances.get(host2).get(host) != null) { return distances.get(host2).get(host); } return new Long(Long.MAX_VALUE); }

Target:
public Long getDistance(InetAddress host, InetAddress host2) { if (host.equals(host2)) { return long0; } else { HashMap<InetAddress, Long> dhost = distances.get(host); HashMap<InetAddress, Long> dhost2 = distances.get(host2); Long dHostToHost2; Long dHost2ToHost; if (dhost != null && (dHostToHost2 = dhost.get(host2)) != null) { return dHostToHost2; } else if (dhost2 != null && (dHost2ToHost = dhost2.get(host)) != null) { return dHost2ToHost; } } return longMax; }
Source:
static boolean hasRequiredParameter(String template) { int index = -1; do { index = template.indexOf(":", index + 1); if (index >= 0) { final int regexIndex = template.indexOf("(", index); final int slashIndex = template.indexOf("/", index); int parameterNameEnding = Math.min(regexIndex, slashIndex); if (parameterNameEnding < 0) { parameterNameEnding = slashIndex; } if (parameterNameEnding < 0) { parameterNameEnding = template.length(); } int optional = template.indexOf("?", index); if (0 < optional && optional < parameterNameEnding) { continue; } int wildcard = template.indexOf("*", index); if (0 < wildcard && wildcard < parameterNameEnding) { return false; } return true; } else { return false; } } while (true); }

Target:
static boolean hasRequiredParameter(String template) { int index = -1; do { index = template.indexOf(':', index + 1); if (index >= 0) { final int regexIndex = template.indexOf('(', index); final int slashIndex = template.indexOf('/', index); int parameterNameEnding = Math.min(regexIndex, slashIndex); if (parameterNameEnding < 0) { parameterNameEnding = slashIndex; } if (parameterNameEnding < 0) { parameterNameEnding = template.length(); } int optional = template.indexOf('?', index); if (0 < optional && optional < parameterNameEnding) { continue; } int wildcard = template.indexOf('*', index); if (0 < wildcard && wildcard < parameterNameEnding) { return false; } return true; } else { return false; } } while (true); }
Source:
public void testGetBaseNicVerifyDelegation() throws Exception { CalculateBaseNic spy = spy(calculateBaseNic); spy.getBaseNic(baseNic); verify(spy).getBaseNic(Matchers.any(), Matchers.any()); }

Target:
public void testGetBaseNicVerifyDelegation() throws Exception { CalculateBaseNic spy = spy(calculateBaseNic); spy.getBaseNic(baseNic); verify(spy).getBaseNic(any(VdsNetworkInterface.class), anyMapOf(String.class, VdsNetworkInterface.class)); }
Source:
public void removeObserver(String tenantId, String id, Observer observer) { List<Observer> observers = eventListener.observersMap.get(id); if (observers != null) { observers.remove(observer); } }

Target:
public void removeObserver(String tenantId, String id, Observer observer) { List<Observer> observers = eventListener.observersMap.get(id); if (observers != null) { observers.remove(observer); if (observers.isEmpty()) { eventListener.observersMap.remove(id); } } }
Source:
protected void prePopulateUserProfileResults(Step step, StepResult result) { user = DataProvider.getInstance().getUser(getContext()); if (user == null) { user = new User(); } if (result == null) { result = new StepResult<StepResult>(step); } for (ProfileInfoOption option : getProfileStep().getProfileInfoOptions()) { StepResult profileResult = StepResultHelper.findStepResult(result, option.getIdentifier()); if (profileResult == null) { Step profileStep = StepHelper.getStepWithIdentifier(formStep.getFormSteps(), option.getIdentifier()); StepResult stepResult = null; if (profileStep != null) { switch (option) { case NAME: if (user.getName() != null) { StepResult<String> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getName()); stepResult = nameResult; } break; case EMAIL: if (user.getEmail() != null) { StepResult<String> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getEmail()); stepResult = nameResult; } break; case BIRTHDATE: if (user.getBirthDate() != null) { StepResult<Long> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getBirthDate().getTime()); stepResult = nameResult; } break; } } if (stepResult != null) { result.setResultForIdentifier(stepResult.getIdentifier(), stepResult); } } } }

Target:
protected void prePopulateUserProfileResults(Step step, StepResult result) { user = DataProvider.getInstance().getUser(getContext()); if (user == null) { user = new User(); } for (ProfileInfoOption option : getProfileStep().getProfileInfoOptions()) { StepResult profileResult = StepResultHelper.findStepResult(result, option.getIdentifier()); if (profileResult == null) { Step profileStep = StepHelper.getStepWithIdentifier(formStep.getFormSteps(), option.getIdentifier()); StepResult stepResult = null; if (profileStep != null) { switch (option) { case NAME: if (user.getName() != null) { StepResult<String> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getName()); stepResult = nameResult; } break; case EMAIL: if (user.getEmail() != null) { StepResult<String> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getEmail()); stepResult = nameResult; } break; case BIRTHDATE: if (user.getBirthDate() != null) { StepResult<Long> nameResult = new StepResult<>(profileStep); nameResult.setResult(user.getBirthDate().getTime()); stepResult = nameResult; } break; } } if (stepResult != null) { result.setResultForIdentifier(stepResult.getIdentifier(), stepResult); } } } }
Source:
public static boolean isInChain(Certificate cert, List<Certificate> chain) { String lookSKI = getCertKeyIdSubject(cert); if (null == lookSKI) { return false; } String foundSKI = null; for (Certificate link : chain) { foundSKI = getCertKeyIdSubject(link); if (lookSKI.equals(foundSKI)) { return true; } } return false; }

Target:
public static boolean isInChain(Certificate cert, List<Certificate> chain) { String lookSKI = getCertKeyIdSubject(cert); if (null != lookSKI) { for (Certificate link : chain) { String foundSKI = getCertKeyIdSubject(link); if (lookSKI.equals(foundSKI)) { return true; } } } return false; }
Source:
private <T extends JavaScriptObject> void sendPost(final AsyncCallback<T> cb, String token) { RequestBuilder req = new RequestBuilder(RequestBuilder.POST, url.toString()); req.setHeader("Accept", JsonConstants.JSON_TYPE); req.setHeader("Content-Type", "application/x-www-form-urlencoded"); req.setRequestData(token); req.setCallback(new MyRequestCallback<T>(cb)); try { req.send(); } catch (RequestException e) { RpcStatus.INSTANCE.onRpcComplete(); cb.onFailure(e); } }

Target:
private <T extends JavaScriptObject> void sendPost(final AsyncCallback<T> cb, String token) { RequestBuilder req = new RequestBuilder(RequestBuilder.POST, url.toString()); req.setHeader("Accept", JsonConstants.JSON_TYPE); req.setHeader("Content-Type", JsonConstants.JSON_TYPE); req.setRequestData(token); req.setCallback(new MyRequestCallback<T>(cb)); try { req.send(); } catch (RequestException e) { RpcStatus.INSTANCE.onRpcComplete(); cb.onFailure(e); } }
Source:
public Filter getFilter() { return new Filter() { @Override protected FilterResults performFiltering(CharSequence constraint) { FilterResults results = new FilterResults(); ArrayList<Label> filteredArrayList = new ArrayList<>(); if (labels == null) { labels = new ArrayList<>(displayedLabels); } if (constraint == null || constraint.length() == 0) { Collections.swap(labels, 0 , labels.indexOf(Label.fromText("BOOKMARK"))); results.count = labels.size(); results.values = labels; } else { constraint = constraint.toString().toLowerCase(); for (Label label : labels) { String data = label.toString(); if (data.toLowerCase().startsWith(constraint.toString())) { filteredArrayList.add(Label.fromText(label.getText())); } } results.count = filteredArrayList.size(); results.values = filteredArrayList; } return results; } @Override protected void publishResults(CharSequence constraint, FilterResults results) { displayedLabels = (ArrayList<Label>) results.values; notifyDataSetChanged(); } }; }

Target:
public Filter getFilter() { return new Filter() { @Override protected FilterResults performFiltering(CharSequence constraint) { FilterResults results = new FilterResults(); ArrayList<Label> filteredArrayList = new ArrayList<>(); if (labels == null) { labels = new ArrayList<>(displayedLabels); } if (constraint == null || constraint.length() == 0) { results.count = labels.size(); results.values = labels; } else { constraint = constraint.toString().toLowerCase(); for (Label label : labels) { String data = label.toString(); if (data.toLowerCase().startsWith(constraint.toString())) { filteredArrayList.add(Label.fromText(label.getText())); } } results.count = filteredArrayList.size(); results.values = filteredArrayList; } return results; } @Override protected void publishResults(CharSequence constraint, FilterResults results) { displayedLabels = (ArrayList<Label>) results.values; notifyDataSetChanged(); } }; }
Source:
public static HelloExtension fromExtensionDataReader(DatagramReader extensionDataReader) { List<SupportedGroup> groups = new ArrayList<>(); int listLength = extensionDataReader.read(LIST_LENGTH_BITS); DatagramReader rangeReader = extensionDataReader.createRangeReader(listLength); while (rangeReader.bytesAvailable()) { int id = rangeReader.read(CURVE_BITS); SupportedGroup group = SupportedGroup.fromId(id); if (group != null && group.isUsable()) { groups.add(group); } } return new SupportedEllipticCurvesExtension(Collections.unmodifiableList(groups)); }

Target:
public static HelloExtension fromExtensionDataReader(DatagramReader extensionDataReader) { List<SupportedGroup> groups = new ArrayList<>(); int listLength = extensionDataReader.read(LIST_LENGTH_BITS); DatagramReader rangeReader = extensionDataReader.createRangeReader(listLength); while (rangeReader.bytesAvailable()) { int id = rangeReader.read(CURVE_BITS); SupportedGroup group = SupportedGroup.fromId(id); if (group != null) { groups.add(group); } } return new SupportedEllipticCurvesExtension(Collections.unmodifiableList(groups)); }
Source:
public ConnectionPolicy(GatewayConnectionConfig gatewayConnectionConfig) { this(ConnectionMode.GATEWAY); this.enableTcpConnectionEndpointRediscovery = false; this.idleHttpConnectionTimeout = gatewayConnectionConfig.getIdleConnectionTimeout(); this.maxConnectionPoolSize = gatewayConnectionConfig.getMaxConnectionPoolSize(); this.requestTimeout = BridgeInternal.getRequestTimeoutFromGatewayConnectionConfig(gatewayConnectionConfig); this.proxy = gatewayConnectionConfig.getProxy(); }

Target:
public ConnectionPolicy(GatewayConnectionConfig gatewayConnectionConfig) { this(ConnectionMode.GATEWAY); this.tcpConnectionEndpointRediscoveryEnabled = true; this.idleHttpConnectionTimeout = gatewayConnectionConfig.getIdleConnectionTimeout(); this.maxConnectionPoolSize = gatewayConnectionConfig.getMaxConnectionPoolSize(); this.requestTimeout = BridgeInternal.getRequestTimeoutFromGatewayConnectionConfig(gatewayConnectionConfig); this.proxy = gatewayConnectionConfig.getProxy(); }
Source:
public List<DiagnosticReport> getFHIRDiagnosticReportBySubjectName(String name) { log.debug("In Radiology Handler : getFHIRDiagnosticReportBySubjectName : " + name); ArrayList<DiagnosticReport> diagnosticReports = new ArrayList<DiagnosticReport>(); String serverBase = FHIRUtils.getDiagnosticReportRadiologyBaseServerURL(); ICriterion<ReferenceClientParam> diagnosticReportBySubject = DiagnosticReport.SUBJECT.hasChainedProperty( Patient.GIVEN.matches().value(name)); ICriterion<TokenClientParam> diagnosticReportByService = DiagnosticReport.SERVICE.exactly().code("RAD"); Bundle bundle = FHIRRESTfulGenericClient.search(serverBase, DiagnosticReport.class, diagnosticReportBySubject, diagnosticReportByService); log.debug("Bundle size : " + bundle.size()); for (BundleEntry entry : bundle.getEntries()) { IResource resource = entry.getResource(); log.debug("Resource Type : " + resource.getResourceName()); if (resource.getResourceName().equals("DiagnosticReport")) { DiagnosticReport diagnosticReport = (DiagnosticReport) resource; diagnosticReports.add(diagnosticReport); } } return diagnosticReports; }

Target:
public List<DiagnosticReport> getFHIRDiagnosticReportBySubjectName(String name) { if (log.isDebugEnabled()) { log.debug("In Radiology Handler : getFHIRDiagnosticReportBySubjectName : " + name); } List<DiagnosticReport> diagnosticReports = new ArrayList<DiagnosticReport>(); String serverBase = FHIRUtils.getDiagnosticReportRadiologyBaseServerURL(); ICriterion<ReferenceClientParam> diagnosticReportBySubject = DiagnosticReport.SUBJECT.hasChainedProperty( Patient.GIVEN.matches().value(name)); ICriterion<TokenClientParam> diagnosticReportByService = DiagnosticReport.SERVICE.exactly().code("RAD"); Bundle bundle = FHIRRESTfulGenericClient.searchWhereReferenceAndToken(serverBase, DiagnosticReport.class, diagnosticReportBySubject, diagnosticReportByService); if (log.isDebugEnabled()) { log.debug("Bundle size : " + bundle.size()); } for (BundleEntry entry : bundle.getEntries()) { IResource resource = entry.getResource(); if (log.isDebugEnabled()) { log.debug("Resource Type : " + resource.getResourceName()); } if (resource.getResourceName().equals("DiagnosticReport")) { DiagnosticReport diagnosticReport = (DiagnosticReport) resource; diagnosticReports.add(diagnosticReport); } } return diagnosticReports; }
Source:
public EhcacheEntityMessage decode(byte[] payload) { ByteBuffer message = ByteBuffer.wrap(payload); byte[] encodedMsg = new byte[message.capacity() - 1]; message.get(); message.get(encodedMsg, 0, encodedMsg.length); EhcacheEntityMessage entityMessage = (EhcacheEntityMessage) Util.unmarshall(encodedMsg); return entityMessage; }

Target:
public EhcacheEntityMessage decode(byte[] payload) { ByteBuffer message = ByteBuffer.wrap(payload); byte[] encodedMsg = new byte[message.capacity() - OPCODE_SIZE]; byte opCode = message.get(); if (opCode == LifecycleMessage.LIFECYCLE_MSG_OP_CODE) { message.get(encodedMsg, 0, encodedMsg.length); EhcacheEntityMessage entityMessage = (EhcacheEntityMessage) Util.unmarshall(encodedMsg); return entityMessage; } else { throw new IllegalArgumentException("LifeCycleMessage operation not defined for : " + opCode); } }
Source:
public static void registerEndpoints(AppConfiguration cfg) { Beans beans = new Beans(cfg.websitePath()); ResponseTransformer transformer = beans.getResponseTransformer(); registerPostHandler("/begin", openTransaction(beans), transformer); registerPostHandler("/publish", addFiles(beans), transformer); registerPostHandler("/commit", commitTransaction(beans), transformer); registerPostHandler("/CommitManifest", sendManifest(beans), transformer); registerPostHandler("/rollback", rollbackTransaction(beans), transformer); registerGetHandler("/transaction", getTransaction(beans), beans.getResponseTransformer()); registerGetHandler("/contentHash", getContentHash(beans, cfg.isVerifyPublishEnabled()), transformer); registerGetHandler("*", getNotFoundHadler(), transformer); }

Target:
public static void registerEndpoints(AppConfiguration cfg) { Beans beans = new Beans(cfg.websitePath()); ResponseTransformer transformer = beans.getResponseTransformer(); registerPostHandler("/begin", openTransaction(beans), transformer); registerPostHandler("/publish", addFiles(beans), transformer); registerPostHandler("/commit", commitTransaction(beans), transformer); registerPostHandler("/CommitManifest", sendManifest(beans), transformer); registerPostHandler("/rollback", rollbackTransaction(beans), transformer); registerGetHandler("/transaction", getTransaction(beans), transformer); registerGetHandler("/contentHash", getContentHash(beans, cfg.isVerifyPublishEnabled()), transformer); registerGetHandler("*", getNotFoundHandler(), transformer); }
Source:
private Set<Object> collectParentTestInstances(final ExtensionContext context) { Set<Object> testInstances = new LinkedHashSet<>(); Optional<ExtensionContext> current = Optional.of(context); while (current.isPresent()) { ExtensionContext ctx = current.get(); List<Object> contextTestInstances = ctx.getTestInstances() .map(TestInstances::getAllInstances) .orElseGet(Collections::emptyList); for (int i = contextTestInstances.size() - 1; i >= 0; --i) { testInstances.add(contextTestInstances.get(i)); } current = ctx.getParent(); } return testInstances; }

Target:
private Set<Object> collectParentTestInstances(final ExtensionContext context) { List<Object> allInstances = new ArrayList<>(context.getRequiredTestInstances().getAllInstances()); Collections.reverse(allInstances); return new LinkedHashSet<>(allInstances); }
Source:
public TmfConstantTransform(@NonNull ITmfTimestamp offset) { fOffset = offset.getValue(); }

Target:
public TmfConstantTransform(@NonNull ITmfTimestamp offset) { this(new TmfNanoTimestamp(offset).getValue()); }
Source:
public void controller(FragmentConfiguration config) throws Exception { if (config.getAttribute("conceptSet") != null) { List < Map < String, Object >> options = (List<Map<String, Object>>) config.getAttribute("options"); if (options == null) { options = new ArrayList < Map < String, Object >> (); } String conceptSetUuid = (String) config.getAttribute("conceptSet"); Concept conceptSet = Context.getConceptService().getConceptByUuid(conceptSetUuid); for (Concept concept: conceptSet.getSetMembers()) { Map < String, Object > option = new HashMap < String, Object > (); option = new HashMap < String, Object > (); option.put("value", concept.getId().toString()); option.put(OPTION_LABEL, concept.getName(Context.getUserContext().getLocale()).getName()); options.add(option); } Collections.sort(options, mapComparator); config.addAttribute("options", options); } }

Target:
public void controller(FragmentConfiguration config) throws Exception { if (config.getAttribute("conceptSet") != null) { List < Map < String, Object >> options = (List<Map<String, Object>>) config.getAttribute("options"); if (options == null) { options = new ArrayList < Map < String, Object >> (); } String conceptSetUuid = (String) config.getAttribute("conceptSet"); Concept conceptSet = Context.getConceptService().getConceptByUuid(conceptSetUuid); for (Concept concept: conceptSet.getSetMembers()) { Map < String, Object > option = new HashMap < String, Object > (); option = new HashMap < String, Object > (); option.put("value", concept.getId().toString()); option.put(OPTION_LABEL, concept.getName(Context.getUserContext().getLocale()).getName()); options.add(option); } Collections.sort(options, new Comparator<Map<String, Object>>() { public int compare(Map<String, Object> m1, Map<String, Object> m2) { return ((String) m1.get(OPTION_LABEL)).compareTo((String) m2.get(OPTION_LABEL)); } }); config.addAttribute("options", options); } }
Source:
void property(Property prop) { boolean depr = prop.isDeprecated(); doc.print("| <a name=\"" + prop.getKey().replace(".", "_") + "\" class=\"prop\"></a> " + prop.getKey() + " | "); doc.print((depr ? "**Deprecated.** " : "") + strike(sanitize(prop.getDescription()), depr) + "<br>"); doc.print(strike("**type:** " + prop.getType().name(), depr) + ", "); doc.print(strike("**zk mutable:** " + isZooKeeperMutable(prop), depr) + ", "); String defaultValue = sanitize(prop.getRawDefaultValue()).trim(); if (defaultValue.length() == 0) { defaultValue = strike("**default value:** empty", depr); } else if (defaultValue.contains("\n")) { defaultValue = strike("**default value:** ", depr) + "\n```\n" + defaultValue + "\n```\n"; } else { if (prop.getType() == PropertyType.CLASSNAME && defaultValue.startsWith("org.apache.accumulo.core")) { defaultValue = strike("**default value:** " + "{% jlink -f " + defaultValue + " %}", depr); } else { defaultValue = strike("**default value:** " + "`" + defaultValue + "`", depr); } } doc.println(defaultValue + " |"); }

Target:
void property(Property prop) { boolean depr = prop.isDeprecated(); doc.print("| <a name=\"" + prop.getKey().replace(".", "_") + "\" class=\"prop\"></a> " + prop.getKey() + " | "); doc.print((depr ? "**Deprecated.** " : "") + strike(sanitize(prop.getDescription()), depr) + "<br>"); doc.print(strike("**type:** " + prop.getType().name(), depr) + ", "); doc.print(strike("**zk mutable:** " + isZooKeeperMutable(prop), depr) + ", "); String defaultValue = sanitize(prop.getRawDefaultValue()).trim(); if (defaultValue.length() == 0) { defaultValue = strike("**default value:** empty", depr); } else if (defaultValue.contains("\n")) { defaultValue = strike("**default value:** ", depr) + "\n```\n" + defaultValue + "\n```\n"; } else { if (prop.getType() == PropertyType.CLASSNAME && defaultValue.startsWith("org.apache.accumulo")) { defaultValue = strike("**default value:** " + "{% jlink -f " + defaultValue + " %}", depr); } else { defaultValue = strike("**default value:** " + "`" + defaultValue + "`", depr); } } doc.println(defaultValue + " |"); }
Source:
public void applyChunk(JSONObject sech) throws UnknownHttpResponseException { parseDict(_run("applyChunk", sech)); }

Target:
public void applyChunk(JSONObject sech) throws UnknownHttpResponseException { _run("applyChunk", sech); }
Source:
private static void configureHttpProxy() throws MalformedURLException { for (String protocol : new String[] { "http", "https" }) { final String s = System.getenv(protocol + "_proxy"); if (s == null || s.equals("")) return; final URL u = new URL( (s.indexOf("://") == -1) ? protocol + "://" + s : s); if (!protocol.equals(u.getProtocol())) throw new MalformedURLException(MessageFormat.format( CLIText.get().invalidHttpProxyOnlyHttpSupported, s)); final String proxyHost = u.getHost(); final int proxyPort = u.getPort(); System.setProperty(protocol + ".proxyHost", proxyHost); if (proxyPort > 0) System.setProperty(protocol + ".proxyPort", String.valueOf(proxyPort)); final String userpass = u.getUserInfo(); if (userpass != null && userpass.contains(":")) { final int c = userpass.indexOf(':'); final String user = userpass.substring(0, c); final String pass = userpass.substring(c + 1); CachedAuthenticator.add( new CachedAuthenticator.CachedAuthentication(proxyHost, proxyPort, user, pass)); } } }

Target:
private static void configureHttpProxy() throws MalformedURLException { for (String protocol : new String[] { "http", "https" }) { final String s = System.getenv(protocol + "_proxy"); if (s == null || s.equals("")) return; final URL u = new URL( (s.indexOf("://") == -1) ? protocol + "://" + s : s); if (!u.getProtocol().startsWith("http")) throw new MalformedURLException(MessageFormat.format( CLIText.get().invalidHttpProxyOnlyHttpSupported, s)); final String proxyHost = u.getHost(); final int proxyPort = u.getPort(); System.setProperty(protocol + ".proxyHost", proxyHost); if (proxyPort > 0) System.setProperty(protocol + ".proxyPort", String.valueOf(proxyPort)); final String userpass = u.getUserInfo(); if (userpass != null && userpass.contains(":")) { final int c = userpass.indexOf(':'); final String user = userpass.substring(0, c); final String pass = userpass.substring(c + 1); CachedAuthenticator.add( new CachedAuthenticator.CachedAuthentication(proxyHost, proxyPort, user, pass)); } } }
Source:
public GeoEntry createGeoEntry(final String line, String entryResource) { final String[] fields = line.split("\\t", -1); Optional<CountryCode> optionalCountryCode = isoStandard .getStandardEntries() .stream() .filter(c -> c.getAsFormat("alpha2").equals(fields[8])) .findFirst(); String countryCode = fields[8]; if (optionalCountryCode.isPresent()) { countryCode = optionalCountryCode.get().getAsFormat("alpha3"); } return new GeoEntry.Builder() .name(fields[1]) .latitude(Double.parseDouble(fields[4])) .longitude(Double.parseDouble(fields[5])) .featureCode(fields[7]) .population(Long.parseLong(fields[14])) .alternateNames(fields[3]) .countryCode(countryCode) .importLocation(entryResource) .build(); }

Target:
public GeoEntry createGeoEntry(final String line, String entryResource) { final String[] fields = line.split("\\t", -1); final String countryCodeAlpha2 = fields[8]; String countryCodeAlpha3 = isoStandard .getStandardEntries() .stream() .filter(c -> c.getAsFormat("alpha2").equals(countryCodeAlpha2)) .findFirst() .map(cc -> cc.getAsFormat("alpha3")) .orElse(countryCodeAlpha2); return new GeoEntry.Builder() .name(fields[1]) .latitude(Double.parseDouble(fields[4])) .longitude(Double.parseDouble(fields[5])) .featureCode(fields[7]) .population(Long.parseLong(fields[14])) .alternateNames(fields[3]) .countryCode(countryCodeAlpha3) .importLocation(entryResource) .build(); }
Source:
protected File computeCorruptedFileDumpDir(File persistDir, DataSchema schema) { return new File( persistDir.getAbsolutePath() .replace(schema.getDataSource(), "corrupted/" + schema.getDataSource()) ); }

Target:
protected File computeCorruptedFileDumpDir(File persistDir, DataSchema schema) { return new File( persistDir.getAbsolutePath() .replace(schema.getDataSource(), "corrupted" + File.pathSeparator + schema.getDataSource()) ); }
Source:
public PersistedCassandraFrameworkConfiguration( @NotNull final State state, @NotNull final String frameworkName, @NotNull final CassandraFrameworkProtos.CassandraConfigRole defaultConfigRole, final long healthCheckIntervalSeconds, final long bootstrapGraceTimeSec ) { super( "CassandraFrameworkConfiguration", state, new Supplier<CassandraFrameworkConfiguration>() { @Override public CassandraFrameworkConfiguration get() { return CassandraFrameworkConfiguration.newBuilder() .setFrameworkName(frameworkName) .setDefaultConfigRole(defaultConfigRole) .setHealthCheckIntervalSeconds(healthCheckIntervalSeconds) .setBootstrapGraceTimeSeconds(bootstrapGraceTimeSec) .build(); } }, new Function<byte[], CassandraFrameworkConfiguration>() { @Override public CassandraFrameworkConfiguration apply(final byte[] input) { try { return CassandraFrameworkConfiguration.parseFrom(input); } catch (InvalidProtocolBufferException e) { throw new ProtoUtils.RuntimeInvalidProtocolBufferException(e); } } }, new Function<CassandraFrameworkConfiguration, byte[]>() { @Override public byte[] apply(final CassandraFrameworkConfiguration input) { return input.toByteArray(); } } ); }

Target:
public PersistedCassandraFrameworkConfiguration( @NotNull final State state, @NotNull final String frameworkName, @NotNull final CassandraFrameworkProtos.CassandraConfigRole defaultConfigRole, final long healthCheckIntervalSeconds, final long bootstrapGraceTimeSec ) { super( "CassandraFrameworkConfiguration", state, new Supplier<CassandraFrameworkConfiguration>() { @Override public CassandraFrameworkConfiguration get() { return CassandraFrameworkConfiguration.newBuilder() .setFrameworkName(frameworkName) .setDefaultConfigRole(fillConfigRoleGaps(defaultConfigRole)) .setHealthCheckIntervalSeconds(healthCheckIntervalSeconds) .setBootstrapGraceTimeSeconds(bootstrapGraceTimeSec) .build(); } }, new Function<byte[], CassandraFrameworkConfiguration>() { @Override public CassandraFrameworkConfiguration apply(final byte[] input) { try { return CassandraFrameworkConfiguration.parseFrom(input); } catch (InvalidProtocolBufferException e) { throw new ProtoUtils.RuntimeInvalidProtocolBufferException(e); } } }, new Function<CassandraFrameworkConfiguration, byte[]>() { @Override public byte[] apply(final CassandraFrameworkConfiguration input) { return input.toByteArray(); } } ); }
Source:
public String getSessionIdBySeqId(long sessionSequenceId) { return findFirstSessionByData(sessionSequenceId, ENGINE_SESSION_SEQ_ID); }

Target:
public String getSessionIdBySeqId(long sessionSequenceId) { String sessionId = null; for (SessionInfo sessionInfo : sessionInfoMap.values()) { if (sessionInfo.contentOfSession.get(ENGINE_SESSION_SEQ_ID) == sessionSequenceId) { sessionId = (String) sessionInfo.contentOfSession.get(ENGINE_SESSION_ID); break; } } return sessionId; }
Source:
public MarketHistory(Market m) { super(); this.m = market; history = new HashMap<String, List<Double>>(); }

Target:
public MarketHistory(Market m) { super(); this.market = m; history = new HashMap<String, List<Double>>(); }
Source:
public void testDomainWithEnoughSpaceForRequest() { validator = new StorageDomainValidator(mockStorageDomain(16, 748, StorageType.NFS)); assertTrue("Domain should have more space then threshold", validator.isDomainWithinThresholds().isValid()); }

Target:
public void testDomainWithEnoughSpaceForRequest() { validator = new StorageDomainValidator(mockStorageDomain(16, 748, StorageType.NFS)); assertTrue("Domain should have more space then threshold", validator.isDomainHasSpaceForRequest(10).isValid()); }
Source:
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiPowerJunction.TEXTURE); int j = guiLeft; int k = guiTop; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); int level = 100 - junction.getChargeState(); drawTexturedModalRect(j + 10, k + 11 + (level * 59 / 100), 176, level * 59 / 100, 5, 59 - (level * 59 / 100)); mc.fontRenderer.drawString(StringUtils.translate(GuiPowerJunction.PREFIX + "LogisticsPowerJunction"), guiLeft + 30, guiTop + 8, 0x404040); mc.fontRenderer.drawString(StringUtils.translate(GuiPowerJunction.PREFIX + "StoredEnergy") + ":", guiLeft + 40, guiTop + 23, 0x404040); mc.fontRenderer.drawString(StringUtils.getStringWithSpacesFromInteger(junction.getPowerLevel()) + " LP", guiLeft + 40, guiTop + 33, 0x404040); mc.fontRenderer.drawString("/ " + StringUtils.getStringWithSpacesFromInteger(LogisticsPowerJunctionTileEntity.MAX_STORAGE) + " LP", guiLeft + 40, guiTop + 43, 0x404040); mc.fontRenderer.drawString("2 MJ = 5 EU = 20 RF = 10 LP", guiLeft + 24, guiTop + 58, 0x404040); }

Target:
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiPowerJunction.TEXTURE); int j = guiLeft; int k = guiTop; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); int level = 100 - junction.getChargeState(); drawTexturedModalRect(j + 10, k + 11 + (level * 59 / 100), 176, level * 59 / 100, 5, 59 - (level * 59 / 100)); mc.fontRenderer.drawString(StringUtils.translate(GuiPowerJunction.PREFIX + "LogisticsPowerJunction"), guiLeft + 30, guiTop + 8, 0x404040); mc.fontRenderer.drawString(StringUtils.translate(GuiPowerJunction.PREFIX + "StoredEnergy") + ":", guiLeft + 40, guiTop + 23, 0x404040); mc.fontRenderer.drawString(StringUtils.getStringWithSpacesFromInteger(junction.getPowerLevel()) + " LP", guiLeft + 40, guiTop + 33, 0x404040); mc.fontRenderer.drawString("/ " + StringUtils.getStringWithSpacesFromInteger(LogisticsPowerJunctionTileEntity.MAX_STORAGE) + " LP", guiLeft + 40, guiTop + 43, 0x404040); mc.fontRenderer.drawString("1 MJ = 5 LP", guiLeft + 30, guiTop + 58, 0x404040); mc.fontRenderer.drawString("1 EU = 2 LP", guiLeft + 100, guiTop + 58, 0x404040); mc.fontRenderer.drawString("10 RF = 5 LP", guiLeft + 24, guiTop + 68, 0x404040); }
Source:
public ConsistencyLevel getDefaultConsistencyLevel() { if (this.cachedConsistencyLevel == null) { ConsistencyLevel result = ConsistencyPolicy.DEFAULT_DEFAULT_CONSISTENCY_LEVEL; String consistencyLevelString = super.getString(Constants.Properties.DEFAULT_CONSISTENCY_LEVEL); try { result = ConsistencyLevel .valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, consistencyLevelString)); } catch (IllegalArgumentException e) { this.getLogger().warn("Unknown consistency level {}, value ignored.", consistencyLevelString); } this.cachedConsistencyLevel = result; } return cachedConsistencyLevel; }

Target:
public ConsistencyLevel getDefaultConsistencyLevel() { if (this.consistencyLevel == null) { ConsistencyLevel result = ConsistencyPolicy.DEFAULT_DEFAULT_CONSISTENCY_LEVEL; String consistencyLevelString = super.getString(Constants.Properties.DEFAULT_CONSISTENCY_LEVEL); try { result = BridgeInternal.fromServiceSerializedFormat(consistencyLevelString); } catch (IllegalArgumentException e) { this.getLogger().warn("Unknown consistency level {}, value ignored.", consistencyLevelString); } this.consistencyLevel = result; } return consistencyLevel; }
Source:
private static boolean isUserInBed(final long startMillis, final long endMillis, final List<AmplitudeData> alignedMotion){ if(endMillis - startMillis <= ACCEPTABLE_QUIET_PERIOD_MILLIS) { return true; } int motionCount = 0; int quietLength = 0; int maxQuietLength = 0; for(int i = 0; i< alignedMotion.size(); i++) { final AmplitudeData motion = alignedMotion.get(i); if(motion.timestamp >= startMillis + 10 * DateTimeConstants.MILLIS_PER_MINUTE && motion.timestamp <= endMillis - 10 * DateTimeConstants.MILLIS_PER_MINUTE) { if(motion.amplitude > 0) { motionCount += 1; quietLength = 0; }else{ quietLength++; if(quietLength > maxQuietLength){ maxQuietLength = quietLength; } } } } if(maxQuietLength > 90) { if (motionCount / (double) maxQuietLength <= 1d / 90) { return false; } } return true; }

Target:
private static boolean isUserInBed(final long startMillis, final long endMillis, final List<AmplitudeData> alignedMotion){ if(endMillis - startMillis <= ACCEPTABLE_QUIET_PERIOD_MILLIS) { return true; } int motionCount = 0; int quietLength = 0; int maxQuietLength = 0; for(int i = 0; i< alignedMotion.size(); i++) { final AmplitudeData motion = alignedMotion.get(i); if(motion.timestamp >= startMillis + 10 * DateTimeConstants.MILLIS_PER_MINUTE && motion.timestamp <= endMillis - 10 * DateTimeConstants.MILLIS_PER_MINUTE) { if(motion.amplitude > 0) { motionCount += 1; quietLength = 0; }else{ quietLength++; if(quietLength > maxQuietLength){ maxQuietLength = quietLength; } } } } if(maxQuietLength > ACCEPTABLE_MAX_QUIET_PERIOD_MILLIS) { if (motionCount / (double) maxQuietLength <= 1d / ACCEPTABLE_MAX_QUIET_PERIOD_MILLIS) { return false; } } return true; }
Source:
public IdeGeneralPreferencesPresenter( IdeGeneralPreferencesView view, CoreLocalizationConstant constant, ThemeAgent themeAgent, PreferencesManager preferencesManager) { super(constant.generalTitle(), constant.generalCategory()); this.view = view; this.themeAgent = themeAgent; this.preferencesManager = preferencesManager; view.setDelegate(this); revertChanges(); }

Target:
public IdeGeneralPreferencesPresenter( IdeGeneralPreferencesView view, CoreLocalizationConstant constant, ThemeAgent themeAgent, PreferencesManager preferencesManager) { super(constant.generalTitle(), constant.generalCategory()); this.view = view; this.themeAgent = themeAgent; this.preferencesManager = preferencesManager; view.setDelegate(this); themeId = getStoredThemeId(); isAskBeforeClosingTab = getStoredAskBeforeClosingTab(); }
Source:
public static AutoCompletionCandidates autoComplete(@Nullable String label) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Set<Label> labels = Jenkins.get().getLabels(); List<String> queries = new AutoCompleteSeeder(label).getSeeds(); for (String term : queries) { for (Label l : labels) { if (l.getName().startsWith(term)) { c.add(l.getName()); } } } return c; }

Target:
public static AutoCompletionCandidates autoComplete(@Nullable String label) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Set<Label> labels = Jenkins.get().getLabels(); List<String> queries = new LabelAutoCompleteSeeder(Util.fixNull(label)).getSeeds(); for (String term : queries) { for (Label l : labels) { if (l.getName().startsWith(term)) { c.add(l.getName()); } } } return c; }
Source:
private static void checkIfSessionIsAssociatedWithProject(SessionId sessionId, ProjectId projectId) throws AccessControlException { final EList<Adapter> eAdapters = sessionId.eAdapters(); for (final Adapter adapter : eAdapters) { if (ShareProjectAdapter.class.isInstance(adapter)) { final ShareProjectAdapter shareAdapter = (ShareProjectAdapter) adapter; final boolean didRemove = shareAdapter.removeProject(projectId); if (!didRemove) { throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } return; } } throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); }

Target:
private static void checkIfSessionIsAssociatedWithProject(SessionId sessionId, ProjectId projectId) throws AccessControlException { final EList<Adapter> eAdapters = sessionId.eAdapters(); for (final Adapter adapter : eAdapters) { if (ShareProjectAdapter.class.isInstance(adapter)) { final ShareProjectAdapter shareAdapter = (ShareProjectAdapter) adapter; final boolean didRemove = shareAdapter.removeProject(projectId); if (didRemove) { return; } throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } } throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); }
Source:
public void testMarshallDateObject() { String expectedString = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<date-object>\n" + " <localDate>2017-01-01</localDate>\n" + " <localDateTime>2017-01-01T10:10:10</localDateTime>\n" + " <localTime>10:10:10</localTime>\n" + "</date-object>\n"; Set<Class<?>> extraClasses = new HashSet<Class<?>>(); extraClasses.add(DateObject.class); Marshaller marshaller = MarshallerFactory.getMarshaller( extraClasses, MarshallingFormat.JAXB, getClass().getClassLoader() ); DateObject dateObject = new DateObject(); dateObject.setLocalDate( LocalDate.parse( "2017-01-01" ) ); dateObject.setLocalDateTime( LocalDateTime.parse("2017-01-01T10:10:10") ); dateObject.setLocalTime( LocalTime.parse( "10:10:10" ) ); String dateObjectString = marshaller.marshall( dateObject ); assertNotNull( dateObjectString ); assertEquals( expectedString, dateObjectString ); }

Target:
public void testMarshallDateObject() { String expectedString = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<date-object>\n" + " <localDate>2017-01-01</localDate>\n" + " <localDateTime>2017-01-01T10:10:10</localDateTime>\n" + " <localTime>10:10:10</localTime>\n" + " <offsetDateTime>2017-01-01T10:10:10+01:00</offsetDateTime>\n" + "</date-object>\n"; Set<Class<?>> extraClasses = new HashSet<Class<?>>(); extraClasses.add(DateObject.class); Marshaller marshaller = MarshallerFactory.getMarshaller( extraClasses, MarshallingFormat.JAXB, getClass().getClassLoader() ); DateObject dateObject = new DateObject(); dateObject.setLocalDate( LocalDate.of( 2017, 1, 1 ) ); dateObject.setLocalDateTime( LocalDateTime.of( 2017, 1, 1, 10, 10, 10 ) ); dateObject.setLocalTime( LocalTime.of( 10, 10, 10 ) ); dateObject.setOffsetDateTime( OffsetDateTime.of( LocalDateTime.of( 2017, 1, 1, 10, 10, 10 ), ZoneOffset.ofHours( 1 ) ) ); String dateObjectString = marshaller.marshall( dateObject ); assertNotNull( dateObjectString ); assertEquals( expectedString, dateObjectString ); }
Source:
@Override public <T> T serviceProxy(ClusterGroup prj, String name, Class<? super T> srvcCls, boolean sticky, long timeout) throws IgniteException { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE); if (hasLocalNode(prj)) { ServiceContextImpl ctx = serviceContext(name); if (ctx != null) { Service svc = ctx.service(); if (svc != null) { if (srvcCls.isAssignableFrom(svc.getClass())) return (T)svc; else if (!PlatformService.class.isAssignableFrom(svc.getClass())) throw new IgniteException("Service does not implement specified interface [svcItf=" + srvcCls.getName() + ", svcCls=" + svc.getClass().getName() + ']'); } } } return new GridServiceProxy<T>(prj, name, srvcCls, sticky, timeout, ctx).proxy(); }

Target:
@Override public <T> T serviceProxy(ClusterGroup prj, String name, Class<? super T> srvcCls, boolean sticky, long timeout) throws IgniteException { ctx.security().authorize(name, SecurityPermission.SERVICE_INVOKE); if (hasLocalNode(prj)) { ServiceContextImpl ctx = serviceContext(name); if (ctx != null) { Service svc = ctx.service(); if (svc != null) { if (srvcCls.isAssignableFrom(svc.getClass())) return (T)svc; else if (!PlatformService.class.isAssignableFrom(svc.getClass())) { throw new IgniteException("Service does not implement specified interface [svcItf=" + srvcCls.getName() + ", svcCls=" + svc.getClass().getName() + ']'); } } } } return new GridServiceProxy<T>(prj, name, srvcCls, sticky, timeout, ctx).proxy(); }
Source:
public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); if (processType == null) { return ExecutionResult.NOTHING_TO_DO; } List<String> impactedComponents = Arrays.asList("tFileOutputParquet", "tHiveOutput", "tRedshiftOutput", "tSqlRow", "tMatchPairing", "tMatchPredict", "tMatchModel", "tDataShuffling"); IComponentConversion AdaptSchemaForDateType = new AdaptSchemaForDateType(); try { for (String componentName : impactedComponents) { ModifyComponentsAction.searchAndModify(item, processType, new NameComponentFilter(componentName), Arrays.<IComponentConversion> asList(AdaptSchemaForDateType)); } return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { return ExecutionResult.FAILURE; } }

Target:
public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); if (processType == null) { return ExecutionResult.NOTHING_TO_DO; } IComponentConversion adaptSchemaForDateType = new AdaptSchemaForDateType(); try { for (String componentName : IMPACTED_COMPONENTS) { ModifyComponentsAction.searchAndModify(item, processType, new NameComponentFilter(componentName), java.util.Collections.singletonList(adaptSchemaForDateType)); } return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } }
Source:
public Object perform(String name, Object obj, ApiRequest request) { if (obj instanceof MachineDriverRecord) { MachineDriverErrorInput machineDriverErrorInput = request.proxyRequestObject(MachineDriverErrorInput.class); if (StringUtils.isNotBlank(machineDriverErrorInput.getErrorMessage())) { DataAccessor.fields(obj).withKey(ERROR_MESSAGE).set(machineDriverErrorInput.getErrorMessage()); ((MachineDriverRecord) obj).setState(CommonStatesConstants.ERROR); } objectManager.persist(obj); return objectManager.reload(obj); } throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "NotMachineDriver"); }

Target:
public Object perform(String name, Object obj, ApiRequest request) { if (obj instanceof MachineDriver) { MachineDriverErrorInput machineDriverErrorInput = request.proxyRequestObject(MachineDriverErrorInput.class); if (StringUtils.isNotBlank(machineDriverErrorInput.getErrorMessage())) { DataAccessor.fields(obj).withKey(ERROR_MESSAGE).set(machineDriverErrorInput.getErrorMessage()); ((MachineDriver) obj).setState(CommonStatesConstants.ERROR); } objectManager.persist(obj); return objectManager.reload(obj); } throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, "NotMachineDriver"); }