auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized void terminateJenkinsSlave(String name) { LOGGER.info("Terminating jenkins slave " + name); TaskID taskId = TaskID.newBuilder().setValue(name).build(); if (results.containsKey(taskId)) { LOGGER.info("Killing mesos task " + taskId); driver.killTask(taskId); } else { Request ref = null; for (Request request : requests) { if(request.request.slave.name.equals(name)){ ref = request; break; } } if(ref != null) { requests.remove(ref); ref = null; LOGGER.info("Removing enqueued mesos task " + name); } else LOGGER.warning("Asked to kill unknown mesos task " + taskId); } }

Target:
public synchronized void terminateJenkinsSlave(String name) { LOGGER.info("Terminating jenkins slave " + name); TaskID taskId = TaskID.newBuilder().setValue(name).build(); if (results.containsKey(taskId)) { LOGGER.info("Killing mesos task " + taskId); driver.killTask(taskId); } else { for(Request request : requests) { if(request.request.slave.name.equals(name)) { LOGGER.info("Removing enqueued mesos task " + name); requests.remove(request); return; } } LOGGER.warning("Asked to kill unknown mesos task " + taskId); } }
Source:
private void onSuccess() { if (errorCount.getAndSet(0) >= config.storeIOErrorCountToTriggerShutdown) { logger.info("Resetting the error count of BlobStore because restart or one operation succeeded", storeId); } }

Target:
private void onSuccess() { errorCount.getAndSet(0); }
Source:
public void testHasNotTaskChanged2() { TaskData taskData = new TaskData(new TaskAttributeMapper(repository), connector.getConnectorKind(), repository.getRepositoryUrl(), "123"); TaskTask task = new TaskTask(repository.getConnectorKind(), repository.getRepositoryUrl(), "123"); Date now = new Date(); task.setAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey(), "" + now.getTime()); assertTrue(!connector.hasTaskChanged(repository, task, taskData)); }

Target:
public void testHasNotTaskChanged2() { TaskData taskData = new TaskData(new TaskAttributeMapper(repository), connector.getConnectorKind(), repository.getRepositoryUrl(), "123"); TaskTask task = new TaskTask(repository.getConnectorKind(), repository.getRepositoryUrl(), "123"); Date now = new Date(); task.setAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey(), "" + now.getTime()); assertTrue(connector.hasTaskChanged(repository, task, taskData)); }
Source:
protected void buildVmCD() { Map<String, Object> struct; boolean hasPayload = vm.getVmPayload() != null && vm.getVmPayload().getDeviceType() == VmDeviceType.CDROM; if (hasPayload) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, vm.getVmPayload().getSpecParams(), true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, null, true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (VmPayload.isPayload(vmDevice.getSpecParams())) { continue; } struct = new HashMap<String, Object>(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct, vm); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); } } }

Target:
protected void buildVmCD() { Map<String, Object> struct; boolean hasPayload = vm.getVmPayload() != null && vm.getVmPayload().getDeviceType() == VmDeviceType.CDROM; if (hasPayload) { struct = new HashMap<String, Object>(); addCdDetails(vm.getVmPayload(), struct, vm); addDevice(struct, vm.getVmPayload(), ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, null, true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (VmPayload.isPayload(vmDevice.getSpecParams())) { continue; } struct = new HashMap<String, Object>(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct, vm); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); } } }
Source:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.modifyAttribute(0, statev, quark); fixture.modifyAttribute(10, TmfStateValue.nullValue(), quark); } fixture.closeHistory(1002); String[] csp = { CALLSTACK_PATH }; String[] pp = { PROCESS_PATH }; String[] tp = { THREAD_PATH }; CallGraphAnalysis cga = new CallGraphAnalysis(); assertTrue(cga.iteratorOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); @NonNull ISegmentStore<? extends ISegment> sss = NonNullUtils.checkNotNull(cga.getSegmentStore()); Object[] segments = sss.toArray(); assertEquals("Number of segments Found", LARGE_AMOUNT_OF_SEGMENTS, segments.length, ERROR); }

Target:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.modifyAttribute(0, statev, quark); fixture.modifyAttribute(10, TmfStateValue.nullValue(), quark); } fixture.closeHistory(1002); String[] csp = { CALLSTACK_PATH }; String[] pp = { PROCESS_PATH }; String[] tp = { THREAD_PATH }; CGAnalysis cga = new CGAnalysis(); assertTrue(cga.iterateOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); @NonNull ISegmentStore<? extends ISegment> sss = NonNullUtils.checkNotNull(cga.getSegmentStore()); Object[] segments = sss.toArray(); assertEquals("Number of segments found", LARGE_AMOUNT_OF_SEGMENTS, segments.length, ERROR); }
Source:
public void writeProviderAssignation(SourceWriter writer) { if (customProviderAnnotation != null) { JClassType customProvider = oracle.findType(customProviderAnnotation.value().getName()); writer.println("presenter = new " + customProvider.getQualifiedSourceName() + "<" + presenterClassName + ">( ginjector." + getPresenterMethodName + "() );"); } else { if (proxyStandardAnnotation != null) { writer.println("presenter = new StandardProvider<" + presenterClassName + ">( ginjector." + getPresenterMethodName + "() );"); } else if (proxyCodeSplitAnnotation != null) { writer.println("presenter = new CodeSplitProvider<" + presenterClassName + ">( ginjector." + getPresenterMethodName + "() );"); } else { assert proxyCodeSplitBundleAnnotation != null; writer.print("presenter = new CodeSplitBundleProvider<" + presenterClassName + ", " + bundleClassName + ">(ginjector." + getPresenterMethodName + "(), "); if (ginjectorInspector.isGenerated()) { writer.print(bundleClassName + "." + presenterClass.getSimpleSourceName().toUpperCase() + ");"); } else { writer.print(proxyCodeSplitBundleAnnotation.id() + ");"); } } } }

