auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(Paths.get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; }

Target:
public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; }
Source:
protected boolean validateSourceDomainsSpaceRequirements() { Map<Guid, List<DiskImage>> storageDomainsActiveImagesMap = new HashMap<>(); for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { DiskImage diskImage = getDiskImageByImageId(parameters.getImageId()); if (diskImage.getActive()) { MultiValueMapUtils.addToMap(parameters.getSourceStorageDomainId(), diskImage, storageDomainsActiveImagesMap); continue; } } for (Map.Entry<Guid, List<DiskImage>> entry : storageDomainsActiveImagesMap.entrySet()) { Guid sourceDomainId = entry.getKey(); List<DiskImage> disksList = entry.getValue(); Guid storagePoolId = disksList.get(0).getStoragePoolId(); StorageDomain sourceDomain = getStorageDomainById(sourceDomainId, storagePoolId); StorageDomainValidator storageDomainValidator = createStorageDomainValidator(sourceDomain); if (!validate(storageDomainValidator.hasSpaceForNewDisks(disksList))) { return false; } } return true; }

Target:
protected boolean validateSourceDomainsSpaceRequirements() { Map<Guid, List<DiskImage>> storageDomainsActiveImagesMap = new HashMap<>(); for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { DiskImage diskImage = getDiskImageByImageId(parameters.getImageId()); MultiValueMapUtils.addToMap(parameters.getSourceStorageDomainId(), diskImage, storageDomainsActiveImagesMap); } for (Map.Entry<Guid, List<DiskImage>> entry : storageDomainsActiveImagesMap.entrySet()) { Guid sourceDomainId = entry.getKey(); List<DiskImage> disksList = entry.getValue(); Guid storagePoolId = disksList.get(0).getStoragePoolId(); StorageDomain sourceDomain = getStorageDomainById(sourceDomainId, storagePoolId); StorageDomainValidator storageDomainValidator = createStorageDomainValidator(sourceDomain); if (!validate(storageDomainValidator.hasSpaceForNewDisks(disksList))) { return false; } } return true; }
Source:
private boolean containsPart(IViewPart[] viewStack, IWorkbenchPart part) { if (viewStack == null) { return false; } for (IViewPart element : viewStack) { if (element == part) { return true; } } return false; }

Target:
private boolean containsPart(IViewPart[] viewStack, IWorkbenchPart part) { if (viewStack == null) { return false; } for (IViewPart viewPart : viewStack) { if (viewPart == part) { return true; } } return false; }
Source:
public void testDeleteTag() throws Exception{ api.deleteTag(createdTag.getUuid()); }

Target:
public void testDeleteTag() throws Exception { String uuid = createdTag.getUuid(); api.deleteTag(uuid); assertNull(api.getTagInfo(uuid)); }
Source:
public static boolean hasLogMessage(String logFileName, String logMessage) throws Exception { BufferedReader fileReader = null; boolean found = false; Path logPath = LoggingUtil.getInServerLogPath(logFileName); fileReader = Files.newBufferedReader(logPath); String line = ""; while ((line = fileReader.readLine()) != null) { if(line.contains(logMessage)) { found = true; break; } } fileReader.close(); return found; }

Target:
public static boolean hasLogMessage(String logFileName, String logMessage) throws Exception { boolean found = false; Path logPath = LoggingUtil.getInServerLogPath(logFileName); try (BufferedReader fileReader = Files.newBufferedReader(logPath)) { String line = ""; while ((line = fileReader.readLine()) != null) { if (line.contains(logMessage)) { found = true; break; } } } return found; }
Source:
public void should_fail_if_actual_has_message_not_containing_with_expected_description() { AssertionInfo info = someInfo(); String content = "expected description part"; try { throwables.assertHasMessageContaining(info, actual, content); fail("AssertionError expected"); } catch (AssertionError err) { verify(failures).failure(info, shouldContain(actual.getMessage(), content), actual.getMessage(), content); } }

