auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void downloadAndExtractArtifacts(List<URLChecksumEntity> artifactDetails) { LOGGER.fine("Current Platform: " + Platform.getCurrent()); for (Iterator<URLChecksumEntity> iterator = artifactDetails.iterator(); iterator.hasNext();) { URLChecksumEntity entity = (URLChecksumEntity) iterator.next(); String url = entity.getUrl().getValue(); String checksum = entity.getChecksum().getValue(); StringBuilder msg = new StringBuilder(); msg.append("Downloading from URL: ").append(url).append("..."); msg.append("[").append(checksum).append("] will be used for checksum validation."); LOGGER.fine(msg.toString()); String result; while ((result = downloadFile(url, checksum)) == null) { LOGGER.warning("Error downloading the file " + url + ". Retrying...."); } files.add(result); if(result.endsWith(".msi")){ String extractedExeFile = FileExtractor.extractMsi(result); files.add(extractedExeFile); } if (!result.endsWith(".jar") && !result.endsWith(".msi") ) { List<String> extractedFileList = FileExtractor.extractArchive(result); files.addAll(extractedFileList); } } LOGGER.fine("Files after download and extract: " + files.toString()); }

Target:
private static void downloadAndExtractArtifacts(List<URLChecksumEntity> artifactDetails) { LOGGER.fine("Current Platform: " + Platform.getCurrent()); for (Iterator<URLChecksumEntity> iterator = artifactDetails.iterator(); iterator.hasNext();) { URLChecksumEntity entity = (URLChecksumEntity) iterator.next(); String url = entity.getUrl().getValue(); String checksum = entity.getChecksum().getValue(); StringBuilder msg = new StringBuilder(); msg.append("Downloading from URL: ").append(url).append("..."); msg.append("[").append(checksum).append("] will be used for checksum validation."); LOGGER.fine(msg.toString()); String result; while ((result = downloadFile(url, checksum)) == null) { LOGGER.warning("Error downloading the file " + url + ". Retrying...."); } files.add(result); if (result.endsWith(".msi")) { String extractedExeFile = FileExtractor.extractMsi(result); files.add(extractedExeFile); } else if (!result.endsWith(".jar") && !result.endsWith(".msi")) { List<String> extractedFileList = FileExtractor.extractArchive(result); files.addAll(extractedFileList); } } LOGGER.fine("Files after download and extract: " + files.toString()); }
Source:
public void testColumnNameContainsTableName() { int daysSinceEpoch = 16138; long secondsSinceEpoch = 16138 * 24 * 60 * 60; List<String> baseQueries = Arrays.asList("SELECT * FROM mytable", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable order by DaysSinceEpoch limit 10000", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable order by timeConvert(DaysSinceEpoch,'DAYS','SECONDS') DESC limit 10000", "SELECT count(*) FROM mytable WHERE DaysSinceEpoch = " + daysSinceEpoch, "SELECT count(*) FROM mytable WHERE timeConvert(DaysSinceEpoch,'DAYS','SECONDS') = " + secondsSinceEpoch, "SELECT count(*) FROM mytable WHERE timeConvert(DaysSinceEpoch,'DAYS','SECONDS') = " + daysSinceEpoch, "SELECT MAX(timeConvert(DaysSinceEpoch,'DAYS','SECONDS')) FROM mytable", "SELECT COUNT(*) FROM mytable GROUP BY dateTimeConvert(DaysSinceEpoch,'1:DAYS:EPOCH','1:HOURS:EPOCH','1:HOURS')"); List<String> queries = new ArrayList<>(); baseQueries.stream().forEach(q -> queries.add(q.replace("DaysSinceEpoch", "mytable.DAYSSinceEpOch"))); baseQueries.stream().forEach(q -> queries.add(q.replace("DaysSinceEpoch", "mytable.DAYSSinceEpOch"))); TestUtils.waitForCondition(aVoid -> { try { for (String query : queries) { JsonNode response = postQuery(query); return response.get("exceptions").size() == 0 && response.get("numSegmentsProcessed").asInt() > 0; } } catch (Exception e) { throw new RuntimeException(e); } return true; }, 10_000L, "Failed to get results for case-insensitive queries"); }

