auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { stdout.print(p.getName()); if (showBranch != null) { RevId revId = getRevIdForBranch(p.getNameKey(), showBranch); if (revId != null) { stdout.print("\t" + revId.get()); } } stdout.println(); } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }

Target:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { if (showBranch != null) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(ObjectId.toString(id) + " "); } } stdout.print(p.getName()); stdout.println(); } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }
Source:
public Object getMetadata() { Object[] ports = _state.snapshot().keySet().toArray(); Integer[] p = new Integer[ports.length]; for (int i = 0; i < ports.length; i++) { p[i] = Integer.parseInt((String) ports[i]); } return PersistentVector.create((Object[]) p); }

Target:
public Object getMetadata() { Set<Integer> ports = _taskAssignments.getAssignedPorts(); if (ports == null) { return null; } return PersistentVector.create(ports); }
Source:
public DiagnosticsElement getDiagnostics(String diagnosticsElementName) { if (!hasDiagnostics(diagnosticsElementName)) { throw new NoSuchElementException(diagnosticsElementName); } JsonNode node = getJson().get(diagnosticsElementName); boolean isHealthy = false; String message = null; if (node.get(HEALTHY) != null) { isHealthy = node.get(HEALTHY).asBoolean(); } if (node.get(MESSAGE) != null) { message = node.get(MESSAGE).asText(); } return new DiagnosticsElement(diagnosticsElementName, isHealthy, message); }

Target:
public DiagnosticsElement getDiagnostics(String diagnosticsElementName) { if (!hasDiagnostics(diagnosticsElementName)) { throw new NoSuchElementException(diagnosticsElementName); } JsonNode node = getJson().get(diagnosticsElementName); boolean isHealthy = false; String message = null; if (node.get(HEALTHY) != null) { isHealthy = node.get(HEALTHY).asBoolean(); } if (node.get(MESSAGE) != null) { message = node.get(MESSAGE).asText(); } else { message = new String("Message Unavailable"); } return new DiagnosticsElement(diagnosticsElementName, isHealthy, message); }
Source:
protected void clientInit() { CommonHelper.assertNotBlank("fields", getConfiguration().getFields()); configuration.setApi(FacebookApi.instance()); configuration.setProfileDefinition(new FacebookProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorReason = ctx.getRequestParameter(OAuthCredentialsException.ERROR_REASON); if ("access_denied".equals(error.orElse(null)) && "user_denied".equals(errorReason.orElse(null))) { return true; } else { return false; } }); configuration.setWithState(true); defaultProfileCreator(new FacebookProfileCreator(configuration, this)); super.clientInit(); }

Target:
protected void clientInit() { CommonHelper.assertNotBlank("fields", getConfiguration().getFields()); configuration.setApi(FacebookApi.instance()); configuration.setProfileDefinition(new FacebookProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorReason = ctx.getRequestParameter(OAuthCredentialsException.ERROR_REASON); return error.map(e -> "access_denied".equals(e)).orElse(false) && errorReason.map(e -> "user_denied".equals(e)).orElse(false); }); configuration.setWithState(true); defaultProfileCreator(new FacebookProfileCreator(configuration, this)); super.clientInit(); }
Source:
public void processCommandInsert(JsonObject request, WebSocketSession session) { HivePrincipal principal = (HivePrincipal) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); final String deviceId = gson.fromJson(request.get(DEVICE_ID), String.class); final DeviceCommandWrapper deviceCommand = gson .fromJson(request.getAsJsonObject(COMMAND), DeviceCommandWrapper.class); logger.debug("command/insert action for {}, Session ", deviceId, session.getId()); Set<DeviceVO> devices = new HashSet<>(); if (deviceId == null) { throw new HiveException(Messages.DEVICE_ID_REQUIRED, SC_BAD_REQUEST); } DeviceVO deviceVO = deviceService.findByIdWithPermissionsCheck(deviceId, principal); if (deviceVO == null) { throw new HiveException(String.format(Messages.DEVICE_NOT_FOUND, deviceId), SC_NOT_FOUND); } devices.add(deviceVO); if (devices.isEmpty()) { throw new HiveException(String.format(Messages.DEVICE_NOT_FOUND, deviceId), SC_NOT_FOUND); } if (deviceCommand == null) { throw new HiveException(Messages.EMPTY_COMMAND, SC_BAD_REQUEST); } final UserVO user = principal.getUser(); WebSocketResponse response = new WebSocketResponse(); for (DeviceVO device : devices) { commandService.insert(deviceCommand, device, user) .thenAccept(command -> { response.addValue(COMMAND, command, COMMAND_TO_CLIENT); clientHandler.sendMessage(request, response, session); }) .exceptionally(ex -> { logger.warn("Unable to insert notification.", ex); throw new HiveException(Messages.INTERNAL_SERVER_ERROR, SC_INTERNAL_SERVER_ERROR); }); } }

Target:
public void processCommandInsert(JsonObject request, WebSocketSession session) { HivePrincipal principal = (HivePrincipal) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); final String deviceId = gson.fromJson(request.get(DEVICE_ID), String.class); final DeviceCommandWrapper deviceCommand = gson .fromJson(request.getAsJsonObject(COMMAND), DeviceCommandWrapper.class); logger.debug("command/insert action for {}, Session ", deviceId, session.getId()); Set<DeviceVO> devices = new HashSet<>(); if (deviceId == null) { throw new HiveException(Messages.DEVICE_ID_REQUIRED, SC_BAD_REQUEST); } DeviceVO deviceVO = deviceService.findByIdWithPermissionsCheck(deviceId, principal); if (deviceVO == null) { throw new HiveException(String.format(Messages.DEVICE_NOT_FOUND, deviceId), SC_NOT_FOUND); } devices.add(deviceVO); if (deviceCommand == null) { throw new HiveException(Messages.EMPTY_COMMAND, SC_BAD_REQUEST); } final UserVO user = principal.getUser(); WebSocketResponse response = new WebSocketResponse(); for (DeviceVO device : devices) { commandService.insert(deviceCommand, device, user) .thenAccept(command -> { response.addValue(COMMAND, command, COMMAND_TO_CLIENT); clientHandler.sendMessage(request, response, session); }) .exceptionally(ex -> { logger.warn("Unable to insert notification.", ex); throw new HiveException(Messages.INTERNAL_SERVER_ERROR, SC_INTERNAL_SERVER_ERROR); }); } }
Source:
public void testEmptyCreation() { String regex = ""; RestResourceConcatenator rc = new RestResourceConcatenator(regex); fail("An empty string should not produce " + rc.toString()); }

