auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setEmailProperties(){ email.setEmailTo(props.getProperty("summaryEmail").toString().split(";")); email.setEmailSubject("CHPL - Weekly Summary Statistics Report"); Calendar calendarCounter = Calendar.getInstance(TimeZone.getTimeZone("UTC")); String htmlPreText = "<pre><br>"; String htmlPostText = "</br></pre>"; StringBuilder emailMessage = new StringBuilder(); emailMessage.append(htmlPreText); emailMessage.append("<ul><li>Date: " + calendarCounter.getTime() + "</li>"); emailMessage.append("<li>Total Developers: " + this.totalDevelopers + "</li>"); emailMessage.append("<li>Total Products: " + this.totalProducts + "</li>"); emailMessage.append("<li>Total CPs: " + this.totalCPs + "</li>"); emailMessage.append("<li>Total 2014 CPs: " + this.totalCPs2014 + "</li>"); emailMessage.append("<li>Total 2015 CPs: " + this.totalCPs2015 + "</li>"); emailMessage.append("<li>Total Surveillance Activities: " + this.totalNumSurvActivities + "</li>"); emailMessage.append("<li>Total Open Surveillance Activities: " + this.numOpenSurvActivities + "</li>"); emailMessage.append("<li>Total Closed Surveillance Activities: " + this.numClosedSurvActivities + "</li>"); emailMessage.append("<li>Total Non-conformities: " + this.totalNumNonConformities + "</li>"); emailMessage.append("<li>Total Open Non-conformities: " + this.numOpenNonConformities + "</li>"); emailMessage.append("<li>Total Closed Non-conformities: " + this.numClosedNonConformities + "</li></ul>"); emailMessage.append(htmlPostText); email.setEmailMessage(emailMessage.toString()); email.setProps(props); email.setFiles(files); }

Target:
public void setEmailProperties(){ email.setEmailTo(props.getProperty("summaryEmail").toString().split(";")); email.setEmailSubject("CHPL - Weekly Summary Statistics Report"); Calendar calendarCounter = Calendar.getInstance(TimeZone.getTimeZone("UTC")); StringBuilder emailMessage = new StringBuilder(); emailMessage.append("<ul><li>Date: " + calendarCounter.getTime() + "</li>"); emailMessage.append("<li>Total Developers: " + this.totalDevelopers + "</li>"); emailMessage.append("<li>Total Products: " + this.totalProducts + "</li>"); emailMessage.append("<li>Total CPs: " + this.totalCPs + "</li>"); emailMessage.append("<li>Total 2014 CPs: " + this.totalCPs2014 + "</li>"); emailMessage.append("<li>Total 2015 CPs: " + this.totalCPs2015 + "</li>"); emailMessage.append("<li>Total Surveillance Activities: " + this.totalNumSurvActivities + "</li>"); emailMessage.append("<li>Total Open Surveillance Activities: " + this.numOpenSurvActivities + "</li>"); emailMessage.append("<li>Total Closed Surveillance Activities: " + this.numClosedSurvActivities + "</li>"); emailMessage.append("<li>Total Non-conformities: " + this.totalNumNonConformities + "</li>"); emailMessage.append("<li>Total Open Non-conformities: " + this.numOpenNonConformities + "</li>"); emailMessage.append("<li>Total Closed Non-conformities: " + this.numClosedNonConformities + "</li></ul>"); email.setEmailMessage(emailMessage.toString()); email.setProps(props); email.setFiles(files); }
Source:
public void testSync10() throws Exception { try { Path sourcePath = new Path(dfs.getWorkingDirectory(), "source"); initData10(sourcePath); dfs.allowSnapshot(sourcePath); dfs.createSnapshot(sourcePath, "s1"); generateFilterFile("/tmp", "filters.txt"); final DistCpOptions.Builder builder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withFiltersFile("/tmp/filters.txt") .withSyncFolder(true); new DistCp(conf, builder.build()).execute(); dfs.allowSnapshot(target); dfs.createSnapshot(target, "s1"); changeData10(sourcePath); dfs.createSnapshot(sourcePath, "s2"); final DistCpOptions.Builder diffBuilder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withUseDiff("s1", "s2") .withFiltersFile("/tmp/filters.txt") .withSyncFolder(true); new DistCp(conf, diffBuilder.build()).execute(); verifyCopy(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false); } finally { deleteFilterFile("/tmp", "filters.txt"); } }

Target:
public void testSync10() throws Exception { java.nio.file.Path filterFile = null; try { Path sourcePath = new Path(dfs.getWorkingDirectory(), "source"); initData10(sourcePath); dfs.allowSnapshot(sourcePath); dfs.createSnapshot(sourcePath, "s1"); filterFile = generateFilterFile("filters"); final DistCpOptions.Builder builder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withFiltersFile(filterFile.toString()) .withSyncFolder(true); new DistCp(conf, builder.build()).execute(); verifySync(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false, ".staging"); dfs.allowSnapshot(target); dfs.createSnapshot(target, "s1"); changeData10(sourcePath); dfs.createSnapshot(sourcePath, "s2"); final DistCpOptions.Builder diffBuilder = new DistCpOptions.Builder( new ArrayList<>(Arrays.asList(sourcePath)), target) .withUseDiff("s1", "s2") .withFiltersFile(filterFile.toString()) .withSyncFolder(true); new DistCp(conf, diffBuilder.build()).execute(); verifyCopy(dfs.getFileStatus(sourcePath), dfs.getFileStatus(target), false); } finally { deleteFilterFile(filterFile); } }
Source:
private static String getTimeZone(VM vm) { String retVal; String timeZone = null; if (vm.getVmInit() != null && StringUtils.isNotEmpty(vm.getVmInit().getTimeZone())) { timeZone = vm.getVmInit().getTimeZone(); } else { timeZone = Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone); } if (osRepository.isTimezoneValueInteger(vm.getStaticData(). getOsId(), null)) { retVal = getTimezoneIndexByKey(timeZone); } else { retVal = timeZone; } return retVal; }

