auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static ArrayBackedResultSet fromMessage(Responses.Result msg, SessionManager session, ProtocolVersion protocolVersion, ExecutionInfo info, Statement statement) { info = update(info, msg, session); switch (msg.kind) { case VOID: return empty(info); case ROWS: Responses.Result.Rows r = (Responses.Result.Rows)msg; ColumnDefinitions columnDefs; if (r.metadata.columns == null) { assert statement instanceof BoundStatement; columnDefs = ((BoundStatement)statement).statement.getPreparedId().resultSetMetadata; assert columnDefs != null; } else { columnDefs = r.metadata.columns; } Token.Factory tokenFactory = (session == null) ? null : session.getCluster().manager.metadata.tokenFactory(); assert r.metadata.pagingState == null || info != null; CodecRegistry codecRegistry = (session == null) ? CodecRegistry.DEFAULT_INSTANCE : session.getCluster().getConfiguration().getCodecRegistry(); return r.metadata.pagingState == null ? new SinglePage(columnDefs, tokenFactory, protocolVersion, codecRegistry, r.data, info) : new MultiPage(columnDefs, tokenFactory, protocolVersion, codecRegistry, r.data, info, r.metadata.pagingState, session, statement); case SET_KEYSPACE: case SCHEMA_CHANGE: return empty(info); case PREPARED: throw new RuntimeException("Prepared statement received when a ResultSet was expected"); default: logger.error("Received unknown result type '{}'; returning empty result set", msg.kind); return empty(info); } }

Target:
static ArrayBackedResultSet fromMessage(Responses.Result msg, SessionManager session, ProtocolVersion protocolVersion, ExecutionInfo info, Statement statement) { info = update(info, msg, session); switch (msg.kind) { case VOID: return empty(info); case ROWS: Responses.Result.Rows r = (Responses.Result.Rows)msg; ColumnDefinitions columnDefs; if (r.metadata.columns == null) { assert statement instanceof BoundStatement; columnDefs = ((BoundStatement)statement).statement.getPreparedId().resultSetMetadata; assert columnDefs != null; } else { columnDefs = r.metadata.columns; } Token.Factory tokenFactory = (session == null) ? null : session.getCluster().manager.metadata.tokenFactory(); assert r.metadata.pagingState == null || info != null; return r.metadata.pagingState == null ? new SinglePage(columnDefs, tokenFactory, protocolVersion, columnDefs.codecRegistry, r.data, info) : new MultiPage(columnDefs, tokenFactory, protocolVersion, columnDefs.codecRegistry, r.data, info, r.metadata.pagingState, session, statement); case SET_KEYSPACE: case SCHEMA_CHANGE: return empty(info); case PREPARED: throw new RuntimeException("Prepared statement received when a ResultSet was expected"); default: logger.error("Received unknown result type '{}'; returning empty result set", msg.kind); return empty(info); } }
Source:
private static void updateConnection(final Connection connection, final MagnetManager.Magnets magnets, final com.ait.lienzo.client.core.types.Point2D abeLocation, final Consumer<Boolean> isAutoConnectionConsumer, final Consumer<WiresMagnet> magnetConsumer) { final WiresMagnet[] magnet = new WiresMagnet[]{null}; final boolean[] auto = new boolean[]{false}; if (null != connection) { final Optional<DiscreteConnection> discreteConnection = connection instanceof DiscreteConnection ? Optional.of((DiscreteConnection) connection) : Optional.empty(); discreteConnection .ifPresent(c -> { c.getMagnetIndex().ifPresent(index -> magnet[0] = magnets.getMagnet(index)); auto[0] = c.isAuto(); }); if (null == magnet[0]) { magnet[0] = getMagnetForConnection(connection, magnets, abeLocation); discreteConnection.ifPresent(c -> c.setIndex(magnet[0].getIndex())); } } isAutoConnectionConsumer.accept(auto[0]); magnetConsumer.accept(magnet[0]); }

Target:
private static void updateConnection(final Connection connection, final MagnetManager.Magnets magnets, final com.ait.lienzo.client.core.types.Point2D abeLocation, final Consumer<Boolean> isAutoConnectionConsumer, final Consumer<WiresMagnet> magnetConsumer) { final WiresMagnet[] magnet = new WiresMagnet[]{null}; final boolean[] auto = new boolean[]{false}; if (null != connection) { final DiscreteConnection dc = connection instanceof DiscreteConnection ? (DiscreteConnection) connection : null; if (null != dc) { dc.getMagnetIndex().ifPresent(index -> magnet[0] = magnets.getMagnet(index)); auto[0] = dc.isAuto(); } if (null == magnet[0]) { magnet[0] = getMagnetForConnection(connection, magnets, abeLocation); if (null != dc) { dc.setIndex(magnet[0].getIndex()); } } } isAutoConnectionConsumer.accept(auto[0]); magnetConsumer.accept(magnet[0]); }
Source:
public String generateCredData(String nextNonce) { MessageDigest digest; String usrPwdNonceHash = null; String nonce; try { nonce = new String(Base64.decodeBase64(nextNonce), "utf-8"); digest = MessageDigest.getInstance("MD5"); String usrPwd = Constants.PROVIDER_ID + ":" + Constants.SERVER_SECRET; String usrPwdHash = Base64.encodeBase64String(digest.digest(usrPwd.getBytes("utf-8"))); String usrPwdNonce = usrPwdHash + ":" + nonce; usrPwdNonceHash = Base64.encodeBase64String(digest.digest(usrPwdNonce.getBytes("utf-8"))); } catch (Exception e) { String msg = "Problem occurred in generating server credentials."; log.error(msg, e); } return usrPwdNonceHash; }