Target:
public void testColumnNameContainsTableName() { int daysSinceEpoch = 16138; long secondsSinceEpoch = 16138 * 24 * 60 * 60; List<String> baseQueries = Arrays.asList("SELECT * FROM mytable", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable order by DaysSinceEpoch limit 10000", "SELECT DaysSinceEpoch, timeConvert(DaysSinceEpoch,'DAYS','SECONDS') FROM mytable order by timeConvert(DaysSinceEpoch,'DAYS','SECONDS') DESC limit 10000", "SELECT count(*) FROM mytable WHERE DaysSinceEpoch = " + daysSinceEpoch, "SELECT count(*) FROM mytable WHERE timeConvert(DaysSinceEpoch,'DAYS','SECONDS') = " + secondsSinceEpoch, "SELECT count(*) FROM mytable WHERE timeConvert(DaysSinceEpoch,'DAYS','SECONDS') = " + daysSinceEpoch, "SELECT MAX(timeConvert(DaysSinceEpoch,'DAYS','SECONDS')) FROM mytable", "SELECT COUNT(*) FROM mytable GROUP BY dateTimeConvert(DaysSinceEpoch,'1:DAYS:EPOCH','1:HOURS:EPOCH','1:HOURS')"); List<String> queries = new ArrayList<>(); baseQueries.forEach(q -> queries.add(q.replace("DaysSinceEpoch", "mytable.DAYSSinceEpOch"))); baseQueries.forEach(q -> queries.add(q.replace("DaysSinceEpoch", "mytable.DAYSSinceEpOch"))); for (String query : queries) { try { postQuery(query); } catch (Exception e) { throw new RuntimeException("Got Exceptions from query - " + query); } } }
Source:
public T getAckCheckpoint() { if (Objects.equals(_currentCheckpoint, _inFlight.peek())) { return _prevCheckpoint; } return _currentCheckpoint; }

Target:
public T getAckCheckpoint() { return _currentCheckpoint; }
Source:
public InvertingProxy awaitReadyInvertingProxyForAccount(String requestId, String accountId) { return getRetryTemplate().execute( retryContext -> { LOGGER.debug("Retrieving InvertingProxy Config for accountId '{}'", accountId); return Optional.ofNullable(grpcCcmV2Client.getOrCreateInvertingProxy(requestId, accountId, ThreadBasedUserCrnProvider.getUserCrn())) .filter(invertingProxy -> InvertingProxy.Status.READY.equals(invertingProxy.getStatus())) .orElseThrow(() -> new RuntimeException(String.format("InvertingProxy not found in ready state for accountId '%s'", accountId))); }, retryExhausted -> { LOGGER.error("Error retrieving InvertingProxy for accountId '{}', retryCount '{}'", accountId, retryExhausted.getRetryCount()); throw new RuntimeException("Error Retrieving CCM InvertingProxy Config", retryExhausted.getLastThrowable()); }); }

Target:
public InvertingProxy awaitReadyInvertingProxyForAccount(String requestId, String accountId) { return getRetryTemplate().execute( retryContext -> { LOGGER.debug("Retrieving InvertingProxy for accountId '{}'", accountId); InvertingProxy invertingProxy = grpcCcmV2Client.getOrCreateInvertingProxy(requestId, accountId, ThreadBasedUserCrnProvider.getUserCrn()); LOGGER.debug("Retrieved InvertingProxy with status '{}' for accountId '{}'", invertingProxy.getStatus(), accountId); if (!InvertingProxy.Status.READY.equals(invertingProxy.getStatus())) { throw new CcmV2Exception(String.format("InvertingProxy is not available in 'READY' state for accountId '%s'", accountId)); } return invertingProxy; }, retryExhausted -> { LOGGER.error("Error Retrieving InvertingProxy for accountId '{}', retryCount '{}'", accountId, retryExhausted.getRetryCount()); throw new CcmV2Exception("Error Retrieving CCM InvertingProxy", retryExhausted.getLastThrowable()); }); }
Source:
protected ListGroups(final GroupCache groupCache, final GroupControl.Factory groupControlFactory, final GroupControl.GenericFactory genericGroupControlFactory, final Provider<IdentifiedUser> identifiedUser, final IdentifiedUser.GenericFactory userFactory, final Provider<GetGroups> accountGetGroups, GroupJson json) { this.groupCache = groupCache; this.groupControlFactory = groupControlFactory; this.genericGroupControlFactory = genericGroupControlFactory; this.identifiedUser = identifiedUser; this.userFactory = userFactory; this.accountGetGroups = accountGetGroups; this.json = json; }

Target:
protected ListGroups(final GroupCache groupCache, final GroupControl.Factory groupControlFactory, final GroupControl.GenericFactory genericGroupControlFactory, final Provider<IdentifiedUser> identifiedUser, final IdentifiedUser.GenericFactory userFactory, final Provider<GetGroups> accountGetGroups, GroupJson json) { this.groupCache = groupCache; this.groupControlFactory = groupControlFactory; this.genericGroupControlFactory = genericGroupControlFactory; this.identifiedUser = identifiedUser; this.userFactory = userFactory; this.accountGetGroups = accountGetGroups; this.json = json; this.options = EnumSet.noneOf(ListGroupsOption.class); }
Source:
public BigtableInstanceName(String projectId, String instanceId) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId), "projectId must be supplied"); Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId), "instnaceId must be supplied"); this.InstanceName = String.format(BIGTABLE_V1_INSTANCE_FMT, instanceId); }

Target:
public BigtableInstanceName(String projectId, String instanceId) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId), "projectId must be supplied"); Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId), "instanceId must be supplied"); this.instanceName = String.format(BIGTABLE_V2_INSTANCE_FMT, instanceId); }
Source:
private void addContent(ProductDTO product, ContentDTO update) { if (update == null || update.getId() == null) { throw new IllegalArgumentException("update references incomplete content"); } Set<ProductContentDTO> productContent = product.getProductContent(); ProductContentDTO oldContent = findContent(productContent, update.getId()); ProductContentDTO content = new ProductContentDTO(); content.setContent(update); boolean enabled = oldContent != null && oldContent.getEnabled(); content.setEnabled(enabled); if (oldContent != null) { productContent.remove(oldContent); } productContent.add(content); }

Target:
private void addContent(ProductDTO product, ContentDTO update) { if (product == null) { throw new IllegalArgumentException("Cannot add content to null product"); } if (update == null || update.getId() == null) { throw new IllegalArgumentException("update references incomplete content"); } Set<ProductContentDTO> productContent; if (product.getProductContent() == null) { productContent = new HashSet<>(); } else { productContent = new HashSet<>(product.getProductContent()); } ProductContentDTO oldContent = findContent(productContent, update.getId()); ProductContentDTO content = new ProductContentDTO(); content.setContent(update); boolean enabled = oldContent != null && oldContent.getEnabled(); content.setEnabled(enabled); if (oldContent != null) { productContent.remove(oldContent); } productContent.add(content); product.setProductContent(productContent); }
Source:
public MemcachedClient createMemcachedClient() throws IOException { try { log.info("Starting an instance of memcache client towards elasticache cluster"); return new MemcachedClient(new InetSocketAddress(hostname, port)); } catch (IOException e) { log.error("Could not initilise connection to elasticache cluster", e); e.printStackTrace(); return null; } }

Target:
public MemcachedClient createMemcachedClient() throws IOException { try { log.info("Starting an instance of memcache client towards elasticache cluster"); return new MemcachedClient(new InetSocketAddress(hostname, port)); } catch (IOException e) { log.error("Could not initilise connection to elasticache cluster", e); return null; } }
Source:
public static QueryBy of(String value) { if (value != null) { return QueryBy.valueOf(value.toUpperCase()); } else { return null; } }

Target:
public static QueryBy of(String value) { return QueryBy.valueOf(value.toUpperCase()); }
Source:
private MediaModel getMediaFromQueueById(int id) { if (mQueue != null && mQueue.size() > 0) { for (MediaModel media : mQueue) { if (media.getId() == id) return media; } } return null; }

Target:
private MediaModel getMediaFromQueueById(int id) { List<MediaModel> queue = getUploadQueue(); for (MediaModel media : queue) { if (media.getId() == id) return media; } return null; }
Source:
protected boolean checkHash(ByteBuffer data) throws NoSuchAlgorithmException { byte[] calculatedHash = Torrent.hash(data); int torrentHashPosition = getIndex() * Torrent.PIECE_HASH_SIZE; for (int i = 0; i < Torrent.PIECE_HASH_SIZE; i++) { byte value = this.torrentHash.get(torrentHashPosition + i); if (value != calculatedHash[i]) { return false; } } return true; }