Target:
public void testEmptyCreation() { thrown.expect(OseeArgumentException.class); thrown.expectMessage("xmlTag cannot be empty"); String regex = ""; RestResourceConcatenator rc = new RestResourceConcatenator(); rc.initialize(regex); fail("An empty string should not produce " + rc.toString()); }
Source:
public List<Object> getEntityClassIds() { return dataService.findAll(EntityTypeMetadata.ENTITY_TYPE_META_DATA).map(Entity::getIdValue).collect(toList()); }

Target:
public List<Object> getEntityClassIds() { return getEntityTypes().map(EntityType::getId).collect(toList()); }
Source:
private static com.vividsolutions.jts.geom.Geometry readGeoFromWkt(final String wkt) throws CatalogTransformerException { WKTReader reader = new WKTReader(); try { return reader.read(wkt); } catch (ParseException e) { throw new CatalogTransformerException("Unable to parse WKT to Geometry.", e); } }

Target:
private static com.vividsolutions.jts.geom.Geometry readGeoFromWkt(final String wkt) throws CatalogTransformerException { try { return WKT_READER_THREAD_LOCAL.get().read(wkt); } catch (ParseException e) { throw new CatalogTransformerException("Unable to parse WKT to Geometry.", e); } }
Source:
protected final EntityClass<E> entityClass() { if (entityClass == null) { @SuppressWarnings("unchecked") final Class<E> cast = (Class<E>)ENTITY.getArgumentIn(getClass()); entityClass = getModelClass(cast); } return entityClass; }

Target:
protected final EntityClass<E> entityClass() { if (entityClass == null) { @SuppressWarnings("unchecked") Class<E> cast = (Class<E>) ENTITY.getArgumentIn(getClass()); entityClass = getModelClass(cast); } return entityClass; }
Source:
protected void refreshFile(IFile file, IProgressMonitor monitor) throws CoreException { if (file == null) { return; } class RefreshFileOperation extends DocumentProviderOperation implements ISchedulingRuleProvider { @Override protected void execute(IProgressMonitor m) throws CoreException { try { file.refreshLocal(IResource.DEPTH_INFINITE, m); } catch (OperationCanceledException x) { } } @Override public ISchedulingRule getSchedulingRule() { return getRefreshRule(file); } } executeOperation(new RefreshFileOperation(), monitor); }

Target:
protected void refreshFile(IFile file, IProgressMonitor monitor) throws CoreException { class RefreshFileOperation extends DocumentProviderOperation implements ISchedulingRuleProvider { @Override protected void execute(IProgressMonitor m) throws CoreException { try { file.refreshLocal(IResource.DEPTH_INFINITE, m); } catch (OperationCanceledException x) { } } @Override public ISchedulingRule getSchedulingRule() { return getRefreshRule(file); } } executeOperation(new RefreshFileOperation(), monitor); }
Source:
public void close() { context = null; memSpace = null; address = null; }

Target:
public void close() { context = null; address = null; memSpace = null; }
Source:
public boolean visit(MethodInvocation node) { if (isInflateMethod(node)) { this.viewVariableDeclarationFragment = (VariableDeclarationFragment) getFirstAncestorOrNull(node, VariableDeclarationFragment.class); if (viewVariableDeclarationFragment != null) { this.viewVariable = viewVariableDeclarationFragment.getName(); this.viewAssignmentStatement = getAncestor(viewVariableDeclarationFragment, VariableDeclarationStatement.class); } else { this.viewVariableAssignment = (Assignment) getFirstAncestorOrNull(node, Assignment.class); if (viewVariableAssignment != null) { this.viewVariable = (SimpleName) viewVariableAssignment.getLeftHandSide(); this.viewAssignmentStatement = getAncestor(viewVariableAssignment, ExpressionStatement.class); } } return DO_NOT_VISIT_SUBTREE; } return VISIT_SUBTREE; }

Target:
public boolean visit(MethodInvocation node) { if (isInflateMethod(node)) { ASTNode ancestor = getFirstAncestorOrNull(node, VariableDeclarationFragment.class, Assignment.class); if (ancestor instanceof VariableDeclarationFragment) { viewVariableDeclarationFragment = (VariableDeclarationFragment) ancestor; viewVariable = viewVariableDeclarationFragment.getName(); viewAssignmentStmt = getAncestorOrNull(viewVariableDeclarationFragment, VariableDeclarationStatement.class); if (viewAssignmentStmt == null) { resetData(); return VISIT_SUBTREE; } } else if (ancestor instanceof Assignment) { viewVariableAssignment = (Assignment) ancestor; ASTNode leftHandSideNode = viewVariableAssignment.getLeftHandSide(); if (leftHandSideNode.getNodeType() == SIMPLE_NAME) { viewVariable = (SimpleName) leftHandSideNode; } else { resetData(); return VISIT_SUBTREE; } viewAssignmentStmt = getAncestorOrNull(viewVariableAssignment, ExpressionStatement.class); } return DO_NOT_VISIT_SUBTREE; } return VISIT_SUBTREE; }
Source:
public void testScopeInLoginOptionsShouldBeConsideredByLoginUrl() { try { testExecutor.configure() .init(defaultArguments()); } catch (WebDriverException ex) { } JSObjectBuilder loginOptions = JSObjectBuilder.create().add("scope", "profile email phone"); testExecutor.login(loginOptions.build(), (JavascriptStateValidator) (driver, output, events) -> { assertThat(jsDriver.getCurrentUrl(), containsString("&scope=openid%20profile%20email%20phone")); }); }