Target:
public String generateCredData(String nextNonce) { MessageDigest digest; String usrPwdNonceHash = null; String nonce; try { nonce = new String(Base64.decodeBase64(nextNonce), "utf-8"); digest = MessageDigest.getInstance("MD5"); String usrPwd = Constants.PROVIDER_ID + ":" + Constants.SERVER_SECRET; String usrPwdHash = Base64.encodeBase64String(digest.digest(usrPwd.getBytes("utf-8"))); String usrPwdNonce = usrPwdHash + ":" + nonce; usrPwdNonceHash = Base64.encodeBase64String(digest.digest(usrPwdNonce.getBytes("utf-8"))); } catch (UnsupportedEncodingException e) { String msg = "Problem occurred in encoding credentials data."; log.error(msg, e); } catch (NoSuchAlgorithmException e) { String msg = "Problem occurred in generating password hash."; log.error(msg, e); } return usrPwdNonceHash; }
Source:
private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) { Map<Node,Computer> computers = getComputerMap(); Computer c; c = byNameMap.get(n.getNodeName()); if (c!=null) { c.setNode(n); } else { if((n.getNumExecutors()>0 && bypass(FeatureSwitchConfiguration.Feature.DEFER_EXECUTOR_CREATION,n.isAcceptingTasks())) || n==Jenkins.getInstance()) { computers.put(n, c = n.createComputer()); if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) { RetentionStrategy retentionStrategy = c.getRetentionStrategy(); if (retentionStrategy != null) { retentionStrategy.start(c); } else { c.connect(true); } } } } if(c!=null){ used.add(c); } }

Target:
private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) { Map<Node,Computer> computers = getComputerMap(); Computer c; c = byNameMap.get(n.getNodeName()); if (c!=null) { c.setNode(n); } else { if((n.getNumExecutors()>0 && Feature.DEFER_EXECUTOR_CREATION.isOffOr(n.isAcceptingTasks())) || n==Jenkins.getInstance()) { computers.put(n, c = n.createComputer()); if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) { RetentionStrategy retentionStrategy = c.getRetentionStrategy(); if (retentionStrategy != null) { retentionStrategy.start(c); } else { c.connect(true); } } } } if(c!=null){ used.add(c); } }
Source:
public long getTotalConnectionCount() { return totalConnectionCount; }

Target:
public long getTotalConnectionCount() { return statsPerHost .values() .stream() .mapToLong(HostStats::getHostConnectionCount) .sum(); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> nodes = getSelectedNodes(event); RepositoryTreeNode node = nodes.get(0); WizardDialog wizardDialog = null; try { switch (node.getType()) { case REF: Ref ref = (Ref) node.getObject(); wizardDialog = new PushBranchDialog(getShell(event), new PushBranchWizard(node.getRepository(), ref)); break; case TAG: wizardDialog = new WizardDialog(getShell(event), createPushTagsWizard(nodes)); break; case REPO: wizardDialog = new WizardDialog(getShell(event), new PushWizard(node.getRepository())); break; default: throw new UnsupportedOperationException("type not supported!"); } } catch (URISyntaxException e1) { Activator.handleError(e1.getMessage(), e1, true); return null; } wizardDialog.open(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> nodes = getSelectedNodes(event); RepositoryTreeNode node = nodes.get(0); WizardDialog wizardDialog = null; try { switch (node.getType()) { case REF: Ref ref = (Ref) node.getObject(); wizardDialog = new PushBranchDialog(getShell(event), new PushBranchWizard(node.getRepository(), ref)); break; case TAG: wizardDialog = new WizardDialog(getShell(event), createPushTagsWizard(nodes)); break; case REPO: wizardDialog = new WizardDialog(getShell(event), new PushWizard(node.getRepository())); break; default: throw new UnsupportedOperationException("type not supported!"); } } catch (URISyntaxException e1) { Activator.handleError(e1.getMessage(), e1, true); return null; } wizardDialog.setHelpAvailable(true); wizardDialog.open(); return null; }
Source:
public void save(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String schemeName = request.getParameter("schemeName"); final String schemeId = request.getParameter("schemeId"); final String schemeDescription = request.getParameter("schemeDescription"); final boolean schemeArchived = (request.getParameter("schemeArchived") != null) ? Boolean.parseBoolean(request.getParameter("schemeArchived")) : false; final WorkflowSchemeForm schemeForm = new WorkflowSchemeForm.Builder().schemeName(schemeName) .schemeDescription(schemeDescription) .schemeArchived(schemeArchived) .build(); try { final User user = this.userWebAPI.getUser(request); final WorkflowHelper helper = WorkflowHelper.getInstance(); String x = saveScheme(schemeId, schemeForm, user); response.getWriter().println(x); } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); writeError(response, e.getMessage()); } }

Target:
public void save(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String schemeName = request.getParameter("schemeName"); final String schemeId = request.getParameter("schemeId"); final String schemeDescription = request.getParameter("schemeDescription"); final boolean schemeArchived = (request.getParameter("schemeArchived") != null) ? Boolean.parseBoolean(request.getParameter("schemeArchived")) : false; final WorkflowSchemeForm schemeForm = new WorkflowSchemeForm.Builder().schemeName(schemeName) .schemeDescription(schemeDescription) .schemeArchived(schemeArchived) .build(); try { final User user = this.userWebAPI.getUser(request); final WorkflowHelper helper = WorkflowHelper.getInstance(); String responseMessage = saveScheme(schemeId, schemeForm, user); response.getWriter().println(responseMessage); } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); writeError(response, e.getMessage()); } }
Source:
public String sanitizeHashStr(final String raw) throws InvalidHashException { if (!raw.matches("^[a-zA-Z0-9]*$")) { throw new InvalidHashException( String.format("Hash %s has invalid characters. Should be only alphanumeric.", raw)); } else if (this.type.equals("MD5") && raw.length() != 32) { throw new InvalidHashException( String.format("MD5 hash %s has incorrect length %d, expected 32", raw, raw.length())); } else if (this.type.equals("SHA1") && raw.length() != 40) { throw new InvalidHashException( String.format("SHA1 hash %s has incorrect length %d, expected 40", raw, raw.length())); } return raw.toLowerCase(); }

Target:
public String sanitizeHashStr(final String raw) throws InvalidHashException { if (this == HashUtils.MD5 && raw.length() != MD5_SIZE_BYTES) { throw new InvalidHashException( String.format("MD5 hash %s has incorrect length %d, expected %d", raw, raw.length(), MD5_SIZE_BYTES)); } else if (this == HashUtils.SHA1 && raw.length() != SHA1_SIZE_BYTES) { throw new InvalidHashException( String.format("SHA1 hash %s has incorrect length %d, expected %d", raw, raw.length(), SHA1_SIZE_BYTES)); } else if (!raw.matches("^[a-zA-Z0-9]*$")) { throw new InvalidHashException( String.format("Hash %s has invalid characters. Should be only alphanumeric.", raw)); } return raw.toLowerCase(); }
Source:
private boolean isGuavaPrecondition(Symbol.MethodSymbol symbol) { return symbol.owner().type().is("com.google.common.base.Preconditions") && ("checkNotNull".equals(symbol.name()) || "checkArgument".equals(symbol.name()) || "checkState".equals(symbol.name()) ); }