Target:
protected boolean checkHash(ByteBuffer data) throws NoSuchAlgorithmException { byte[] calculatedHash = Torrent.hash(data); int torrentHashPosition = getIndex() * Torrent.PIECE_HASH_SIZE; ByteBuffer torrentHash = this.torrent.getPiecesHashes(); for (int i = 0; i < Torrent.PIECE_HASH_SIZE; i++) { byte value = torrentHash.get(torrentHashPosition + i); if (value != calculatedHash[i]) { return false; } } return true; }
Source:
protected PojoMapper<?> createNestedMapper(StatementContext ctx, PojoProperty<T> property, String nestedPrefix) { final Type propertyType = property.getQualifiedType().getType(); return new PojoMapper( GenericTypes.getErasedType(propertyType), ctx.getConfig(PojoTypes.class).propertiesOf(type) .orElseThrow(() -> new UnableToProduceResultException("Couldn't find properties for nested type " + propertyType, ctx)), nestedPrefix); }

Target:
protected PojoMapper<?> createNestedMapper(StatementContext ctx, PojoProperty<T> property, String nestedPrefix) { final Type propertyType = property.getQualifiedType().getType(); return new PojoMapper( GenericTypes.getErasedType(propertyType), ctx.getConfig(PojoTypes.class).findFor(type) .orElseThrow(() -> new UnableToProduceResultException("Couldn't find properties for nested type " + propertyType, ctx)), nestedPrefix); }
Source:
public CloseableIterator<SAMRecord> query(QueryInterval[] intervals, boolean contained) { throw new RuntimeException("query is not implemented."); }

Target:
public CloseableIterator<SAMRecord> query(QueryInterval[] intervals, boolean contained) { BAMFileSpan span = new BAMFileSpan(); BrowseableBAMIndex index = getBrowseableIndex(); for (QueryInterval interval : intervals) { BAMFileSpan intervalSpan; if (!contained) { intervalSpan = index.getSpanOverlapping(interval.referenceIndex, interval.start, interval.end); } else { intervalSpan = getSpanContained(interval.referenceIndex, interval.start, interval.end); } span.add(intervalSpan); } return getIterator(span); }
Source:
protected boolean approveMoveRequest(MoveRequest request) { boolean result = request.getElementsToMove().size() > 0; StateMachine targetSM = StateMachineUtils.getStateMachine(request.getTargetContainer()); for (Object e : request.getElementsToMove().keySet()) { if (!(e instanceof Vertex) || (((Vertex) e).eContainer() != null && targetSM != StateMachineUtils.getStateMachine((Vertex) e))) { result = false; break; } } return result; }

Target:
protected boolean approveMoveRequest(MoveRequest request) { boolean result = request.getElementsToMove().size() > 0; if (request.getTargetContainer() instanceof StateMachine) { StateMachine targetSM = (StateMachine) request.getTargetContainer(); for (Object e : request.getElementsToMove().keySet()) { if (!(e instanceof Vertex) || (((Vertex) e).eContainer() != null && targetSM != ((Vertex) e).containingStateMachine())) { result = false; break; } } } return result; }
Source:
public boolean isEnabled() { return getProjectsInRepositoryOfSelectedResources().length > 0 && selectionMapsToSingleRepository(); }

Target:
public boolean isEnabled() { return getProjectsInRepositoryOfSelectedResources().length > 0; }
Source:
public void clone(Long serverID, BinlogPosition position) throws SchemaStoreException { List<ResolvedSchemaChange> empty = Collections.emptyList(); try (Connection c = maxwellConnectionPool.getConnection()) { getSchema(); MysqlSavedSchema cloned = new MysqlSavedSchema(serverID, caseSensitivity, getSchema(), position, savedSchema.getSchemaID(), empty); Long schemaId = cloned.save(c); String logMessage = "clone schema @" + position + " based on id " + savedSchema.getSchemaID(); if (schemaId != null) { logMessage += ", new schema id is " + schemaId; } LOGGER.info(logMessage); } catch ( SQLException e ) { throw new SchemaStoreException(e); } }

Target:
public void clone(Long serverID, BinlogPosition position) throws SchemaStoreException { List<ResolvedSchemaChange> empty = Collections.emptyList(); try (Connection c = maxwellConnectionPool.getConnection()) { getSchema(); MysqlSavedSchema cloned = new MysqlSavedSchema(serverID, caseSensitivity, getSchema(), position, savedSchema.getSchemaID(), empty); Long schemaId = cloned.save(c); LOGGER.info("clone schema @" + position + " based on id " + savedSchema.getSchemaID() + ", new schema id is " + schemaId); } catch ( SQLException e ) { throw new SchemaStoreException(e); } }
Source:
private static void readAndAssertBytesRead(FSDataInputStream inputStream, int bytesToRead) throws IOException { assertEquals("S3AInputStream#read did not read the correct number of " + "bytes", bytesToRead, inputStream.read(new byte[bytesToRead])); }