Target:
private static String getTimeZone(VM vm) { String timeZone = null; if (vm.getVmInit() != null && StringUtils.isNotEmpty(vm.getVmInit().getTimeZone())) { timeZone = vm.getVmInit().getTimeZone(); } else { timeZone = Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone); } if (osRepository.isTimezoneValueInteger(vm.getStaticData(). getOsId(), null)) { return getTimezoneIndexByKey(timeZone); } return timeZone; }
Source:
void testGetMissingConfigThrowsException() throws Exception { final String key = "foo.bar.baz"; BrooklynProperties properties = ((ManagementContextInternal)getManagementContext()).getBrooklynProperties(); Object existingValue = null; boolean keyAlreadyPresent = false; String response = null; if (properties.containsKey(key)) { existingValue = properties.remove(key); keyAlreadyPresent = true; } try { response = client().resource("/v1/server/config/" + key).get(String.class); } catch (UniformInterfaceException e) { assertEquals(e.getResponse().getStatus(), 204); return; } finally { if (keyAlreadyPresent) { properties.put(key, existingValue); } } Asserts.fail("Expected call to /v1/server/config/" + key + " to fail with status 404, instead server returned " + response); }

Target:
void testGetMissingConfigThrowsException() throws Exception { final String key = "foo.bar.baz"; BrooklynProperties properties = ((ManagementContextInternal)getManagementContext()).getBrooklynProperties(); Object existingValue = null; boolean keyAlreadyPresent = false; String response = null; if (properties.containsKey(key)) { existingValue = properties.remove(key); keyAlreadyPresent = true; } try { response = client().resource("/v1/server/config/" + key).get(String.class); Asserts.fail("Expected call to /v1/server/config/" + key + " to fail with status 404, instead server returned " + response); } catch (UniformInterfaceException e) { assertEquals(e.getResponse().getStatus(), 204); } finally { if (keyAlreadyPresent) { properties.put(key, existingValue); } } }
Source:
public abstract void scanForRepoChanges() throws IOException; public static String shortenRefName(String refName) { if (refName.startsWith(Constants.R_HEADS)) return refName.substring(Constants.R_HEADS.length()); if (refName.startsWith(Constants.R_TAGS)) return refName.substring(Constants.R_TAGS.length()); if (refName.startsWith(Constants.R_REMOTES)) return refName.substring(Constants.R_REMOTES.length()); if (refName.startsWith(Constants.R_NOTES)) return refName.substring(Constants.R_NOTES.length()); return refName; }

Target:
public abstract void scanForRepoChanges() throws IOException; public static String shortenRefName(String refName) { if (refName.startsWith(Constants.R_HEADS)) return refName.substring(Constants.R_HEADS.length()); if (refName.startsWith(Constants.R_TAGS)) return refName.substring(Constants.R_TAGS.length()); if (refName.startsWith(Constants.R_REMOTES)) return refName.substring(Constants.R_REMOTES.length()); return refName; }
Source:
public static boolean isValidSingleVersion( final String version ) { boolean result = true; if ( version == null || version.trim().length() < 1 ) { result = false; } try { SingleVersion singleVersion = new VersionParser( version ).single(); } catch ( final ParseException e ) { result = false; } catch ( final TokenMgrError e ) { result = false; } return result; }

Target:
public static boolean isValidSingleVersion( final String version ) { boolean result = true; if ( version == null || version.trim().length() < 1 ) { return false; } try { SingleVersion singleVersion = new VersionParser( version ).single(); } catch ( final ParseException e ) { result = false; } catch ( final TokenMgrError e ) { result = false; } return result; }
Source:
public SynapseJsonPath(String jsonPathExpression) throws JaxenException { super(jsonPathExpression, SynapsePath.JSON_PATH, log); EIPUtils.setJsonPathConfiguration(); this.contentAware = true; Pattern fullPattern = Pattern.compile(JSON_PATH_WITH_PROP_REGEX); Matcher fullMatcher = fullPattern.matcher(jsonPathExpression); if (fullMatcher.matches()) { Pattern extractProp = Pattern.compile(EXTRACT_PROP_REGEX); Matcher extractPropMatcher = extractProp.matcher(jsonPathExpression); if (extractPropMatcher.find()) { propertyExpression = extractPropMatcher.group(0); expression = "$" + jsonPathExpression.substring(propertyExpression.length()); } } else { this.expression = jsonPathExpression; } if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } jsonPath = JsonPath.compile(expression); if ("$".equals(jsonPath.getPath().trim()) || "$.".equals(jsonPath.getPath().trim())) { isWholeBody = true; } if (InlineExpressionUtil.checkForInlineExpressions(expression)) { isJSONPathNeedsProcessing = true; } this.setPathType(SynapsePath.JSON_PATH); }

Target:
public SynapseJsonPath(String jsonPathExpression) throws JaxenException { super(jsonPathExpression, SynapsePath.JSON_PATH, log); EIPUtils.setJsonPathConfiguration(); this.contentAware = true; if (jsonPathExpression.startsWith("$ctx:") || jsonPathExpression.startsWith("$trp:") || jsonPathExpression.startsWith("$axis2:")) { Pattern extractProp = Pattern.compile(EXTRACT_PROP_REGEX); Matcher extractPropMatcher = extractProp.matcher(jsonPathExpression); if (extractPropMatcher.find()) { propertyExpression = extractPropMatcher.group(0); expression = "$" + jsonPathExpression.substring(propertyExpression.length()); } } else { this.expression = jsonPathExpression; } if (expression.endsWith(".")) { expression = expression.substring(0, expression.length() - 1); } jsonPath = JsonPath.compile(expression); if ("$".equals(jsonPath.getPath().trim()) || "$.".equals(jsonPath.getPath().trim())) { isWholeBody = true; } if (InlineExpressionUtil.checkForInlineExpressions(expression)) { isJSONPathNeedsProcessing = true; } this.setPathType(SynapsePath.JSON_PATH); }
Source:
public void logChunk(String chunk) { Log.d(tag, chunk); }