Target:
public void should_fail_if_actual_has_message_not_containing_with_expected_description() { String content = "expected description part"; expectAssertionError(() -> throwables.assertHasMessageContaining(INFO, actual, content)); verify(failures).failure(INFO, shouldContain(actual.getMessage(), content)); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryGroup> groupsToDelete = new ArrayList<>(); List<RepositoryGroupNode> groupsNodes = new ArrayList<>(); List<RepositoryTreeNode> elements = getSelectedNodes(); for (Object element : elements) { if (element instanceof RepositoryGroupNode) { RepositoryGroupNode groupNode = (RepositoryGroupNode) element; groupsNodes.add(groupNode); groupsToDelete.add(groupNode.getGroup()); } } if (!groupsToDelete.isEmpty()) { DeleteRepositoryGroupConfirmDialog confirmDelete = new DeleteRepositoryGroupConfirmDialog( getShell(event), groupsNodes); if (confirmDelete.open() == Window.OK) { RepositoryGroups groups = new RepositoryGroups(); groups.delete(groupsToDelete); getView(event).refresh(); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryGroup> groupsToDelete = new ArrayList<>(); List<RepositoryGroupNode> groupsNodes = new ArrayList<>(); List<RepositoryTreeNode> elements = getSelectedNodes(); for (Object element : elements) { if (element instanceof RepositoryGroupNode) { RepositoryGroupNode groupNode = (RepositoryGroupNode) element; groupsNodes.add(groupNode); groupsToDelete.add(groupNode.getGroup()); } } if (!groupsToDelete.isEmpty()) { DeleteRepositoryGroupConfirmDialog confirmDelete = new DeleteRepositoryGroupConfirmDialog( getShell(event), groupsNodes); if (confirmDelete.open() == Window.OK) { RepositoryGroups.getInstance().delete(groupsToDelete); getView(event).refresh(); } } return null; }
Source:
public Service create(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException { Service service = fetchFromCache(serviceType, implementation); if (service == null) { if (getServiceType() == serviceType) { service = createService(gatewayServices, serviceType, gatewayConfig, options, implementation); if (service == null && StringUtils.isNotBlank(implementation)) { try { service = Service.class.cast(Class.forName(implementation).newInstance()); logServiceUsage(implementation, serviceType); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new ServiceLifecycleException("Errror while instantiating " + serviceType.getShortName() + " service implementation " + implementation, e); } } } if (service != null) { service.init(gatewayConfig, options); cacheService(serviceType, implementation, service); } } return service; }

Target:
public Service create(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException { Service service = null; if (getServiceType() == serviceType) { service = createService(gatewayServices, serviceType, gatewayConfig, options, implementation); if (service == null && StringUtils.isNotBlank(implementation)) { try { service = (Service) Class.forName(implementation).newInstance(); logServiceUsage(implementation, serviceType); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new ServiceLifecycleException("Error while instantiating " + serviceType.getShortName() + " service implementation " + implementation, e); } } } return service; }
Source:
private static boolean hasWrapper(final Ds3Element ds3Element) { if (ds3Element.getName().endsWith("Jobs")) { return false; } else if (ds3Element.getName().equals("CommonPrefixes")) { return false; } return Ds3ElementUtil.hasWrapperAnnotations(ds3Element.getDs3Annotations()); }

Target:
private static boolean hasWrapper(final Ds3Element ds3Element) { if (ds3Element.getName().endsWith("Jobs") || ds3Element.getName().equals("CommonPrefixes")) { return false; } return Ds3ElementUtil.hasWrapperAnnotations(ds3Element.getDs3Annotations()); }
Source:
protected void executeCommand() { if (InitializeStorage()) { FencingExecutor executor = new FencingExecutor(getVds(), FenceActionType.Status); if (getVds().getpm_enabled() && executor.FindVdsToFence()) { VDSReturnValue returnValue = executor.Fence(); _fencingSucceeded = returnValue.getSucceeded(); _fenceStatusReturnValue = (FenceStatusReturnValue) returnValue.getReturnValue(); _vdsProxyFound = true; } if (getVds().getspm_status() != VdsSpmStatus.None) { storage_pool pool = DbFacade.getInstance().getStoragePoolDAO().get(getVds().getstorage_pool_id()); if (pool != null && pool.getstatus() == StoragePoolStatus.NotOperational) { pool.setstatus(StoragePoolStatus.Problematic); DbFacade.getInstance().getStoragePoolDAO().updateStatus(pool.getId(), pool.getstatus()); StoragePoolStatusHandler.PoolStatusChanged(pool.getId(), pool.getstatus()); } } } else { SetNonOperationalVdsParameters tempVar = new SetNonOperationalVdsParameters(getVds().getId(), STORAGE_DOMAIN_UNREACHABLE, null); tempVar.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, tempVar); } setSucceeded(true); }

Target:
protected void executeCommand() { if (InitializeStorage()) { FencingExecutor executor = new FencingExecutor(getVds(), FenceActionType.Status); if (getVds().getpm_enabled() && executor.FindVdsToFence()) { VDSReturnValue returnValue = executor.Fence(); _fencingSucceeded = returnValue.getSucceeded(); _fenceStatusReturnValue = (FenceStatusReturnValue) returnValue.getReturnValue(); _vdsProxyFound = true; } if (getVds().getspm_status() != VdsSpmStatus.None) { storage_pool pool = DbFacade.getInstance().getStoragePoolDAO().get(getVds().getstorage_pool_id()); if (pool != null && pool.getstatus() == StoragePoolStatus.NotOperational) { pool.setstatus(StoragePoolStatus.Problematic); DbFacade.getInstance().getStoragePoolDAO().updateStatus(pool.getId(), pool.getstatus()); StoragePoolStatusHandler.PoolStatusChanged(pool.getId(), pool.getstatus()); } } } else { SetNonOperationalVdsParameters tempVar = new SetNonOperationalVdsParameters(getVds().getId(), STORAGE_DOMAIN_UNREACHABLE); tempVar.setSaveToDb(true); Backend.getInstance().runInternalAction(VdcActionType.SetNonOperationalVds, tempVar); } setSucceeded(true); }
Source:
public String encode(CharSequence rawPassword) { if (rawPassword == null) { throw new IllegalArgumentException("Raw password cannot be null"); } String salt; if (random != null) { salt = BCrypt.gensalt(version.getVersion(), strength, random); } else { salt = BCrypt.gensalt(version.getVersion(), strength); } return BCrypt.hashpw(rawPassword.toString(), salt); }

Target:
public String encode(CharSequence rawPassword) { if (rawPassword == null) { throw new IllegalArgumentException("rawPassword cannot be null"); } String salt; if (random != null) { salt = BCrypt.gensalt(version.getVersion(), strength, random); } else { salt = BCrypt.gensalt(version.getVersion(), strength); } return BCrypt.hashpw(rawPassword.toString(), salt); }
Source:
public Observable<ResultSet> insert(Date timeSlice, JobDetails job) { if (job.getJobId() == null || job.getJobName() == null || job.getJobType() == null || job.getTrigger() == null) { logger.warn("Tried to insert job on scheduled jobs with invalid values"); } return session.execute(insertScheduled.bind(timeSlice, job.getJobId(), job.getJobType(), job.getJobName(), job.getParameters().getMap(), getTriggerValue(session, job.getTrigger()))); }

Target:
public Observable<ResultSet> insert(Date timeSlice, JobDetails job) { if (job.getJobId() == null || job.getJobName() == null || job.getJobType() == null || job.getTrigger() == null) { logger.warnf("Tried to insert job on scheduled jobs with invalid values, [JobId: %s, TimeSlice: %s]", job .getJobId(), timeSlice); } return session.execute(insertScheduled.bind(timeSlice, job.getJobId(), job.getJobType(), job.getJobName(), job.getParameters().getMap(), getTriggerValue(session, job.getTrigger()))); }
Source:
private List<String> getRcfileNameAsList() { if (rcfileName != null) { return ImmutableList.of(pylintRcfileName + rcfileName); } else { return ImmutableList.of(); } }

Target:
private List<String> getRcfileNameAsList() { if (rcfileName == null) { return ImmutableList.of(); } return ImmutableList.of(PYLINT_RCFILE_NAME + rcfileName); }
Source:
static void addDefaultCapabilities(MutableCapabilities capabilities) { Set<String> capabilitieNames = capabilities.getCapabilityNames(); if (capabilitieNames.contains(CapabilityType.BROWSER_NAME) && !capabilitieNames.contains(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR)) { capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); } }

Target:
static void addDefaultCapabilities(MutableCapabilities capabilities) { Set<String> capabilityNames = capabilities.getCapabilityNames(); if (capabilityNames.contains(CapabilityType.BROWSER_NAME) && !capabilityNames.contains(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR)) { capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); } }
Source:
private boolean executeSingleFrame() { boolean finished = false; while (!ASTQueue.isEmpty()) { AST ast = ASTQueue.pop(); try { ast.eval(environment); } catch (WordsRuntimeException e) { System.err.println(); System.err.println(e.toString()); System.out.println("> "); } } for (WordsObject object : environment.getObjects()) { try { object.executeNextAction(environment); } catch (WordsProgramException e) { System.err.println("Error executing action on object " + object.getObjectName() + ": \n" + e.toString()); System.err.println("Action will not be performed"); System.out.println("> "); } } for (Iterator<WordsEventListener> iterator = environment.getEventListeners().iterator(); iterator.hasNext();) { try { WordsEventListener eventListener = iterator.next(); boolean delete = !eventListener.execute(environment); if (delete) { iterator.remove(); } } catch (WordsRuntimeException e) { System.err.println(e.toString()); System.out.println("> "); } } if (GUI != null) { GUI.clear(); for (WordsObject object : environment.getObjects()) { GUI.add(object.getCurrentCell(), object.getClassName(), object.getObjectName(), object.getCurrentMessage()); } GUI.render(); } else { System.out.println("frame #: " + numFrames); WordsLog log = new WordsLog(); for (WordsObject object : environment.getObjects()) { log.add(object.getCurrentCell(), object.getClassName(), object.getObjectName(), object.getCurrentMessage()); } log.log(); if (Option.FRAME_LIMIT_ENABLED && numFrames >= Option.MAX_FRAMES) finished = true; } ++numFrames; return finished; }

Target:
private boolean executeSingleFrame() { boolean finished = false; while (!ASTQueue.isEmpty()) { AST ast = ASTQueue.pop(); try { ast.eval(environment); } catch (WordsRuntimeException e) { System.err.println(); System.err.println(e.toString()); System.out.println("> "); } } for (WordsObject object : environment.getObjects()) { try { object.executeNextAction(environment); } catch (WordsProgramException e) { System.err.println("Error executing action on object " + object.getObjectName() + ": \n" + e.toString()); System.err.println("Action will not be performed"); System.out.println("> "); } } for (Iterator<WordsEventListener> iterator = environment.getEventListeners().iterator(); iterator.hasNext();) { try { WordsEventListener eventListener = iterator.next(); boolean delete = !eventListener.execute(environment); if (delete) { iterator.remove(); } } catch (WordsProgramException e) { System.err.println(e.toString()); System.out.println("> "); } } if (GUI != null) { GUI.clear(); for (WordsObject object : environment.getObjects()) { GUI.add(object.getCurrentCell(), object.getClassName(), object.getObjectName(), object.getCurrentMessage()); } GUI.render(); } else { System.out.println("frame #: " + numFrames); WordsLog log = new WordsLog(); for (WordsObject object : environment.getObjects()) { log.add(object.getCurrentCell(), object.getClassName(), object.getObjectName(), object.getCurrentMessage()); } log.log(); if (Option.FRAME_LIMIT_ENABLED && numFrames >= Option.MAX_FRAMES) finished = true; } ++numFrames; return finished; }
Source:
public void refresh() { try { refreshVdsRunTimeInfo(); } finally { try { if (firstStatus != vds.getStatus() && vds.getStatus() == VDSStatus.Up) { vdsManager.cancelRecoveryJob(); log.debug("Host '{}' ({}) firing up event.", vds.getName(), vds.getId()); vdsManager.setIsSetNonOperationalExecuted(!getVdsEventListener().vdsUpEvent(vds)); } saveDataToDb(); } catch (IRSErrorException ex) { logFailureMessage("ResourceManager::refreshVdsRunTimeInfo:", ex); log.debug("Exception", ex); } catch (RuntimeException ex) { logFailureMessage("ResourceManager::refreshVdsRunTimeInfo:", ex); log.debug("Exception", ex); } } }

Target:
public void refresh() { try { refreshVdsRunTimeInfo(); } finally { try { if (firstStatus != vds.getStatus() && vds.getStatus() == VDSStatus.Up) { vdsManager.cancelRecoveryJob(); log.debug("Host '{}' ({}) firing up event.", vds.getName(), vds.getId()); vdsManager.setIsSetNonOperationalExecuted(!getVdsEventListener().vdsUpEvent(vds)); } saveDataToDb(); } catch (RuntimeException ex) { logFailureMessage("ResourceManager::refreshVdsRunTimeInfo:", ex); log.debug("Exception", ex); } } }
Source:
public boolean addIncomingChatMarkerMessageListener(ChatMarkersListener listener) { synchronized (incomingListeners) { return incomingListeners.add(listener); } }

Target:
public boolean addIncomingChatMarkerMessageListener(ChatMarkersListener listener) { return incomingListeners.add(listener); }
Source:
public Ample.TabletMutator deleteBulkFile(Ample.FileMeta bulkref) { throw new UnsupportedOperationException(); }

Target:
public Ample.TabletMutator deleteBulkFile(Ample.FileMeta bulkref) { Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); mutation.putDelete(TabletsSection.BulkFileColumnFamily.NAME, bulkref.meta()); return this; }
Source:
public static void typedCharacter(char c, boolean isSeparator) { boolean isSpace = c == ' '; boolean isEnter = c == '\n'; switch (sState) { case IN_WORD: if (isSpace || isSeparator) { sState = State.START; } break; case ACCEPTED_DEFAULT: if (isSpace) { sState = State.SPACE_AFTER_ACCEPTED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_ACCEPTED; } else { sState = State.IN_WORD; } break; case PERFORMED_GESTURE: case PICKED_CORRECTION: case PICKED_SUGGESTION: case PICKED_TYPED_ADDED_TO_DICTIONARY: if (isSpace) { sState = State.SPACE_AFTER_PICKED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_PICKED; } else { sState = State.IN_WORD; } break; case START: case UNKNOWN: case SPACE_AFTER_ACCEPTED: case SPACE_AFTER_PICKED: case PUNCTUATION_AFTER_ACCEPTED: case PUNCTUATION_AFTER_PICKED: if (!isSpace && !isSeparator) { sState = State.IN_WORD; } else { sState = State.START; } break; case UNDO_COMMIT: if (isSpace || isSeparator) { sState = State.ACCEPTED_DEFAULT; } else { sState = State.IN_WORD; } break; } displayState(); }