Target:
public void writeProviderAssignation(SourceWriter writer) { if (customProviderAnnotation != null) { JClassType customProvider = oracle.findType(customProviderAnnotation.value().getName()); writer.println("presenter = new " + customProvider.getQualifiedSourceName() + "( ginjector." + getPresenterMethodName + "() );"); } else if (proxyStandardAnnotation != null) { writer.println("presenter = new StandardProvider<" + presenterClassName + ">( ginjector." + getPresenterMethodName + "() );"); } else if (proxyCodeSplitAnnotation != null) { writer.println("presenter = new CodeSplitProvider<" + presenterClassName + ">( ginjector." + getPresenterMethodName + "() );"); } else { assert proxyCodeSplitBundleAnnotation != null; writer.print("presenter = new CodeSplitBundleProvider<" + presenterClassName + ", " + bundleClassName + ">(ginjector." + getPresenterMethodName + "(), "); if (ginjectorInspector.isGenerated()) { writer.print(bundleClassName + "." + presenterClass.getSimpleSourceName().toUpperCase() + ");"); } else { writer.print(proxyCodeSplitBundleAnnotation.id() + ");"); } } }
Source:
public StarDoublePathElement(String key) { super(key); if ( StringUtils.countMatches(key, "*") != 2 ) { throw new IllegalArgumentException( "StarDoublePathElement should have two '*' in its key." ); } else if ( "*".equals( key ) ) { throw new IllegalArgumentException( "StarDoublePathElement should have a key that has two '*'." ); } String[] split = StringUtils.split(key, '*'); if ( key.startsWith( "*" ) && key.endsWith("*")) { prefix = ""; mid = split[0]; suffix = ""; } else if ( key.endsWith( "*" ) ) { prefix = split[0]; mid = split[1]; suffix = ""; } else if ( key.startsWith( "*" ) ) { prefix = ""; mid = split[0]; suffix = split[1]; } else{ prefix=split[0]; mid=split[1]; suffix=split[2]; } }

Target:
public StarDoublePathElement(String key) { super(key); if ( StringUtils.countMatches(key, "*") != 2 ) { throw new IllegalArgumentException( "StarDoublePathElement should have two '*' in its key." ); } String[] split = key.split("\\*"); boolean startsWithStar = key.startsWith( "*" ); boolean endsWithStar = key.endsWith("*"); if ( startsWithStar && endsWithStar) { prefix = ""; mid = split[1]; suffix = ""; } else if ( endsWithStar ) { prefix = split[0]; mid = split[1]; suffix = ""; } else if ( startsWithStar ) { prefix = ""; mid = split[1]; suffix = split[2]; } else{ prefix=split[0]; mid=split[1]; suffix=split[2]; } }
Source:
public static Map<String, Long> buildIoTune( Guid diskProfileId, Map<Guid, Guid> diskProfileStorageQosMap, Map<Guid, Map<String, Long>> storageQosIoTuneMap) { if (diskProfileId == null) { return null; } Guid storageQosId = diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos qos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (qos == null) { return null; } storageQosId = qos.getId(); diskProfileStorageQosMap.put(diskProfileId, storageQosId); storageQosIoTuneMap.put(storageQosId, IoTuneUtils.ioTuneMap(qos)); } return storageQosIoTuneMap.get(storageQosId); }

Target:
private static Map<String, Long> buildIoTune( Guid diskProfileId, Map<Guid, Guid> diskProfileStorageQosMap, Map<Guid, Map<String, Long>> storageQosIoTuneMap) { if (diskProfileId == null) { return null; } Guid storageQosId = diskProfileStorageQosMap.get(diskProfileId); if (storageQosId == null) { StorageQos qos = DbFacade.getInstance().getStorageQosDao().getQosByDiskProfileId(diskProfileId); if (qos == null) { return null; } storageQosId = qos.getId(); diskProfileStorageQosMap.put(diskProfileId, storageQosId); storageQosIoTuneMap.put(storageQosId, IoTuneUtils.ioTuneMapFrom(qos)); } return storageQosIoTuneMap.get(storageQosId); }
Source:
public void rememberExecution(LocalDateTime timestamp) { this.lastExecution = timestamp; this.numberOfExecutions++; if (this.runs != null) { this.runs = this.runs - 1; } }

Target:
public void rememberExecution(LocalDateTime timestamp) { this.lastExecution = timestamp; this.numberOfExecutions++; if (this.runs != null) { this.runs -= 1; } }
Source:
private Direction getLevelingDirection() { if (driveSpeed.direction() == Direction.STOP && driveSpeed.speed() == DriveObject.StopSpeed) { if (mLevelUp.getValue() == false) { return Direction.UP; } else if (mLevelDown.getValue() == false) { return Direction.DOWN; } } return driveSpeed.direction(); }

Target:
private Direction getLevelingDirection() { Direction d = driveSpeed.direction(); if (mLevelUp.getValue() == false) return (d == Direction.DOWN) ? Direction.STOP : Direction.UP; else if (mLevelDown.getValue() == false) return (d == Direction.UP) ? Direction.STOP : Direction.DOWN; return Direction.STOP; }
Source:
public long getPositionsSizeInBytes(boolean[] positions) { checkValidPositions(positions, positionCount); boolean[] seen = new boolean[dictionary.getPositionCount()]; boolean[] used = new boolean[dictionary.getPositionCount()]; for (int i = 0; i < positions.length; i++) { if (positions[i]) { int position = getId(i); if (!seen[position]) { if (!dictionary.isNull(position)) { used[position] = true; } seen[position] = true; } } } return dictionary.getPositionsSizeInBytes(used); }