Target:
public void logChunk(String chunk) { Log.d(getTag(), chunk); }
Source:
public int[] getRawTimingData() { return rawTimingData; }

Target:
public int[] getRawTimingData(){ return Arrays.copyOfRange(rawTimingData, 0, rawTimingData.length); }
Source:
protected boolean checkExistence(String uid) { if (moduleTypeRegistry.get(uid) != null) { logger.error("Module Type with UID \"{}\" already exists! Failed to create a second with the same UID!", uid, new IllegalArgumentException()); return true; } return false; }

Target:
protected boolean checkExistence(String uid) { if (moduleTypeRegistry.get(uid) != null) { return true; } return false; }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VmPool vmPool = getParameters().getVmPool(); String vmPoolName = vmPool != null ? vmPool.getVmPoolName() : StringUtils.EMPTY; jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName); Guid vmTemplateId = getVmTemplateId(); String templateName = getVmTemplateName(); if (StringUtils.isEmpty(templateName)) { templateName = vmTemplateId == null ? StringUtils.EMPTY : vmTemplateId.toString(); } jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), templateName); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VmPool vmPool = getParameters().getVmPool(); String vmPoolName = vmPool == null ? StringUtils.EMPTY : vmPool.getVmPoolName(); jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName); Guid vmTemplateId = getVmTemplateId(); String templateName = getVmTemplateName(); if (StringUtils.isEmpty(templateName)) { templateName = vmTemplateId == null ? StringUtils.EMPTY : vmTemplateId.toString(); } jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), templateName); } return jobProperties; }
Source:
public void testSimultaneousUpdateCustomizedState() { int n = 10; List<Callable<Boolean>> threads = new ArrayList<>(); for (int i = 0; i < n; i++) { threads.add(new TestSimultaneousUpdate()); } Map<String, Boolean> resultMap = TestHelper.startThreadsConcurrently(threads, 1000); Assert.assertEquals(resultMap.size(), n); Boolean[] results = new Boolean[n]; Arrays.fill(results, true); Assert.assertEqualsNoOrder(resultMap.values().toArray(), results); }

Target:
public void testSimultaneousUpdateCustomizedState() { List<Callable<Boolean>> threads = new ArrayList<>(); int threadCount = 10; for (int i = 0; i < threadCount; i++) { threads.add(new TestSimultaneousUpdate()); } Map<String, Boolean> resultMap = TestHelper.startThreadsConcurrently(threads, 1000); Assert.assertEquals(resultMap.size(), threadCount); Boolean[] results = new Boolean[threadCount]; Arrays.fill(results, true); Assert.assertEqualsNoOrder(resultMap.values().toArray(), results); }
Source:
public void test01_ldapOnlyGroupMappings() { test01_ldapOnlyGroupMappings(true); try { Thread.sleep(1000000000); } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
public void test01_ldapOnlyGroupMappings() { test01_ldapOnlyGroupMappings(true); }
Source:
public SearchScope getUseScope() { final PsiElement parent = getParent(); if(parent != null) { if (this instanceof HaxeLocalVarDeclarationPart) { return new LocalSearchScope(parent.getParent()); } else if (this instanceof HaxeLocalVarDeclaration) { return new LocalSearchScope(parent); } } return super.getUseScope(); }

Target:
public SearchScope getUseScope() { final PsiElement localVar = UsefulPsiTreeUtil.getParentOfType(this, HaxeLocalVarDeclaration.class); if(localVar != null) { final PsiElement outerBlock = UsefulPsiTreeUtil.getParentOfType(localVar, HaxeBlockStatement.class); if(outerBlock != null) { return new LocalSearchScope(outerBlock); } } return super.getUseScope(); }
Source:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", new JsonSerdeV2<>(PageViewEvent.class)); OutputStream<KV<String, PageViewCount>> pageViewEventPerMemberStream = graph.getOutputStream("pageViewEventPerMemberStream", KVSerde.of(new StringSerde(), new JsonSerdeV2<>(PageViewCount.class))); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn, null, null) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING), "window") .map(windowPane -> KV.of(windowPane.getKey().getKey(), new PageViewCount(windowPane))) .sendTo(pageViewEventPerMemberStream); }

Target:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", new JsonSerdeV2<>(PageViewEvent.class)); OutputStream<KV<String, PageViewCount>> pageViewEventPerMemberStream = graph.getOutputStream("pageViewEventPerMemberStream", KVSerde.of(new StringSerde(), new JsonSerdeV2<>(PageViewCount.class))); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn, null, null) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING), "tumblingWindow") .map(windowPane -> KV.of(windowPane.getKey().getKey(), new PageViewCount(windowPane))) .sendTo(pageViewEventPerMemberStream); }
Source:
private Metacard getPreviousMetacardWithId(String id, Map<String, Metacard> previousMetacards) { Metacard previous; previous = previousMetacards .entrySet() .stream() .map(e -> e.getValue()) .filter((x) -> x.getId().equals(id)) .findFirst() .orElse(null); return previous; }

Target:
private Metacard getPreviousMetacardWithId(String id, Map<String, Metacard> previousMetacards) { Metacard previous; previous = previousMetacards .entrySet() .stream() .map(Map.Entry::getValue) .filter(x -> x.getId().equals(id)) .findFirst() .orElse(null); if (previous == null) { LOGGER.debug("Cannot locate metacard for update.", id); return null; } return previous; }
Source:
public SmallRyeHealth getHealth() { String emptyChecksStatus = emptyLivenessChecksStatus.equals(DOWN) || emptyReadinessChecksStatus.equals(DOWN) ? DOWN : UP; return getHealth(emptyChecksStatus, healthChecks, livenessChecks, readinessChecks); }

Target:
public SmallRyeHealth getHealth() { String emptyChecksStatus = DOWN.equals(emptyLivenessChecksStatus) || DOWN.equals(emptyReadinessChecksStatus) ? DOWN : UP; return getHealth(emptyChecksStatus, healthChecks, livenessChecks, readinessChecks); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SSOLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; if (req.getSession(false) == null || req.getSession(false).getAttribute(FiltersHelper.Constants.LOGOUT_INPROGRESS) == null) { StringBuffer requestURL = req.getRequestURL(); if (StringUtils.isNotEmpty(req.getQueryString())) { requestURL.append("?").append(req.getQueryString()); } if (!FiltersHelper.isAuthenticated(req) || !FiltersHelper.isSessionValid((HttpServletRequest) request)) { log.debug("Redirecting to {}{}&app_url={}&locale={}", req.getServletContext().getContextPath(), loginUrl, URLEncoder.encode(requestURL.toString(), "UTF-8"), request.getAttribute("locale").toString()); res.sendRedirect(String.format("%s%s&app_url=%s&locale=%s", req.getServletContext().getContextPath(), loginUrl, URLEncoder.encode(requestURL.toString(), "UTF-8"), request.getAttribute("locale").toString())); } else { log.debug("Already logged in, executing next filter in chain."); res.addHeader("OVIRT-SSO-TOKEN", URLEncoder.encode((String) ((HttpServletRequest) request).getSession(true).getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY), "UTF-8")); chain.doFilter(request, response); } } log.debug("Exiting SSOLoginFilter"); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SSOLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; if (req.getSession(false) == null || req.getSession(false).getAttribute(FiltersHelper.Constants.LOGOUT_INPROGRESS) == null) { StringBuffer requestURL = req.getRequestURL(); if (StringUtils.isNotEmpty(req.getQueryString())) { requestURL.append("?").append(req.getQueryString()); } if (!FiltersHelper.isAuthenticated(req) || !FiltersHelper.isSessionValid((HttpServletRequest) request)) { String url = new URLBuilder(String.format("%s%s", req.getServletContext().getContextPath(), loginUrl)) .addParameter("app_url", requestURL.toString()) .addParameter("locale", request.getAttribute("locale").toString()) .build(); log.debug("Redirecting to {}", url); res.sendRedirect(url); } else { log.debug("Already logged in, executing next filter in chain."); res.addHeader("OVIRT-SSO-TOKEN", URLEncoder.encode((String) ((HttpServletRequest) request) .getSession(true) .getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY), "UTF-8")); chain.doFilter(request, response); } } log.debug("Exiting SSOLoginFilter"); }
Source:
public void addCoFeature(final Gff3FeatureImpl coFeature) { if (!parents.equals(coFeature.getParents())) { throw new TribbleException("Co-featrues " + baseData.id + " do not have same parents"); } for (final Gff3FeatureImpl feature : coFeatures) { feature.addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(feature); } addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(this); }