Target:
public static void typedCharacter(char c, boolean isSeparator) { final boolean isSpace = c == ' '; final boolean isEnter = c == '\n'; switch (sState) { case IN_WORD: if (isSpace || isSeparator) { sState = State.START; } break; case ACCEPTED_DEFAULT: if (isSpace) { sState = State.SPACE_AFTER_ACCEPTED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_ACCEPTED; } else { sState = State.IN_WORD; } break; case PERFORMED_GESTURE: case PICKED_CORRECTION: case PICKED_SUGGESTION: case PICKED_TYPED_ADDED_TO_DICTIONARY: if (isSpace) { sState = State.SPACE_AFTER_PICKED; } else if (isEnter) { sState = State.UNKNOWN; } else if (isSeparator) { sState = State.PUNCTUATION_AFTER_PICKED; } else { sState = State.IN_WORD; } break; case START: case UNKNOWN: case SPACE_AFTER_ACCEPTED: case SPACE_AFTER_PICKED: case PUNCTUATION_AFTER_ACCEPTED: case PUNCTUATION_AFTER_PICKED: if (!isSpace && !isSeparator) { sState = State.IN_WORD; } else { sState = State.START; } break; case UNDO_COMMIT: if (isSpace || isSeparator) { sState = State.ACCEPTED_DEFAULT; } else { sState = State.IN_WORD; } break; } displayState(); }
Source:
public Map<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { Map<TableScanNode, Void> ret = new IdentityHashMap<>(); ret.put(node, null); return ret; }