Target:
public void testScopeInLoginOptionsShouldBeConsideredByLoginUrl() { testExecutor.configure().init(defaultArguments()); JSObjectBuilder loginOptions = JSObjectBuilder.create().add("scope", "profile email phone"); testExecutor.login(loginOptions, (JavascriptStateValidator) (driver, output, events) -> { assertThat(driver.getCurrentUrl(), containsString("&scope=openid%20profile%20email%20phone")); }); }
Source:
public void rewriteContext(CubeQueryContext cubeql) throws SemanticException { if (cubeql.getCube() != null && !cubeql.getCandidateFactTables() .isEmpty()) { Map<CandidateFact, Double> factWeightMap = new HashMap<CandidateFact, Double>(); for (CandidateFact fact : cubeql.getCandidateFactTables()) { factWeightMap.put(fact, fact.fact.weight()); } double minWeight = Collections.min(factWeightMap.values()); for (Iterator<CandidateFact> i = cubeql.getCandidateFactTables().iterator(); i.hasNext();) { CandidateFact fact = i.next(); if (factWeightMap.get(fact) > minWeight) { LOG.info("Not considering fact:" + fact + " from candidate fact tables as it has more fact weight:" + factWeightMap.get(fact) + " minimum:" + minWeight); cubeql.addFactPruningMsgs(fact.fact, "The fact " + fact + " has more weight."); i.remove(); } } } }

Target:
public void rewriteContext(CubeQueryContext cubeql) throws SemanticException { if (cubeql.getCube() != null && !cubeql.getCandidateFactTables() .isEmpty()) { Map<CandidateFact, Double> factWeightMap = new HashMap<CandidateFact, Double>(); for (CandidateFact fact : cubeql.getCandidateFactTables()) { factWeightMap.put(fact, fact.fact.weight()); } double minWeight = Collections.min(factWeightMap.values()); for (Iterator<CandidateFact> i = cubeql.getCandidateFactTables().iterator(); i.hasNext();) { CandidateFact fact = i.next(); if (factWeightMap.get(fact) > minWeight) { LOG.info("Not considering fact:" + fact + " from candidate fact tables as it has more fact weight:" + factWeightMap.get(fact) + " minimum:" + minWeight); cubeql.addFactPruningMsgs(fact.fact, new CandidateTablePruneCause( fact.fact.getName(), CubeTableCause.MORE_WEIGHT)); i.remove(); } } } }
Source:
public Boolean getCachedAuthorizationResult(DSpaceObject dspaceObject, int action, EPerson eperson) { if(mode == Mode.READ_ONLY) { return authorizedActionsCache.get(buildAuthorizedActionKey(dspaceObject, action, eperson)); } else { return false; } }

Target:
public Boolean getCachedAuthorizationResult(DSpaceObject dspaceObject, int action, EPerson eperson) { if(isReadOnly()) { return readOnlyCache.getCachedAuthorizationResult(dspaceObject, action, eperson); } else { return null; } }
Source:
public void onBecomeStandbyFromBootstrap(Message message, NotificationContext context) { String partitionName = message.getPartitionName(); logger.info("Partition in resource is becoming STANDBY from BOOTSTRAP", partitionName, message.getResourceName()); if (clusterMapConfig.clustermapEnableStateModelListener) { partitionStateChangeListener.onPartitionBecomeStandbyFromBootstrap(partitionName); } try { replicaSyncUpManager.waitBootstrapCompleted(partitionName); } catch (InterruptedException | IllegalStateException e) { logger.info("Bootstrap failed or was interrupted on partition {}", partitionName); throw new StateTransitionException("Bootstrap failed or was interrupted", StateTransitionException.TransitionErrorCode.BootstrapFailure); } }

Target:
public void onBecomeStandbyFromBootstrap(Message message, NotificationContext context) { String partitionName = message.getPartitionName(); logger.info("Partition in resource is becoming STANDBY from BOOTSTRAP", partitionName, message.getResourceName()); if (clusterMapConfig.clustermapEnableStateModelListener) { partitionStateChangeListener.onPartitionBecomeStandbyFromBootstrap(partitionName); } try { replicaSyncUpManager.waitBootstrapCompleted(partitionName); } catch (InterruptedException e) { logger.error("Bootstrap was interrupted on partition {}", partitionName); throw new StateTransitionException("Bootstrap failed or was interrupted", StateTransitionException.TransitionErrorCode.BootstrapFailure); } catch (StateTransitionException e) { logger.error("Bootstrap didn't complete.", e); throw e; } }
Source:
public long getTransactionTime() { return execConfig.get(Long.class, "transaction_time", 0L); }

Target:
public Timestamp getTransactionTime() { return execConfig.get(Timestamp.class, "transaction_time", sessionCreatedTime); }
Source:
private ZapNumberSpinner getDurationNumberSpinner() { if (durationNumberSpinner == null) { durationNumberSpinner = new ZapNumberSpinner(0, 60, Integer.MAX_VALUE); } return durationNumberSpinner; }