Target:
private boolean isGuavaPrecondition(Symbol.MethodSymbol symbol) { String name = symbol.name(); return symbol.owner().type().is("com.google.common.base.Preconditions") && ("checkNotNull".equals(name) || "checkArgument".equals(name) || "checkState".equals(name) ); }
Source:
protected AbstractLightblueClientCRUDController getControllerInstance() { if (controller == null) { try { if (removeHooks == Boolean.TRUE) controller = new ArtificialLightblueClientCRUDController(httpServerPort); else if(removeHooks == Boolean.FALSE) controller = new ArtificialLightblueClientCRUDControllerWithHooks(httpServerPort); } catch (Exception e) { throw new RuntimeException("Unable to create test CRUD Controller", e); } } return controller; }

Target:
protected AbstractLightblueClientCRUDController getControllerInstance() { if (controller == null) { try { if (removeHooks) controller = new ArtificialLightblueClientCRUDController(httpServerPort); else controller = new ArtificialLightblueClientCRUDControllerWithHooks(httpServerPort); } catch (Exception e) { throw new RuntimeException("Unable to create test CRUD Controller", e); } } return controller; }
Source:
protected RowMapper<VmNetworkStatistics> createEntityRowMapper() { return new VmNetworkStatisticsRowMapper(); }

Target:
protected RowMapper<VmNetworkStatistics> createEntityRowMapper() { return VmNetworkStatisticsRowMapper.INSTANCE; }
Source:
protected void init() { T parameters = getParameters(); super.setVmTemplateName(parameters.getName()); VmStatic parameterMasterVm = parameters.getMasterVm(); if (parameterMasterVm != null) { super.setVmId(parameterMasterVm.getId()); setVdsGroupId(parameterMasterVm.getVdsGroupId()); if (getVdsGroup() != null && VmDeviceUtils.shouldOverrideSoundDevice(getParameters().isSoundDeviceEnabled(), getParameters().getMasterVm(), getVdsGroup().getCompatibilityVersion())) { parameters.setSoundDeviceEnabled(true); } if (getParameters().isConsoleEnabled() == null) { parameters.setConsoleEnabled(false); } VmHandler.updateDefaultTimeZone(parameterMasterVm); VmHandler.autoSelectUsbPolicy(getParameters().getMasterVm(), getVdsGroup()); VmHandler.autoSelectDefaultDisplayType(getVmId(), getParameters().getMasterVm(), getVdsGroup(), getParameters().getGraphicsDevices()); separateCustomProperties(parameterMasterVm); } if (getVm() != null) { updateVmDevices(); images.addAll(getVmDisksFromDB()); setStoragePoolId(getVm().getStoragePoolId()); isVmInDb = true; } else if (getVdsGroup() != null && parameterMasterVm != null) { VM vm = new VM(parameterMasterVm, new VmDynamic(), null); vm.setVdsGroupCompatibilityVersion(getVdsGroup().getCompatibilityVersion()); setVm(vm); setStoragePoolId(getVdsGroup().getStoragePoolId()); } updateDiskInfoDestinationMap(); }

Target:
protected void init() { T parameters = getParameters(); super.setVmTemplateName(parameters.getName()); VmStatic parameterMasterVm = parameters.getMasterVm(); if (parameterMasterVm != null) { super.setVmId(parameterMasterVm.getId()); setVdsGroupId(parameterMasterVm.getVdsGroupId()); if (getVdsGroup() != null && VmDeviceUtils.shouldOverrideSoundDevice(getParameters().isSoundDeviceEnabled(), getParameters().getMasterVm(), getVdsGroup().getCompatibilityVersion())) { parameters.setSoundDeviceEnabled(true); } if (getParameters().isConsoleEnabled() == null) { parameters.setConsoleEnabled(false); } VmHandler.updateDefaultTimeZone(parameterMasterVm); VmHandler.autoSelectUsbPolicy(getParameters().getMasterVm(), getVdsGroup()); VmHandler.autoSelectDefaultDisplayType(getVmId(), getParameters().getMasterVm(), getVdsGroup(), getParameters().getGraphicsDevices()); separateCustomProperties(parameterMasterVm); } if (getVm() != null) { updateVmDevices(); images.addAll(getVmDisksFromDB()); setStoragePoolId(getVm().getStoragePoolId()); isVmInDb = true; } else if (getVdsGroup() != null && parameterMasterVm != null) { VM vm = new VM(parameterMasterVm, new VmDynamic(), null); vm.setVdsGroupCompatibilityVersion(getVdsGroup().getCompatibilityVersion()); setVm(vm); setStoragePoolId(getVdsGroup().getStoragePoolId()); } updateDiskInfoDestinationMap(); parameters.setUseCinderCommandCallback(!getCinderDisks().isEmpty()); }
Source:
private JSONObject createObject(String id, String value, String avatar, String type) { JSONObject o = new JSONObject(); StringBuilder idWithType = new StringBuilder(); idWithType.append(id).append(";").append(type); o.put(UsersAndGroups.ID_KEY, idWithType.toString()); o.put(UsersAndGroups.VALUE_KEY, value); o.put(UsersAndGroups.ICON_KEY, avatar); return o; }

Target:
private JSONObject createObject(String id, String value, String avatar, String type) { JSONObject o = new JSONObject(); StringBuilder idWithType = new StringBuilder(); idWithType.append(id); o.put(UsersAndGroups.ID_KEY, idWithType.toString()); o.put(UsersAndGroups.VALUE_KEY, value); o.put(UsersAndGroups.ICON_KEY, avatar); return o; }
Source:
public void testSTMax() throws Exception { assertQuery("select st_max_x(st_geometry_from_text('linestring(8 4, 4 8)'))", "select 8.0"); assertQuery("select st_max_y(st_geometry_from_text('linestring(8 4, 4 8)'))", "select 8.0"); assertQuery("select st_max_x(st_geometry_from_text('polygon ((2 0, 2 1, 3 1))'))", "select 3.0"); assertQuery("select st_max_y(st_geometry_from_text('polygon ((2 0, 2 1, 3 1))'))", "select 1.0"); }