Target:
public Map<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { Map<TableScanNode, Void> result = new IdentityHashMap<>(); result.put(node, null); return result; }
Source:
ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); IncludedInDetail _detail = new IncludedInDetail(); try { _detail = resolveBranches(c); } catch (Exception e) { e.printStackTrace(); } branches = _detail.getBranches(); }

Target:
ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); IncludedInDetail detail = new IncludedInDetail(); try { detail = resolveBranches(c); } catch (Exception e) { e.printStackTrace(); } branches = detail.getBranches(); }
Source:
private int getNumericValue(String name, int defaultValue) { try { return Integer.parseInt( getProperties().getSingleProperty( name, "" + defaultValue ) ); } catch (NumberFormatException nfe) { return defaultValue; } }

Target:
private int getNumericValue(String name, int defaultValue) { try { return Integer.parseInt( getProperties().getSingleProperty( name, "" + defaultValue ) ); } catch (NumberFormatException nfe) { throw new DecisionTableParseException( "Invalid numeric value for option: " + name, nfe ); } }
Source:
public List<Integer> getQuarks() { String[] paths = fPath.split(File.separator); List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); for (String path : paths) { List<Integer> subQuarks = new LinkedList<>(); String name = WILDCARD_PATTERN.matcher(path).replaceAll(".*"); for (int relativeQuark : quarks) { subQuarks.addAll(fStateSystem.getSubAttributes(relativeQuark, false, name)); } quarks = subQuarks; } return quarks; }