Target:
private ZapNumberSpinner getDurationNumberSpinner() { if (durationNumberSpinner == null) { durationNumberSpinner = new ZapNumberSpinner(0, 0, Integer.MAX_VALUE); } return durationNumberSpinner; }
Source:
private CompletableFuture<JobResult> unwrapJobResultException( CompletableFuture<JobResult> jobResult) { return jobResult.thenApply(result -> { if (result.isSuccess()) { return result; } Optional<SerializedThrowable> serializedThrowable = result.getSerializedThrowable(); if (result.getApplicationStatus() == ApplicationStatus.CANCELED) { throw new CompletionException( new JobCancellationException( result.getJobId(), "Job was cancelled.", serializedThrowable.orElse(null))); } if (serializedThrowable.isPresent()) { Throwable throwable; try { throwable = serializedThrowable .get() .deserializeError(application.getUserCodeClassLoader()); } catch (ProgramInvocationException e) { LOG.info("Application getUserCodeClassLoader failed.", e); throw new RuntimeException(e.getMessage()); } throw new CompletionException(throwable); } throw new RuntimeException("Job execution failed for unknown reason."); }); }

Target:
private CompletableFuture<JobResult> unwrapJobResultException( CompletableFuture<JobResult> jobResult) { return jobResult.thenApply(result -> { if (result.isSuccess()) { return result; } Optional<SerializedThrowable> serializedThrowable = result.getSerializedThrowable(); if (result.getApplicationStatus() == ApplicationStatus.CANCELED) { throw new CompletionException( new JobCancellationException( result.getJobId(), "Job was cancelled.", serializedThrowable.orElse(null))); } if (serializedThrowable.isPresent()) { Throwable throwable = serializedThrowable .get() .deserializeError(application.getUserCodeClassLoader()); throw new CompletionException(throwable); } throw new RuntimeException("Job execution failed for unknown reason."); }); }
Source:
protected CloseableIterator<Map<String, Object>> intermediateRowIterator() throws IOException { final Closer closer = Closer.create(); final InputEntity.CleanableFile resultFile = closer.register(source.fetch(temporaryDirectory, null)); FileInputStream inputStream = new FileInputStream(resultFile.file()); JsonIterator<Map<String, Object>> jsonIterator = new JsonIterator<>(new TypeReference<Map<String, Object>>() { }, inputStream, closer, objectMapper); return new CloseableIterator<Map<String, Object>>() { @Override public void close() throws IOException { jsonIterator.close(); } @Override public boolean hasNext() { return jsonIterator.hasNext(); } @Override public Map<String, Object> next() { return jsonIterator.next(); } }; }

Target:
protected CloseableIterator<Map<String, Object>> intermediateRowIterator() throws IOException { final Closer closer = Closer.create(); final InputEntity.CleanableFile resultFile = closer.register(source.fetch(temporaryDirectory, null)); FileInputStream inputStream = new FileInputStream(resultFile.file()); JsonIterator<Map<String, Object>> jsonIterator = new JsonIterator<>(new TypeReference<Map<String, Object>>() { }, inputStream, closer, objectMapper); return jsonIterator; }
Source:
public void process() { PerformanceMonitor.startActivity("rendering/outline"); outlineMaterial.setFloat("viewingDistance", renderingConfig.getViewDistance().getChunkDistance().x * 8.0f, true); outlineMaterial.setFloat("daylight", backdropProvider.getDaylight(), true); outlineMaterial.setFloat("tick", worldRenderer.getMillisecondsSinceRenderingStart(), true); outlineMaterial.setFloat("sunlightValueAtPlayerPos", worldRenderer.getTimeSmoothedMainLightIntensity(), true); cameraDir = activeCamera.getViewingDirection(); cameraPosition = activeCamera.getPosition(); outlineMaterial.setFloat("swimming", activeCamera.isUnderWater() ? 1.0f : 0.0f, true); outlineMaterial.setFloat3("cameraPosition", cameraPosition.x, cameraPosition.y, cameraPosition.z, true); outlineMaterial.setFloat3("cameraDirection", cameraDir.x, cameraDir.y, cameraDir.z, true); outlineMaterial.setFloat3("cameraParameters", activeCamera.getzNear(), activeCamera.getzFar(), 0.0f, true); sunDirection = backdropProvider.getSunDirection(false); outlineMaterial.setFloat3("sunVec", sunDirection.x, sunDirection.y, sunDirection.z, true); outlineMaterial.setFloat("time", worldProvider.getTime().getDays(), true); outlineMaterial.setFloat("texelWidth", 1.0f / sceneOpaqueFboWidth); outlineMaterial.setFloat("texelHeight", 1.0f / sceneOpaqueFboHeight); outlineMaterial.setFloat("pixelOffsetX", pixelOffsetX); outlineMaterial.setFloat("pixelOffsetY", pixelOffsetY); renderFullscreenQuad(); PerformanceMonitor.endActivity(); }

Target:
public void process() { PerformanceMonitor.startActivity("rendering/outline"); outlineMaterial.setFloat("texelWidth", 1.0f / sceneOpaqueFboWidth); outlineMaterial.setFloat("texelHeight", 1.0f / sceneOpaqueFboHeight); outlineMaterial.setFloat("pixelOffsetX", pixelOffsetX); outlineMaterial.setFloat("pixelOffsetY", pixelOffsetY); renderFullscreenQuad(); PerformanceMonitor.endActivity(); }
Source:
public static void init(int memCheckInterval) { File f = new File(MEMINFO_FILE); memCheckEnabled = f.exists() && !f.isDirectory(); if (memCheckEnabled) { readMemoryInfoFile(); logger.info(String.format("Scheduled thread to read /proc/meminfo every %d seconds", memCheckInterval)); scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); scheduledExecutorService.scheduleAtFixedRate(new MemoryInfoReader(), 0, memCheckInterval, TimeUnit.SECONDS); } }