Target:
private static void readAndAssertBytesRead(FSDataInputStream inputStream, int bytesToRead) throws IOException { assertEquals("AbfsInputStream#read did not read the correct number of " + "bytes", bytesToRead, inputStream.read(new byte[bytesToRead])); }
Source:
public Response toResponse(JsonProcessingException exception) { if (exception instanceof JsonGenerationException || exception instanceof InvalidDefinitionException) { return super.toResponse(exception); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Unable to process JSON", exception); } final String message = exception.getOriginalMessage(); final ErrorMessage errorMessage = new ErrorMessage(Response.Status.BAD_REQUEST.getStatusCode(), "Unable to process JSON", showDetails ? message : null); return Response.status(Response.Status.BAD_REQUEST) .type(MediaType.APPLICATION_JSON_TYPE) .entity(errorMessage) .build(); }

Target:
public Response toResponse(JsonProcessingException exception) { if (exception instanceof JsonGenerationException || exception instanceof InvalidDefinitionException) { return super.toResponse(exception); } LOGGER.debug("Unable to process JSON", exception); final String message = exception.getOriginalMessage(); final ErrorMessage errorMessage = new ErrorMessage(Response.Status.BAD_REQUEST.getStatusCode(), "Unable to process JSON", showDetails ? message : null); return Response.status(Response.Status.BAD_REQUEST) .type(MediaType.APPLICATION_JSON_TYPE) .entity(errorMessage) .build(); }
Source:
Integer throwsException() { if ((random ^ random) == 0) throw new RuntimeException(); return 1; }

Target:
Integer throwsException() { throw new RuntimeException(); }
Source:
private long callApplyBinaryLogEE(ByteBuffer paramBuffer, long txnId, long spHandle, long uniqueId, int remoteClusterId, long remoteUniqueId) throws EEException { try { return m_ee.applyBinaryLog(paramBuffer, txnId, spHandle, m_lastCommittedSpHandle, uniqueId, remoteClusterId, getNextUndoToken(m_currentTxnId)); } catch(DRTableNotFoundException e) { DRTableNotFoundException tableNotFound = (DRTableNotFoundException) e; tableNotFound.setRemoteTxnUniqueId(remoteUniqueId); tableNotFound.setCatalogVersion(getSystemProcedureExecutionContext().getCatalogVersion()); throw e; } }

Target:
private long callApplyBinaryLogEE(ByteBuffer paramBuffer, long txnId, long spHandle, long uniqueId, int remoteClusterId, long remoteUniqueId) throws EEException { try { return m_ee.applyBinaryLog(paramBuffer, txnId, spHandle, m_lastCommittedSpHandle, uniqueId, remoteClusterId, getNextUndoToken(m_currentTxnId)); } catch(DRTableNotFoundException e) { e.setRemoteTxnUniqueId(remoteUniqueId); e.setCatalogVersion(getSystemProcedureExecutionContext().getCatalogVersion()); throw e; } }
Source:
protected void Perform() { final VM vm = getVm(); setSucceeded(Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.VmLogoff, new VmLogoffVDSCommandParameters(getVdsId(), vm.getvm_guid(), mForce)).getSucceeded()); if (getSucceeded()) { vm.setguest_cur_user_name(null); vm.setguest_cur_user_id(null); DbFacade.getInstance().getVmDynamicDAO().update(vm.getDynamicData()); } }

Target:
protected void Perform() { final VM vm = getVm(); final boolean sentToVM = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.VmLogoff, new VmLogoffVDSCommandParameters(getVdsId(), vm.getvm_guid(), mForce)).getSucceeded(); if (sentToVM) { vm.setguest_cur_user_name(null); vm.setguest_cur_user_id(null); DbFacade.getInstance().getVmDynamicDAO().update(vm.getDynamicData()); } setSucceeded(sentToVM); }
Source:
public void destroy() { if (out != null) { IOUtils.closeQuietly(out); } FileUtils.deleteQuietly(tempData); super.destroy(); }

Target:
public void destroy() { IOUtils.closeQuietly(out); FileUtils.deleteQuietly(tempData); super.destroy(); }
Source:
private void parseSuite(String suitePath) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("suiteXmlPath: \"" + suitePath + "\""); } try { Collection<XmlSuite> allSuites = Parser.parse(suitePath, getProcessor()); for (XmlSuite s : allSuites) { s.setParallel(this.m_parallelMode); s.setThreadCount(this.m_threadCount); if (m_testNames != null) { XmlSuiteUtils.cloneIfContainsTestsWithNamesMatchingAny(s, m_testNames); List<String> missMatchedTestname = XmlSuiteUtils.getMissMatchedTestNames(m_testNames); if (CollectionUtils.hasElements(missMatchedTestname)) { XmlSuiteUtils.resetField(); throw new TestNGException("The test(s) <" + Arrays.toString(missMatchedTestname.toArray()) + "> cannot be found."); } else { m_suites.addAll(XmlSuiteUtils.getCloneSuite()); XmlSuiteUtils.resetField(); } } else { m_suites.add(s); } } } catch (IOException e) { e.printStackTrace(System.out); } catch (Exception ex) { Throwable t = ex; while (t.getCause() != null) { t = t.getCause(); } if (t instanceof TestNGException) { throw (TestNGException) t; } throw new TestNGException(t); } }

Target:
private void parseSuite(String suitePath) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("suiteXmlPath: \"" + suitePath + "\""); } try { Collection<XmlSuite> allSuites = Parser.parse(suitePath, getProcessor()); for (XmlSuite s : allSuites) { s.setParallel(this.m_parallelMode); s.setThreadCount(this.m_threadCount); if (m_testNames == null) { m_suites.add(s); continue; } TestNamesMatcher testNamesMatcher = new TestNamesMatcher(s, m_testNames); List<String> missMatchedTestname = testNamesMatcher.getMissMatchedTestNames(); if (!missMatchedTestname.isEmpty()) { throw new TestNGException("The test(s) <" + missMatchedTestname + "> cannot be found."); } m_suites.addAll(testNamesMatcher.getSuitesMatchingTestNames()); } } catch (IOException e) { e.printStackTrace(System.out); } catch (Exception ex) { Throwable t = ex; while (t.getCause() != null) { t = t.getCause(); } if (t instanceof TestNGException) { throw (TestNGException) t; } throw new TestNGException(t); } }
Source:
protected void doValidate(CommonHttpResponse response, IOperationMonitor monitor) throws IOException, BugzillaRestException { int statusCode = response.getStatusCode(); if (statusCode != 400 && statusCode != 200) { if (statusCode == HttpStatus.SC_NOT_FOUND) { throw new BugzillaRestResourceNotFoundException( NLS.bind("Requested resource ''{0}'' does not exist", response.getRequestPath())); } throw new BugzillaRestException(NLS.bind("Unexpected response from Bugzilla REST server for ''{0}'': {1}", response.getRequestPath(), HttpUtil.getStatusText(statusCode))); } }

Target:
protected void doValidate(CommonHttpResponse response, IOperationMonitor monitor) throws IOException, BugzillaRestException { int statusCode = response.getStatusCode(); if (statusCode != HttpURLConnection.HTTP_BAD_REQUEST && statusCode != HttpURLConnection.HTTP_OK) { if (statusCode == HttpStatus.SC_NOT_FOUND) { throw new BugzillaRestResourceNotFoundException( NLS.bind("Requested resource ''{0}'' does not exist", response.getRequestPath())); } throw new BugzillaRestException(NLS.bind("Unexpected response from Bugzilla REST server for ''{0}'': {1}", response.getRequestPath(), HttpUtil.getStatusText(statusCode))); } }
Source:
public URI getUri() { return UriBuilder.fromUri(getBaseUri()) .path(ResourceUris.DHCPV6_HOSTS) .path(clientIdToUri(clientId)) .build(); }