Target:
public void addCoFeature(final Gff3FeatureImpl coFeature) { if (!parents.equals(coFeature.getParents())) { throw new TribbleException("Co-features " + baseData.id + " do not have same parents"); } for (final Gff3FeatureImpl feature : coFeatures) { feature.addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(feature); } addCoFeatureShallow(coFeature); coFeature.addCoFeatureShallow(this); }
Source:
public void onBackPressed(){ patientAdapter.cancelBackgroundTask(); listView.clearFocus(); super.onBackPressed(); if(getCurrentFocus() != null) { System.out.println("Current focusssssssss: " + getCurrentFocus().toString()); } else { System.out.println("Current focusssssssss: null"); } }

Target:
public void onBackPressed(){ patientAdapter.cancelBackgroundTask(); listView.clearFocus(); super.onBackPressed(); }
Source:
protected Map<String, Object> computeInitialOffset( String tableOrQuery, Map<String, Object> partitionOffset, TimeZone timezone) { if (!(partitionOffset == null)) { return partitionOffset; } else { Map<String, Object> initialPartitionOffset = null; Long timestampInitial = config.getLong(JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CONFIG); if (timestampInitial != null) { if (timestampInitial == JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CURRENT) { try (Connection con = cachedConnectionProvider.getConnection()) { Calendar cal = Calendar.getInstance(timezone); timestampInitial = dialect.currentTimeOnDB(con, cal).getTime(); } catch (SQLException e) { throw new ConnectException("Error while getting initial timestamp from database", e); } } initialPartitionOffset = new HashMap<String, Object>(); initialPartitionOffset.put(TimestampIncrementingOffset.TIMESTAMP_FIELD, timestampInitial); log.info("No offsets found for '{}', so using configured timestamp {}", tableOrQuery, timestampInitial); } return initialPartitionOffset; } }