Target:
public long getPositionsSizeInBytes(boolean[] positions) { checkValidPositions(positions, positionCount); boolean[] used = new boolean[dictionary.getPositionCount()]; for (int i = 0; i < positions.length; i++) { if (positions[i]) { used[getId(i)] = true; } } return dictionary.getPositionsSizeInBytes(used) + Integer.BYTES * countUsedPositions(positions); }
Source:
private void enableSchedule(Id scheduleId) throws IOException, SystemExitException { DigdagClient client = buildClient(); Optional<String> mode = modeString == null ? Optional.absent() : Optional.of(modeString); client.enableSchedule(scheduleId, mode, Optional.absent()); ln("Enabled schedule id: %s", scheduleId); }

Target:
private void enableSchedule(Id scheduleId) throws IOException, SystemExitException { DigdagClient client = buildClient(); client.enableSchedule(scheduleId); ln("Enabled schedule id: %s", scheduleId); }
Source:
private void checkIfEditMetadataAllowedInCurrentStep(Context context, XmlWorkflowItem xmlWorkflowItem) { try { ClaimedTask claimedTask = claimedTaskService.findByWorkflowIdAndEPerson(context, xmlWorkflowItem, context.getCurrentUser()); if (claimedTask == null) { throw new UnprocessableEntityException("WorkflowItem with id " + xmlWorkflowItem.getID() + " has not been claimed yet."); } Workflow workflow = workflowFactory.getWorkflow(claimedTask.getWorkflowItem().getCollection()); Step step = workflow.getStep(claimedTask.getStepID()); WorkflowActionConfig currentActionConfig = step.getActionConfig(claimedTask.getActionID()); if (!currentActionConfig.getProcessingAction().getOptions().contains(SUBMIT_EDIT_METADATA)) { throw new UnprocessableEntityException(SUBMIT_EDIT_METADATA + " is not a valid option on this " + "action (" + currentActionConfig.getProcessingAction().getClass() + ")."); } } catch (SQLException | WorkflowConfigurationException e) { throw new RuntimeException(e.getMessage(), e); } }

Target:
private void checkIfEditMetadataAllowedInCurrentStep(Context context, XmlWorkflowItem xmlWorkflowItem) { try { ClaimedTask claimedTask = claimedTaskService.findByWorkflowIdAndEPerson(context, xmlWorkflowItem, context.getCurrentUser()); if (claimedTask == null) { throw new UnprocessableEntityException("WorkflowItem with id " + xmlWorkflowItem.getID() + " has not been claimed yet."); } Workflow workflow = workflowFactory.getWorkflow(claimedTask.getWorkflowItem().getCollection()); Step step = workflow.getStep(claimedTask.getStepID()); WorkflowActionConfig currentActionConfig = step.getActionConfig(claimedTask.getActionID()); if (!currentActionConfig.getProcessingAction().getOptions().contains(SUBMIT_EDIT_METADATA)) { throw new UnprocessableEntityException(SUBMIT_EDIT_METADATA + " is not a valid option on this " + "action (" + currentActionConfig.getProcessingAction().getClass() + ")."); } } catch (SQLException e) { throw new RuntimeException("SQLException in " + this.getClass() + "#checkIfEditMetadataAllowedInCurrentStep trying to retrieve workflowitem from db by eperson.", e); } catch (WorkflowConfigurationException e) { throw new RuntimeException("WorkflowConfigurationException in " + this.getClass() + "#checkIfEditMetadataAllowedInCurrentStep trying to retrieve workflow configuration from config", e); } }
Source:
public void sendMessage_shouldSetRecipientIfAddressIsNotNull() throws MessageException { String recipient1 = "address1"; String recipient2 = "address2"; Context.getAuthenticatedUser().setUserProperty(OpenmrsConstants.USER_PROPERTY_NOTIFICATION_ADDRESS, recipient2); MessageSender messageSender = new MailMessageSender(); Context.getMessageService().setMessageSender(messageSender); Message messageObj = new Message(1,recipient1,"sender","subject","content"); try { Context.getMessageService().sendMessage(messageObj, Context.getAuthenticatedUser()); } catch (MessageException e) { if (!e.getMessage().contains(NO_SMTP_SERVER_ERROR)) { e.printStackTrace(); fail(); } } assertEquals(messageObj.getRecipients(),recipient1 + "," + recipient2); }

Target:
public void sendMessage_shouldSetRecipientIfAddressIsNotNull() { String recipient1 = "address1"; String recipient2 = "address2"; getAuthenticatedUser().setUserProperty(OpenmrsConstants.USER_PROPERTY_NOTIFICATION_ADDRESS, recipient2); MessageSender messageSender = new MailMessageSender(); ms.setMessageSender(messageSender); Message messageObj = new Message(1,recipient1,"sender","subject","content"); try { ms.sendMessage(messageObj, getAuthenticatedUser()); } catch (MessageException e) { if (!e.getMessage().contains(NO_SMTP_SERVER_ERROR)) { e.printStackTrace(); fail(); } } assertEquals(messageObj.getRecipients(),recipient1 + "," + recipient2); }
Source:
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mAllergensFromDao = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().loadAll(); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergensEnabled = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(mAllergensEnabled, getActivity()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }

Target:
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mAllergenDao = Utils.getAppDaoSession(getActivity()).getAllergenDao(); mAllergensFromDao = mAllergenDao.loadAll(); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergensEnabled = mAllergenDao.queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(mAllergensEnabled, getActivity()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }
Source:
public Iterator<Resource> iterateResources(String startPath, final boolean recursive) { if (relativePath != null) startPath = startPath.equals("") ? relativePath : relativePath + "/" + startPath; final String startName = PathUtils.canonicalize(PathUtils.relativize(startPath)); List<String> directory = this.directory; if (directory == null) { synchronized (jarFile) { directory = this.directory; if (directory == null) { directory = new ArrayList<>(); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry jarEntry = entries.nextElement(); if (! jarEntry.isDirectory()) { directory.add(jarEntry.getName()); } } this.directory = directory; } } } final Iterator<String> iterator = directory.iterator(); return new Iterator<Resource>() { private Resource next; public boolean hasNext() { while (next == null) { if (! iterator.hasNext()) { return false; } final String name = iterator.next(); if ((recursive ? PathUtils.isChild(startName, name) : PathUtils.isDirectChild(startName, name))) { try { next = new JarEntryResource(jarFile, name, relativePath, getJarURI(jarURI, name).toURL()); } catch (Exception ignored) { } } } return true; } public Resource next() { if (! hasNext()) { throw new NoSuchElementException(); } try { return next; } finally { next = null; } } public void remove() { throw new UnsupportedOperationException(); } }; }

Target:
public Iterator<Resource> iterateResources(String startPath, final boolean recursive) { if (relativePath != null) startPath = startPath.equals("") ? relativePath : relativePath + "/" + startPath; final String startName = PathUtils.canonicalize(PathUtils.relativize(startPath)); List<String> directory = this.directory; if (directory == null) { synchronized (jarFile) { directory = this.directory; if (directory == null) { directory = new ArrayList<>(); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry jarEntry = entries.nextElement(); if (! jarEntry.isDirectory()) { directory.add(jarEntry.getName()); } } this.directory = directory; } } } final Iterator<String> iterator = directory.iterator(); return new Iterator<Resource>() { private Resource next; public boolean hasNext() { while (next == null) { if (! iterator.hasNext()) { return false; } final String name = iterator.next(); if ((recursive ? PathUtils.isChild(startName, name) : PathUtils.isDirectChild(startName, name))) { try { next = new JarEntryResource(jarFile, name, relativePath, getJarURI(name).toURL()); } catch (Exception ignored) { } } } return true; } public Resource next() { if (! hasNext()) { throw new NoSuchElementException(); } try { return next; } finally { next = null; } } public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
private void removeFromDB(String serviceName, String type, String userId) throws CredentialStoreException { try { Connection connection = getConnection(); try { String application = findApplicationName(); if(StringUtil.isEmpty(userId)){ userId = serviceName+application; } PreparedStatement ps = connection .prepareStatement("DELETE FROM "+getTableName()+" WHERE APPID = ? AND SERVICENAME = ? AND USERID = ? AND TYPE = ?"); try { ps.setString(1, application); ps.setString(2, serviceName); ps.setString(3, userId); ps.setString(4, type); ps.executeUpdate(); } finally { ps.close(); } } finally { connection.close(); } } catch (SQLException e) { logger.log(Level.SEVERE, "deleteConsumerToken : ", e); throw new CredentialStoreException(e, "DBTokenStore.java : deleteConsumerToken caused a SQLException"); } }

Target:
private void removeFromDB(String serviceName, String type, String userId) throws CredentialStoreException { try { Connection connection = getConnection(); try { String application = findApplicationName(); if(StringUtil.isEmpty(userId)){ userId = ""; } PreparedStatement ps = connection .prepareStatement("DELETE FROM "+getTableName()+" WHERE APPID = ? AND SERVICENAME = ? AND USERID = ? AND TYPE = ?"); try { ps.setString(1, application); ps.setString(2, serviceName); ps.setString(3, userId); ps.setString(4, type); ps.executeUpdate(); } finally { ps.close(); } } finally { connection.close(); } } catch (SQLException e) { logger.log(Level.SEVERE, "deleteConsumerToken : ", e); throw new CredentialStoreException(e, "DBTokenStore.java : deleteConsumerToken caused a SQLException"); } }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); this.breeder().ifPresent(v -> vanillaValues.add(v.asImmutable())); vanillaValues.add(this.breedTime().asImmutable()); return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.breedTime().asImmutable()); values.add(this.canBreed().asImmutable()); this.breeder().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
public IndexProcessingResults(Map<StoreKey, Info> keyToState, long processedCount, long putCount, long deleteCount, Set<StoreKey> duplicatePuts, Set<StoreKey> putAfterDeletes, Set<StoreKey> duplicateDeletes) { this.keyToState = keyToState; this.processedCount = processedCount; this.putCount = putCount; this.deleteCount = deleteCount; this.duplicatePuts = duplicatePuts; this.putAfterDeletes = putAfterDeletes; this.duplicateDeletes = duplicateDeletes; activeCount = keyToState.values().stream().filter(value -> value.getStates().contains(BlobState.Valid)).count(); }