Target:
public void testSTMax() throws Exception { assertFunction("ST_XMax(ST_GeometryFromText('POINT (1.5 2.5)'))", DOUBLE, 1.5); assertFunction("ST_YMax(ST_GeometryFromText('POINT (1.5 2.5)'))", DOUBLE, 2.5); assertFunction("ST_XMax(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)'))", DOUBLE, 4.0); assertFunction("ST_YMax(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)'))", DOUBLE, 8.0); assertFunction("ST_XMax(ST_GeometryFromText('LINESTRING (8 4, 5 7)'))", DOUBLE, 8.0); assertFunction("ST_YMax(ST_GeometryFromText('LINESTRING (8 4, 5 7)'))", DOUBLE, 7.0); assertFunction("ST_XMax(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'))", DOUBLE, 5.0); assertFunction("ST_YMax(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'))", DOUBLE, 4.0); assertFunction("ST_XMax(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))'))", DOUBLE, 3.0); assertFunction("ST_YMax(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))'))", DOUBLE, 1.0); assertFunction("ST_XMax(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((2 4, 2 6, 6 6, 6 4)))'))", DOUBLE, 6.0); assertFunction("ST_YMax(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((2 4, 2 6, 6 10, 6 4)))'))", DOUBLE, 10.0); }
Source:
@Override public void run() { try { updateThreadName(data); if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_EXECUTING, getLogIdsForHunter(this)); } result = hunt(); if (result == null) { dispatcher.dispatchFailed(this); } else { dispatcher.dispatchComplete(this); } } catch (Downloader.ResponseException e) { if (!e.localCacheOnly && e.responseCode != 504){ exception = e; } dispatcher.dispatchFailed(this); } catch (IOException e) { exception = e; dispatcher.dispatchRetry(this); } catch (OutOfMemoryError e) { StringWriter writer = new StringWriter(); stats.createSnapshot().dump(new PrintWriter(writer)); exception = new RuntimeException(writer.toString(), e); dispatcher.dispatchFailed(this); } catch (Exception e) { exception = e; dispatcher.dispatchFailed(this); } finally { Thread.currentThread().setName(Utils.THREAD_IDLE_NAME); } }

Target:
@Override public void run() { try { updateThreadName(data); if (picasso.loggingEnabled) { log(OWNER_HUNTER, VERB_EXECUTING, getLogIdsForHunter(this)); } result = hunt(); if (result == null) { dispatcher.dispatchFailed(this); } else { dispatcher.dispatchComplete(this); } } catch (Downloader.ResponseException e) { if (!e.localCacheOnly || e.responseCode != 504) { exception = e; } dispatcher.dispatchFailed(this); } catch (IOException e) { exception = e; dispatcher.dispatchRetry(this); } catch (OutOfMemoryError e) { StringWriter writer = new StringWriter(); stats.createSnapshot().dump(new PrintWriter(writer)); exception = new RuntimeException(writer.toString(), e); dispatcher.dispatchFailed(this); } catch (Exception e) { exception = e; dispatcher.dispatchFailed(this); } finally { Thread.currentThread().setName(Utils.THREAD_IDLE_NAME); } }
Source:
public List<ACL> getAcl(final String path) throws KeeperException { return reporter.time(tag, "ensurePath", () -> client.getAcl(path)); }

Target:
public List<ACL> getAcl(final String path) throws KeeperException { return reporter.time(tag, "getAcl", () -> client.getAcl(path)); }
Source:
public static ScalarFunction getCeilExpression(List<Expression> children) throws SQLException { final Expression firstChild = children.get(0); final PDataType firstChildDataType = firstChild.getDataType(); if(firstChildDataType.isCoercibleTo(PDataType.DATE)) { return new CeilDateExpression(children); } else if(firstChildDataType == PDataType.TIMESTAMP) { return new CeilTimestampExpression(children) ; } else if(firstChildDataType.isCoercibleTo(PDataType.DECIMAL)) { return new CeilDecimalExpression(children); } else { throw new SQLException("Invalid data type: " + firstChildDataType); } }

Target:
public static ScalarFunction getCeilExpression(List<Expression> children) throws SQLException { final Expression firstChild = children.get(0); final PDataType firstChildDataType = firstChild.getDataType(); if(firstChildDataType.isCoercibleTo(PDataType.DATE)) { return new CeilDateExpression(children); } else if (firstChildDataType == PDataType.TIMESTAMP || firstChildDataType == PDataType.UNSIGNED_TIMESTAMP) { Object secondChild = ((LiteralExpression)children.get(1)).getValue(); String timeUnit = secondChild == null ? null : secondChild.toString(); TimeUnit tu = TimeUnit.getTimeUnit(timeUnit); LiteralExpression multiplierExpr = (LiteralExpression)children.get(2); if(tu == TimeUnit.MILLISECOND) { return CeilTimestampExpression.create(firstChild, multiplierExpr); } return new CeilDateExpression(children); } else if(firstChildDataType.isCoercibleTo(PDataType.DECIMAL)) { return new CeilDecimalExpression(children); } else { throw new TypeMismatchException(firstChildDataType, "1"); } }
Source:
public org.apache.parquet.column.statistics.Statistics fromParquetStatistics( String createdBy, Statistics statistics, PrimitiveType type) { SortOrder expectedOrder = isSignedOrderOkay(type) ? SortOrder.SIGNED : sortOrder(type); return fromParquetStatisticsInternal( createdBy, statistics, type.getPrimitiveTypeName(), expectedOrder); }

Target:
public org.apache.parquet.column.statistics.Statistics fromParquetStatistics( String createdBy, Statistics statistics, PrimitiveType type) { SortOrder expectedOrder = overrideSortOrderToSigned(type) ? SortOrder.SIGNED : sortOrder(type); return fromParquetStatisticsInternal( createdBy, statistics, type.getPrimitiveTypeName(), expectedOrder); }
Source:
void removeUserFromProjectSuccessfully() throws Exception { mvc() .perform(delete("/api/projects/" + testProject.getId() + "/users/" + testUser.getId())) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(document("user/role/project/remove")) .andReturn(); Assertions.assertTrue(userRepository.listUsersForProject(testProject.getId()).isEmpty()); }