Target:
protected Map<String, Object> computeInitialOffset( String tableOrQuery, Map<String, Object> partitionOffset, TimeZone timezone) { if (!(partitionOffset == null)) { return partitionOffset; } else { Map<String, Object> initialPartitionOffset = null; Long timestampInitial = config.getLong(JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CONFIG); if (timestampInitial != null) { if (timestampInitial == JdbcSourceConnectorConfig.TIMESTAMP_INITIAL_CURRENT) { try { final Connection con = cachedConnectionProvider.getConnection(); Calendar cal = Calendar.getInstance(timezone); timestampInitial = dialect.currentTimeOnDB(con, cal).getTime(); } catch (SQLException e) { throw new ConnectException("Error while getting initial timestamp from database", e); } } initialPartitionOffset = new HashMap<String, Object>(); initialPartitionOffset.put(TimestampIncrementingOffset.TIMESTAMP_FIELD, timestampInitial); log.info("No offsets found for '{}', so using configured timestamp {}", tableOrQuery, timestampInitial); } return initialPartitionOffset; } }
Source:
private int read(SelectionKey key) throws InterruptedException, IOException { SocketChannel socketChannel = (SocketChannel)key.channel(); SocketServerInputSet input = null; if(key.attachment() == null) { input = new SocketServerInputSet(); key.attach(input); } else { input = (SocketServerInputSet)key.attachment(); } int bytesRead = input.readFrom(socketChannel); if(bytesRead == -1) return -1; logger.trace("bytes read from {}", socketChannel.socket().getRemoteSocketAddress()); if(input.isReadComplete()) { SocketServerRequest req = new SocketServerRequest(id, key, input); channel.sendRequest(req); key.attach(null); key.interestOps(key.interestOps() & (~SelectionKey.OP_READ)); logger.trace("resetting read interest for key for {}", ((SocketChannel) key.channel()).socket().getRemoteSocketAddress()); } else { if (logger.isTraceEnabled()) { logger.trace("Did not finish reading, registering for read again on connection {}", socketChannel.socket().getRemoteSocketAddress()); } key.interestOps(SelectionKey.OP_READ); wakeup(); } return bytesRead; }

Target:
private void read(SelectionKey key) throws InterruptedException, IOException { SocketChannel socketChannel = (SocketChannel) key.channel(); SocketServerInputSet input = null; if (key.attachment() == null) { input = new SocketServerInputSet(); key.attach(input); } else { input = (SocketServerInputSet) key.attachment(); } long bytesRead = input.readFrom(socketChannel); if (bytesRead == -1) { close(key); return; } logger.trace("bytes read from {}", socketChannel.socket().getRemoteSocketAddress()); if (input.isReadComplete()) { SocketServerRequest req = new SocketServerRequest(id, key, input); channel.sendRequest(req); key.attach(null); key.interestOps(key.interestOps() & (~SelectionKey.OP_READ)); logger.trace("resetting read interest for key for {}", ((SocketChannel) key.channel()).socket().getRemoteSocketAddress()); } else { if (logger.isTraceEnabled()) { logger.trace("Did not finish reading, registering for read again on connection {}", socketChannel.socket().getRemoteSocketAddress()); } key.interestOps(SelectionKey.OP_READ); wakeup(); } }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR_ACTION_GEO_REP_RESUME); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__RESUME); }
Source:
public Function<Context, Context> contextPropagationFlag() { return ctx -> ctx.put("ctxPropagated", true); }

Target:
public Function<Context, Context> contextPropagationFlag() { return ctx -> ctx.put(CTX_PROPAGATED_KEY, true); }
Source:
public PullRequest getUpstreamPullRequest(final PullRequest pullRequest) throws MalformedURLException, NotFoundException { Objects.requireNonNull(pullRequest, "url cannot be null"); checkIssueTrackerExists(); if (this.isUpstreamRequired(pullRequest)) { final String body = pullRequest.getBody(); final String[] url = extractURLs(body, UPSTREAM_PR, false); if (url == null || url.length == 0 || url[0] == null) return null; else return getPullRequest(new URL(url[0])); } else { return null; } }

Target:
public PullRequest getUpstreamPullRequest(final PullRequest pullRequest) throws MalformedURLException, NotFoundException { Objects.requireNonNull(pullRequest, "pull request cannot be null"); checkIssueTrackerExists(); if (this.isUpstreamRequired(pullRequest)) { final String body = pullRequest.getBody(); final String[] url = extractURLs(body, UPSTREAM_PR, false); if (url == null || url.length == 0 || url[0] == null) return null; else return getPullRequest(new URL(url[0])); } else { return null; } }
Source:
private Stream<JavaFileScannerContext.Location> methodInvocationFlow(Constraint learnedConstraint, ExplodedGraph.Node currentNode, ExplodedGraph.Node parent) { MethodInvocationTree mit = (MethodInvocationTree) parent.programPoint.syntaxTree(); MethodYield selectedMethodYield = currentNode.selectedMethodYield(parent); if (selectedMethodYield == null) { return Stream.of(location(parent, String.format("'%s()' invoked.", mit.symbol().name()))); } Stream.Builder<JavaFileScannerContext.Location> flow = Stream.builder(); if (selectedMethodYield.isExceptional()) { Type exceptionType = selectedMethodYield.exceptionType(); String exception = exceptionType == null || exceptionType.isUnknown() ? "Exception" : exceptionType.name(); flow.add(location(parent, String.format("'%s' thrown by '%s()'.", exception, mit.symbol().name()))); } if (selectedMethodYield.resultConstraint == learnedConstraint) { flow.add(location(parent, String.format("'%s()' returns %s.", mit.symbol().name(), learnedConstraint.valueAsString()))); } int argIdx = correspondingArgumentIndex(symbolicValue, parent); if (argIdx != -1) { ExpressionTree argTree = mit.arguments().get(argIdx); String message = String.format("Implies '%s' is %s.", SyntaxTreeNameFinder.getName(argTree), learnedConstraint.valueAsString()); flow.add(new JavaFileScannerContext.Location(message, argTree)); } selectedMethodYield.flow(argIdx).forEach(flow::add); return flow.build(); }

Target:
private Stream<JavaFileScannerContext.Location> methodInvocationFlow(Constraint learnedConstraint, ExplodedGraph.Node currentNode, ExplodedGraph.Node parent) { MethodInvocationTree mit = (MethodInvocationTree) parent.programPoint.syntaxTree(); Stream.Builder<JavaFileScannerContext.Location> flowBuilder = Stream.builder(); if (currentNode.programState.peekValue() == symbolicValue) { flowBuilder.add(location(parent, String.format("'%s()' returns %s.", mit.symbol().name(), learnedConstraint.valueAsString()))); } SymbolicValue methodIdentifier = parent.programState.peekValues(mit.arguments().size() + 1).get(mit.arguments().size()); if (methodIdentifier == symbolicValue) { flowBuilder.add(location(parent, "...")); } int argIdx = correspondingArgumentIndex(symbolicValue, parent); if (argIdx != -1) { ExpressionTree argTree = mit.arguments().get(argIdx); String message = String.format("Implies '%s' is %s.", SyntaxTreeNameFinder.getName(argTree), learnedConstraint.valueAsString()); flowBuilder.add(new JavaFileScannerContext.Location(message, argTree)); } MethodYield selectedMethodYield = currentNode.selectedMethodYield(parent); if (selectedMethodYield != null) { selectedMethodYield.flow(argIdx).forEach(flowBuilder::add); } return flowBuilder.build(); }
Source:
public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }

Target:
public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (Objects.equals(getName(), other.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
Source:
private void handleGroupMessageRequest(GroupMessageRequest serviceRequest) { ServerRequest serverRequest = serviceRequest.parseRequestForServer(); try { mCacheHelper.addMessage(serviceRequest.getMessage(), serviceRequest.getReceivingGroup().getId()); } catch (CacheDatabaseException e) { } try { mCommunicationChannel.sendRequest(serverRequest); } catch (IOException e) { mService.receiveError("no connection available : " + e.getMessage()); } }

Target:
private void handleGroupMessageRequest(GroupMessageRequest serviceRequest) { ServerRequest serverRequest = serviceRequest.parseRequestForServer(); try { mCacheHelper.addMessage(serviceRequest.getMessage(), serviceRequest.getReceivingGroup().getId()); } catch (CacheDatabaseException e) { } try { mCommunicationChannel.sendRequest(serverRequest); } catch (IOException e) { mService.receiveError("No connection available : " + e.getMessage()); } }
Source:
public boolean isIncludesDependencies() { return false; }

Target:
public boolean isIncludesDependencies() { return wrappedHandler.isIncludesDependencies(); }
Source:
public PrimitiveLongIterator query( String... terms ) { MultiFieldQueryParser multiFieldQueryParser = new MultiFieldQueryParser( properties, analyzer ); multiFieldQueryParser.setDefaultOperator( QueryParser.Operator.OR ); Query query; try { query = multiFieldQueryParser.parse( String.join( " ", terms ) ); } catch ( ParseException e ) { query = parseFallbackBooleanQuery( multiFieldQueryParser, terms ); } return query( query ); }

Target:
public PrimitiveLongIterator query( String... terms ) { String concatenatedQuery = String.join( " ", terms ); return innerQuery( concatenatedQuery ); }
Source:
protected LoginPackage preLogin() throws BankException, IOException { urlopen = new Urllib(context, CertificateReader.getCertificates(context, R.raw.cert_americanexpress, R.raw.cert_americanexpress_global)); urlopen.setAllowCircularRedirects(true); urlopen.setContentCharset(HTTP.ISO_8859_1); urlopen.addHeader("Face", "sv_SE"); return new LoginPackage(urlopen, null, null, "<LINK_0>"); }

Target:
protected LoginPackage preLogin() throws BankException, IOException { urlopen = new Urllib(context, CertificateReader.getCertificates(context, R.raw.cert_americanexpress_global)); urlopen.setAllowCircularRedirects(true); urlopen.setContentCharset(HTTP.UTF_8); urlopen.addHeader("Face", "sv_SE"); return new LoginPackage(urlopen, null, null, "<LINK_0>"); }
Source:
public Locale getLocale() { return Optional.ofNullable(locale).orElse(DEFAULT_LOCALE); }

Target:
public Locale getLocale() { return locale; }
Source:
public void activate(){ toolBoxPanel = new ToolBoxPanel(this); dataUIManager = new DataUIManager(this); parameters = new DockingPanelParameters(); parameters.setTitle(I18N.tr("ToolBox")); parameters.setTitleIcon(ToolBoxIcon.getIcon(ToolBoxIcon.ORBIS_TOOLBOX)); parameters.setCloseable(true); parameters.setName(TOOLBOX_REFERENCE); ActionCommands dockingActions = new ActionCommands(); parameters.setDockActions(dockingActions.getActions()); dockingActions.addPropertyChangeListener(new ActionDockingListener(parameters)); dockingActions.addAction( new DefaultAction(ACTION_REFRESH, ACTION_REFRESH, I18N.tr("Refresh the selected node."), ToolBoxIcon.getIcon(ToolBoxIcon.REFRESH), EventHandler.create(ActionListener.class, this, "refreshAvailableScripts"), null) ); lee = new LogEditableElement(); openEditorList = new ArrayList<>(); le = new LogEditor(lee); dockingManager.addDockingPanel(le); openEditorList.add(le); jobStateListenerList = new ArrayList<>(); jobMap = new HashMap<>(); refreshAvailableScripts(); editorFactory = new ProcessEditorFactory(editorManager, this); editorManager.addEditorFactory(editorFactory); }

Target:
public void activate(){ toolBoxPanel = new ToolBoxPanel(this); dataUIManager = new DataUIManager(this); parameters = new DockingPanelParameters(); parameters.setTitle(I18N.tr("ToolBox")); parameters.setTitleIcon(ToolBoxIcon.getIcon(ToolBoxIcon.ORBIS_TOOLBOX)); parameters.setCloseable(true); parameters.setName(TOOLBOX_REFERENCE); ActionCommands dockingActions = new ActionCommands(); parameters.setDockActions(dockingActions.getActions()); dockingActions.addPropertyChangeListener(new ActionDockingListener(parameters)); dockingActions.addAction( new DefaultAction(ACTION_REFRESH, ACTION_REFRESH, I18N.tr("Refresh the selected node."), ToolBoxIcon.getIcon(ToolBoxIcon.REFRESH), EventHandler.create(ActionListener.class, this, "refreshAvailableScripts"), null) ); lee = new LogEditableElement(); openEditorList = new ArrayList<>(); le = new LogEditor(lee); dockingManager.addDockingPanel(le); openEditorList.add(le); jobStateListenerList = new ArrayList<>(); jobMap = new HashMap<>(); refreshAvailableScripts(); }
Source:
public String toString() { String out = header() + "\n"; for (MafEntry entry: entries_){ out += entry.src + " " + Integer.toString(entry.start0) + " " + Integer.toString(entry.size) + " " + (entry.strand?"+":"-") + " " + Integer.toString(entry.srcSize) + " " + Integer.toString(entry.srcSize) + "\n"; } return out; }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(header()+'\n'); for (MafEntry entry: entries_){ sb.append( entry.src + " " + Integer.toString(entry.start0) + " " + Integer.toString(entry.size) + " " + (entry.strand?"+":"-") + " " + Integer.toString(entry.srcSize) + " " + Integer.toString(entry.srcSize) + "\n"); } return sb.toString(); }
Source:
public void migrationRequired_throwsExceptionInTheMigrationBlock() { final RuntimeException exception = new RuntimeException("TEST"); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { throw exception; } }; RealmConfiguration config = configFactory.createConfigurationBuilder() .migration(migration) .schemaVersion(1) .assetFile("default0.realm") .build(); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (RuntimeException expected) { assertEquals(exception, expected); } finally { if (realm != null) { realm.close(); } } }