Target:
public static void init(int memCheckInterval) { File f = new File(MEMINFO_FILE); memCheckEnabled = f.exists() && !f.isDirectory(); if (memCheckEnabled) { readMemoryInfoFile(); logger.info(String.format("Scheduled thread to read /proc/meminfo every %d seconds", memCheckInterval)); scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); scheduledExecutorService.scheduleAtFixedRate(new MemoryInfoReader(), 0, memCheckInterval, TimeUnit.SECONDS); } else { logger.info("Cannot find /proc/meminfo, memory check will be disabled"); } }
Source:
protected void run() throws Exception { if (createBranch) { final ObjectId head = db.resolve(Constants.HEAD); if (head == null) throw die(CLIText.get().onBranchToBeBorn); } try (Git git = new Git(db)) { CheckoutCommand command = git.checkout(); if (paths.size() > 0) { command.setStartPoint(name); if (paths.size() == 1 && paths.get(0).equals(".")) { command.setAllPaths(true); } else { for (String path : paths) command.addPath(path); } } else { command.setCreateBranch(createBranch); command.setName(name); command.setForce(force); command.setOrphan(orphan); } try { String oldBranch = db.getBranch(); Ref ref = command.call(); if (ref == null) return; if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) { outw.println(MessageFormat.format( CLIText.get().alreadyOnBranch, name)); return; } if (createBranch || orphan) outw.println(MessageFormat.format( CLIText.get().switchedToNewBranch, name)); else outw.println(MessageFormat.format( CLIText.get().switchedToBranch, Repository.shortenRefName(ref.getName()))); } catch (RefNotFoundException e) { outw.println(MessageFormat.format( CLIText.get().pathspecDidNotMatch, name)); } catch (RefAlreadyExistsException e) { throw die(MessageFormat.format(CLIText.get().branchAlreadyExists, name)); } catch (CheckoutConflictException e) { outw.println(CLIText.get().checkoutConflict); for (String path : e.getConflictingPaths()) outw.println(MessageFormat.format( CLIText.get().checkoutConflictPathLine, path)); } } }

Target:
protected void run() throws Exception { if (createBranch) { final ObjectId head = db.resolve(Constants.HEAD); if (head == null) throw die(CLIText.get().onBranchToBeBorn); } try (Git git = new Git(db)) { CheckoutCommand command = git.checkout(); if (paths.size() > 0) { command.setStartPoint(name); if (paths.size() == 1 && paths.get(0).equals(".")) { command.setAllPaths(true); } else { for (String path : paths) { command.addPath(path); } } } else { command.setCreateBranch(createBranch); command.setName(name); command.setForce(force); command.setOrphan(orphan); } try { String oldBranch = db.getBranch(); Ref ref = command.call(); if (ref == null) return; if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) { outw.println(MessageFormat.format( CLIText.get().alreadyOnBranch, name)); return; } if (createBranch || orphan) outw.println(MessageFormat.format( CLIText.get().switchedToNewBranch, name)); else outw.println(MessageFormat.format( CLIText.get().switchedToBranch, Repository.shortenRefName(ref.getName()))); } catch (RefNotFoundException e) { outw.println(MessageFormat.format( CLIText.get().pathspecDidNotMatch, name)); } catch (RefAlreadyExistsException e) { throw die(MessageFormat.format(CLIText.get().branchAlreadyExists, name)); } catch (CheckoutConflictException e) { outw.println(CLIText.get().checkoutConflict); for (String path : e.getConflictingPaths()) outw.println(MessageFormat.format( CLIText.get().checkoutConflictPathLine, path)); } } }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(getName()); selectionMap = new LinkedHashMap<String, PlayerSelectionOption>(); selectionMap.put("Widevine DASH Stream", new PlayerSelectionOption("BjN213NzE6H-9WPurASHfKFOtEak5x6b", OoyalaSkinOPTPlayerActivity.class)); selectionMap.put("Widevine DASH Downloader", new PlayerSelectionOption("BjN213NzE6H-9WPurASHfKFOtEak5x6b", OfflineDownloadActivity.class)); selectionMap.put("Widevine DASH Offline Player", new PlayerSelectionOption("BjN213NzE6H-9WPurASHfKFOtEak5x6b", OfflineSkinPlayerActivity.class)); setContentView(R.layout.list_activity_layout); selectionAdapter = new ArrayAdapter<String>(this, R.layout.list_activity_list_item); for(String key : selectionMap.keySet()) { selectionAdapter.add(key); } selectionAdapter.notifyDataSetChanged(); ListView selectionListView = (ListView) findViewById(R.id.mainActivityListView); selectionListView.setAdapter(selectionAdapter); selectionListView.setOnItemClickListener(this); if(Build.VERSION_CODES.M == Build.VERSION.SDK_INT) { showDevOptionsDialog(); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(getName()); selectionMap = new LinkedHashMap<String, PlayerSelectionOption>(); selectionMap.put("Widevine DASH Stream", new PlayerSelectionOption("tyb2g2NjE64BuIcLQyS0wEccq4fr5Y03", OoyalaSkinOPTPlayerActivity.class)); selectionMap.put("Widevine DASH Downloader", new PlayerSelectionOption("tyb2g2NjE64BuIcLQyS0wEccq4fr5Y03", OfflineDownloadActivity.class)); selectionMap.put("Widevine DASH Offline Player", new PlayerSelectionOption("tyb2g2NjE64BuIcLQyS0wEccq4fr5Y03", OfflineSkinPlayerActivity.class)); setContentView(R.layout.list_activity_layout); selectionAdapter = new ArrayAdapter<String>(this, R.layout.list_activity_list_item); for(String key : selectionMap.keySet()) { selectionAdapter.add(key); } selectionAdapter.notifyDataSetChanged(); ListView selectionListView = (ListView) findViewById(R.id.mainActivityListView); selectionListView.setAdapter(selectionAdapter); selectionListView.setOnItemClickListener(this); if(Build.VERSION_CODES.M == Build.VERSION.SDK_INT) { showDevOptionsDialog(); } }
Source:
Mono<Response<DetectLanguageResult>> detectLanguageWithResponse(String text, String countryHint, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); List<DetectLanguageInput> languageInputs = Collections.singletonList(new DetectLanguageInput("0", text, countryHint)); return detectBatchLanguageWithResponse(languageInputs, null, context) .map(Transforms::processSingleResponseErrorResult); }