Target:
public List<Integer> getQuarks() { String[] paths = fPath.split(SPLIT_STRING); List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); for (String path : paths) { List<Integer> subQuarks = new LinkedList<>(); String name = WILDCARD_PATTERN.matcher(path).replaceAll(".*"); for (int relativeQuark : quarks) { subQuarks.addAll(fStateSystem.getSubAttributes(relativeQuark, false, name)); } quarks = subQuarks; } return quarks; }
Source:
public String getURL(DocumentReference docRef, String action, String queryString) { URL url = context.getXWikiContext().getURLFactory().createURL( docRef.getLastSpaceReference().getName(), docRef.getName(), action, queryString, null, docRef.getRoot().getName(), context.getXWikiContext()); return celementsweb.encodeUrlToUtf8(context.getXWikiContext().getURLFactory().getURL(url, context.getXWikiContext())); }

Target:
public String getURL(DocumentReference docRef, String action, String queryString) { return urlService.getURL(docRef, action, queryString); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(UserStateDetails userStateDetails) { Log.i(TAG, "AWSMobileClient initialized. User State is : " + userStateDetails.getUserState()); } @Override public void onError(Exception e) { Log.e(TAG, "Initialization error.", e); } }); initUI(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initUI(); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); if (discussionTopic == null) { String topicId = getArguments().getString(Router.EXTRA_DISCUSSION_TOPIC_ID); GetSpecificCourseTopicsTask getTopicsTask = new GetSpecificCourseTopicsTask(getContext(), courseData.getCourse().getId(), Collections.singletonList(topicId)) { @Override protected void onSuccess(CourseTopics courseTopics) throws Exception { discussionTopic = courseTopics.getCoursewareTopics().get(0).getChildren().get(0); if (!getArguments().getBoolean(ARG_DISCUSSION_HAS_TOPIC_NAME)) { getActivity().setTitle(discussionTopic.getName()); } if (populatePostListRunnable != null) { populatePostListRunnable.run(); } } }; getTopicsTask.setProgressDialog(loadingIndicator); getTopicsTask.execute(); } else { getActivity().setTitle(discussionTopic.getName()); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); }
Source:
private T processResponse(HttpResponse httpResponse) throws E { T value; long responseStart = System.nanoTime(); state.set(NettyAsyncHttpState.PROCESSING_RESPONSE); NettyResponse response = null; try { response = new NettyResponse(httpResponse); value = responseHandler.handle(request, response); } finally { Duration responseProcessingTime = Duration.nanosSince(responseStart); Duration requestProcessingTime = new Duration(responseStart - requestStart, TimeUnit.NANOSECONDS); if (response != null) { stats.record(request.getMethod(), response.getStatusCode(), response.getBytesRead(), response.getBytesRead(), requestProcessingTime, responseProcessingTime); } } return value; }

Target:
private T processResponse(HttpResponse httpResponse) throws E { long responseStart = System.nanoTime(); state.set(NettyAsyncHttpState.PROCESSING_RESPONSE); NettyResponse response = null; T value; try { response = new NettyResponse(httpResponse); value = responseHandler.handle(request, response); } finally { Duration responseProcessingTime = Duration.nanosSince(responseStart); Duration requestProcessingTime = new Duration(responseStart - requestStart, TimeUnit.NANOSECONDS); if (response != null) { stats.record(request.getMethod(), response.getStatusCode(), response.getBytesRead(), response.getBytesRead(), requestProcessingTime, responseProcessingTime); } } return value; }
Source:
protected static boolean isNewWatchdogEvent(VmDynamic vmDynamic, VM vmTo) { Double lastWatchdogEvent = vmDynamic.getLastWatchdogEvent(); return vmTo != null && lastWatchdogEvent != null && (vmTo.getLastWatchdogEvent() == null || vmTo.getLastWatchdogEvent() < lastWatchdogEvent); }

Target:
protected static boolean isNewWatchdogEvent(VmDynamic vmDynamic, VM vmTo) { Long lastWatchdogEvent = vmDynamic.getLastWatchdogEvent(); return vmTo != null && lastWatchdogEvent != null && (vmTo.getLastWatchdogEvent() == null || vmTo.getLastWatchdogEvent() < lastWatchdogEvent); }
Source:
private void onInsertedData(List<Metric<?>> metrics) { List<Data> data = new ArrayList<>(metrics.size()); metrics.stream().forEach(m -> addToData(m, data)); if (!data.isEmpty()) { try { log.tracef("Sending: %s", data); alertsService.sendData(data); } catch (Exception e) { log.warnf("Failed to send alerting data.", e); } } }

Target:
private void onInsertedData(List<Metric<?>> metrics) { List<Data> dataToSend = new ArrayList<>(metrics.size()); CacheKey reusableKey = new CacheKey("", ""); metrics.stream().forEach(m -> addToData(m, dataToSend, reusableKey)); if (!dataToSend.isEmpty()) { try { alertsService.sendData(dataToSend, true); } catch (Exception e) { log.warnf("Failed to send alerting data.", e); } } }
Source:
public void init() { super.init(); router = addChild(EntitySpec.create(MongoDBRouter.class) .configure(MongoDBRouter.CONFIG_SERVERS, DependentConfiguration.attributeWhenReady( getConfig(CoLocatedMongoDBRouter.SHARDED_DEPLOYMENT), MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES))); for (EntitySpec<?> siblingSpec : getConfig(CoLocatedMongoDBRouter.SIBLING_SPECS)) { addChild(siblingSpec); } sensors().set(ROUTER, (MongoDBRouter) Iterables.tryFind(getChildren(), Predicates.instanceOf(MongoDBRouter.class)).get()); }