Target:
public URI getUri() { return absoluteUri(ResourceUris.DHCPV6_HOSTS, clientIdToUri(clientId)); }
Source:
private static boolean isRetryable(Throwable error) { if (!(error instanceof RetrofitError)) { return false; } RetrofitError retrofitError = (RetrofitError) error; if (retrofitError.getKind() == Kind.NETWORK) { return true; } if (retrofitError.getKind() == Kind.HTTP && retrofitError.getResponse().getStatus() != HttpStatus.BAD_REQUEST.value()) { return true; } return false; }

Target:
private static boolean isRetryable(Throwable error) { if (!(error instanceof RetrofitError)) { return false; } RetrofitError retrofitError = (RetrofitError) error; if (retrofitError.getKind() == Kind.NETWORK) { return true; } if (retrofitError.getKind() == Kind.HTTP) { Response response = retrofitError.getResponse(); return (response != null && response.getStatus() != HttpStatus.BAD_REQUEST.value()); } return false; }
Source:
public void sendEndOfStream(SystemStream systemStream, int taskCount) { log.info("Send end-of-stream messages to all partitions of " + systemStream); String stream = systemStream.getStream(); SystemStreamMetadata metadata = sysAdmins.get(systemStream.getSystem()) .getSystemStreamMetadata(Collections.singleton(stream)) .get(stream); int partitionCount = metadata.getSystemStreamPartitionMetadata().size(); for (int i = 0; i < partitionCount; i++) { String key = String.format(EOS_KEY_FORMAT, stream, taskName); EndOfStreamMessage message = new EndOfStreamMessage(taskName, taskCount); OutgoingMessageEnvelope envelopeOut = new OutgoingMessageEnvelope(systemStream, i, key, message); collector.send(envelopeOut); } }

Target:
void sendEndOfStream(SystemStream systemStream, int taskCount) { log.info("Send end-of-stream messages with upstream task count to all partitions of {}", taskCount, systemStream); final EndOfStreamMessage message = new EndOfStreamMessage(taskName, taskCount); ControlMessageUtils.sendControlMessage(message, systemStream, metadataCache, collector); }
Source:
private Map<Guid, List<AsyncTasks>> groupTasksByRootCommandId(List<AsyncTasks> tasksInDB) { Map<Guid, List<AsyncTasks>> rootCommandIdToCommandsMap = new HashMap<>(); for (AsyncTasks task : tasksInDB) { Guid rootCommandId = task.getRootCommandId(); if (!rootCommandIdToCommandsMap.containsKey(rootCommandId)) { rootCommandIdToCommandsMap.put(rootCommandId, new ArrayList<AsyncTasks>()); } rootCommandIdToCommandsMap.get(rootCommandId).add(task); } return rootCommandIdToCommandsMap; }

Target:
private Map<Guid, List<AsyncTasks>> groupTasksByRootCommandId(List<AsyncTasks> tasksInDB) { Map<Guid, List<AsyncTasks>> rootCommandIdToCommandsMap = new HashMap<>(); for (AsyncTasks task : tasksInDB) { Guid rootCommandId = task.getRootCommandId(); if (!rootCommandIdToCommandsMap.containsKey(rootCommandId)) { rootCommandIdToCommandsMap.put(rootCommandId, new ArrayList<AsyncTasks>()); } MultiValueMapUtils.addToMap(rootCommandId, task, rootCommandIdToCommandsMap); } return rootCommandIdToCommandsMap; }
Source:
public void migrate(Connection connection) throws Exception { long viewId = VIEW_SERVICE.getDefaultViewId(); makeInsert(viewId,connection); }

Target:
public void migrate(Connection connection) throws Exception { if(PropertyUtil.getOptional("flyway.sample.1_0_12.skip", true)) { return; } long viewId = VIEW_SERVICE.getDefaultViewId(); makeInsert(viewId,connection); }
Source:
private boolean allow(Message message) { MessageContent messageContent = new MessageContent.Builder() .withContentType(message.getContentType()) .withSchema(message.getSchema()) .withData(message.getData()) .build(); FilterResult result = filterChain.apply(messageContent); filteredMessageHandler.handle(result, message, subscription, (offset) -> receiver.commit(singleton(offset))); return !result.isFiltered(); }

Target:
private boolean allow(Message message) { FilterResult result = filterChain.apply(getMessageContent(message)); filteredMessageHandler.handle(result, message, subscription); return !result.isFiltered(); }
Source:
public void setSessionTimeout(Duration duration) { throw new NotImplementedException("operation not supported by JettyReactiveWebServerFactory"); }

Target:
public void setSessionTimeout(Duration duration) { throw new UnsupportedOperationException("operation not supported by JettyReactiveWebServerFactory"); }
Source:
protected void executeImport(ImportVmFromExportDomainModel importVmModel) { importVmModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { VmListModel.this.setWindow(null); } }, cloneObjectMap); }

Target:
protected void executeImport(ImportVmFromExportDomainModel importVmModel) { importVmModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { setWindow(null); } }, cloneObjectMap); }
Source:
public ProcessTaskWrapper<Integer> stopIptablesAsync(final SshMachineLocation machine) { log.info("Stopping iptables for at {}", entity(), machine); List<String> cmds = ImmutableList.<String>of(); if (isLocationFirewalldEnabled(machine)) { cmds = ImmutableList.of(IptablesCommands.firewalldServiceStop(), IptablesCommands.firewalldServiceStatus()); } else { cmds = ImmutableList.of(IptablesCommands.iptablesServiceStop(), IptablesCommands.iptablesServiceStatus()); } ProcessTaskFactory<Integer> stopIptables = SshTasks.newSshExecTaskFactory(machine, cmds.toArray(new String[cmds.size()])) .summary("stop iptables"); return DynamicTasks.queue(stopIptables); }