Target:
IndexProcessingResults(Map<StoreKey, Info> keyToState, long processedCount, long putCount, long deleteCount, Set<StoreKey> duplicatePuts, Set<StoreKey> putAfterDeletes, Set<StoreKey> duplicateDeletes) { this.keyToState = keyToState; this.processedCount = processedCount; this.putCount = putCount; this.deleteCount = deleteCount; this.duplicatePuts = duplicatePuts; this.putAfterDeletes = putAfterDeletes; this.duplicateDeletes = duplicateDeletes; activeCount = keyToState.values().stream().filter(value -> value.getStates().contains(BlobState.Valid)).count(); }
Source:
private String getResourcePath(String subscriptionID, String topicName) { String resourcePath = this.topicStoragePath; topicName = topicName.replaceAll("\\.", RegistryConstants.PATH_SEPARATOR); if (!topicName.startsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } if (topicName.indexOf('*') > -1){ topicName = topicName.substring(0, topicName.indexOf('*')); } else if (topicName.indexOf('#') > -1){ topicName = topicName.substring(0, topicName.indexOf('#')); } resourcePath = resourcePath + topicName; if (!resourcePath.endsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } resourcePath = resourcePath + EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME + RegistryConstants.PATH_SEPARATOR + subscriptionID; return resourcePath; }

Target:
private String getResourcePath(String subscriptionID, String topicName) { String resourcePath = this.topicStoragePath; topicName = topicName.replaceAll("\\.", RegistryConstants.PATH_SEPARATOR); if (!topicName.startsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } if (topicName.indexOf(STAR_WILDCARD) > -1) { topicName = topicName.substring(0, topicName.indexOf(STAR_WILDCARD)); } else { if (topicName.indexOf(HASH_WILDCARD) > -1) { topicName = topicName.substring(0, topicName.indexOf(HASH_WILDCARD)); } } resourcePath = resourcePath + topicName; if (!resourcePath.endsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } resourcePath = resourcePath + EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME + RegistryConstants.PATH_SEPARATOR + subscriptionID; return resourcePath; }
Source:
public boolean removeVMFromBackupOffering(VirtualMachine vm) { s_logger.debug("Removing VM ID " + vm.getUuid() + " from backup offering by the Dummy Backup Provider"); final List<Backup> backups = backupDao.listByVmId(null, vm.getId()); for (final Backup backup : backups) { backupDao.remove(backup.getId()); } return true; }

Target:
public boolean removeVMFromBackupOffering(VirtualMachine vm) { s_logger.debug("Removing VM ID " + vm.getUuid() + " from backup offering by the Dummy Backup Provider"); return true; }
Source:
public void updateVmDevices(VmManagementParametersBase params, VM oldVm) { VmBase oldVmBase = oldVm.getStaticData(); VmBase newVmBase = params.getVmStaticData(); if (newVmBase == null) { return; } updateCdPath(oldVmBase, newVmBase); updateBootOrder(oldVmBase, newVmBase); updateVideoDevices(oldVmBase, newVmBase); updateUsbSlots(oldVmBase, newVmBase); updateMemoryBalloon(newVmBase.getId(), params.isBalloonEnabled()); updateSoundDevice(oldVmBase, newVmBase, oldVm.getCompatibilityVersion(), params.isSoundDeviceEnabled()); updateSmartcardDevice(oldVm, newVmBase); updateConsoleDevice(newVmBase.getId(), params.isConsoleEnabled()); int scsiControllers = (newVmBase.getNumOfIoThreads() > 1 && params.isVirtioScsiEnabled()) ? newVmBase.getNumOfIoThreads() : 1; for (int i = 1; i <= scsiControllers; i++) { updateVirtioScsiController(newVmBase.getId(), params.isVirtioScsiEnabled()); } }

Target:
public void updateVmDevices(VmManagementParametersBase params, VM oldVm) { VmBase oldVmBase = oldVm.getStaticData(); VmBase newVmBase = params.getVmStaticData(); if (newVmBase == null) { return; } updateCdPath(oldVmBase, newVmBase); updateBootOrder(oldVmBase, newVmBase); updateVideoDevices(oldVmBase, newVmBase); updateUsbSlots(oldVmBase, newVmBase); updateMemoryBalloon(newVmBase.getId(), params.isBalloonEnabled()); updateSoundDevice(oldVmBase, newVmBase, oldVm.getCompatibilityVersion(), params.isSoundDeviceEnabled()); updateSmartcardDevice(oldVm, newVmBase); updateConsoleDevice(newVmBase.getId(), params.isConsoleEnabled()); updateVirtioScsiController(newVmBase, params.isVirtioScsiEnabled()); }
Source:
public GeneratorPriceIndexCurveInterpolatedAnchorNode(final double[] nodePoints, final Interpolator1D interpolator, final double anchorNode, final double anchorValue) { ArgumentChecker.notNull(nodePoints, "Node points"); ArgumentChecker.notNull(interpolator, "Interpolator"); _nbPoints = nodePoints.length; _nodePoints = nodePoints; _anchorNode = anchorNode; _anchorValue = anchorValue; _interpolator = interpolator; }

Target:
public GeneratorPriceIndexCurveInterpolatedAnchorNode(final double[] nodePoints, final Interpolator1D interpolator, final double anchorNode, final double anchorValue) { ArgumentChecker.notNull(nodePoints, "Node points"); ArgumentChecker.notNull(interpolator, "Interpolator"); _nbPoints = nodePoints.length; _nodePoints = nodePoints.clone(); _anchorNode = anchorNode; _anchorValue = anchorValue; _interpolator = interpolator; }
Source:
public void testTaskUpdateSizeLimit() { Session session = Session.builder(getSession()).build(); assertQueryFails(session, "SELECT * " + "FROM ORDERS " + "WHERE ORDERKEY != 50303681 " + "AND ORDERKEY != 50303682 " + "AND ORDERKEY != 50303683 " + "AND ORDERKEY != 50303684 " + "AND ORDERKEY != 50303685 " + "AND CUSTKEY != 1327381 " + "AND CUSTKEY != 1327382 " + "AND CUSTKEY != 1327383 " + "AND CUSTKEY != 1327384 " + "AND CUSTKEY != 1327385 " + "LIMIT 10", "TaskUpdate size of [0-9]* Bytes has exceeded the limit of 100 Bytes"); }