Target:
void removeUserFromProjectSuccessfully() throws Exception { mvc() .perform(delete("/api/projects/" + testProject.getId() + "/users/" + testUser.getId())) .andExpect(status().isOk()) .andDo(document("user/role/project/remove")) .andReturn(); Assertions.assertTrue(userRepository.listUsersForProject(testProject.getId()).isEmpty()); }
Source:
public String render(DataObject dataobject, String contentModel, String langCode, RequestContext reqCtx) { dataobject.getAttributeList().forEach(f -> logger.info("render value type {}", f.getName(), f.getValue(), f.getType())); String renderedEntity; try { Context velocityContext = new VelocityContext(); DataObjectWrapper contentWrapper = (DataObjectWrapper) this.getEntityWrapper(dataobject); contentWrapper.setRenderingLang(langCode); velocityContext.put("data", contentWrapper); I18nManagerWrapper i18nWrapper = new I18nManagerWrapper(langCode, this.getI18nManager()); velocityContext.put("i18n", i18nWrapper); SystemInfoWrapper systemInfoWrapper = new SystemInfoWrapper(reqCtx); velocityContext.put("info", systemInfoWrapper); StringWriter stringWriter = new StringWriter(); boolean isEvaluated = Velocity.evaluate(velocityContext, stringWriter, "render", contentModel); if (!isEvaluated){ throw new ApsSystemException("Error rendering DataObject"); } stringWriter.flush(); renderedEntity = stringWriter.toString(); } catch (Throwable t) { logger.error("Error rendering dataobject", t); renderedEntity = ""; } return renderedEntity; }

Target:
public String render(DataObject dataobject, String contentModel, String langCode, RequestContext reqCtx) { String renderedEntity; try { Context velocityContext = new VelocityContext(); DataObjectWrapper contentWrapper = (DataObjectWrapper) this.getEntityWrapper(dataobject); contentWrapper.setRenderingLang(langCode); velocityContext.put("data", contentWrapper); I18nManagerWrapper i18nWrapper = new I18nManagerWrapper(langCode, this.getI18nManager()); velocityContext.put("i18n", i18nWrapper); SystemInfoWrapper systemInfoWrapper = new SystemInfoWrapper(reqCtx); velocityContext.put("info", systemInfoWrapper); StringWriter stringWriter = new StringWriter(); boolean isEvaluated = Velocity.evaluate(velocityContext, stringWriter, "render", contentModel); if (!isEvaluated) { throw new ApsSystemException("Error rendering DataObject"); } stringWriter.flush(); renderedEntity = stringWriter.toString(); } catch (Throwable t) { logger.error("Error rendering dataobject", t); renderedEntity = ""; } return renderedEntity; }
Source:
public static int formatBase10(final byte[] b, int o, int value) { if (value == 0) { b[--o] = '0'; return o; } final boolean isneg = value < 0; if (isneg) { value = -value; } while (value != 0) { b[--o] = base10byte[value % 10]; value /= 10; } if (isneg) b[--o] = '-'; return o; }

Target:
public static int formatBase10(final byte[] b, int o, int value) { if (value == 0) { b[--o] = '0'; return o; } final boolean isneg = value < 0; if (isneg) value = -value; while (value != 0) { b[--o] = base10byte[value % 10]; value /= 10; } if (isneg) b[--o] = '-'; return o; }
Source:
private CompletableFuture<Optional<SnmpAgentConfig>> fitProfile(SnmpProfile snmpProfile, InetAddress inetAddress, String location, String oid) { final SnmpAgentConfig agentConfig = agentConfigFactory.getAgentConfigFromProfile(snmpProfile, inetAddress); if (!Strings.isNullOrEmpty(oid)) { snmpObjId = SnmpObjId.get(oid); } if (Strings.isNullOrEmpty(location)) { location = "Default"; } CompletableFuture<Optional<SnmpAgentConfig>> future = new CompletableFuture<>(); CompletableFuture<SnmpValue> snmpResult = locationAwareSnmpClient.get(agentConfig, snmpObjId) .withLocation(location) .withDescription("Snmp-Profile:" + snmpProfile.getLabel()) .execute(); snmpResult.whenComplete(((snmpValue, throwable) -> { if(throwable == null) { if (snmpValue != null && !snmpValue.isError()) { future.complete(Optional.of(agentConfig)); } else { future.complete(Optional.empty()); } } else { LOG.warn("Exception while doing SNMP get on OID '{}' with profile '{}'", snmpObjId, snmpProfile.getLabel(), throwable); future.complete(Optional.empty()); } })); return future; }

Target:
private CompletableFuture<Optional<SnmpAgentConfig>> fitProfile(SnmpProfile snmpProfile, InetAddress inetAddress, String location, String oid) { SnmpObjId snmpObjectId = this.snmpObjId; final SnmpAgentConfig agentConfig = agentConfigFactory.getAgentConfigFromProfile(snmpProfile, inetAddress); if (!Strings.isNullOrEmpty(oid)) { snmpObjectId = SnmpObjId.get(oid); } CompletableFuture<Optional<SnmpAgentConfig>> future = new CompletableFuture<>(); CompletableFuture<SnmpValue> snmpResult = locationAwareSnmpClient.get(agentConfig, snmpObjectId) .withLocation(location) .withDescription("Snmp-Profile:" + snmpProfile.getLabel()) .execute(); final String objectId = Strings.isNullOrEmpty(oid) ? SYS_OBJECTID_INSTANCE : oid; snmpResult.whenComplete(((snmpValue, throwable) -> { if (throwable == null) { if (snmpValue != null && !snmpValue.isError()) { future.complete(Optional.of(agentConfig)); } else { future.complete(Optional.empty()); } } else { LOG.info("Exception while doing SNMP get on OID '{}' with profile '{}'", objectId, snmpProfile.getLabel()); future.complete(Optional.empty()); } })); return future; }
Source:
private boolean alertVolumeLimitReached(final GlusterVolumeEntity volume, boolean checkHardLimit) { List<AuditLog> limitAlerts = DbFacade.getInstance() .getAuditLogDao() .getByVolumeIdAndType(volume.getId(), checkHardLimit ? AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED.getValue() : AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED.getValue()); if (!limitAlerts.isEmpty()) { for (AuditLog alert : limitAlerts) { if (!alert.isDeleted()) { return true; } } } boolean limitReached = checkHardLimit ? GlusterDBUtils.getInstance().isVolumeSnapshotHardLimitReached(volume.getId()) : GlusterDBUtils.getInstance().isVolumeSnapshotSoftLimitReached(volume.getId()); if (limitReached) { GlusterAuditLogUtil.getInstance().logAuditMessage(volume.getClusterId(), volume, null, checkHardLimit ? AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED : AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_NAME, volume.getName()); put(GlusterConstants.CLUSTER, volume.getVdsGroupName()); } }); return true; } return false; }