Target:
public Task<Void> stopIptablesAsync(final SshMachineLocation machine) { return DynamicTasks.queue("stop iptables", new Runnable() { public void run() { stopIptablesImpl(machine); } }); }
Source:
public Collection<BaragonConfigFile> generateConfigsForProject(ServiceContext snapshot) throws MissingTemplateException { final Collection<BaragonConfigFile> files = Lists.newArrayList(); String templateName = snapshot.getService().getTemplate() != null ? snapshot.getService().getTemplate() : "default"; List<LbConfigTemplate> matchingTemplates = templates.get(templateName); if (templates.get(templateName) != null) { for (LbConfigTemplate template : matchingTemplates) { final String filename = String.format(template.getFilename(), snapshot.getService().getServiceId()); final StringWriter sw = new StringWriter(); try { template.getTemplate().apply(snapshot, sw); } catch (Exception e) { throw Throwables.propagate(e); } files.add(new BaragonConfigFile(String.format("%s/%s", loadBalancerConfiguration.getRootPath(), filename), sw.toString())); } } else { throw new MissingTemplateException(String.format("MissingTemplateException : Template %s could not be found", templateName)); } return files; }

Target:
public Collection<BaragonConfigFile> generateConfigsForProject(ServiceContext snapshot) throws MissingTemplateException { final Collection<BaragonConfigFile> files = Lists.newArrayList(); String templateName = snapshot.getService().getTemplateName().or(BaragonAgentServiceModule.DEFAULT_TEMPLATE_NAME); List<LbConfigTemplate> matchingTemplates = templates.get(templateName); if (templates.get(templateName) != null) { for (LbConfigTemplate template : matchingTemplates) { final String filename = String.format(template.getFilename(), snapshot.getService().getServiceId()); final StringWriter sw = new StringWriter(); try { template.getTemplate().apply(snapshot, sw); } catch (Exception e) { throw Throwables.propagate(e); } files.add(new BaragonConfigFile(String.format("%s/%s", loadBalancerConfiguration.getRootPath(), filename), sw.toString())); } } else { throw new MissingTemplateException(String.format("MissingTemplateException : Template %s could not be found", templateName)); } return files; }
Source:
private void enterCustomOrganizationKey() { while (true) { String organizationKey = Messages.showInputDialog(panel, "Please enter the organization key", "Add Another Organization", null); if (StringUtil.isNotEmpty(organizationKey)) { boolean found = selectOrganizationIfExists(organizationKey); if (!found) { GetOrganizationTask task = new GetOrganizationTask(model.createServerWithoutOrganization(), organizationKey); ProgressManager.getInstance().run(task); if (task.organization() != null) { listModel.add(0, task.organization()); orgList.setSelectedIndex(0); orgList.ensureIndexIsVisible(0); } else if (task.getException() != null) { Messages.showErrorDialog("Failed to fetch organization from SonarQube server: " + task.getException().getMessage(), "Connection Failure"); continue; } else { Messages.showErrorDialog(String.format("Organization '%s' not found. Please enter the key of an existing organization.", organizationKey), "Organization Not Found"); continue; } } } break; } }

Target:
private void enterCustomOrganizationKey() { while (true) { String organizationKey = Messages.showInputDialog(panel, "Please enter the organization key", "Add Another Organization", null); if (StringUtil.isNotEmpty(organizationKey)) { boolean found = selectOrganizationIfExists(organizationKey); if (found) { break; } GetOrganizationTask task = new GetOrganizationTask(model.createServerWithoutOrganization(), organizationKey); ProgressManager.getInstance().run(task); if (task.organization() != null) { listModel.add(0, task.organization()); orgList.setSelectedIndex(0); orgList.ensureIndexIsVisible(0); break; } else if (task.getException() != null) { Messages.showErrorDialog("Failed to fetch organization from SonarQube server: " + task.getException().getMessage(), "Connection Failure"); } else { Messages.showErrorDialog(String.format("Organization '%s' not found. Please enter the key of an existing organization.", organizationKey), "Organization Not Found"); } } } }
Source:
private Optional<CommonTokenStream> getTokenStream(File input) { try { FileInputStream inputStream = new FileInputStream(input); SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); if (!configuration.debugFlagSet()) { lexer.removeErrorListeners(); lexer.addErrorListener(new ErrorListener()); } inputStream.close(); return Optional.of(new CommonTokenStream(lexer)); } catch (IOException e) { handleIOException(e); } catch (CLIArgumentParserException e) { handleCLIException(e); } return Optional.empty(); }

Target:
private Optional<CommonTokenStream> getTokenStream(File input) { try (FileInputStream inputStream = new FileInputStream(input)) { SwiftLexer lexer = new SwiftLexer(new ANTLRInputStream(inputStream)); if (!configuration.debugFlagSet()) { lexer.removeErrorListeners(); lexer.addErrorListener(new ErrorListener()); } return Optional.of(new CommonTokenStream(lexer)); } catch (IOException e) { handleIOException(e); } catch (CLIArgumentParserException e) { handleCLIException(e); } return Optional.empty(); }
Source:
public void run() { if (WatchDogGlobals.isActive) { long executionDate = System.currentTimeMillis(); long delta = executionDate - previousExecutionDate; boolean deltaIsWithinReasonableBoundaries = delta >= UPDATE_RATE && delta <= UPDATE_RATE * 1.16; if (!deltaIsWithinReasonableBoundaries) { WatchDogLogger.getInstance().logInfo( "System suspend detected!"); intervalManager.closeAllIntervals(new Date( previousExecutionDate + UPDATE_RATE)); intervalManager.generateAndSetSessionSeed(); eventManager.update(new WatchDogEvent(this, EventType.START_IDE)); PerspectiveInterval perspectiveInt = intervalManager .getInterval(PerspectiveInterval.class); if(perspectiveInt != null) { eventManager.update(new WatchDogEvent(perspectiveInt.getPerspectiveType(), EventType.START_PERSPECTIVE)); } } } startTimeCheckerOnce(); previousExecutionDate = System.currentTimeMillis(); }

