auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getParameters().getStorageServerConnection().getid()); if (!domains.isEmpty() && domains.size() == 1) { setStorageDomain(domains.get(0)); locks.put(getStorageDomain().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getParameters().getStorageServerConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getConnection().getid()); if (!domains.isEmpty()) { for (StorageDomain domain : domains) { locks.put(domain.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } if (getConnection().getstorage_type().isFileDomain()) { locks.put(getConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } else { locks.put(getConnection().getconnection() + ";" + getConnection().getiqn() + ";" + getConnection().getport() + ";" + getConnection().getuser_name(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getConnection().getid(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }
Source:
protected void validateClone(Map<String, Long> values) throws IOException { try (Table clonedTable = getConnection().getTable(clonedTableName); ResultScanner scanner = clonedTable.getScanner(new Scan())){ for(Result result : scanner) { String row = Bytes.toString(result.getRow()); Long expected = values.get(row); Long found = Bytes.toLong(result.getValue(COLUMN_FAMILY, QUALIFIER)); Assert.assertEquals("row " + row + " not equal", expected, found); values.remove(row); } } Assert.assertTrue("Extra keys found.", values.isEmpty()); }

Target:
protected void validateClone(Map<String, Long> values) throws IOException { try (Table clonedTable = getConnection().getTable(clonedTableName); ResultScanner scanner = clonedTable.getScanner(new Scan())){ for(Result result : scanner) { String row = Bytes.toString(result.getRow()); Long expected = values.get(row); Long found = Bytes.toLong(result.getValue(COLUMN_FAMILY, QUALIFIER)); Assert.assertEquals("row " + row + " not equal", expected, found); values.remove(row); } } Assert.assertTrue("There were missing keys.", values.isEmpty()); }
Source:
public boolean pushdownFilterAndProjection(PageSourceOptions options) { ImmutableList.Builder<FilterFunction> remainingFilterFunctions = ImmutableList.builder(); for (FilterFunction filterFunction : options.getFilterFunctions()) { Set<ColumnMappingKind> inputKinds = getInputKinds(filterFunction); if (!inputKinds.contains(PREFILLED)) { remainingFilterFunctions.add(filterFunction); continue; } if (inputKinds.size() > 1) { throw new UnsupportedOperationException("Filters on a mix of partition and non-partition columns are not supported"); } if (!evaluateFilterFunction(filterFunction)) { filterOnPrefilledValuesFailed = true; close(); break; } } if (filterOnPrefilledValuesFailed) { return true; } this.outputChannels = Arrays.copyOf(options.getOutputChannels(), options.getOutputChannels().length); int[] internalChannels = options.getInternalChannels(); int[] outputChannels = options.getOutputChannels(); for (int i = 0; i < internalChannels.length; i++) { ColumnMapping columnMapping = columnMappings.get(i); if (columnMapping.getKind() != REGULAR && columnMapping.getKind() != INTERIM) { internalChannels[i] = -1; if (i < outputChannels.length) { outputChannels[i] = -1; } } } filterAndProjectPushedDown = delegate.pushdownFilterAndProjection( new PageSourceOptions( internalChannels, outputChannels, options.getReusePages(), remainingFilterFunctions.build().toArray(new FilterFunction[0]), options.getReorderFilters(), options.getTargetBytes(), options.getAriaFlags())); return filterAndProjectPushedDown; }

Target:
public boolean pushdownFilterAndProjection(PageSourceOptions options) { List<FilterFunction> remainingFilterFunctions = pushdownFilterOnPrefilledColumns(options); if (filterOnPrefilledValuesFailed) { return true; } this.outputChannels = Arrays.copyOf(options.getOutputChannels(), options.getOutputChannels().length); filterAndProjectPushedDown = delegate.pushdownFilterAndProjection(createPageSourceOptionsForDelegate(options, remainingFilterFunctions)); return filterAndProjectPushedDown; }
Source:
public void deleteUniqueAllergy() throws Exception { Allergy allergy = Context.getPatientService().getAllergy(AALLERGY_ID); Assert.assertFalse(allergy.isVoided()); handle(newDeleteRequest(getURI() + "/" + RestTestConstants2_0.ALLERGY_ID, new Parameter("reason", "unit test"))); allergy = Context.getPatientService().getAllergy(AALLERGY_ID); Assert.assertTrue(allergy.isVoided()); Assert.assertEquals("unit test", allergy.getVoidReason()); }

Target:
public void deleteUniqueAllergy() throws Exception { Allergy allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Assert.assertFalse(allergy.isVoided()); handle(newDeleteRequest(getURI() + "/" + getUuid(), new Parameter("reason", "unit test"))); allergy = Context.getPatientService().getAllergyByUuid(getUuid()); Assert.assertTrue(allergy.isVoided()); Assert.assertEquals("unit test", allergy.getVoidReason()); }
Source:
@Override public Void visitDynamicParam(RexDynamicParam dynamicParam) { containsDynamicParam |= true; return super.visitDynamicParam(dynamicParam); }

Target:
@Override public Void visitDynamicParam(RexDynamicParam dynamicParam) { containsDynamicParam = true; return super.visitDynamicParam(dynamicParam); }
Source:
public Future<ReadableStreamChannel> getBlob(String blobId, Callback<ReadableStreamChannel> callback) { currentOperationsCount.incrementAndGet(); routerMetrics.getBlobOperationRate.mark(); routerMetrics.operationQueuingRate.mark(); FutureResult<ReadableStreamChannel> futureResult = new FutureResult<ReadableStreamChannel>(); if (isOpen.get()) { getOperationController().getBlob(blobId, futureResult, callback); } else { RouterException routerException = new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed); routerMetrics.operationDequeuingRate.mark(); routerMetrics.operationAbortCount.inc(); routerMetrics.getBlobErrorCount.inc(); routerMetrics.countError(routerException); operationCompleteCallback.completeOperation(futureResult, callback, null, routerException); } return futureResult; }

Target:
public Future<ReadableStreamChannel> getBlob(String blobId, Callback<ReadableStreamChannel> callback) { currentOperationsCount.incrementAndGet(); routerMetrics.getBlobOperationRate.mark(); routerMetrics.operationQueuingRate.mark(); FutureResult<ReadableStreamChannel> futureResult = new FutureResult<ReadableStreamChannel>(); if (isOpen.get()) { getOperationController().getBlob(blobId, futureResult, callback); } else { RouterException routerException = new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed); routerMetrics.operationDequeuingRate.mark(); routerMetrics.getBlobErrorCount.inc(); routerMetrics.countError(routerException); operationCompleteCallback.completeOperation(futureResult, callback, null, routerException); } return futureResult; }
Source:
private void setGit() throws IllegalArgumentException, IOException { try { if (workDirTree == null) throw new IllegalArgumentException("workDirTree is null and can't be resolved"); git = Git.open(workDirTree); } catch (IOException e) { throw new IOException("failed while read from workDirTree", e); } }

Target:
private void setGit() throws IOException { try { if (workDirTree == null) throw new IllegalArgumentException("workDirTree is null and can't be resolved"); git = Git.open(workDirTree); } catch (IOException e) { throw new IOException( "failed while read from workDirTree with name " + workDirTree.getName(), e); } }
Source:
private void appendAttributeString(StringBuilder sb, BlackboardAttribute.ATTRIBUTE_TYPE attribType, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributesMap, String prependStr) { BlackboardAttribute attribute = attributesMap.get(attribType); if (attribute != null) { String attrVal = attribute.getDisplayString(); if (!StringUtils.isEmpty(attrVal)) { if (!StringUtils.isEmpty(prependStr)) { sb.append(prependStr).append(' '); } sb.append(StringUtils.abbreviate(attrVal, 200)).append(' '); } } }

Target:
private void appendAttributeString(StringBuilder sb, BlackboardAttribute.ATTRIBUTE_TYPE attribType, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributesMap, String prependStr) { BlackboardAttribute attribute = attributesMap.get(attribType); if (attribute != null) { String attrVal = attribute.getDisplayString(); if (!StringUtils.isEmpty(attrVal)) { if (!StringUtils.isEmpty(prependStr)) { sb.append(prependStr).append(' '); } sb.append(StringUtils.abbreviate(attrVal, ATTRIBUTE_STR_MAX_LEN)).append(' '); } } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TtyDev other = (TtyDev) obj; if (!getOuterType().equals(other.getOuterType())) { return false; } if (this.portName == null) { if (other.portName != null) { return false; } } else if (!this.portName.equals(other.portName)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TtyDev other = (TtyDev) obj; if (this.portName == null) { if (other.portName != null) { return false; } } else if (!this.portName.equals(other.portName)) { return false; } return true; }
Source:
public <T extends Vertex> void link( Class<T> type, Function<T, DataImportIssue> unlinkedIssueMapper ) { @SuppressWarnings("unchecked") List<T> vertices = graph.getVertices() .stream() .filter(type::isInstance) .map(it -> (T)it) .collect(Collectors.toList()); String actionName = "Link " + type.getSimpleName(); if(vertices.isEmpty()) { LOG.info("{} skiped. No such data exist.", actionName); return; } ProgressTracker progress = ProgressTracker.track(actionName, 500, vertices.size()); LOG.info(progress.startMessage()); for (T v : vertices) { boolean alreadyLinked = v.getOutgoing().stream().anyMatch(e -> e instanceof StreetTransitLink); if (alreadyLinked) { continue; } if (v instanceof TransitStopVertex && !((TransitStopVertex) v).isStreetLinkable()) continue; if (!link(v)) { issueStore.add(unlinkedIssueMapper.apply(v)); }; progress.step(m -> LOG.info(m)); } LOG.info(progress.completeMessage()); }

Target:
public <T extends Vertex> void link( Class<T> type, Function<T, DataImportIssue> unlinkedIssueMapper ) { @SuppressWarnings("unchecked") List<T> vertices = graph.getVertices() .stream() .filter(type::isInstance) .map(it -> (T)it) .collect(Collectors.toList()); String actionName = "Link " + type.getSimpleName(); if(vertices.isEmpty()) { LOG.info("{} skiped. No such data exist.", actionName); return; } ProgressTracker progress = ProgressTracker.track(actionName, 500, vertices.size()); LOG.info(progress.startMessage()); for (T v : vertices) { boolean alreadyLinked = v.getOutgoing().stream().anyMatch(e -> e instanceof StreetTransitLink); if (alreadyLinked) { continue; } if (v instanceof TransitStopVertex && ((TransitStopVertex) v).hasPathways()) { continue; }; if (!link(v)) { issueStore.add(unlinkedIssueMapper.apply(v)); }; progress.step(m -> LOG.info(m)); } LOG.info(progress.completeMessage()); }
Source:
private Collection<Pattern> loadRegexPatterns(String patternFilename) { Collection<Pattern> patterns = new LinkedList<>(); try { Path patternFile = Paths.get(patternFilename); if (!Files.exists(patternFile)) { return patterns; } List<String> lines = Files.readAllLines(patternFile, StandardCharsets.UTF_8); for (String line : lines) { patterns.add(Pattern.compile(line, Pattern.DOTALL)); } } catch (FileNotFoundException e) { log.info("Patterns file not found, ignoring.", patternFilename); } catch (IOException e) { log.warn("Failed reading from patterns file"); } log.info("Loaded patterns from {}", patterns.size(), patternFilename); return patterns; }

Target:
private Collection<Pattern> loadRegexPatterns(String patternFilename) { Collection<Pattern> patterns = new LinkedList<>(); try { Path patternFile = Paths.get(patternFilename); if (!Files.exists(patternFile)) { return patterns; } Files.lines(patternFile, UTF_8) .forEach(line -> patterns.add(Pattern.compile(line, Pattern.DOTALL))); } catch (FileNotFoundException e) { log.info("Patterns file not found, ignoring.", patternFilename); } catch (IOException e) { log.warn("Failed reading from patterns file"); } log.info("Loaded patterns from {}", patterns.size(), patternFilename); return patterns; }
Source:
protected void initStreamBufferSize() { Integer streamBufferSizeParam = getInitParameter("streamBufferSize", Integer.class); setStreamBufferSize((streamBufferSizeParam == null) ? DEFAULT_STREAM_BUFFER_SIZE : streamBufferSizeParam); if (isDebug()) { LOGGER.debug("streamBufferSize: {}", getStreamBufferSize()); } }

Target:
protected void initStreamBufferSize() { setStreamBufferSize(Optional.ofNullable(getInitParameter("streamBufferSize", Integer.class)).orElse(DEFAULT_STREAM_BUFFER_SIZE)); if (isDebug()) { LOGGER.debug("streamBufferSize: {}", getStreamBufferSize()); } }
Source:
private void preRequestReadMoreItems(final LayoutInflater layoutInflater) { if (parentFragment.getPage().getPageProperties().isMainPage()) { new MainPageReadMoreTopicTask(activity) { @Override public void onFinish(PageTitle myTitle) { requestReadMoreItems(layoutInflater, myTitle); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while getting Read More topic for main page.", caught); layoutContent(); } }.execute(); } else { requestReadMoreItems(layoutInflater, pageTitle); } }

Target:
private void preRequestReadMoreItems(final LayoutInflater layoutInflater) { if (parentFragment.getPage().isMainPage()) { new MainPageReadMoreTopicTask(activity) { @Override public void onFinish(PageTitle myTitle) { requestReadMoreItems(layoutInflater, myTitle); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while getting Read More topic for main page.", caught); layoutContent(); } }.execute(); } else { requestReadMoreItems(layoutInflater, pageTitle); } }
Source:
private void sendToDevice(final ClientConnection conn, final DlmsDevice device, final ReplaceKeyCommandExecutor.KeyWrapper keyWrapper) throws ProtocolAdapterException { try { final byte[] decryptedKey = this.decrypt(keyWrapper.getBytes()); final MethodParameter methodParameterAuth = SecurityUtils.globalKeyTransfer(this.getMasterKey(device), decryptedKey, keyWrapper.getKeyId()); final MethodResultCode methodResultCode = conn.action(methodParameterAuth).get(0).resultCode(); if (!MethodResultCode.SUCCESS.equals(methodResultCode)) { throw new ProtocolAdapterException("AccessResultCode for replace keys was not SUCCESS: " + methodResultCode); } } catch (final TechnicalException | IOException e) { throw new ConnectionException(e); } }

Target:
private void sendToDevice(final ClientConnection conn, final DlmsDevice device, final ReplaceKeyCommandExecutor.KeyWrapper keyWrapper) throws ProtocolAdapterException { try { final byte[] decryptedKey = RsaEncrypterService.decrypt(keyWrapper.getBytes(), this.privateKeyPath); final byte[] decryptedMasterKey = RsaEncrypterService.decrypt(this.getMasterKey(device), this.privateKeyPath); final MethodParameter methodParameterAuth = SecurityUtils.globalKeyTransfer(decryptedMasterKey, decryptedKey, keyWrapper.getKeyId()); final MethodResultCode methodResultCode = conn.action(methodParameterAuth).get(0).resultCode(); if (!MethodResultCode.SUCCESS.equals(methodResultCode)) { throw new ProtocolAdapterException("AccessResultCode for replace keys was not SUCCESS: " + methodResultCode); } } catch (final IOException e) { throw new ConnectionException(e); } catch (final RsaEncrypterException e) { LOGGER.error("Unexpected exception during decryption of security keys", e); throw new ProtocolAdapterException("Unexpected exception during decryption of security keys, reason = " + e.getMessage()); } }
Source:
public boolean add(BufferConsumer bufferConsumer, boolean isPriorityEvent) { if (isPriorityEvent) { if (readView != null && readView.notifyPriorityEvent(bufferConsumer)) { bufferConsumer.close(); return true; } return add(bufferConsumer, false, true); } return add(bufferConsumer, false, false); }

Target:
public boolean add(BufferConsumer bufferConsumer, boolean isPriorityEvent) throws IOException { if (isPriorityEvent) { if (readView != null && readView.notifyPriorityEvent(bufferConsumer)) { bufferConsumer.close(); return true; } return add(bufferConsumer, false, true); } return add(bufferConsumer, false, false); }
Source:
public boolean pollSocketsInfo() { if (!isTcpInfoSupported()) return false; FileDescriptor fd = null; try { final long time = SystemClock.elapsedRealtime(); fd = connectToKernel(); mTcpStats.clear(); for (final int family : ADDRESS_FAMILIES) { if (!sendPollingRequest(fd, family)) continue; final ByteBuffer bytes = recvMesssage(fd); log("pollSocketsInfo: recv size=" + bytes.limit()); while (enoughBytesRemainForValidNlMsg(bytes)) { final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { bytes.position(bytes.position() + StructInetDiagMsg.STRUCT_SIZE - 7 * Integer.BYTES); final long cookie = bytes.getLong(); bytes.position(bytes.position() + 5 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); mSocketInfos.put(cookie, info); } if (nlmsghdr.nlmsg_type == NLMSG_DONE) break; } } cleanupSocketInfo(time); return true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return false; }

Target:
public boolean pollSocketsInfo() { if (!mDependencies.isTcpInfoParsingSupported()) return false; FileDescriptor fd = null; try { final long time = SystemClock.elapsedRealtime(); fd = mDependencies.connectToKernel(); mTcpStats.clear(); for (final int family : ADDRESS_FAMILIES) { mDependencies.sendPollingRequest(fd, mSockDiagMsg.get(family)); final ByteBuffer bytes = mDependencies.recvMesssage(fd); while (enoughBytesRemainForValidNlMsg(bytes)) { final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(bytes); final int nlmsgLen = nlmsghdr.nlmsg_len; log("pollSocketsInfo: nlmsgLen=" + nlmsgLen); if (isValidInetDiagMsgSize(nlmsgLen)) { bytes.position(bytes.position() + StructInetDiagMsg.STRUCT_SIZE - 7 * Integer.BYTES); final long cookie = bytes.getLong(); bytes.position(bytes.position() + 5 * Integer.BYTES); final SocketInfo info = parseSockInfo(bytes, family, nlmsgLen, time); mTcpStats.put(cookie, makeTcpStat(info, mSocketInfos.get(cookie))); mSocketInfos.put(cookie, info); } if (nlmsghdr.nlmsg_type == NLMSG_DONE) break; } } cleanupSocketInfo(time); return true; } catch (ErrnoException | SocketException | InterruptedIOException e) { Log.e(TAG, "Fail to get TCP info via netlink.", e); } finally { NetworkStackUtils.closeSocketQuietly(fd); } return false; }
Source:
private void reportIssues() { MethodInvariantContext methodInvariantContext = methodInvariantContexts.pop(); if (!methodInvariantContext.methodToCheck) { return; } if (methodInvariantContext.returnImmutableType && methodInvariantContext.symbolicValues.size() == 1 && methodInvariantContext.endPaths > 1) { report(methodInvariantContext); } if(!methodInvariantContext.avoidRaisingConstraintIssue) { for (Class<? extends Constraint> aClass : methodInvariantContext.methodConstraints.keys()) { Collection<Constraint> constraints = methodInvariantContext.methodConstraints.get(aClass); if(constraints.size() == methodInvariantContext.endPaths && constraints.stream().allMatch(c -> constraints.iterator().next().hasPreciseValue() && constraints.iterator().next().equals(c))) { report(methodInvariantContext); return; } } } }

Target:
private void reportIssues() { MethodInvariantContext methodInvariantContext = methodInvariantContexts.pop(); if (!methodInvariantContext.methodToCheck) { return; } if (methodInvariantContext.returnImmutableType && methodInvariantContext.symbolicValues.size() == 1 && methodInvariantContext.endPaths > 1) { report(methodInvariantContext); } else if (!methodInvariantContext.avoidRaisingConstraintIssue) { for (Class<? extends Constraint> constraintClass : methodInvariantContext.methodConstraints.keys()) { Collection<Constraint> constraints = methodInvariantContext.methodConstraints.get(constraintClass); Constraint firstConstraint = constraints.iterator().next(); if (constraints.size() == methodInvariantContext.endPaths && firstConstraint.hasPreciseValue() && constraints.stream().allMatch(firstConstraint::equals)) { report(methodInvariantContext); return; } } } }
Source:
private List<DataCenterVnetVO> findOverlappingVnets(final long dcId, final Long physicalNetworkId, final String vnet) { final List<Integer> searchVnets = UriUtils.expandVlanUri(vnet); final List<DataCenterVnetVO> overlappingVnets = new ArrayList<>(); if (searchVnets != null && searchVnets.size() > 0) { SearchCriteria<DataCenterVnetVO> sc = VnetDcSearch.create(); sc.setParameters("dc", dcId); if (physicalNetworkId != null) { sc.setParameters("physicalNetworkId", physicalNetworkId); } for (final DataCenterVnetVO dcVNet : listBy(sc)) { if (dcVNet == null || dcVNet.getVnet() == null) { continue; } final Integer vnetValue = NumbersUtil.parseInt(dcVNet.getVnet(), -1); if (vnetValue != -1 && searchVnets.contains(vnetValue)) { overlappingVnets.add(dcVNet); } } } return overlappingVnets; }

Target:
private List<DataCenterVnetVO> findOverlappingVnets(final long dcId, final Long physicalNetworkId, final String vnet) { final List<Integer> searchVnets = UriUtils.expandVlanUri(vnet); final List<DataCenterVnetVO> overlappingVnets = new ArrayList<>(); if (searchVnets == null || searchVnets.isEmpty()) { return overlappingVnets; } SearchCriteria<DataCenterVnetVO> sc = VnetDcSearch.create(); sc.setParameters("dc", dcId); if (physicalNetworkId != null) { sc.setParameters("physicalNetworkId", physicalNetworkId); } for (final DataCenterVnetVO dcVNet : listBy(sc)) { if (dcVNet == null || dcVNet.getVnet() == null) { continue; } final Integer vnetValue = NumbersUtil.parseInt(dcVNet.getVnet(), -1); if (vnetValue != -1 && searchVnets.contains(vnetValue)) { overlappingVnets.add(dcVNet); } } return overlappingVnets; }
Source:
public void onEventMainThread(RegisterTask task) { if(AppPrefs.getInstance(this).isLoggedIn()) { broadcastLogInSuccess(this); Toast.makeText(this, "success register", Toast.LENGTH_SHORT).show(); startActivity(MainActivity.getLaunchIntent(this)); finish(); } else { Toast.makeText(this, "failed register", Toast.LENGTH_SHORT).show(); } }

Target:
public void onEventMainThread(RegisterTask task) { if(AppPrefs.getInstance(this).isLoggedIn()) { broadcastLogInSuccess(this); Toast.makeText(this, "success register", Toast.LENGTH_SHORT).show(); startActivity(MainActivity.getLaunchIntent(this)); } else { Toast.makeText(this, "failed register", Toast.LENGTH_SHORT).show(); } }
Source:
public boolean afterLRANotification() { boolean notifiedAll = true; if (afterLRAListeners != null) { Client client = ClientBuilder.newClient(); try { Iterator<URI> listeners = afterLRAListeners.iterator(); while (listeners.hasNext()) { URI uri = listeners.next(); Response response = null; try { Future<Response> asyncResponse = client.target(uri) .request() .header(LRA.LRA_HTTP_ENDED_CONTEXT_HEADER, id) .async() .put(Entity.text(status.name())); response = asyncResponse.get(1000, TimeUnit.SECONDS); if (response.getStatus() == 200) { listeners.remove(); } else { notifiedAll = false; } response = null; } catch (WebApplicationException | InterruptedException | ExecutionException | TimeoutException e) { if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("Could not notify AfterLRA listener at %s (%s)", uri, e.getMessage()); } } finally { if (response != null) { response.close(); } } } } finally { client.close(); } } return notifiedAll; }

Target:
public boolean afterLRANotification() { boolean notifiedAll = true; if (afterLRAListeners != null) { Client client = ClientBuilder.newClient(); try { Iterator<URI> listeners = afterLRAListeners.iterator(); while (listeners.hasNext()) { URI uri = listeners.next(); Response response = null; try { Future<Response> asyncResponse = client.target(uri) .request() .header(LRA.LRA_HTTP_ENDED_CONTEXT_HEADER, id) .async() .put(Entity.text(status.name())); response = asyncResponse.get(PARTICIPANT_TIMEOUT, TimeUnit.SECONDS); if (response.getStatus() == 200) { listeners.remove(); } else { notifiedAll = false; } response = null; } catch (WebApplicationException | InterruptedException | ExecutionException | TimeoutException e) { notifiedAll = false; if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("Could not notify AfterLRA listener at %s (%s)", uri, e.getMessage()); } } finally { if (response != null) { response.close(); } } } } finally { client.close(); } } return notifiedAll; }
Source:
public boolean replugNic(final Network network, final NicTO nic, final VirtualMachineTO vm, final ReservationContext context, final DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { boolean result = true; final VMInstanceVO router = _vmDao.findById(vm.getId()); if (router.getState() == State.Running) { try { final ReplugNicCommand replugNicCmd = new ReplugNicCommand(nic, vm.getName(), vm.getType(), vm.getDetails()); final Commands cmds = new Commands(Command.OnError.Stop); cmds.addCommand("replugnic", replugNicCmd); _agentMgr.send(dest.getHost().getId(), cmds); final ReplugNicAnswer replugNicAnswer = cmds.getAnswer(ReplugNicAnswer.class); if (!(replugNicAnswer != null && replugNicAnswer.getResult())) { s_logger.warn("Unable to plug nic for vm " + vm.getName()); result = false; } } catch (final OperationTimedoutException e) { throw new AgentUnavailableException("Unable to plug nic for router " + vm.getName() + " in network " + network, dest.getHost().getId(), e); } } else { s_logger.warn("Unable to apply ReplugNic, vm " + router + " is not in the right state " + router.getState()); throw new ResourceUnavailableException("Unable to apply ReplugNic on the backend," + " vm " + vm + " is not in the right state", DataCenter.class, router.getDataCenterId()); } return result; }

Target:
public boolean replugNic(final Network network, final NicTO nic, final VirtualMachineTO vm, final ReservationContext context, final DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { boolean result = true; final VMInstanceVO router = _vmDao.findById(vm.getId()); if (router.getState() == State.Running) { try { final ReplugNicCommand replugNicCmd = new ReplugNicCommand(nic, vm.getName(), vm.getType(), vm.getDetails()); final Commands cmds = new Commands(Command.OnError.Stop); cmds.addCommand("replugnic", replugNicCmd); _agentMgr.send(dest.getHost().getId(), cmds); final ReplugNicAnswer replugNicAnswer = cmds.getAnswer(ReplugNicAnswer.class); if (replugNicAnswer == null || !replugNicAnswer.getResult()) { s_logger.warn("Unable to replug nic for vm " + vm.getName()); result = false; } } catch (final OperationTimedoutException e) { throw new AgentUnavailableException("Unable to plug nic for router " + vm.getName() + " in network " + network, dest.getHost().getId(), e); } } else { s_logger.warn("Unable to apply ReplugNic, vm " + router + " is not in the right state " + router.getState()); throw new ResourceUnavailableException("Unable to apply ReplugNic on the backend," + " vm " + vm + " is not in the right state", DataCenter.class, router.getDataCenterId()); } return result; }
Source:
private SelectionAdapter createErrorHandlingSelectionAdapter( Text textWidget ) { SelectionAdapterOptions errorOptions = new SelectionAdapterOptions( SelectionOperation.SAVE, new FilterType[] { FilterType.ALL }, FilterType.ALL ); return new SelectionAdapterFileDialogText( log, textWidget, transMeta, errorOptions ); }

Target:
private SelectionAdapter createErrorHandlingSelectionAdapter( Text textWidget ) { SelectionAdapterOptions errorOptions = new SelectionAdapterOptions( SelectionOperation.FILE_OR_FOLDER, new FilterType[] { FilterType.ALL }, FilterType.ALL ); return new SelectionAdapterFileDialogText( log, textWidget, transMeta, errorOptions ); }
Source:
protected void updateOntologyList() { ontologies.clear(); ontologies.addSelectionHandler(new SelectionHandler<OntologySummaryBean>() { @Override public void onSelection(SelectionEvent<OntologySummaryBean> event) { OntologySummaryBean bean = event.getSelectedItem(); onOntologyClicked(bean); } }); ontologies.setValue(ontologyMap); }

Target:
protected void updateOntologyList() { ontologies.clear(); ontologies.setValue(ontologyMap); if (uuidNewOntology != null && !uuidNewOntology.equals("") && ontologies.getSelectedOntology() == null) { ontologies.selectItem(uuidNewOntology); } else if (ontologyMap.size() == 1) { ontologies.selectItem(ontologyMap.keySet().iterator().next()); } else if (ontologies.getSelectedOntology() != null) { ontologies.selectItem(ontologies.getSelectedOntology().getUuid()); } }
Source:
public Tuple next() throws SQLException { if (keyIterator == null) { hash = populateHash(); keyList = sortKeys(); keyIterator = keyList.iterator(); } if (!keyIterator.hasNext()) { return null; } ImmutableBytesWritable key = keyIterator.next(); Aggregator[] rowAggregators = hash.get(key); byte[] value = aggregators.toBytes(rowAggregators); Tuple tuple = wrapKeyValueAsResult(KeyValueUtil.newKeyValue(key, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, value, 0, value.length)); return tuple; }

Target:
public Tuple next() throws SQLException { if (keyIterator == null) { hash = populateHash(); if (orderBy == OrderBy.FWD_ROW_KEY_ORDER_BY || orderBy == OrderBy.REV_ROW_KEY_ORDER_BY) { keyList = sortKeys(); keyIterator = keyList.iterator(); } else { keyIterator = hash.keySet().iterator(); } } if (!keyIterator.hasNext()) { return null; } ImmutableBytesWritable key = keyIterator.next(); Aggregator[] rowAggregators = hash.get(key); byte[] value = aggregators.toBytes(rowAggregators); Tuple tuple = wrapKeyValueAsResult(PhoenixKeyValueUtil.newKeyValue(key, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, value, 0, value.length)); return tuple; }
Source:
public List<BrooklinMetricInfo> getMetricInfos() { return DatabaseChunkedReaderMetrics.getMetricInfos(); }

Target:
public static List<BrooklinMetricInfo> getMetricInfos() { return DatabaseChunkedReaderMetrics.getMetricInfos(); }
Source:
public void setCourse(int destX, int destY) { Log.wtf("Plotting", "..."); int srcX = getX(); int srcY = getY(); while (srcX < destX) { if (srcY == destY) { if (destX == srcX) { break; } } else if (srcY < destY) { srcY++; } else { srcY--; } if (srcX != destX) { srcX++; } Log.wtf("Plotting", srcX + "," + srcY); course.add(new Cood(srcX, srcY)); } while (destX <= srcX) { if (srcY == destY) { if (destX == srcX) { break; } } else if (srcY < destY) { srcY++; } else { srcY--; } if (srcX != (destX)) { srcX--; } Log.wtf("Plotting", srcX + "," + srcY); course.add(new Cood(srcX, srcY)); } Log.wtf("Plotting", "Finished"); }

Target:
public void setCourse(int destX, int destY) { Log.wtf("Plotting", "..."); int srcX = getX(); int srcY = getY(); course.clear(); while (srcX < destX) { if (srcY == destY) { if (destX == srcX) { break; } } else if (srcY < destY) { srcY++; } else { srcY--; } if (srcX != destX) { srcX++; } Log.wtf("Plotting", srcX + "," + srcY); course.add(new Coordinates(srcX, srcY)); } while (destX <= srcX) { if (srcY == destY) { if (destX == srcX) { break; } } else if (srcY < destY) { srcY++; } else { srcY--; } if (srcX != (destX)) { srcX--; } Log.wtf("Plotting", srcX + "," + srcY); course.add(new Coordinates(srcX, srcY)); } Log.wtf("Plotting", "Finished"); }
Source:
public RequestLogger get() { final List<RequestLogger> loggers = Lists.newArrayList(Lists.transform( requestLoggers, new Function<RequestLoggerProvider, RequestLogger>() { @Override public RequestLogger apply(RequestLoggerProvider input) { return input.get(); } } )); return new ComposingRequestLogger(loggers); }

Target:
public RequestLogger get() { final List<RequestLogger> loggers = new ArrayList<>(); for (RequestLoggerProvider loggerProvider : loggerProviders) { loggers.add(loggerProvider.get()); } return new ComposingRequestLogger(loggers); }
Source:
public EndNode onboardEndnodeWithGateway( @NonNull PendingEndNode pendingEndNode, @NonNull String endnodePassword) throws ThingIFException { return thingIfApi.onboardEndnodeWithGateway(pendingEndNode, endnodePassword); }

Target:
public EndNode onboardEndnodeWithGateway( @NonNull PendingEndNode pendingEndNode, @NonNull String endnodePassword) throws ThingIFException { return this.thingIfApi.onboardEndnodeWithGateway(pendingEndNode, endnodePassword); }
Source:
private void failure( String message, Exception e ) { failure( message, e, 1 ); }

Target:
private void failure( String message, Exception e ) { failure( message, e, STATUS_ERROR ); }
Source:
public String getRule() { return "Whenever a player kicks a spell, " + super.getRule(); }

Target:
public String getRule() { return "Whenever a player kicks a spell, you put a 1/1 green Saproling creature token onto the battlefield."; }
Source:
public static Test suite() { if (CommonTestUtil.fixProxyConfiguration()) { CommonTestUtil.dumpSystemInfo(System.err); } TestConfiguration testConfiguration = ManagedSuite.getTestConfiguration(); if (testConfiguration == null) { testConfiguration = new TestConfiguration(TestKind.UNIT); testConfiguration.setDefaultOnly(CommonTestUtil.runHeartbeatTestsOnly()); ManagedSuite.setTestConfiguration(testConfiguration); } TestSuite suite = new ManagedTestSuite(AllGerritTests.class.getName()); addTests(suite, testConfiguration); return suite; }

Target:
public static Test suite() { if (CommonTestUtil.fixProxyConfiguration()) { CommonTestUtil.dumpSystemInfo(System.err); } TestConfiguration testConfiguration = ManagedSuite.getTestConfigurationOrCreateDefault(); TestSuite suite = new ManagedTestSuite(AllGerritTests.class.getName()); addTests(suite, testConfiguration); return suite; }
Source:
public Page<DayActivityOverviewDto<DayActivityWithBuddiesDto>> getUserDayActivityOverviewsWithBuddies(UUID userId, Pageable pageable) { UUID userAnonymizedId = userService.getUserAnonymizedId(userId); UserAnonymizedDto userAnonymized = userAnonymizedService.getUserAnonymized(userAnonymizedId); Interval interval = getInterval(getCurrentDayDate(userAnonymized), pageable, ChronoUnit.DAYS); Set<BuddyDto> buddies = buddyService.getBuddiesOfUserThatAcceptedSending(userId); Set<UUID> userAnonymizedIds = buddies.stream().map(this::getBuddyUserAnonymizedId).collect(Collectors.toSet()); Set<UUID> activityCategoryIds = buddies.stream().map(BuddyDto::getGoals).flatMap(Set::stream) .map(GoalDto::getActivityCategoryId).collect(Collectors.toSet()); userAnonymizedIds.add(userAnonymizedId); Map<ZonedDateTime, Set<DayActivityDto>> dayActivityDtosByZonedDate = executeAndCreateInactivityEntries( mia -> getDayActivitiesForUserAnonymizedIdsInInterval(userAnonymizedIds, activityCategoryIds, interval, mia)); List<DayActivityOverviewDto<DayActivityWithBuddiesDto>> dayActivityOverviews = dayActivityEntitiesToOverviewsUserWithBuddies( dayActivityDtosByZonedDate); return new PageImpl<>(dayActivityOverviews, pageable, getTotalPageableItems(buddies, ChronoUnit.DAYS)); }

Target:
public Page<DayActivityOverviewDto<DayActivityWithBuddiesDto>> getUserDayActivityOverviewsWithBuddies(UUID userId, Pageable pageable) { UUID userAnonymizedId = userService.getUserAnonymizedId(userId); UserAnonymizedDto userAnonymized = userAnonymizedService.getUserAnonymized(userAnonymizedId); Interval interval = getInterval(getCurrentDayDate(userAnonymized), pageable, ChronoUnit.DAYS); Set<BuddyDto> buddies = buddyService.getBuddiesOfUserThatAcceptedSending(userId); Set<UUID> userAnonymizedIds = buddies.stream().map(this::getBuddyUserAnonymizedId).collect(Collectors.toSet()); userAnonymizedIds.add(userAnonymizedId); Set<UUID> activityCategoryIdsUsedByBuddies = buddies.stream().map(BuddyDto::getGoals).flatMap(Set::stream) .map(GoalDto::getActivityCategoryId).collect(Collectors.toSet()); Map<ZonedDateTime, Set<DayActivityDto>> dayActivityDtosByZonedDate = executeAndCreateInactivityEntries( mia -> getDayActivitiesForUserAnonymizedIdsInInterval(userAnonymizedIds, activityCategoryIdsUsedByBuddies, interval, mia)); List<DayActivityOverviewDto<DayActivityWithBuddiesDto>> dayActivityOverviews = dayActivityEntitiesToOverviewsUserWithBuddies( dayActivityDtosByZonedDate); return new PageImpl<>(dayActivityOverviews, pageable, getTotalPageableItems(buddies, ChronoUnit.DAYS)); }
Source:
public static boolean shouldShowRequestPermissionRationale(Activity activity, String... permissions) { for (String permission : permissions) { if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { return true; } } return false; }

Target:
static boolean shouldShowRequestPermissionRationale(Activity activity, String... permissions) { for (String permission : permissions) { if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { return true; } } return false; }
Source:
public void testFixedHostPortMapping() throws IOException { final Integer unusedHostPort; String content; try (final GenericContainer echoServer = new GenericContainer<>(TEST_IMAGE) .withExposedPorts(TEST_PORT) .withCommand("/bin/sh", "-c", HTTP_ECHO_CMD)) { echoServer.start(); unusedHostPort = echoServer.getMappedPort(TEST_PORT); content = this.readResponse(echoServer, unusedHostPort); assertThat("Returned echo does not match expected", content, equalTo(TEST_RESPONSE)); } try (final GenericContainer echoServer = new FixedHostPortGenericContainer(TEST_IMAGE) .withFixedExposedPort(unusedHostPort, TEST_PORT) .withExposedPorts(TEST_PORT) .withCommand("/bin/sh", "-c", HTTP_ECHO_CMD)) { echoServer.start(); assertThat("Port mapping does not seem to match given fixed port", echoServer.getMappedPort(TEST_PORT), equalTo(unusedHostPort)); content = this.readResponse(echoServer, unusedHostPort); assertThat("Returned echo from fixed port does not match expected", content, equalTo(TEST_RESPONSE)); } }

Target:
public void testFixedHostPortMapping() throws IOException { final Integer unusedHostPort; try ( final GenericContainer echoServer = new GenericContainer<>(TEST_IMAGE) .withExposedPorts(TEST_PORT) .withCommand("/bin/sh", "-c", HTTP_ECHO_CMD) ) { echoServer.start(); unusedHostPort = echoServer.getMappedPort(TEST_PORT); } try ( final GenericContainer echoServer = new FixedHostPortGenericContainer(TEST_IMAGE) .withFixedExposedPort(unusedHostPort, TEST_PORT) .withExposedPorts(TEST_PORT) .withCommand("/bin/sh", "-c", HTTP_ECHO_CMD) ) { echoServer.start(); assertThat("Port mapping does not seem to match given fixed port", echoServer.getMappedPort(TEST_PORT), equalTo(unusedHostPort)); final String content = this.readResponse(echoServer, unusedHostPort); assertThat("Returned echo from fixed port does not match expected", content, equalTo(TEST_RESPONSE)); } }
Source:
public long getMiddlePoint() { return start + end / 2; }

Target:
public long getMiddlePoint() { return (start + end) / 2; }
Source:
private void emitStaticOverloads(String propName, ObjectType objType, JSType propertyType) { Set<JSType> incompatibleSuperTypes = new LinkedHashSet<>(); collectIncompatibleSuperTypes(objType, propName, incompatibleSuperTypes); for (JSType superPropType : incompatibleSuperTypes) { if (!propertyType.isSubtype(superPropType)) { if (!propertyType.isFunctionType() || !superPropType.isFunctionType()) { errors.add(JSError.make(currentSymbol.getNode(), CLUTZ_OVERRIDDEN_STATIC_FIELD, objType.getDisplayName(), propName)); } else { emit(" "); emitBreak(); emitProperty(propName, superPropType, true); } } } }

Target:
private void emitStaticOverloads(String propName, ObjectType objType, JSType propertyType) { Set<JSType> incompatibleSuperTypes = getIncompatibleSuperTypes(objType, propName, propertyType); for (JSType superPropType : incompatibleSuperTypes) { if (!propertyType.isFunctionType() || !superPropType.isFunctionType()) { errors.add(JSError.make(currentSymbol.getNode(), CLUTZ_OVERRIDDEN_STATIC_FIELD, objType.getDisplayName(), propName)); } else { emit(" "); emitBreak(); emitProperty(propName, superPropType, true); } } }
Source:
public long appendFrom(ReadableByteChannel channel, long size) throws IOException { int tempIndex = index; index++; int sizeRead = 0; while(sizeRead < size) { sizeRead += channel.read(buflist.get(tempIndex)); tempIndex = index++; } if(sizeRead != size) { throw new IOException("Not able to read entire size. Expected " + size+" Actual " + sizeRead); } return sizeRead; }

Target:
public void appendFrom(ReadableByteChannel channel, long size) throws IOException { int sizeRead = 0; while(sizeRead < size) { sizeRead += channel.read(buflist.get(index++)); } }
Source:
protected void setClientTokenProvider(Quantum client) { String tenantName = ((OpenstackNetworkProviderProperties) provider.getAdditionalProperties()).getTenantName(); KeystoneTokenProvider keystoneTokenProvider = new KeystoneTokenProvider(provider.getAuthUrl(), provider.getUsername(), provider.getPassword()); client.setTokenProvider(keystoneTokenProvider.getProviderByTenant(tenantName)); }

Target:
protected void setClientTokenProvider(Quantum client) { String tenantName = provider.getAdditionalProperties().getTenantName(); KeystoneTokenProvider keystoneTokenProvider = new KeystoneTokenProvider(provider.getAuthUrl(), provider.getUsername(), provider.getPassword()); client.setTokenProvider(keystoneTokenProvider.getProviderByTenant(tenantName)); }
Source:
private void wireOutputDataStreams(Map<ComponentType, ComponentBuilder> componentBuilders) { for (Map.Entry<ComponentType, ComponentBuilder> entry : componentBuilders.entrySet()) { ComponentType componentType = entry.getKey(); ComponentBuilder componentBuilder = entry.getValue(); for (OutputDataStreamType outputDataStreamType : componentType.getOutputDataStream()) { String name = outputDataStreamType.getName(); final OutputDataStream outputDataStream = componentBuilder.getOutputDataStream(name); AnalysisJobBuilder outputDataStreamJobBuilder = componentBuilder .getOutputDataStreamJobBuilder(outputDataStream); JobType job = outputDataStreamType.getJob(); List<ColumnType> sourceColumnTypes = job.getSource().getColumns().getColumn(); List<MetaModelInputColumn> sourceColumns = outputDataStreamJobBuilder.getSourceColumns(); final Map<String, InputColumn<?>> inputColumns = new HashMap<>(); for (ColumnType sourceColumnPath : sourceColumnTypes) { for (InputColumn<?> inputColumn : sourceColumns) { if (inputColumn.getName().equals(sourceColumnPath.getPath())) { inputColumns.put(sourceColumnPath.getId(), inputColumn); } } } configureComponents(job, getVariables(job), outputDataStreamJobBuilder, inputColumns); } } }

Target:
private void wireOutputDataStreams(Map<ComponentType, ComponentBuilder> componentBuilders) { for (Map.Entry<ComponentType, ComponentBuilder> entry : componentBuilders.entrySet()) { final ComponentType componentType = entry.getKey(); final ComponentBuilder componentBuilder = entry.getValue(); for (OutputDataStreamType outputDataStreamType : componentType.getOutputDataStream()) { final String name = outputDataStreamType.getName(); final OutputDataStream outputDataStream = componentBuilder.getOutputDataStream(name); final AnalysisJobBuilder outputDataStreamJobBuilder = componentBuilder .getOutputDataStreamJobBuilder(outputDataStream); final JobType job = outputDataStreamType.getJob(); final List<ColumnType> sourceColumnTypes = job.getSource().getColumns().getColumn(); final List<MetaModelInputColumn> sourceColumns = outputDataStreamJobBuilder.getSourceColumns(); final Map<String, InputColumn<?>> inputColumns = new HashMap<>(); for (ColumnType sourceColumnPath : sourceColumnTypes) { for (InputColumn<?> inputColumn : sourceColumns) { if (inputColumn.getName().equals(sourceColumnPath.getPath())) { inputColumns.put(sourceColumnPath.getId(), inputColumn); } } } configureComponents(job, getVariables(job), outputDataStreamJobBuilder, inputColumns); } } }
Source:
private void updateInputSpace(Job job, String inputFolder) throws NotConnectedException, PermissionException { List<String> inputSpaces; if (job.getInputSpace() != null) { inputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getInputSpace())); } else { inputSpaces = getUserSpaceURIs(); } StringBuilder inputSpace_url_updated = new StringBuilder(); for (String inputSpace : inputSpaces) { if (inputSpace_url_updated.length() > 0) { inputSpace_url_updated.append(" "); } inputSpace_url_updated.append(appendSlashIfNeeded(inputSpace)); inputSpace_url_updated.append(inputFolder); } job.setInputSpace(inputSpace_url_updated.toString()); log.debug("Input space of job " + job.getName() + " will be " + inputSpace_url_updated); }

Target:
private void updateInputSpace(Job job, String inputFolder) throws NotConnectedException, PermissionException { List<String> inputSpaces; if (job.getInputSpace() != null) { inputSpaces = Arrays.asList(Tools.dataSpaceConfigPropertyToUrls(job.getInputSpace())); } else { inputSpaces = getUserSpaceURIs(); } StringBuilder inputSpace_url_updated = buildUpdatedSpaceConfiguration(inputFolder, inputSpaces); job.setInputSpace(inputSpace_url_updated.toString()); log.debug("Input space of job " + job.getName() + " will be " + inputSpace_url_updated); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { DiskImage diskImage = getDiskImageDao().get(parameters.getImageId()); if (diskImage != null) { permissionList.add(new PermissionSubject(diskImage.getId(), VdcObjectType.Disk, ActionGroup.CONFIGURE_DISK_STORAGE)); permissionList.add(new PermissionSubject(diskImage.getId(), VdcObjectType.Disk, ActionGroup.DISK_LIVE_STORAGE_MIGRATION)); } permissionList.add(new PermissionSubject(parameters.getTargetStorageDomainId(), VdcObjectType.Storage, ActionGroup.CREATE_DISK)); } return permissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { DiskImage diskImage = getDiskImageDao().get(parameters.getImageId()); if (diskImage != null) { permissionList.add(new PermissionSubject(diskImage.getId(), VdcObjectType.Disk, ActionGroup.DISK_LIVE_STORAGE_MIGRATION)); } } return permissionList; }
Source:
public Path generateArtifact(NpmArtifactCoordinates coordinates) throws IOException { return this.of(coordinates).buildPublishJson(); }

Target:
public Path generateArtifact(NpmArtifactCoordinates coordinates) throws IOException { this.of(coordinates).buildPublishJson(); return getPackagePath(); }
Source:
public HAServiceProtocol.HAServiceState getHAServiceState() { try { rpcServer.checkOperation(NameNode.OperationCategory.WRITE); } catch (StandbyException e) { return HAServiceProtocol.HAServiceState.STANDBY; } return HAServiceProtocol.HAServiceState.ACTIVE; }

Target:
public HAServiceProtocol.HAServiceState getHAServiceState() { if (rpcServer.isSafeMode()) { return HAServiceProtocol.HAServiceState.STANDBY; } return HAServiceProtocol.HAServiceState.ACTIVE; }