Target:
private boolean alertVolumeLimitReached(final GlusterVolumeEntity volume, boolean checkHardLimit) { AuditLogType logType = checkHardLimit ? AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED : AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED; List<AuditLog> limitAlerts = DbFacade.getInstance() .getAuditLogDao() .getByVolumeIdAndType(volume.getId(), logType.getValue()); if (!limitAlerts.isEmpty()) { for (AuditLog alert : limitAlerts) { if (!alert.isDeleted()) { return true; } } } boolean limitReached = checkHardLimit ? GlusterDBUtils.getInstance().isVolumeSnapshotHardLimitReached(volume.getId()) : GlusterDBUtils.getInstance().isVolumeSnapshotSoftLimitReached(volume.getId()); if (limitReached) { GlusterAuditLogUtil.getInstance().logAuditMessage(volume.getClusterId(), volume, null, logType, new HashMap<String, String>() { { put(GlusterConstants.VOLUME_NAME, volume.getName()); put(GlusterConstants.CLUSTER, volume.getVdsGroupName()); } }); return true; } return false; }
Source:
public boolean syncCRLWithDB(File file) throws IOException { List<BigInteger> revoke = new LinkedList<BigInteger>(); List<CertificateSerial> serials = this.certificateSerialCurator.retrieveTobeCollectedSerials(); for (CertificateSerial serial : serials) { revoke.add(serial.getSerial()); serial.setCollected(true); } List<BigInteger> unrevoke = new LinkedList<BigInteger>(); for (CertificateSerial serial : this.certificateSerialCurator.getExpiredSerials()) { unrevoke.add(serial.getSerial()); } if (revoke.size() > 0 || revoke.size() > 0) { this.updateCRLFile(file, revoke, unrevoke); this.certificateSerialCurator.saveOrUpdateAll(serials); } return true; }

Target:
public boolean syncCRLWithDB(File file) throws IOException { List<BigInteger> revoke = new LinkedList<BigInteger>(); List<CertificateSerial> serials = this.certificateSerialCurator.retrieveTobeCollectedSerials(); for (CertificateSerial serial : serials) { revoke.add(serial.getSerial()); serial.setCollected(true); } List<BigInteger> unrevoke = new LinkedList<BigInteger>(); for (CertificateSerial serial : this.certificateSerialCurator.getExpiredSerials()) { unrevoke.add(serial.getSerial()); } if (revoke.size() > 0 || unrevoke.size() > 0) { this.updateCRLFile(file, revoke, unrevoke); this.certificateSerialCurator.saveOrUpdateAll(serials); } return true; }
Source:
public CharSequence toXML() { XmlStringBuilder xml = new XmlStringBuilder(); xml.halfOpenElement(this); xml.attribute(ATTR_START, getStart()); xml.attribute(ATTR_END, getEnd()); xml.closeEmptyElement(); return xml; }

Target:
public XmlStringBuilder toXML() { XmlStringBuilder xml = new XmlStringBuilder(); xml.halfOpenElement(this); xml.attribute(ATTR_START, getStart()); xml.attribute(ATTR_END, getEnd()); xml.closeEmptyElement(); return xml; }
Source:
public String getBucketLifeCycle(String bucketName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> queryParamMap = new HashMap<>(); queryParamMap.put("lifecycle", ""); byte[] buf = new byte[16384]; int bytesRead = 0; HttpResponse response = null; try { response = executeGet(bucketName, "", null, queryParamMap); bytesRead = response.body().byteStream().read(buf); if (bytesRead < 0) { throw new IOException("reached EOF when reading bucket lifecycle"); } } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_LIFECYCLE_CONFIGURATION) { throw e; } } finally { if (response != null && response.body() != null) { response.body().close(); } } return new String(buf, 0, bytesRead, StandardCharsets.UTF_8); }

Target:
public String getBucketLifeCycle(String bucketName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> queryParamMap = new HashMap<>(); queryParamMap.put("lifecycle", ""); HttpResponse response = null; String bodyContent = ""; Scanner scanner = null ; try { response = executeGet(bucketName, "", null, queryParamMap); scanner = new Scanner(response.body().charStream()); scanner.useDelimiter("\\A"); if (scanner.hasNext()) { bodyContent = scanner.next(); } } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_LIFECYCLE_CONFIGURATION) { throw e; } } finally { if (response != null && response.body() != null) { response.body().close(); } if (scanner != null) { scanner.close(); } } return bodyContent; }
Source:
public void write(OutgoingMessageEnvelope ome) throws IOException { Optional<IndexedRecord> optionalIndexedRecord; byte[] encodedRecord; if (ome.getMessage() instanceof IndexedRecord) { optionalIndexedRecord = Optional.of((IndexedRecord) ome.getMessage()); encodedRecord = encodeRecord((IndexedRecord) ome.getMessage()); } else { optionalIndexedRecord = Optional.empty(); encodedRecord = (byte[]) ome.getMessage(); } synchronized (currentDataFileWriterLock) { if (currentBlobWriterComponents == null || willCurrentBlobExceedSize(encodedRecord) || willCurrentBlobExceedRecordLimit()) { startNextBlob(optionalIndexedRecord); } currentBlobWriterComponents.dataFileWriter.appendEncoded(ByteBuffer.wrap(encodedRecord)); recordsInCurrentBlob++; } }