Target:
public void run() { if (WatchDogGlobals.isActive) { long executionDate = System.currentTimeMillis(); long delta = executionDate - previousExecutionDate; boolean deltaIsWithinReasonableBoundaries = delta >= UPDATE_RATE && delta <= UPDATE_RATE * 1.16; if (!deltaIsWithinReasonableBoundaries) { WatchDogLogger.getInstance().logInfo( "System suspend detected!"); intervalManager.closeAllIntervals(new Date( previousExecutionDate + UPDATE_RATE)); intervalManager.generateAndSetSessionSeed(); eventManager.update(new WatchDogEvent(this, EventType.START_IDE)); eventManager.updatePerspectiveInterval(); } } startTimeCheckerOnce(); previousExecutionDate = System.currentTimeMillis(); }
Source:
public DeviceInfoReturn attachManagedBlockStorageVolume(Guid volumeId, Map<String, Object> connectionInfo) { JsonRpcRequest request = new RequestBuilder("ManagedVolume.attach_volume") .withParameter("vol_id", volumeId) .withParameter("connection_info", connectionInfo) .build(); Map<String, Object> response = new FutureMap(this.client, request); Map<String, Object> info = (Map<String, Object>) response.get("info"); return new DeviceInfoReturn(info); }

Target:
public DeviceInfoReturn attachManagedBlockStorageVolume(Guid volumeId, Map<String, Object> connectionInfo) { JsonRpcRequest request = new RequestBuilder("ManagedVolume.attach_volume") .withParameter("vol_id", volumeId.toString()) .withParameter("connection_info", connectionInfo) .build(); Map<String, Object> response = new FutureMap(this.client, request); Map<String, Object> info = (Map<String, Object>) response.get("info"); return new DeviceInfoReturn(info); }
Source:
public String getBriefDescription() { return briefDescription; }

Target:
public String getBriefDescription() { return this.briefDescription; }
Source:
private void rollbackTransaction(Connection dbConnection) { try { if (dbConnection != null) { dbConnection.rollback(); } } catch (SQLException e) { log.error("An error occurred while rolling back transactions.", e); } }

Target:
private void rollbackTransaction(Connection dbConnection) { try { if (dbConnection != null && !dbConnection.getAutoCommit()) { dbConnection.rollback(); } } catch (SQLException e) { log.error("An error occurred while transaction rollback.", e); } }
Source:
private static String getTrimmedLabel(IMarkerEvent marker) { String label = marker.getLabel(); if (label == null) { return null; } return label.substring(0, Math.min(label.indexOf('\n') != -1 ? label.indexOf('\n') : label.length(), MAX_LABEL_LENGTH)); }

Target:
private static String getTrimmedLabel(IMarkerEvent marker) { String label = marker.getLabel(); if (label == null) { return null; } return label.substring(0, Math.min(label.indexOf(SWT.LF) != -1 ? label.indexOf(SWT.LF) : label.length(), MAX_LABEL_LENGTH)); }
Source:
public void put(RevObject obj) { byte[] value = encode(obj); byte[] prev = map.putIfAbsent(obj.getId(), value); if (prev == null) { sizeTracker.inserted(obj.getId(), value); } }

Target:
public void put(RevObject obj) { if (!map.containsKey(obj.getId())) { byte[] value = encode(obj); byte[] prev = map.putIfAbsent(obj.getId(), value); if (prev == null) { sizeTracker.inserted(obj.getId(), value); } } }
Source:
private boolean methodOpeningResource(MethodInvocationTree mit) { return !excludedByRuleOption(mit.symbolType()) && !isWithinTryHeader(mit) && !handledByFramework(mit) && (JDBC_RESOURCE_CREATIONS.anyMatch(mit) || STREAMS_BACKED_BY_RESOURCE.anyMatch(mit) || (needsClosing(mit.symbolType()) && !CLOSEABLE_EXCEPTIONS.anyMatch(mit) && mitHeuristics(mit))); }

Target:
private boolean methodOpeningResource(MethodInvocationTree mit) { return !isWithinTryHeader(mit) && !excludedByRuleOption(mit.symbolType()) && !handledByFramework(mit) && (JDBC_RESOURCE_CREATIONS.anyMatch(mit) || STREAMS_BACKED_BY_RESOURCE.anyMatch(mit) || (needsClosing(mit.symbolType()) && !CLOSEABLE_EXCEPTIONS.anyMatch(mit) && mitHeuristics(mit))); }
Source:
private void setUpClusterArtifacts(Topology topology) throws IOException { String config = topology.getConfig(); ObjectMapper objectMapper = new ObjectMapper(); Map jsonMap = objectMapper.readValue(config, Map.class); if (jsonMap != null) { List<Object> clusterList = (List<Object>) jsonMap.get(TopologyLayoutConstants.JSON_KEY_CLUSTERS); if (clusterList != null) { List<Cluster> clusters = objectMapper.readValue(objectMapper.writeValueAsString(clusterList), new TypeReference<List<Cluster>>() { }); Path artifactsDir = topologyActions.getArtifactsLocation(topology); if (artifactsDir.toFile().isDirectory()) { FileUtils.cleanDirectory(artifactsDir.toFile()); } else if (!artifactsDir.toFile().mkdirs()) { LOG.error("Could not create artifacts dir {}", artifactsDir); throw new IOException("Could not create artifacts dir: " + artifactsDir); } for (Cluster c : clusters) { Cluster cluster = getCluster(c.getId()); String resource = cluster.getClusterConfigStorageName(); File destPath = Paths.get(artifactsDir.toString(), cluster.getClusterConfigFileName()).toFile(); try ( InputStream src = jarStorage.downloadJar(resource); FileOutputStream dest = new FileOutputStream(destPath); ) { IOUtils.copy(src, dest); LOG.debug("Resource copied to {}", resource, destPath); } } } } }