Target:
public void migrationRequired_throwsExceptionInTheMigrationBlock() { final RuntimeException exception = new RuntimeException("TEST"); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmObjectSchema objectSchema = realm.getSchema().create(StringOnly.CLASS_NAME); objectSchema.addField(StringOnly.FIELD_CHARS, String.class); throw exception; } }; RealmConfiguration config = configFactory.createConfigurationBuilder() .migration(migration) .schemaVersion(1) .schema(StringOnly.class) .build(); createEmptyRealmVersion0(config); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (RuntimeException expected) { assertSame(exception, expected); } finally { if (realm != null) { realm.close(); } } DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); try { assertEquals(0, dynamicRealm.getVersion()); assertNull(dynamicRealm.getSchema().get(StringOnly.CLASS_NAME)); } finally { dynamicRealm.close(); } }
Source:
public SegmentRelocator(PinotHelixResourceManager pinotHelixResourceManager, LeadControllerManager leadControllerManager, ControllerConf config, ControllerMetrics controllerMetrics, ExecutorService executorService) { super(SegmentRelocator.class.getSimpleName(), 60, 30, pinotHelixResourceManager, leadControllerManager, controllerMetrics); _executorService = executorService; }

Target:
public SegmentRelocator(PinotHelixResourceManager pinotHelixResourceManager, LeadControllerManager leadControllerManager, ControllerConf config, ControllerMetrics controllerMetrics, ExecutorService executorService) { super(SegmentRelocator.class.getSimpleName(), config.getSegmentRelocatorFrequencyInSeconds(), config.getSegmentRelocatorInitialDelayInSeconds(), pinotHelixResourceManager, leadControllerManager, controllerMetrics); _executorService = executorService; }
Source:
public <T> List<T> getParentsOfType(Class<T> parentType) { List<T> parents = new ArrayList<>(); Node parentNode = jjtGetParent(); while (parentNode != null) { if (parentType.isInstance(parentNode.getClass())) { parents.add((T) parentNode); } parentNode = parentNode.jjtGetParent(); } return parents; }

Target:
public <T> List<T> getParentsOfType(Class<T> parentType) { List<T> parents = new ArrayList<>(); Node parentNode = jjtGetParent(); while (parentNode != null) { if (parentType.isInstance(parentNode)) { parents.add((T) parentNode); } parentNode = parentNode.jjtGetParent(); } return parents; }
Source:
protected String fieldsToString() { return "topic='" + mTopic + '\'' + ", kafkaPartition=" + mKafkaPartition + ", offset=" + mOffset + ", kafkaKey=" + new String(mKafkaKey) + ", payload=" + new String(mPayload) + ", mTimestamp=" + mTimestamp; }

Target:
protected String fieldsToString() { return "topic='" + mTopic + '\'' + ", kafkaPartition=" + mKafkaPartition + ", offset=" + mOffset + ", kafkaKey=" + new String(mKafkaKey) + ", payload=" + new String(mPayload) + ", timestamp=" + mTimestamp; }
Source:
private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (refreshedIfSaved && isPageSaved(getTitle())) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); return; } else if (isPageSaved(getTitle())) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); return; } menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); }

Target:
private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (refreshedIfSaved) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(getString(R.string.menu_page_saved)); } else if (isPageSaved) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_refresh_saved_page)); } else { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_page_save)); } }
Source:
int countMetadata(String partitionPath, SqlQuerySpec querySpec, Timer timer) throws DocumentClientException { FeedOptions feedOptions = new FeedOptions(); feedOptions.setPartitionKey(new PartitionKey(partitionPath)); try { FeedResponse<Document> response = executeCosmosQuery(querySpec, feedOptions, timer).single(); return ((Number) response.getResults().get(0).getHashMap().values().stream().findFirst().get()).intValue(); } catch (RuntimeException rex) { if (rex.getCause() instanceof DocumentClientException) { throw (DocumentClientException) rex.getCause(); } throw rex; } }

Target:
int countMetadata(String partitionPath, SqlQuerySpec querySpec, Timer timer) throws DocumentClientException { FeedOptions feedOptions = new FeedOptions(); feedOptions.setPartitionKey(new PartitionKey(partitionPath)); try { FeedResponse<Document> response = executeCosmosQuery(querySpec, feedOptions, timer).single(); return response.getResults().get(0).getLong(Constants.Properties.AGGREGATE).intValue(); } catch (RuntimeException rex) { if (rex.getCause() instanceof DocumentClientException) { throw (DocumentClientException) rex.getCause(); } throw rex; } }
Source:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_fields == null || _fields.isEmpty()) { Map<String, Object> jsonMap = JsonUtils.genericRecordToJson(from); jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, RecordReaderUtils.convert(value))); } else { for (String fieldName : _fields) { Object value = from.get(fieldName); Object convertedValue = AvroUtils.convert(value); to.putValue(fieldName, convertedValue); } } return to; }