Target:
public void testTaskUpdateSizeLimit() { assertQueryFails( getSession(), "SELECT * FROM ORDERS LIMIT 10", "TaskUpdate size of [0-9]* Bytes has exceeded the limit of 100 Bytes"); }
Source:
public HideData asMutable() { return new SpongeHideData(enchantments, attributes, unbreakable, canDestroy, canPlace, miscellaneous); }

Target:
public HideData asMutable() { return new SpongeHideData(this.enchantments, this.attributes, this.unbreakable, this.canDestroy, this.canPlace, this.miscellaneous); }
Source:
public SecurityProfile getDeletionSecurityProfile() { return securityProfile; }

Target:
public SecurityProfile getDeletionSecurityProfile() { return getSecurityProfile(); }
Source:
public void bindComparisonOperator() throws StandardException{ boolean nullableResult; if (singleLeftOperand) rightOperandList.comparable(getLeftOperand()); boolean leftNullable = false; for (int index = 0; index < leftOperandList.size(); index++) { ValueNode ln = (ValueNode) leftOperandList.elementAt(index); if (ln.getTypeServices().isNullable()) { leftNullable = true; break; } } nullableResult= leftNullable || rightOperandList.isNullable(); setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID,nullableResult)); }

Target:
public void bindComparisonOperator() throws StandardException{ boolean nullableResult; if (singleLeftOperand) rightOperandList.comparable(getLeftOperand()); nullableResult= leftOperandList.isNullable() || rightOperandList.isNullable(); setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID,nullableResult)); }
Source:
public void testSparkSVDOnTestMatrix() { final RealMatrix dataMatrix = new Array2DRowRealMatrix(TEST_MATRIX); final JavaSparkContext sparkContext = SparkContextFactory.getSparkContext("test", SparkContextFactory.DEFAULT_SPARK_MASTER); final PCA pca = PCA.createPCA(dataMatrix, dm -> SVDFactory.createSVD(dm, sparkContext)); final RealVector centers = pca.getCenters(); final RealVector variances = pca.getVariances(); final RealMatrix loadings = pca.getLoadings(); Assert.assertNotNull(loadings); assertEquals(centers, new ArrayRealVector(TEST_EXPECTED_CENTERS), EPSILON); assertEquals(variances, new ArrayRealVector(TEST_EXPECTED_VARS), EPSILON); assertEqualLoadings(loadings, new Array2DRowRealMatrix(TEST_EXPECTED_LOADINGS), variances, EPSILON); }

Target:
public void testSparkSVDOnTestMatrix() { final RealMatrix dataMatrix = new Array2DRowRealMatrix(TEST_MATRIX); final JavaSparkContext sparkContext = SparkContextFactory.getSparkContext("test", SparkContextFactory.DEFAULT_SPARK_MASTER); final PCA pca = PCA.createPCA(dataMatrix, dm -> SVDFactory.createSVD(dm, sparkContext)); final RealVector centers = pca.getCenters(); final RealVector variances = pca.getVariances(); final RealMatrix eigenVectors = pca.getEigenVectors(); Assert.assertNotNull(eigenVectors); assertEquals(centers, new ArrayRealVector(TEST_EXPECTED_CENTERS), EPSILON); assertEquals(variances, new ArrayRealVector(TEST_EXPECTED_VARS), EPSILON); assertEqualEigenVectors(eigenVectors, new Array2DRowRealMatrix(TEST_EXPECTED_EIGENVECTORS), variances, EPSILON); }
Source:
private static void assertNotEmptyCanDoActionMessage() { assertTrue(EXPECTED_CAN_DO_MESSAGE, canDoActionMessages.size() > 0); canDoActionMessages.clear(); }

Target:
private void assertNotEmptyCanDoActionMessage() { assertTrue(EXPECTED_CAN_DO_MESSAGE, !canDoActionMessages.isEmpty()); canDoActionMessages.clear(); }
Source:
public Access checkPermission(Document doc, ACP mergedAcp, Principal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; if (doc.getType().getName().equals(MAIL_MESSAGE_TYPE) && SecurityConstants.WRITE.equals(permission)) { access = Access.DENY; } return access; }

Target:
public Access checkPermission(Document doc, ACP mergedAcp, Principal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; if (doc.getType().getName().equals(MAIL_MESSAGE_TYPE)) { List<String> resolvedPermissionsList = Arrays.asList(resolvedPermissions); if (resolvedPermissionsList.contains(SecurityConstants.WRITE_PROPERTIES) || resolvedPermissionsList.contains(SecurityConstants.WRITE)) { access = Access.DENY; } } return access; }
Source:
public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration; try { validateToken(token); } catch (final UnknownTokenException e) { if (permissiveFailureEnabled && StringUtils .containsIgnoreCase(e.toString(), "Unknown token")) { return getJWTTokenExpiration(token); } else { throw e; } } synchronized (tokenExpirations) { expiration = tokenExpirations.get(token); } return expiration; }

Target:
public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration; try { validateToken(token); } catch (final UnknownTokenException e) { if (permissiveValidationEnabled && getJWTTokenExpiration(token).isPresent()) { return getJWTTokenExpiration(token).getAsLong(); } else { throw e; } } synchronized (tokenExpirations) { expiration = tokenExpirations.get(token); } return expiration; }
Source:
public String toString() { return "print state of tree"; }