Target:
public void init() { super.init(); MongoDBRouter router = addChild(EntitySpec.create(MongoDBRouter.class) .configure(MongoDBRouter.CONFIG_SERVERS, DependentConfiguration.attributeWhenReady( getConfig(CoLocatedMongoDBRouter.SHARDED_DEPLOYMENT), MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES))); for (EntitySpec<?> siblingSpec : getConfig(CoLocatedMongoDBRouter.SIBLING_SPECS)) { addChild(siblingSpec); } sensors().set(ROUTER, router); }
Source:
private void updateConfig() { final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); geoRepConfigModel.startProgress(null); geoRepConfigModel.setLocked(true); setConfig(geoRepConfigModel); resetConfig(geoRepConfigModel); }

Target:
private void updateConfig() { int n = 0; ArrayList<VdcActionType> actionTypes = new ArrayList<VdcActionType>(); ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); IFrontendActionAsyncCallback[] callbacks; final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel = (GlusterVolumeGeoReplicationSessionConfigModel) getWindow(); LinkedHashMap<String, String> oldConfigs = geoRepConfigModel.getConfigs(); geoRepConfigModel.startProgress(null); for (EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> newConfigEntity : geoRepConfigModel.getConfigsModel() .getItems()) { Pair<Boolean, GlusterGeoRepSessionConfiguration> newConfigPair = newConfigEntity.getEntity(); GlusterGeoRepSessionConfiguration newConfig = newConfigPair.getSecond(); if (newConfigPair.getFirst()) { actionTypes.add(VdcActionType.ResetDefaultGeoRepConfig); } else { if (!newConfig.getValue().equals(oldConfigs.get(newConfig.getKey()))) { actionTypes.add(VdcActionType.SetGeoRepConfig); } } parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig)); } callbacks = new IFrontendActionAsyncCallback[n]; callbacks[n - 1] = new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { geoRepConfigModel.stopProgress(); closeWindow(); } }; Frontend.getInstance().runMultipleActions(actionTypes, parameters, Arrays.asList(callbacks), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { fetchConfigForSession(geoRepConfigModel.getGeoRepSession()); } }, this); }
Source:
public Datum get(int fieldId) { if (values[fieldId] != null) return values[fieldId]; else if (textBytes.length <= fieldId) { values[fieldId] = NullDatum.get(); } else if (textBytes[fieldId] != null) { try { values[fieldId] = serializeDeserialize.deserialize(schema.getColumn(fieldId), textBytes[fieldId], 0, textBytes[fieldId].length, nullBytes); } catch (Exception e) { values[fieldId] = NullDatum.get(); } textBytes[fieldId] = null; } else { values[fieldId] = NullDatum.get(); } return values[fieldId]; }

Target:
public Datum get(int fieldId) { if (values[fieldId] != null) return values[fieldId]; else if (textBytes.length <= fieldId) { values[fieldId] = NullDatum.get(); } else if (textBytes[fieldId] != null) { try { values[fieldId] = serializeDeserialize.deserialize(schema.getColumn(fieldId), textBytes[fieldId], 0, textBytes[fieldId].length, nullBytes); } catch (Exception e) { values[fieldId] = NullDatum.get(); } textBytes[fieldId] = null; } else { } return values[fieldId]; }
Source:
void addTileToCurrentTileCanvasView( final Tile tile ) { mTileRenderHandler.post( new Runnable() { @Override public void run() { tile.setTransitionsEnabled( mTransitionsEnabled ); tile.setTransitionDuration( mTransitionDuration ); tile.stampTime(); mTilesAlreadyRendered.add( tile ); mCurrentTileCanvasView.addTile( tile ); } }); }

Target:
void addTileToCurrentTileCanvasView( final Tile tile ) { mTileRenderHandler.post( new PrepareTileForRenderRunnable( tile ) ); }
Source:
public void init(Composite parent, String viewerName, ITmfTrace trace) { super.init(parent, viewerName); fCountInstance++; fInstanceNb = fCountInstance; fTrace = trace; fModel = new TmfStatisticsModel(); fProcessAll = (trace instanceof TmfExperiment); initContent(parent); initInput(); }

Target:
public void init(Composite parent, String viewerName, ITmfTrace trace) { super.init(parent, viewerName); fCountInstance++; fInstanceNb = fCountInstance; fTrace = trace; fProcessAll = (trace instanceof TmfExperiment); initContent(parent); initInput(); }
Source:
public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] %s server.properties hardwarelayout partitionlayout" .format(AmbryServer.class.getSimpleName())); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap, SystemTime.getInstance()); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }

Target:
public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] " + AmbryMain.class.getCanonicalName() + " server.properties hardwarelayout partitionlayout"); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap, SystemTime.getInstance()); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }
Source:
public void saveProjects(Collection<Project> projects) throws IOException { log.info("Migrating projects..."); User user = serviceManager.getAuthorizationManager().getCurrentUser(); for (Project project : projects) { project.setSecurityProfile(new SecurityProfile(user)); if (project.getStudies() == null) project.setStudies(new HashSet<Study>()); if (project.getStudies().isEmpty()) { Study study = new StudyImpl(project, user); study.setAlias(project.getShortName() + " study"); study.setDescription(""); study.setStudyType("Other"); study.setLastModifier(user); project.getStudies().add(study); } project.setId(serviceManager.getProjectDao().save(project)); for (Study study : project.getStudies()) { study.setId(serviceManager.getStudyDao().save(study)); } log.debug("Saved project " + project.getAlias()); } log.info(projects.size() + " projects migrated."); }