Target:
Mono<Response<DetectedLanguage>> detectLanguageWithResponse(String text, String countryHint, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); List<DetectLanguageInput> languageInputs = Collections.singletonList(new DetectLanguageInput("0", text, countryHint)); return detectLanguageBatchWithResponse(languageInputs, null, context) .map(response -> new SimpleResponse<>(response, Transforms.processSingleResponseErrorResult(response).getValue().getPrimaryLanguage())); }
Source:
private void verifyAuthConfig(AuthConfig config, String username, String password, String email, String auth) { assertNotNull(config); JsonObject params = gsonBuilder.create().fromJson(new String(Base64.decodeBase64(config.toHeaderValue().getBytes())), JsonObject.class); assertEquals(username, params.get("username").getAsString()); assertEquals(password, params.get("password").getAsString()); if (email != null) { assertEquals(email, params.get("email").getAsString()); } if (auth != null) { assertEquals(auth, params.get("auth").getAsString()); } }

Target:
private void verifyAuthConfig(AuthConfig config, String username, String password, String email, String auth) { assertNotNull(config); JsonObject params = gsonBuilder.create().fromJson(new String(Base64.decodeBase64(config.toHeaderValue().getBytes())), JsonObject.class); assertEquals(username, params.get(AuthConfig.AUTH_USERNAME).getAsString()); assertEquals(password, params.get(AuthConfig.AUTH_PASSWORD).getAsString()); if (email != null) { assertEquals(email, params.get(AuthConfig.AUTH_EMAIL).getAsString()); } if (auth != null) { assertEquals(auth, params.get(AuthConfig.AUTH_AUTH).getAsString()); } }
Source:
private void endDiskRelatedActions(VM vm) { EndActionOnAllImageGroups(); VmHandler.updateDisksFromDb(vm); VmDeviceUtils.setVmDevices(vm.getStaticData()); }

Target:
private void endDiskRelatedActions(VM vm) { VmHandler.updateDisksFromDb(vm); VmDeviceUtils.setVmDevices(vm.getStaticData()); }
Source:
public boolean isPattern() { return false; }

Target:
public final boolean isPattern() { return false; }
Source:
public StateItem[] getStateTable() { return STATES; }

Target:
public StateItem[] getStateTable() { return STATE_LIST.toArray(new StateItem[STATE_LIST.size()]); }
Source:
public void shareState(final Map<CodePath, Object> toSend) { final Map<DeviceUID, Map<CodePath, Object>> msg = Stream.of( new AbstractMap.SimpleImmutableEntry<>(deviceUID, toSend) ).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutput out = null; try { out = new ObjectOutputStream(bos); out.writeObject(msg); out.flush(); final MqttMessage message = new MqttMessage(bos.toByteArray()); neighbors.forEach(publish(message)); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void shareState(final Map<CodePath, Object> toSend) { final Map<DeviceUID, Map<CodePath, Object>> msg = Stream.of( new AbstractMap.SimpleImmutableEntry<>(deviceUID, toSend) ).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { final ObjectOutput out = new ObjectOutputStream(bos); out.writeObject(msg); out.flush(); final MqttMessage message = new MqttMessage(bos.toByteArray()); neighbors.forEach(publish(message)); } catch (IOException e) { throw new IllegalStateException(e); } }
Source:
private void updateRateIfNeeded() { if (rateUpdateLimiter.tryAcquire()) { long updatedRate = getUpdatedRate(); if (currentRate != updatedRate) { createRateLimiterAtomically(updatedRate); } } }

Target:
private void updateRateIfNeeded() { long updatedRate = getUpdatedRate(); if (currentRate != updatedRate) { createRateLimiterAtomically(updatedRate); } }
Source:
private boolean activeSDsExist(List<LUNs> luns, String vgId, Guid poolId) { if (poolId == null) { return true; } Set<Guid> storageIDs = new HashSet<>(luns.size()); for (LUNs lun : luns) { if (lun.getStorageDomainId() != null && !lun.getvolume_group_id().equals(vgId)) { storageIDs.add(lun.getStorageDomainId()); } } if (storageIDs.isEmpty()) { return false; } String ids = StringUtils.join(storageIDs, ","); List<StoragePoolIsoMap> isomaps = DbFacade.getInstance().getStoragePoolIsoMapDao().getAllForStorages(ids, poolId); for (StoragePoolIsoMap isomap : isomaps) { if (isomap.getStatus() != StorageDomainStatus.Maintenance) { return true; } } return false; }

Target:
private boolean activeSDsExist(List<LUNs> luns, String vgId, Guid poolId) { if (poolId == null) { return true; } Set<Guid> storageIDs = new HashSet<>(luns.size()); for (LUNs lun : luns) { if (lun.getStorageDomainId() != null && !lun.getvolume_group_id().equals(vgId)) { storageIDs.add(lun.getStorageDomainId()); } } if (storageIDs.isEmpty()) { return false; } String ids = StringUtils.join(storageIDs, ","); List<StoragePoolIsoMap> isomaps = DbFacade.getInstance().getStoragePoolIsoMapDao().getAllForStorages(ids, poolId); for (StoragePoolIsoMap isomap : isomaps) { if (!isomap.getStatus().isStorageDomainDeactivated()) { return true; } } return false; }
Source:
private void validateProject(int type, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, PDECoreMessages.ManifestConsistencyChecker_builderTaskName, getWorkAmount(type)); if ((type & STRUCTURE) != 0) { validateProjectStructure(type, SubMonitor.convert(monitor, 1).newChild(1)); } if ((type & MANIFEST | EXTENSIONS) != 0) { IProject project = getProject(); IFile file = PDEProject.getPluginXml(project); if (!file.exists()) file = PDEProject.getFragmentXml(project); if (file.exists()) { validateFiles(file, type, monitor); } else if ((type & MANIFEST) != 0) { IFile manifestFile = PDEProject.getManifest(project); if (manifestFile.exists()) validateManifestFile(manifestFile, subMonitor.newChild(1)); } } if ((type & BUILD) != 0) { validateBuildProperties(subMonitor.newChild(1)); } }

Target:
private void validateProject(int type, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, PDECoreMessages.ManifestConsistencyChecker_builderTaskName, getWorkAmount(type)); if ((type & STRUCTURE) != 0) { validateProjectStructure(type, subMonitor.newChild(1)); } if ((type & MANIFEST | EXTENSIONS) != 0) { IProject project = getProject(); IFile file = PDEProject.getPluginXml(project); if (!file.exists()) file = PDEProject.getFragmentXml(project); if (file.exists()) { validateFiles(file, type, monitor); } else if ((type & MANIFEST) != 0) { IFile manifestFile = PDEProject.getManifest(project); if (manifestFile.exists()) validateManifestFile(manifestFile, subMonitor.newChild(1)); } } if ((type & BUILD) != 0) { validateBuildProperties(subMonitor.newChild(1)); } }
Source:
protected Optional<String> getVal(ItemStack stack) { if (!stack.hasTagCompound()) { return Optional.empty(); } NBTTagCompound mainCompound = stack.getTagCompound(); if (!mainCompound.hasKey(NbtDataUtil.BLOCK_ENTITY_TAG, NbtDataUtil.TAG_COMPOUND)) { return Optional.empty(); } String lock = mainCompound.getString("Lock"); return Optional.of(lock); }