Target:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { Map<String, Object> jsonMap = JsonUtils.genericRecordToJson(from); jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, RecordReaderUtils.convert(value))); } else { for (String fieldName : _fields) { Object value = from.get(fieldName); Object convertedValue = AvroUtils.convert(value); to.putValue(fieldName, convertedValue); } } return to; }
Source:
private String setupState(Response response) { String sessionId = UUID.randomUUID().toString(); byte[] secret = new byte[20]; random.nextBytes(secret); String state = java.util.Base64.getEncoder().encodeToString(secret); CookieSetting cs = new CookieSetting("_state", sessionId); response.getCookieSettings().add(cs); getContext().getAttributes().put(sessionId, state); return state; }

Target:
private String setupState(Response response) { String sessionId = UUID.randomUUID().toString(); byte[] secret = new byte[20]; random.nextBytes(secret); String state = Base64.getEncoder().encodeToString(secret); CookieSetting cs = new CookieSetting("_state", sessionId); response.getCookieSettings().add(cs); getContext().getAttributes().put(sessionId, state); return state; }
Source:
private <T> List<GenericRecord> testGenericDatumRead(String testType, byte[] bytes, T... entityObjs) throws IOException { GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(); SeekableByteArrayInput avroInputStream = new SeekableByteArrayInput(bytes); DataFileReader<GenericRecord> fileReader = new DataFileReader<>(avroInputStream, datumReader); Schema schema = fileReader.getSchema(); assertNotNull("Unable to get schema for " + testType, schema); GenericRecord record = null; List<GenericRecord> records = new ArrayList<>(); while (fileReader.hasNext()) { try { records.add(fileReader.next(record)); } catch (Exception e) { fail("Fail with schema: " + schema); } } fileReader.close(); return records; }

Target:
private <T> List<GenericRecord> testGenericDatumRead(String testType, byte[] bytes, T... entityObjs) throws IOException { GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(); SeekableByteArrayInput avroInputStream = new SeekableByteArrayInput(bytes); List<GenericRecord> records = new ArrayList<>(); try (DataFileReader<GenericRecord> fileReader = new DataFileReader<>(avroInputStream, datumReader)) { Schema schema = fileReader.getSchema(); assertNotNull("Unable to get schema for " + testType, schema); GenericRecord record = null; while (fileReader.hasNext()) { try { records.add(fileReader.next(record)); } catch (Exception e) { fail("Fail with schema: " + schema); } } } return records; }
Source:
public SetTemperatureMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType+" Payload Len -> "+this.payload.length); if (this.payload.length == SET_TEMPERATURE_PAYLOAD_LEN) { desiredTemperature = (this.payload[0] & 0x3f) / 2.0; ctrlMode = ThermostatControlMode.values()[(this.payload[0]>>6)]; } else logger.error("Got "+this.msgType+" message with incorrect length!"); }

Target:
public SetTemperatureMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType + " Payload Len -> " + this.payload.length); if (this.payload.length == SET_TEMPERATURE_PAYLOAD_LEN) { desiredTemperature = (this.payload[0] & 0x3f) / 2.0; ctrlMode = ThermostatControlMode.values()[(this.payload[0] >> 6)]; } else { logger.error("Got " + this.msgType + " message with incorrect length!"); } }
Source:
void handleBody(InputStream payload) throws IOException, MessageFormatException { if (blobInfo == null) { blobInfo = new BlobInfo(MessageFormatRecord.deserializeBlobProperties(payload), MessageFormatRecord.deserializeUserMetadata(payload).array()); } else { } }

Target:
private void handleBody(InputStream payload) throws IOException, MessageFormatException { if (operationResult == null) { operationResult = new BlobInfo(MessageFormatRecord.deserializeBlobProperties(payload), MessageFormatRecord.deserializeUserMetadata(payload).array()); } else { } }
Source:
private void verifyLowerCamelCase(String constructType, ParserRuleContext ctx) { verifyLowerCamelCase(constructType, ctx, false); }

Target:
private void verifyLowerCamelCase(String constructType, ParserRuleContext ctx) { String constructName = CharFormatUtil.unescapeIdentifier(ctx.getText()); if (!CharFormatUtil.isLowerCamelCaseOrAcronym(constructName)) { Location location = ListenerUtil.getIdentifierStartLocation(ctx); this.printer.error(Rules.LOWER_CAMEL_CASE, constructType + Messages.LOWER_CAMEL_CASE, location); } }
Source:
private boolean addImageTicketToProxy(Guid imagedTicketId, String hostUri) { String imagePath = String.format( "%s%s/%s", hostUri, IMAGES_PATH, imagedTicketId); ImageTicket imageTicket = buildImageTicket(imagedTicketId, imagePath); log.info("Adding image ticket to ovirt-imageio-proxy, id {}", imagedTicketId); try { getProxyClient().putTicket(imageTicket); } catch (RuntimeException e) { log.error("Failed to add image ticket to ovirt-imageio-proxy: {}", e.getMessage(), e); return false; } return true; }

Target:
private boolean addImageTicketToProxy(Guid imagedTicketId, String hostUri) { String url = String.format( "%s%s/%s", hostUri, IMAGES_PATH, imagedTicketId); ImageTicket imageTicket = buildImageTicket(imagedTicketId, url); log.info("Adding image ticket to ovirt-imageio-proxy, id {}", imagedTicketId); try { getProxyClient().putTicket(imageTicket); } catch (RuntimeException e) { log.error("Failed to add image ticket to ovirt-imageio-proxy: {}", e.getMessage(), e); return false; } return true; }