Target:
private void setUpClusterArtifacts(Topology topology) throws IOException { String config = topology.getConfig(); ObjectMapper objectMapper = new ObjectMapper(); Map jsonMap = objectMapper.readValue(config, Map.class); if (jsonMap != null) { List<Object> clusterList = (List<Object>) jsonMap.get(TopologyLayoutConstants.JSON_KEY_CLUSTERS); if (clusterList != null) { List<Cluster> clusters = objectMapper.readValue(objectMapper.writeValueAsString(clusterList), new TypeReference<List<Cluster>>() { }); Path artifactsDir = topologyActions.getArtifactsLocation(topology); if (artifactsDir.toFile().exists()) { if (artifactsDir.toFile().isDirectory()) { FileUtils.cleanDirectory(artifactsDir.toFile()); } else { final String errorMessage = String.format("Artifacts location '%s' must be a directory.", artifactsDir); LOG.error(errorMessage); throw new IOException(errorMessage); } } else if (!artifactsDir.toFile().mkdirs()) { LOG.error("Could not create artifacts dir {}", artifactsDir); throw new IOException("Could not create artifacts dir: " + artifactsDir); } for (Cluster c : clusters) { Cluster cluster = getCluster(c.getId()); String resource = cluster.getClusterConfigStorageName(); File destPath = Paths.get(artifactsDir.toString(), cluster.getClusterConfigFileName()).toFile(); try ( InputStream src = fileStorage.downloadFile(resource); FileOutputStream dest = new FileOutputStream(destPath); ) { IOUtils.copy(src, dest); LOG.debug("Resource copied to {}", resource, destPath); } } } } }
Source:
private static <T> T getField(Object object, String fieldName) { try { Field field = object.getClass().getDeclaredField(fieldName); T result = null; if (field.isAccessible()) { result = (T) field.get(object); } else { field.setAccessible(true); result = (T) field.get(object); field.setAccessible(false); } return result; } catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException("Unable to hack client", e); } }

Target:
private static <T> T getField(Object object, String fieldName) { try { Field field = object.getClass().getDeclaredField(fieldName); T result = null; if (field.isAccessible()) { result = (T) field.get(object); } else { field.setAccessible(true); result = (T) field.get(object); field.setAccessible(false); } return result; } catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException("Unable to access field " + fieldName + " through reflection", e); } }
Source:
public String getNameKey() { return nameKey; }

Target:
String getNameKey() { return nameKey; }
Source:
public void setup() { metricsManager = MetricsManagers.createForTests(); legacyMetrics = SweepOutcomeMetrics.registerLegacy(metricsManager); targetedSweepMetrics = TargetedSweepMetrics .create(metricsManager, mock(TimelockService.class), new InMemoryKeyValueService(true), Long.MAX_VALUE); SweepOutcomeMetrics.LEGACY_OUTCOMES.forEach(outcome -> { assertThat(metricsManager).hasNotRegisteredLegacyOutcome(outcome); }); SweepOutcomeMetrics.TARGETED_OUTCOMES.forEach(outcome -> { assertThat(metricsManager).hasNotRegisteredTargetedOutcome(CONSERVATIVE, outcome); assertThat(metricsManager).hasNotRegisteredTargetedOutcome(THOROUGH, outcome); }); }

Target:
public void setup() { metricsManager = MetricsManagers.createForTests(); legacyMetrics = SweepOutcomeMetrics.registerLegacy(metricsManager); targetedSweepMetrics = TargetedSweepMetrics .create(metricsManager, mock(TimelockService.class), new InMemoryKeyValueService(true), Long.MAX_VALUE); }
Source:
protected void internalReceiveUpdate(String itemName, State newState) { if (newState != UnDefType.UNDEF) { for (ExpireBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { long expireAfterMs = provider.getExpiresAfterMs(itemName); nextExpireTsMap.put(itemName, System.currentTimeMillis() + expireAfterMs); break; } } } }

Target:
protected void internalReceiveUpdate(String itemName, State newState) { for (ExpireBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { State expiredState = provider.getExpiredState(itemName); if (expiredState.equals(newState)) { nextExpireTsMap.put(itemName, Long.MAX_VALUE); } else { long expireAfterMs = provider.getExpiresAfterMs(itemName); nextExpireTsMap.put(itemName, System.currentTimeMillis() + expireAfterMs); } break; } } }
Source:
public static Plan plan(AnalyzedUpdateStatement update, Functions functions, PlannerContext plannerCtx, SubqueryPlanner subqueryPlanner) { if (!update.returnValues().isEmpty()) { if (!plannerCtx.clusterState().getNodes().getMinNodeVersion().onOrAfter(Version.V_4_2_0)) { throw new UnsupportedFeatureException(RETURNING_VERSION_ERROR_MSG); } } AbstractTableRelation table = update.table(); Plan plan; if (table instanceof DocTableRelation) { DocTableRelation docTable = (DocTableRelation) table; plan = plan(docTable, update.assignmentByTargetCol(), update.query(), functions, plannerCtx, update.returnValues(), update.fields()); } else { plan = new Update((plannerContext, params, subQueryValues) -> sysUpdate( plannerContext, (TableRelation) table, update.assignmentByTargetCol(), update.query(), params, subQueryValues, update.returnValues(), update.fields() ) ); } Map<LogicalPlan, SelectSymbol> subQueries = subqueryPlanner.planSubQueries(update); return MultiPhasePlan.createIfNeeded(plan, subQueries); }

Target:
public static Plan plan(AnalyzedUpdateStatement update, Functions functions, PlannerContext plannerCtx, SubqueryPlanner subqueryPlanner) { if (!update.returnValues().isEmpty() && !plannerCtx.clusterState().getNodes().getMinNodeVersion().onOrAfter(Version.V_4_2_0)) { throw new UnsupportedFeatureException(RETURNING_VERSION_ERROR_MSG); } AbstractTableRelation table = update.table(); Plan plan; if (table instanceof DocTableRelation) { DocTableRelation docTable = (DocTableRelation) table; plan = plan(docTable, update.assignmentByTargetCol(), update.query(), functions, plannerCtx, update.returnValues(), update.fields()); } else { plan = new Update((plannerContext, params, subQueryValues) -> sysUpdate( plannerContext, (TableRelation) table, update.assignmentByTargetCol(), update.query(), params, subQueryValues, update.returnValues(), update.fields() ) ); } Map<LogicalPlan, SelectSymbol> subQueries = subqueryPlanner.planSubQueries(update); return MultiPhasePlan.createIfNeeded(plan, subQueries); }
Source:
protected boolean canDoAction() { if (getVds().getKdumpStatus() != KdumpStatus.ENABLED) { log.infoFormat("Kdump detection support is not configured on host {0}({1}).", getVdsName(), getVdsId()); return false; } return getVds().isPmKdumpDetection(); }

Target:
protected boolean canDoAction() { if (getVds().getKdumpStatus() != KdumpStatus.ENABLED) { addCanDoActionMessage(VdcBllMessages.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS); return false; } boolean detectionEnabled = getVds().isPmKdumpDetection(); if (!detectionEnabled) { addCanDoActionMessage(VdcBllMessages.KDUMP_DETECTION_NOT_ENABLED_FOR_VDS); } return detectionEnabled; }