Target:
protected Optional<String> getVal(ItemStack stack) { if (!stack.hasTagCompound()) { return Optional.empty(); } NBTTagCompound mainCompound = stack.getTagCompound(); if (!mainCompound.hasKey(NbtDataUtil.BLOCK_ENTITY_TAG, NbtDataUtil.TAG_COMPOUND)) { return Optional.empty(); } NBTTagCompound tileCompound = mainCompound.getCompoundTag(NbtDataUtil.BLOCK_ENTITY_TAG); String lock = tileCompound.getString(NbtDataUtil.ITEM_LOCK); return Optional.of(lock); }
Source:
private int[] generateIndicesWoR(int populationSize, int sampleSize) { Set<Integer> indices = new HashSet<Integer>(sampleSize); for (int i = populationSize - sampleSize; i < populationSize; i++) { int idx = rand.nextInt(i + 1); if (indices.contains(idx)) { indices.add(i); } else { indices.add(idx); } } int[] indicesArr = new int[indices.size()]; int i = 0; for (Integer val : indices) { indicesArr[i] = val; i++; } Arrays.sort(indicesArr); return indicesArr; }

Target:
private int[] generateIndicesWoR(int populationSize, int sampleSize) { Set<Integer> indices = new HashSet<>(sampleSize); for (int i = populationSize - sampleSize; i < populationSize; i++) { int idx = rand.nextInt(i + 1); if (indices.contains(idx)) { indices.add(i); } else { indices.add(idx); } } int[] indicesArr = Ints.toArray(indices); Arrays.sort(indicesArr); return indicesArr; }
Source:
protected String decryptedFilePath(SecretEngine secretEngine, EncryptedSecret encryptedSecret) { String plainText = secretEngine.decrypt(encryptedSecret); try { File tempFile = File.createTempFile(secretEngine.identifier() + '-', ".secret"); try (FileWriter fileWriter = new FileWriter(tempFile)) { fileWriter.write(plainText); } tempFile.deleteOnExit(); return tempFile.getAbsolutePath(); } catch (IOException e) { throw new SecretDecryptionException(); } }

Target:
protected Path decryptedFilePath(SecretEngine secretEngine, EncryptedSecret encryptedSecret) { String plainText = secretEngine.decrypt(encryptedSecret); try { File tempFile = File.createTempFile(secretEngine.identifier() + '-', ".secret"); try (FileWriter fileWriter = new FileWriter(tempFile)) { fileWriter.write(plainText); } tempFile.deleteOnExit(); return tempFile.toPath(); } catch (IOException e) { throw new SecretDecryptionException(e.getMessage()); } }
Source:
public void jpegRESTim2txtTest() throws Exception { String[] expectedObjects = {"baseball", "bat", "field"}; doRecognize(CONFIG_REST_FILE_IM2TXT, BASEBALL_IMAGE_JPEG, ObjectRecognitionParser.MD_KEY_IMG_CAP, expectedObjects); }

Target:
public void jpegRESTim2txtTest() throws Exception { String[] expectedCaption = {"a baseball player holding a bat on a field"}; doRecognize(CONFIG_REST_FILE_IM2TXT, BASEBALL_IMAGE_JPEG, ObjectRecognitionParser.MD_KEY_IMG_CAP, expectedCaption); }
Source:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } auditLogDirector.log(this, AuditLogType.USER_SYSPREP_VM_TEMPLATE_START); SysprepVDSCommandParameters parameters = new SysprepVDSCommandParameters(); getDiskImages().forEach(diskImage -> parameters.addVolume( diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId())); lockTemplateInDb(); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.Sysprep, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); jobFailed(); } setSucceeded(vdsReturnValue.getSucceeded()); }

Target:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } SysprepVDSCommandParameters parameters = new SysprepVDSCommandParameters(getParameters().getStorageJobId()); getDiskImages().forEach(diskImage -> parameters.addVolume( diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId())); VmTemplateHandler.lockVmTemplateInTransaction(getVmTemplateId(), getCompensationContext()); lockTemplateInDb(); lockDiskImagesInDb(); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.Sysprep, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); unlockDiskImagesInDb(); unlockTemplateInDb(); } setSucceeded(vdsReturnValue.getSucceeded()); }
Source:
private void checkThresholdMonitors(T obj) throws RuntimeException { for (ThresholdMonitor<T> m: monitors) { if (dataSizeB > m.thresholdB && !m.fired) { m.fired = true; m.event.fire(dataSizeB, m.thresholdB, obj); } } }