Target:
public void write(OutgoingMessageEnvelope ome) throws IOException { Optional<IndexedRecord> optionalIndexedRecord; byte[] encodedRecord; if (ome.getMessage() instanceof IndexedRecord) { optionalIndexedRecord = Optional.of((IndexedRecord) ome.getMessage()); encodedRecord = encodeRecord((IndexedRecord) ome.getMessage()); } else if (ome.getMessage() instanceof byte[]) { optionalIndexedRecord = Optional.empty(); encodedRecord = (byte[]) ome.getMessage(); } else { throw new IllegalArgumentException("AzureBlobAvroWriter only supports IndexedRecord and byte[]."); } synchronized (currentDataFileWriterLock) { if (currentBlobWriterComponents == null || willCurrentBlobExceedSize(encodedRecord) || willCurrentBlobExceedRecordLimit()) { startNextBlob(optionalIndexedRecord); } currentBlobWriterComponents.dataFileWriter.appendEncoded(ByteBuffer.wrap(encodedRecord)); recordsInCurrentBlob++; } }
Source:
public TimeSpeedConverter() { }

Target:
private TimeSpeedConverter() { }
Source:
public void testJsonPathAsText() throws Exception { String selectQuery = "SELECT col1 FROM testJson WHERE col1 #>> '{k6,nestk4,0}' LIKE '9'"; String pk = "valueOne"; Connection conn = getConnection(); try { createTableAndUpsertRecord(json, pk, conn); PreparedStatement stmt = conn.prepareStatement(selectQuery); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals("Json data read from DB is not as expected for query: <" + selectQuery + ">", json, rs.getString(1)); assertFalse(rs.next()); } finally { conn.close(); } }

Target:
public void testJsonPathAsText() throws Exception { String selectQuery = "SELECT col1 FROM testJson WHERE col1 #>> ARRAY['k6','nestk4','0'] = '9'"; String pk = "valueOne"; Connection conn = getConnection(); try { createTableAndUpsertRecord(json, pk, conn); PreparedStatement stmt = conn.prepareStatement(selectQuery); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals("Json data read from DB is not as expected for query: <" + selectQuery + ">", json, rs.getString(1)); assertFalse(rs.next()); } finally { conn.close(); } }
Source:
public void have_own_assertTrue() { Tests.assertTrue(true); Tests.assertTrue(false); }

Target:
public void have_own_assertTrue() { Tests.assertTrue(false); }
Source:
public Map<String,String> getOptions() { return Collections.<String,String>emptyMap(); }

Target:
public Map<String,String> getOptions() { throw new UnsupportedOperationException("The current recognizer does not provide an option map"); }
Source:
public List<T> nextN(long elements, long timeoutMillis, String errorMsg) throws InterruptedException { List<T> result = new LinkedList<T>(); long remaining = elements; while (remaining > 0) { result.add(next(timeoutMillis, errorMsg)); remaining--; } return result; }

Target:
public List<T> nextN(long elements, long timeoutMillis, String errorMsg) throws InterruptedException { List<T> result = new LinkedList<T>(); long remaining = elements; long deadline = System.currentTimeMillis() + timeoutMillis; while (remaining > 0) { long remainingMillis = deadline - System.currentTimeMillis(); result.add(next(remainingMillis, errorMsg)); remaining--; } return result; }
Source:
private void setupBackgroundImage() { if (mode == 0) return; bgshape = bgblack; if (!Utility.isLowRamDevice(mContext)) { switch (settings.getBackgroundMode()){ case Settings.BACKGROUND_BLACK: { bgshape = bgblack; break; } case Settings.BACKGROUND_GRADIENT: { bgshape = ContextCompat.getDrawable(mContext, R.drawable.background_gradient); break; } case Settings.BACKGROUND_IMAGE: { bgshape = loadBackgroundImage(); break; } case Settings.BACKGROUND_SLIDESHOW: { if (preloadBackgroundImage == null) { bgshape = loadBackgroundSlideshowImage(); } else { bgshape = new BitmapDrawable(mContext.getResources(), preloadBackgroundImage); } break; } } } if ( settings.hideBackgroundImage && mode == 0 ) { background_images[background_image_active].setImageDrawable(bgblack); } else { if (background_image_active == 0){ background_image_active = 1; }else { background_image_active = 0; } switch (settings.slideshowStyle) { case Settings.SLIDESHOW_STYLE_CROPPED: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_CROP); break; case Settings.SLIDESHOW_STYLE_CENTER: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_INSIDE); break; } parentLayout.bringChildToFront(background_images[background_image_active]); background_images[background_image_active].setImageDrawable(bgshape); setupSlideshowAnimation(); } }

Target:
private void setupBackgroundImage() { if (mode == 0) return; bgshape = bgblack; if (!Utility.isLowRamDevice(mContext)) { switch (settings.getBackgroundMode()){ case Settings.BACKGROUND_BLACK: { bgshape = bgblack; break; } case Settings.BACKGROUND_GRADIENT: { bgshape = ContextCompat.getDrawable(mContext, R.drawable.background_gradient); break; } case Settings.BACKGROUND_IMAGE: { bgshape = loadBackgroundImage(); break; } case Settings.BACKGROUND_SLIDESHOW: { if (preloadBackgroundImage == null) { bgshape = loadBackgroundSlideshowImage(); } else { bgshape = new BitmapDrawable(mContext.getResources(), preloadBackgroundImage); setDominantColorFromBitmap(preloadBackgroundImage); } break; } } } if ( settings.hideBackgroundImage && mode == 0 ) { background_images[background_image_active].setImageDrawable(bgblack); } else { background_image_active = (background_image_active + 1) % 2; switch (settings.slideshowStyle) { case Settings.SLIDESHOW_STYLE_CENTER: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_INSIDE); break; case Settings.SLIDESHOW_STYLE_CROPPED: default: background_images[background_image_active].setScaleType(ImageView.ScaleType.CENTER_CROP); break; } background_images[background_image_active].setImageDrawable(bgshape); setupSlideshowAnimation(); } }
Source:
public ValueNode[] getParsedIndexExpressions(LanguageConnectionContext context, Optimizable optTable) throws StandardException { LanguageConnectionContext lcc = context; if (lcc == null) { lcc = (LanguageConnectionContext) ContextService.getContext(LanguageConnectionContext.CONTEXT_ID); } assert lcc != null; if (exprAsts != null) { for (ValueNode ast : exprAsts) { setTableNumberToIndexExpr(ast, optTable); bindNecessaryNodesInIndexExpr(ast, optTable, lcc); } return exprAsts; } exprAsts = new ValueNode[exprTexts.length]; CompilerContext oldCC = (CompilerContext) ContextService.getContext(CompilerContext.CONTEXT_ID); assert(oldCC != null); CompilerContext newCC = lcc.pushCompilerContext(); newCC.setCurrentDependent(oldCC.getCurrentDependent()); Parser p = newCC.getParser(); for (int i = 0; i < exprTexts.length; i++) { ValueNode exprAst = (ValueNode) p.parseSearchCondition(exprTexts[i]); setTableNumberToIndexExpr(exprAst, optTable); bindNecessaryNodesInIndexExpr(exprAst, optTable, lcc); exprAsts[i] = exprAst; } lcc.popCompilerContext(newCC); return exprAsts; }