Target:
public String toString() { return "Print state of tree"; }
Source:
private boolean contributeObjectActionsOld(IMenuManager manager) { try { DummyPart part = new DummyPart(); MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", new Object[] { part, manager, activeTaskSelectionProvider }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }

Target:
private boolean contributeObjectActionsOld(IMenuManager manager) { try { MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", new Object[] { null, manager, activeTaskSelectionProvider }, new Class[] { IWorkbenchPart.class, IMenuManager.class, ISelectionProvider.class }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }
Source:
public SheetLocation getSheetLocation(EObject eObject, EStructuralFeature structuralFeature) { SheetLocation possibleResult = null; for (final SettingToSheetMapping settingToSheetMapping : getSettingToSheetMap()) { if (structuralFeature != settingToSheetMapping.getSettingLocation().getFeature()) { continue; } if (possibleResult == null) { possibleResult = settingToSheetMapping.getSheetLocation(); } if (eObject != settingToSheetMapping.getSettingLocation().getEObject()) { continue; } return EcoreUtil.copy(settingToSheetMapping.getSheetLocation()); } if (possibleResult != null) { final SheetLocation result = EcoreUtil.copy(possibleResult); result.setRow(-1); return result; } return ErrorFactory.eINSTANCE.createSheetLocation("NO SHEET", -1, -1, getFeatureName(structuralFeature)); }

Target:
public SheetLocation getSheetLocation(EObject eObject, EStructuralFeature structuralFeature) { SheetLocation possibleResult = null; for (final SettingToSheetMapping settingToSheetMapping : getSettingToSheetMap()) { if (structuralFeature != settingToSheetMapping.getSettingLocation().getFeature()) { continue; } if (possibleResult == null) { possibleResult = settingToSheetMapping.getSheetLocation(); } if (eObject != settingToSheetMapping.getSettingLocation().getEObject()) { continue; } return EcoreUtil.copy(settingToSheetMapping.getSheetLocation()); } if (possibleResult != null) { final SheetLocation result = EcoreUtil.copy(possibleResult); result.setRow(-1); return result; } return ErrorFactory.eINSTANCE.createInvalidSheetLocation(getFeatureName(structuralFeature)); }
Source:
public static File createIndexedBamOrCram(final File samFile, final File tempFilePrefix, final SamReader.Type type, final File referenceFasta) throws IOException { if (type != SamReader.Type.BAM_TYPE && type != SamReader.Type.CRAM_TYPE) { throw new PicardException("Cannot create indexed file of type "+type); } if (type == SamReader.Type.CRAM_TYPE && referenceFasta == null) { throw new PicardException("Cannot create indexed CRAM file without reference"); } final File output = File.createTempFile(tempFilePrefix.getAbsolutePath(), "."+type.fileExtension()); output.deleteOnExit(); final File indexFile = new File(output.getAbsolutePath() + "."+type.indexExtension()); indexFile.deleteOnExit(); final SamReader in = SamReaderFactory.makeDefault().open(samFile); SAMFileWriter out = new SAMFileWriterFactory().setCreateIndex(true).makeWriter(in.getFileHeader(), true, output,referenceFasta); in.iterator().stream().forEach(out::addAlignment); out.close(); in.close(); return output; }

Target:
public static File createIndexedBamOrCram(final File samFile, final File tempFilePrefix, final SamReader.Type type, final File referenceFasta) throws IOException { if (type != SamReader.Type.BAM_TYPE && type != SamReader.Type.CRAM_TYPE) { throw new PicardException("Cannot create indexed file of type " + type); } if (type == SamReader.Type.CRAM_TYPE && referenceFasta == null) { throw new PicardException("Cannot create indexed CRAM file without reference"); } final File output = File.createTempFile(tempFilePrefix.getAbsolutePath(), "." + type.fileExtension()); output.deleteOnExit(); final File indexFile; if (type == SamReader.Type.BAM_TYPE) { final String fileBase = output.getAbsolutePath().substring(0, output.getAbsolutePath().lastIndexOf('.')); indexFile = new File(fileBase + BAMIndex.BAI_INDEX_SUFFIX); indexFile.deleteOnExit(); } else if (type == SamReader.Type.CRAM_TYPE) { indexFile = IOUtil.addExtension(Paths.get(output.getAbsolutePath()), BAMIndex.BAI_INDEX_SUFFIX).toFile(); indexFile.deleteOnExit(); } try (final SamReader in = SamReaderFactory.makeDefault().open(samFile); final SAMFileWriter out = new SAMFileWriterFactory().setCreateIndex(true).makeWriter(in.getFileHeader(), true, output, referenceFasta);) { in.iterator().stream().forEach(out::addAlignment); } return output; }
Source:
public Set<String> retrieveServiceLevelsForOwner(Owner owner, boolean exempt) { String stmt = "SELECT DISTINCT Attribute.name, Attribute.value, Product.id " + "FROM Pool AS Pool " + " INNER JOIN Pool.product AS Product " + " INNER JOIN Product.attributes AS Attribute " + " LEFT JOIN Pool.entitlements AS Entitlement " + "WHERE Pool.owner.id = :owner_id " + " AND (Attribute.name = 'support_level' OR Attribute.name = 'support_level_exempt') " + " AND (Pool.endDate >= current_date() OR Entitlement.endDateOverride >= current_date()) " + " ORDER BY Attribute.name DESC"; Query q = currentSession().createQuery(stmt); q.setParameter("owner_id", owner.getId()); List<Object[]> results = q.list(); Set<String> slaSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); Set<String> exemptSlaSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); Set<String> exemptProductIds = new HashSet<String>(); for (Object[] result : results) { String name = (String) result[0]; String value = (String) result[1]; String productId = (String) result[2]; if ("support_level_exempt".equals(name) && "true".equalsIgnoreCase(value)) { exemptProductIds.add(productId); } else if ("support_level".equalsIgnoreCase(name) && (value != null && !value.trim().equals("")) && exemptProductIds.contains(productId)) { exemptSlaSet.add(value); } } for (Object[] result : results) { String name = (String) result[0]; String value = (String) result[1]; if (!"support_level_exempt".equals(name) && !exemptSlaSet.contains(value)) { slaSet.add(value); } } if (exempt) { return exemptSlaSet; } return slaSet; }

Target:
public Set<String> retrieveServiceLevelsForOwner(Owner owner, boolean exempt) { String stmt = "SELECT DISTINCT attribute.name, attribute.value, product.id " + "FROM Pool AS pool " + " INNER JOIN Pool.product AS product " + " INNER JOIN Product.attributes AS attribute " + " LEFT JOIN Pool.entitlements AS entitlement " + "WHERE pool.owner.id = :owner_id " + " AND (attribute.name = 'support_level' OR attribute.name = 'support_level_exempt') " + " AND (pool.endDate >= current_date() OR entitlement.endDateOverride >= current_date()) " + "ORDER BY attribute.name DESC"; Query q = currentSession().createQuery(stmt); q.setParameter("owner_id", owner.getId()); List<Object[]> results = q.list(); Set<String> slaSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); Set<String> exemptSlaSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); Set<String> exemptProductIds = new HashSet<String>(); for (Object[] result : results) { String name = (String) result[0]; String value = (String) result[1]; String productId = (String) result[2]; if ("support_level_exempt".equals(name) && "true".equalsIgnoreCase(value)) { exemptProductIds.add(productId); } else if ("support_level".equalsIgnoreCase(name) && (value != null && !value.trim().equals("")) && exemptProductIds.contains(productId)) { exemptSlaSet.add(value); } } for (Object[] result : results) { String name = (String) result[0]; String value = (String) result[1]; if (!"support_level_exempt".equals(name) && !exemptSlaSet.contains(value)) { slaSet.add(value); } } if (exempt) { return exemptSlaSet; } return slaSet; }
Source:
public static void prepareBriefcaseStorageFolder() { try { BriefcasePreferences.setBriefcaseDirectoryProperty(Files.createTempDirectory("briefcase_test").toString()); File briefcaseFolder = new StorageLocation().getBriefcaseFolder(); boolean mkdirs = briefcaseFolder.mkdirs(); if (mkdirs) log.info("Created test Briefcase storage folder at " + briefcaseFolder); else throw new RuntimeException("Can't create test Briefcase storage folder"); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public static void prepareBriefcaseStorageFolder() { try { BriefcasePreferences.setBriefcaseDirectoryProperty(Files.createTempDirectory("briefcase_test").toString()); File briefcaseFolder = new StorageLocation().getBriefcaseFolder(); if (briefcaseFolder.mkdirs()) log.info("Created test Briefcase storage folder at " + briefcaseFolder); else throw new RuntimeException("Can't create test Briefcase storage folder"); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public void generateRetrieveFilesCall(final Map entryInfos, IPath destination, final String[] files, IAntScript script) { String gitRepo = (String) entryInfos.get(KEY_REPO); String localGitRepo = asLocalRepo(gitRepo); String path = (String) entryInfos.get(KEY_PATH); String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); printCloneRepoAndCheckoutTagTasks(script, gitRepo, localGitRepo, tag, null); Map<String,String> params = new HashMap<String,String>(4); for (int i = 0; i < files.length; i++) { String file = files[i]; IPath filePath; if (path != null) { filePath = new Path(path).append(file); } else { filePath = new Path((String) entryInfos.get(KEY_ELEMENT_NAME)).append(file); } params.clear(); params.put(PROP_GITREPO_LOCAL_PATH, localGitRepo); params.put(PROP_DESTINATIONFOLDER, destination.toString()); params.put(PROP_PATH, filePath.toString()); params.put(PROP_FILE, file); script.printAntCallTask(TARGET_GET_FILE_FROM_REPO, true, params); } }

Target:
public void generateRetrieveFilesCall(final Map entryInfos, IPath destination, final String[] files, IAntScript script) { final String gitRepo = (String) entryInfos.get(KEY_REPO); final String localGitRepo = asLocalRepo(gitRepo); final String path = (String) entryInfos.get(KEY_PATH); final String tag = (String) entryInfos .get(IFetchFactory.KEY_ELEMENT_TAG); printCloneRepoAndCheckoutTagTasks(script, gitRepo, localGitRepo, tag, null); final Map<String, String> params = new HashMap<String, String>(4); for (int i = 0; i < files.length; i++) { final String file = files[i]; IPath filePath; if (path != null) { filePath = new Path(path).append(file); } else { filePath = new Path((String) entryInfos.get(KEY_ELEMENT_NAME)) .append(file); } params.clear(); params.put(PROP_GITREPO_LOCAL_PATH, localGitRepo); params.put(PROP_DESTINATIONFOLDER, destination.toString()); params.put(PROP_PATH, filePath.toString()); params.put(PROP_FILE, file); script.printAntCallTask(TARGET_GET_FILE_FROM_REPO, true, params); } }