Target:
private void checkThresholdMonitors(T obj) throws RuntimeException { for (ThresholdMonitor<T> m: monitors) { if (dataSizeB > m.thresholdB && !m.fired) { m.fired = true; m.callback.fire(dataSizeB, m.thresholdB, obj); } } }
Source:
public static URL getAccumuloPropsLocation() { URL siteUrl = SiteConfiguration.class.getClassLoader().getResource("accumulo-site.xml"); if (siteUrl != null) { throw new IllegalArgumentException("Found deprecated config file 'accumulo-site.xml' on " + "classpath. Since 2.0.0, this file was replaced by 'accumulo.properties'."); } String configFile = System.getProperty("accumulo.configuration", "accumulo.properties"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { throw new IllegalArgumentException( "Failed to load Accumulo configuration at " + configFile); } } catch (MalformedURLException | URISyntaxException e) { throw new IllegalArgumentException( "Failed to load Accumulo configuration from " + configFile, e); } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { throw new IllegalArgumentException( "Failed to load Accumulo configuration '" + configFile + "' from classpath"); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } }

Target:
public static URL getAccumuloPropsLocation() { URL siteUrl = SiteConfiguration.class.getClassLoader().getResource("accumulo-site.xml"); if (siteUrl != null) { throw new IllegalArgumentException("Found deprecated config file 'accumulo-site.xml' on " + "classpath. Since 2.0.0, this file was replaced by 'accumulo.properties'."); } String configFile = System.getProperty("accumulo.properties", "accumulo.properties"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { throw new IllegalArgumentException( "Failed to load Accumulo configuration at " + configFile); } } catch (MalformedURLException | URISyntaxException e) { throw new IllegalArgumentException( "Failed to load Accumulo configuration from " + configFile, e); } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { throw new IllegalArgumentException( "Failed to load Accumulo configuration '" + configFile + "' from classpath"); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } }
Source:
public void deployWithExtensions() throws IOException { String name = "my.comp4"; StreamRef compRef = new URLStreamRef(getResource("MyComp4.xml")); assertNotComponentDeployed(name); TargetExtensions te = new TargetExtensions() { @Override protected void initialize() { addTargetExtension("my.comp3.alias2", "xp"); } }; deployPartialComponent(getContext(), Sets.newHashSet(te), compRef); assertComponentDeployed(name); assertComponentDeployed(name.concat("-partial")); assertExtensionsEquals(1, name); }

Target:
public void deployWithExtensions() throws IOException { String name = "my.comp4"; String partial = name + "-partial"; StreamRef compRef = new URLStreamRef(getResource("MyComp4.xml")); assertNull(getComponent(name)); assertNull(getComponent(partial)); TargetExtensions te = new TargetExtensions() { @Override protected void initialize() { addTargetExtension("my.comp3.alias2", "xp"); } }; deployPartialComponent(getContext(), Collections.singleton(te), compRef); assertNull(getComponent(name)); assertNotNull(getComponent(partial)); assertNumberOfExtensionsEquals(1, partial); }
Source:
public Folder findFolderByPath(String path, String hostid, User user, boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { if(user==null) user = APILocator.getUserAPI().getSystemUser(); Host host = APILocator.getHostAPI().find(hostid, user, false); return findFolderByPath(path,host,user, respectFrontEndPermissions); }

Target:
public Folder findFolderByPath(String path, String hostid, User user, boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { if(user==null){ user = APILocator.systemUser(); } Host host = APILocator.getHostAPI().find(hostid, user, false); return findFolderByPath(path,host,user, respectFrontEndPermissions); }
Source:
public void run(final SpringConfiguration configuration, final Environment environment) throws Exception { log.info("_____spring scanning________*******************"); initializeSpring(configuration, environment); addResources(environment); addHealthChecks(environment); addTasks(environment); addManaged(environment); }

Target:
public void run(final SpringConfiguration configuration, final Environment environment) throws Exception { initializeSpring(configuration, environment); addResources(environment); addHealthChecks(environment); addTasks(environment); addManaged(environment); }
Source:
private OAuthToken getToken(final String userId) throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { OAuthCredentialsResponse credentials; credentialsStoreLock.lock(); try { credentials = credentialsStore.get(userId); } finally { credentialsStoreLock.unlock(); } return newDto(OAuthToken.class).withToken(credentials.token).withScope(credentials.tokenSecret); }

Target:
private OAuthToken getToken(final String userId) { OAuthCredentialsResponse credentials; credentialsStoreLock.lock(); try { credentials = credentialsStore.get(userId); } finally { credentialsStoreLock.unlock(); } if (credentials != null) { return newDto(OAuthToken.class).withToken(credentials.token).withScope(credentials.tokenSecret); } return null; }
Source:
private List<URL> getList() { List<URL> list = new ArrayList<>(); URL url_1 = new URL("dubbo", "127.0.0.0", 1000); URL url_2 = new URL("dubbo", "127.0.0.1", 1001); URL url_3 = new URL("dubbo", "127.0.0.2", 1002); list.add(url_1); list.add(url_2); list.add(url_3); return list; }

Target:
private List<URL> getList() { List<URL> list = new ArrayList<>(); URL url1 = new URL("dubbo", "127.0.0.0", 1000); URL url2 = new URL("dubbo", "127.0.0.1", 1001); URL url3 = new URL("dubbo", "127.0.0.2", 1002); list.add(url1); list.add(url2); list.add(url3); return list; }
Source:
public int unlinkCallback(String path) { try { return unlink(path); } catch (Exception e) { e.printStackTrace(); return -ErrorCodes.EIO(); } }

Target:
public int unlinkCallback(String path) { try { return unlink(path); } catch (Exception e) { LOG.error("Failed to unlink {}: ", path, e); return -ErrorCodes.EIO(); } }