Target:
public ValueNode[] getParsedIndexExpressions(LanguageConnectionContext context, Optimizable optTable) throws StandardException { LanguageConnectionContext lcc = context; if (lcc == null) { lcc = (LanguageConnectionContext) ContextService.getContext(LanguageConnectionContext.CONTEXT_ID); } assert lcc != null; ValueNode[] exprAsts = new ValueNode[exprTexts.length]; CompilerContext oldCC = (CompilerContext) ContextService.getContext(CompilerContext.CONTEXT_ID); assert(oldCC != null); CompilerContext newCC = lcc.pushCompilerContext(); newCC.setCurrentDependent(oldCC.getCurrentDependent()); Parser p = newCC.getParser(); for (int i = 0; i < exprTexts.length; i++) { ValueNode exprAst = (ValueNode) p.parseSearchCondition(exprTexts[i]); setTableNumberToIndexExpr(exprAst, optTable); bindNecessaryNodesInIndexExpr(exprAst, optTable, lcc); exprAsts[i] = exprAst; } lcc.popCompilerContext(newCC); return exprAsts; }
Source:
public void setCustomAttributes(Map<String, String> attributes) { requireCustomAttributesEnabled("setCustomAttributes"); assert attributes != null; synchronized (customAttributes) { customAttributes.clear(); customAttributes.putAll(attributes); } }

Target:
public void setCustomAttributes(Map<String, String> attributes) { requireCustomAttributesEnabled(); assert attributes != null; for (String attr : attributes.keySet()) { failIfRegistered(attr); } requireCustomAttributes(); customAttributes.clear(); customAttributes.putAll(attributes); }
Source:
public Statistic adopt(Statistic statistic) { statistic.setGlusterVolume(clone(parent)); return statistic; }

Target:
public Statistic adopt(Statistic statistic) { statistic.setGlusterVolume(parent); return statistic; }
Source:
public void terminatedPod() throws Exception { r.waitForMessage("+ sleep", b); deletePods(cloud.connect(), getLabels(this, name), false); r.assertBuildStatus(Result.ABORTED, r.waitForCompletion(b)); r.waitForMessage("Container jnlp was terminated", b); }

Target:
public void terminatedPod() throws Exception { r.waitForMessage("+ sleep", b); deletePods(cloud.connect(), getLabels(this, name), false); r.assertBuildStatus(Result.ABORTED, r.waitForCompletion(b)); r.waitForMessage(new ExecutorStepExecution.RemovedNodeCause().getShortDescription(), b); }
Source:
protected void run(Date lastRun) { try { ShareUtils.clearFolder(getContext()); } catch (Exception e) { Log.d("SharedImageCleanupTask", "Failed to clear shared image folder.", e); } }

Target:
protected void run(Date lastRun) { ShareUtils.clearFolder(getContext()); }
Source:
private <ResultType> ResultType doGet(String path, Class<ResultType> resultTypeClass) throws TDClientException { TDApiRequest request = TDApiRequest.Builder.GET(path).build(); return httpClient.call(request, apiKeyCache, resultTypeClass); }

Target:
private <ResultType> ResultType doGet(String path, Class<ResultType> resultTypeClass) throws TDClientException { checkNotNull(path, "path is null"); checkNotNull(resultTypeClass, "resultTypeClass is null"); TDApiRequest request = TDApiRequest.Builder.GET(path).build(); return httpClient.call(request, apiKeyCache, resultTypeClass); }
Source:
public static ColorDescriptor getDecorationsColorDescriptorFromCurrentTheme() { ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); System.out.println(theme.getColorRegistry().getKeySet()); return Preconditions.checkNotNull(theme.getColorRegistry().getColorDescriptor(DECORATIONS_COLOR)); }

Target:
public static ColorDescriptor getDecorationsColorDescriptorFromCurrentTheme() { ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); return Preconditions.checkNotNull(theme.getColorRegistry().getColorDescriptor(DECORATIONS_COLOR)); }
Source:
public void trace(Object arg0) { if(log.isTraceEnabled()) { log.trace(arg0); } }

Target:
public void trace(Object arg0) { if(log.isTraceEnabled()) { log.trace(addPrefixToLogMessage(arg0)); } }
Source:
public boolean performNextOperation(int completedChildren) { if (completedChildren == getParameters().getImageIds().size()) { return false; } if (completedChildren == 0) { ImagesHandler.updateAllDiskImageSnapshotsStatus(getImageGroupId(), ImageStatus.LOCKED); } else { if (isLiveMerge()) { checkImageIdConsistency(completedChildren - 1); } } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = isLiveMerge() ? buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren) : buildRemoveSnapshotSingleDiskParameters(nextImageId); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); persistCommand(getParameters().getParentCommand(), true); CommandCoordinatorUtil.executeAsyncCommand( isLiveMerge() ? VdcActionType.RemoveSnapshotSingleDiskLive : VdcActionType.RemoveSnapshotSingleDisk, parameters, cloneContextAndDetachFromParent()); return true; }

Target:
public boolean performNextOperation(int completedChildren) { return isLiveMerge() ? performNextOperationLiveMerge(completedChildren) : performNextOperationColdMerge(completedChildren); }