Target:
public void saveProjects(Collection<Project> projects) throws IOException { log.info("Migrating projects..."); User user = serviceManager.getAuthorizationManager().getCurrentUser(); for (Project project : projects) { project.setSecurityProfile(new SecurityProfile(user)); if (project.getStudies() == null) project.setStudies(new HashSet<Study>()); if (project.getStudies().isEmpty()) { Study study = new StudyImpl(); study.setAlias(project.getShortName() + " study"); study.setDescription(""); study.setStudyType("Other"); study.setLastModifier(user); project.getStudies().add(study); } project.setId(serviceManager.getProjectDao().save(project)); for (Study study : project.getStudies()) { study.setProject(project); study.inheritPermissions(project); study.setId(serviceManager.getStudyDao().save(study)); } log.debug("Saved project " + project.getAlias()); } log.info(projects.size() + " projects migrated."); }
Source:
public void setup(OperatorContext arg0) { LOG.debug("Store with partitions {}", super.getFileStore(), new PartitionKeys(this.partitionMask, this.partitions)); if (!numberOfBucketsFinalized) { numberOfBucketsFinalized = true; } super.setup(arg0); try { this.codec = getCodec(); Class<?> cls = this.codec.getClass(); while (cls != null) { for (Field field : cls.getDeclaredFields()) { if (field.getType().isAssignableFrom(this.getClass())) { field.setAccessible(true); field.set(this.codec, this); } } cls = cls.getSuperclass(); } } catch (Exception e) { throw new RuntimeException("Failed to create codec", e); } }

Target:
public void setup(OperatorContext arg0) { LOG.debug("Store with partitions {}", super.getFileStore(), new PartitionKeys(this.partitionMask, this.partitions)); if (!numberOfBucketsFinalized) { this.partitionMask = setPartitionMask(); this.numberOfBuckets = this.partitionMask + 1; for (long i = 0; i < this.numberOfBuckets; i++) { this.bucketKeys.add(i); } numberOfBucketsFinalized = true; } super.setup(arg0); try { this.codec = getCodec(); Class<?> cls = this.codec.getClass(); while (cls != null) { for (Field field : cls.getDeclaredFields()) { if (field.getType().isAssignableFrom(this.getClass())) { field.setAccessible(true); field.set(this.codec, this); } } cls = cls.getSuperclass(); } } catch (Exception e) { throw new RuntimeException("Failed to create codec", e); } }
Source:
public Void getResult() { throw new UnsupportedOperationException(getClass().getName()); }

Target:
public Void getResult() { throw new UnsupportedOperationException(); }
Source:
public void actionPerformed(ActionEvent event) { debuggerPresenter.onRemoveExpressionBtnClicked(selectedExpression); }

Target:
public void actionPerformed(ActionEvent event) { WatchExpression expression = debuggerPresenter.getSelectedWatchExpression(); if (expression != null) { debuggerPresenter.onRemoveExpressionBtnClicked(expression); } }
Source:
public void testAnnotationParser() throws Exception { FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"); Map<String, FileDescriptor> descriptors = parseAndResolve(fileDescriptorSource); for (FileDescriptor fileDescriptor : descriptors.values()) { for (Descriptor messageDescriptor : fileDescriptor.getMessageTypes()) { messageDescriptor.getAnnotations(); for (FieldDescriptor fieldDescriptor : messageDescriptor.getFields()) { fieldDescriptor.getAnnotations(); } } } }

Target:
public void testAnnotationParser() throws Exception { Configuration config = new Configuration.Builder() .messageAnnotation("Indexed") .annotationMetadataCreator(new AnnotationMetadataCreator<Object, Descriptor>() { @Override public Object create(Descriptor descriptor, AnnotationElement.Annotation annotation) { AnnotationElement.Value value = annotation.getDefaultAttributeValue(); if (value == null) { return Boolean.TRUE; } if (Boolean.TRUE.equals(value.getValue())) { return Boolean.TRUE; } else if (Boolean.FALSE.equals(value.getValue())) { return Boolean.FALSE; } throw new AnnotationParserException("Invalid value " + value.getValue()); } }) .build(); FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"); Map<String, FileDescriptor> descriptors = new SquareProtoParser(config).parseAndResolve(fileDescriptorSource); FileDescriptor fileDescriptor = descriptors.get("sample_bank_account/bank.proto"); List<Descriptor> messageTypes = fileDescriptor.getMessageTypes(); Descriptor userMessageType = messageTypes.get(0); assertEquals("sample_bank_account.User", userMessageType.getFullName()); assertEquals(Boolean.TRUE, userMessageType.getParsedAnnotation("Indexed")); Descriptor accountMessageType = messageTypes.get(1); assertEquals("sample_bank_account.Account", accountMessageType.getFullName()); assertEquals(Boolean.TRUE, accountMessageType.getParsedAnnotation("Indexed")); }
Source:
public void visitLiteralReturn(int maxAssigned, Boolean voidReturn) { context.isVoidContext = voidReturn; if (maxAllowed == null) { maxAllowed = maxAssigned; } ++count; }

Target:
public void visitLiteralReturn(int maxAssigned, Boolean voidReturn) { isVoidContext = voidReturn; if (maxAllowed == null) { maxAllowed = maxAssigned; } ++count; }
Source:
public String getClusterName() { return clusterId; }

Target:
public String getClusterName() { return clusterName; }
Source:
public void copy(Path source, Path destination, String destinationFilename) { log.info("Copying to {}", source, destination); Path destinationPath = destination.resolve(destinationFilename); try { Files.createDirectories(destination); Files.copy(source, destinationPath); } catch (FileAlreadyExistsException e) { if (!calculateMd5sum(source).equals(calculateMd5sum(destinationPath))) { Throwables.propagate(e); } } catch (IOException e) { throw Throwables.propagate(e); } }

Target:
public void copy(Path source, Path destination, String destinationFilename) { log.info("Copying to {}", source, destination); Path destinationPath = destination.resolve(destinationFilename); try { Files.createDirectories(destination); Files.copy(source, destinationPath); } catch (FileAlreadyExistsException e) { if (!calculateMd5sum(source).equals(calculateMd5sum(destinationPath))) { throw new RuntimeException(e); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { String ownerId = ((Owned) entity).getOwnerId(); if (ownerId != null) { event.setOwnerId(ownerId); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if (entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getUuid() != null) { event.setConsumerUuid(owningConsumer.getUuid()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { Map<String, String> eventData = new HashMap<>(); eventData.put("subscriptionId", ((Pool) entity).getSubscriptionId()); String output = Util.toJson(eventData); if (output == null) { throw new IseException("Error while building JSON for pool.created event."); } event.setEventData(output); } } return this; }

Target:
public EventBuilder setEventData(Eventful entity) { if (entity != null) { if (entity instanceof Named && ((Named) entity).getName() != null) { event.setTargetName(((Named) entity).getName()); } if (entity instanceof Owned) { String ownerId = ((Owned) entity).getOwnerId(); if (ownerId != null) { event.setOwnerId(ownerId); } } if (entity instanceof Entitlement) { event.setReferenceType(Event.ReferenceType.POOL); Pool referencedPool = ((Entitlement) entity).getPool(); if (referencedPool != null && referencedPool.getId() != null) { event.setReferenceId(referencedPool.getId()); } } if (entity.getId() != null) { event.setEntityId((String) entity.getId()); if (entity instanceof ConsumerProperty) { Consumer owningConsumer = ((ConsumerProperty) entity).getConsumer(); if (owningConsumer != null && owningConsumer.getUuid() != null) { event.setConsumerUuid(owningConsumer.getUuid()); } } } if (event.getTarget().equals(Target.POOL) && event.getType().equals(Type.CREATED)) { Map<String, String> eventData = new HashMap<>(); eventData.put("subscriptionId", ((Pool) entity).getSubscriptionId()); try { event.setEventData(Util.toJson(eventData)); } catch (JsonProcessingException e) { log.error("Error while building JSON for pool.created event.", e); throw new IseException("Error while building JSON for pool.created event.", e); } } } return this; }
Source:
protected Map getImgMetadata(InputStream input) { Map<String, String> map = new HashMap<>(); try { Metadata meta = ImageMetadataReader.readMetadata(input); map = processMetaData(meta); } catch (ImageProcessingException ex) { logger.error("Error reading metadata from file " + this.getFileName() + " - message " + ex.getMessage()); } catch (IOException ioex) { logger.error("Error reading inputStream", ioex); } return map; }

Target:
protected Map getImgMetadata(InputStream input) { Map<String, String> imgMetadata = new HashMap<>(); try { Metadata meta = ImageMetadataReader.readMetadata(input); imgMetadata = processMetaData(meta); } catch (ImageProcessingException ex) { logger.error("Error reading metadata from file " + this.getFileName() + " - message " + ex.getMessage(), ex); } catch (IOException ioex) { logger.error("Error reading inputStream", ioex); } return imgMetadata; }
Source:
protected void runImpl() throws IOException, Failure { final Set<AccountGroup.Id> uploadGroup = getServerCommandConfig().getUploadGroup(); if (uploadGroup != null && !uploadGroup.isEmpty()) { if (!CollectionsUtil.isAnyIncludedIn(currentUser.getEffectiveGroups(), uploadGroup)) { throw new Failure(1, "User: " + currentUser.getUserName() + " not allowed to execute this command on this server"); } } final UploadPack up = new UploadPack(repo); if (!projectControl.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, projectControl, db.get())); } up.setTimeout(config.getTimeout()); try { up.upload(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }

Target:
protected void runImpl() throws IOException, Failure { if (!projectControl.canPerformPackAction(uploadGroup)) { throw new Failure(1, "fatal: upload-pack not permitted on this server"); } final UploadPack up = new UploadPack(repo); if (!projectControl.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, projectControl, db.get())); } up.setTimeout(config.getTimeout()); try { up.upload(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }
Source:
private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws Exception { boolean performUpload = messageInfo.getExpirationTimeInMs() == Utils.Infinite_Time && !messageInfo.isDeleted(); if (performUpload) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); cloudDestination.uploadBlob(blobId, size, new ByteBufferInputStream(messageBuf)); } }

Target:
private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws CloudStorageException { boolean performUpload = messageInfo.getExpirationTimeInMs() == Utils.Infinite_Time && !messageInfo.isDeleted(); if (performUpload) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); cloudDestination.uploadBlob(blobId, size, new ByteBufferInputStream(messageBuf)); } }