auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object evaluate(DeferredObject[] arguments) throws HiveException { assert maxMindGeocode != null : "Evaluate called without initializing 'geocodeCity'"; result.clear(); if (arguments.length == 1 && argumentOI != null && arguments[0] != null) { String ip = ((StringObjectInspector) argumentOI).getPrimitiveJavaObject(arguments[0].get()); Map<String, Object> geoDataResult = maxMindGeocode.getGeocodedData(ip); if (geoDataResult != null) { for (String field : geoDataResult.keySet()) { Object value = geoDataResult.get(field); if (value != null) { result.put(field, value.toString()); } } } } return result; }

Target:
public Object evaluate(DeferredObject[] arguments) throws HiveException { assert maxMindGeocode != null : "Evaluate called without initializing 'geocodeCity'"; result.clear(); if (arguments.length == 1 && argumentOI != null && arguments[0] != null) { String ip = ((StringObjectInspector) argumentOI).getPrimitiveJavaObject(arguments[0].get()); Map<String, String > geoDataResult = maxMindGeocode.getResponse(ip).getMap(); if (geoDataResult != null) { for (String field : geoDataResult.keySet()) { Object value = geoDataResult.get(field); if (value != null) { result.put(field, value.toString()); } } } } return result; }
Source:
private void showConfig(Class clazz) { OzoneConfiguration conf = new OzoneConfiguration(); conf.addResource("http://localhost:9876/conf"); ConfigGroup configGroup = (ConfigGroup) clazz.getAnnotation(ConfigGroup.class); if (configGroup == null) { return; } String prefix = configGroup.prefix(); for (Method method : clazz.getMethods()) { if (method.isAnnotationPresent(Config.class)) { Config config = method.getAnnotation(Config.class); String key = prefix + "." + config.key(); System.out.println(">>> " + key); System.out.println(" default: " + config.defaultValue()); System.out.println(" current: " + conf.get(key)); System.out.println(); System.out.println(config.description()); System.out.println(); System.out.println(); } } }

Target:
private void showConfig(Class clazz) { OzoneConfiguration conf = new OzoneConfiguration(); conf.addResource(getHost(conf, new Component(Type.SCM)) + "/conf"); ConfigGroup configGroup = (ConfigGroup) clazz.getAnnotation(ConfigGroup.class); if (configGroup == null) { return; } String prefix = configGroup.prefix(); for (Method method : clazz.getMethods()) { if (method.isAnnotationPresent(Config.class)) { Config config = method.getAnnotation(Config.class); String key = prefix + "." + config.key(); System.out.println(">>> " + key); System.out.println(" default: " + config.defaultValue()); System.out.println(" current: " + conf.get(key)); System.out.println(); System.out.println(config.description()); System.out.println(); System.out.println(); } } }
Source:
private Map<Locator, MetricData> getNumericOrStringDataForRange( List<Locator> locators, Range range, String columnFamily, Granularity gran ) throws IOException { Map<Locator, MetricData> metrics = new HashMap<Locator, MetricData>(); for ( final Locator locator : locators ) { MetricData data = super.getDatapointsForRange( new ArrayList<Locator>() {{ add( locator ); }}, range, columnFamily, gran ).get( locator ); if ( !data.getData().getPoints().isEmpty() ) { metrics.put( locator, data ); } else { metrics.putAll( getStringDataForRange( new ArrayList<Locator>() {{ add( locator ); }}, range ) ); } } return metrics; }

Target:
private Map<Locator, MetricData> getNumericOrStringDataForRange( List<Locator> locators, Range range, String columnFamily, Granularity gran ) throws IOException { Instrumentation.markScanAllColumnFamilies(); Map<Locator, MetricData> metrics = new HashMap<Locator, MetricData>(); for ( final Locator locator : locators ) { MetricData data = super.getDatapointsForRange( new ArrayList<Locator>() {{ add( locator ); }}, range, columnFamily, gran ).get( locator ); if ( !data.getData().getPoints().isEmpty() ) { metrics.put( locator, data ); } else { metrics.putAll( getStringDataForRange( new ArrayList<Locator>() {{ add( locator ); }}, range ) ); } } return metrics; }
Source:
static boolean algEquals(String algURI, String algName) { if ((algName.equalsIgnoreCase("DSA") && algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) || (algName.equalsIgnoreCase("RSA") && algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1))) { return true; } else { return false; } }

Target:
private static boolean algEquals(String algURI, String algName) { return (algName.equalsIgnoreCase("DSA") && algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) || (algName.equalsIgnoreCase("RSA") && algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1)); }
Source:
public void testInputFormatBuilderImplTest_ExecuteHints() { Map<String,String> hints = ImmutableMap.<String,String>builder().put("key1", "value1") .put("key2", "value2").put("key3", "value3").build(); formatBuilderTest.executionHints(hints); Map<String,String> executionHints = formatBuilderTest.getExecutionHints(); assertEquals(executionHints.toString(), hints.toString()); }

Target:
public void testInputFormatBuilderImplTest_ExecuteHints() { SortedMap<String,String> hints = new TreeMap<>(); hints.put("key1", "value1"); hints.put("key2", "value2"); hints.put("key3", "value3"); formatBuilderTest.executionHints(hints); SortedMap<String,String> executionHints = formatBuilderTest.getExecutionHints(); assertEquals(hints.toString(), executionHints.toString()); }
Source:
public boolean managedCheckConnection() { boolean isValid = true; try { checkConnection(); } catch (IOException ioEx) { isValid = false; log.error("JMX check connection: {}", ioEx); } return isValid; }

Target:
public boolean managedCheckConnection() { boolean isValid = true; try { checkConnection(); } catch (IOException ioEx) { isValid = false; log.debug("JMX check connection: {}", ioEx); } return isValid; }
Source:
public void onCompletion(Void result, Exception exception) { long processingStartTimeMs = SystemTime.getInstance().milliseconds(); metrics.getSignedUrlSecurityPostProcessRequestTimeInMs.update(processingStartTimeMs - operationStartTimeMs); try { if (exception == null) { String signedUrl = urlSigningService.getSignedUrl(restRequest); LOGGER.debug("Generated from {}", signedUrl, restRequest); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.SIGNED_URL, signedUrl); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); final long processResponseStartTimeMs = SystemTime.getInstance().milliseconds(); securityService.processResponse(restRequest, restResponseChannel, null, (voidResult, processResponseException) -> { metrics.getSignedUrlSecurityResponseTimeInMs.update( SystemTime.getInstance().milliseconds() - processResponseStartTimeMs); callback.onCompletion(null, processResponseException); }); } } catch (Exception e) { exception = e; } finally { metrics.getSignedUrlProcessingTimeInMs.update(SystemTime.getInstance().milliseconds() - processingStartTimeMs); if (exception != null) { callback.onCompletion(null, exception); } } }

Target:
public void onCompletion(Void result, Exception exception) { long processingStartTimeMs = SystemTime.getInstance().milliseconds(); metrics.getSignedUrlSecurityPostProcessRequestTimeInMs.update(processingStartTimeMs - operationStartTimeMs); try { if (exception == null) { String signedUrl = urlSigningService.getSignedUrl(restRequest); LOGGER.debug("Generated from {}", signedUrl, restRequest); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.SIGNED_URL, signedUrl); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, 0); final long processResponseStartTimeMs = SystemTime.getInstance().milliseconds(); securityService.processResponse(restRequest, restResponseChannel, null, (processResponseResult, processResponseException) -> { metrics.getSignedUrlSecurityResponseTimeInMs.update( SystemTime.getInstance().milliseconds() - processResponseStartTimeMs); callback.onCompletion(null, processResponseException); }); } } catch (Exception e) { exception = e; } finally { metrics.getSignedUrlProcessingTimeInMs.update(SystemTime.getInstance().milliseconds() - processingStartTimeMs); if (exception != null) { callback.onCompletion(null, exception); } } }
Source:
public String getSummaryMessage() { NumberFormat formatSize = NumberFormat.getInstance(); formatSize.setMaximumFractionDigits(2); formatSize.setMinimumFractionDigits(2); SizeConverter.Size sizeMoved= SizeConverter.autoConvert(statusSummary.getTotalSizeMoved(),SizeUnit.BYTES); StringBuilder builder = new StringBuilder(); builder.append("Files [scanned: ") .append(statusSummary.getFilesScanned()) .append(", moved: ") .append(statusSummary.getFilesMoved()) .append(", failed: ") .append(statusSummary.getFilesFailed()) .append(", Total size moved: ") .append((formatSize.format(sizeMoved.getValue())).toString().concat(" ").concat(sizeMoved.getUnit().toString())); return builder.toString(); }

Target:
public String getSummaryMessage() { SizeConverter.Size sizeMoved= SizeConverter.autoConvert(statusSummary.getTotalSizeMoved(), SizeUnit.BYTES); StringBuilder builder = new StringBuilder(); builder.append("Files [scanned: ") .append(statusSummary.getFilesScanned()) .append(", moved: ") .append(statusSummary.getFilesMoved()) .append(", failed: ") .append(statusSummary.getFilesFailed()) .append(", Total size moved: ") .append(sizeMoved.getValue().toString().concat(" ").concat(sizeMoved.getUnit().toString())); return builder.toString(); }
Source:
private static void initializeProviders() { RuntimeEnvironment.application = spy(RuntimeEnvironment.application); when(RuntimeEnvironment.application.getApplicationContext()) .thenReturn(RuntimeEnvironment.application); Resources spiedResources = spy(RuntimeEnvironment.application.getResources()); when(RuntimeEnvironment.application.getResources()).thenReturn(spiedResources); when(spiedResources.getString(R.string.default_web_client_id)).thenReturn("abc"); when(spiedResources.getString(R.string.facebook_application_id)).thenReturn("abc"); when(spiedResources.getString(R.string.twitter_consumer_key)).thenReturn("abc"); when(spiedResources.getString(R.string.twitter_consumer_secret)).thenReturn("abc"); }

Target:
private static void initializeProviders() { Context context = RuntimeEnvironment.application; when(context.getString(R.string.default_web_client_id)).thenReturn("abc"); when(context.getString(R.string.facebook_application_id)).thenReturn("abc"); when(context.getString(R.string.twitter_consumer_key)).thenReturn("abc"); when(context.getString(R.string.twitter_consumer_secret)).thenReturn("abc"); }
Source:
public static List<Visit> getPatientsWithActiveVisitsFilteredByQuery(List<Visit> visitList, String query) { List<Visit> filteredList = new ArrayList<>(); for (Visit visit : visitList) { Patient patient = new PatientDAO().findPatientByID(visit.getPatient().getId().toString()); List<String> patientsWithActiveVisitsSearchableWords = new ArrayList<>(); patientsWithActiveVisitsSearchableWords.addAll(getVisitSearchableWords(visit)); patientsWithActiveVisitsSearchableWords.addAll(getPatientSearchableWords(patient)); if (doesAnySearchableWordFitQuery(patientsWithActiveVisitsSearchableWords, query)) { filteredList.add(visit); } } return filteredList; }

Target:
public static List<Visit> getPatientsWithActiveVisitsFilteredByQuery(List<Visit> visitList, String query) { List<Visit> filteredList = new ArrayList<>(); for (Visit visit : visitList) { Patient patient = visit.getPatient(); List<String> patientsWithActiveVisitsSearchableWords = new ArrayList<>(); patientsWithActiveVisitsSearchableWords.addAll(getVisitSearchableWords(visit)); patientsWithActiveVisitsSearchableWords.addAll(getPatientSearchableWords(patient)); if (doesAnySearchableWordFitQuery(patientsWithActiveVisitsSearchableWords, query)) { filteredList.add(visit); } } return filteredList; }
Source:
public void testUpdateLUNsDeviceSize() { int testDeviceSize = 20; dao.updateLUNsDeviceSize(existingLUN.getLUN_id(), testDeviceSize); LUNs dbLun = dao.get(existingLUN.getLUN_id()); assertEquals("LUNs volume group id wasn't updated", testDeviceSize, dbLun.getDeviceSize()); }

Target:
public void testUpdateLUNsDeviceSize() { int testDeviceSize = 20; dao.updateLUNsDeviceSize(existingLUN.getLUN_id(), testDeviceSize); LUNs dbLun = dao.get(existingLUN.getLUN_id()); assertEquals("LUN device size wasn't updated", testDeviceSize, dbLun.getDeviceSize()); }
Source:
public boolean remove(T t) { boolean result = consumers.remove(t); if (result) { changedIteratorFieldUpdater.set(this, consumers.resettableIterator()); } return result; }

Target:
public boolean remove(T t) { boolean result = consumers.remove(t); if (result) { iterator.update(consumers.resettableIterator()); } return result; }
Source:
public void assignTask(Task task, TaskContext context, String excludedUser) { if (!isEnabled()) { logger.debug("AssignmentService is not enabled - to enable it set system property 'org.jbpm.task.assignment.enabled' to true"); return; } if (task.getTaskData().getActualOwner() != null) { logger.debug("Task has already been assigned to single actor {}", task.getId(), task.getTaskData().getActualOwner()); return; } Assignment assignTo = this.strategy.apply(task, context, excludedUser); if (assignTo == null || assignTo.getUser() == null) { logger.warn("Strategy did not return any assignment for task {}", strategy, task); return; } logger.debug("Actual owner returned by strategy is for task {}", strategy, assignTo, task); User actualOwner = taskModelFactory.newUser(assignTo.getUser()); ((InternalTaskData) task.getTaskData()).setActualOwner(actualOwner); ((InternalTaskData) task.getTaskData()).setStatus(Status.Reserved); }

Target:
public void assignTask(Task task, TaskContext context, String excludedUser) { if (!isEnabled()) { logger.debug("AssignmentService is not enabled - to enable it set system property '" + ENABLED_PROPERTY + "' to true"); return; } if (task.getTaskData().getActualOwner() != null) { logger.debug("Task has already been assigned to single actor {}", task.getId(), task.getTaskData().getActualOwner()); return; } Assignment assignTo = this.strategy.apply(task, context, excludedUser); if (assignTo == null || assignTo.getUser() == null) { logger.warn("Strategy did not return any assignment for task {}", strategy, task); return; } logger.debug("Actual owner returned by strategy is for task {}", strategy, assignTo, task); User actualOwner = taskModelFactory.newUser(assignTo.getUser()); ((InternalTaskData) task.getTaskData()).setActualOwner(actualOwner); ((InternalTaskData) task.getTaskData()).setStatus(Status.Reserved); }
Source:
private boolean bootstrap() { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (serversInfo.bootstrap == null) { LOG.error("Missing info to boostrap the client"); return false; } if (bootstrapHandler.tryToInitSession(serversInfo.bootstrap)) { LOG.info("Starting bootstrap session "); ServerInfo boostrapServer = serversInfo.bootstrap; BootstrapResponse response = sender.send(boostrapServer.getAddress(), boostrapServer.isSecure(), new BootstrapRequest(endpoint), null); if (response == null) { LOG.error("Bootstrap failed: timeout"); return false; } else if (response.getCode() == ResponseCode.CHANGED) { LOG.info("Bootstrap started"); boolean timeout = !bootstrapHandler.waitBoostrapFinished(BS_TIMEOUT); if (timeout) { LOG.error("Bootstrap sequence timeout"); bootstrapHandler.cancelSession(); return false; } else { serversInfo = ServersInfoExtractor.getInfo(objectEnablers); LOG.info("Bootstrap finished {}", serversInfo); return true; } } else { LOG.error("Bootstrap failed: {}", response.getCode()); return false; } } else { LOG.info("Bootstrap sequence already started"); return false; } }

Target:
private boolean bootstrap() { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (serversInfo.bootstrap == null) { throw new IllegalStateException("Missing info to boostrap the client"); } if (bootstrapHandler.tryToInitSession(serversInfo.bootstrap)) { LOG.info("Starting bootstrap session "); try { ServerInfo boostrapServer = serversInfo.bootstrap; BootstrapResponse response = sender.send(boostrapServer.getAddress(), boostrapServer.isSecure(), new BootstrapRequest(endpoint), null); if (response == null) { LOG.error("Bootstrap failed: timeout"); return false; } else if (response.isSuccess()) { LOG.info("Bootstrap started"); boolean timeout = !bootstrapHandler.waitBoostrapFinished(BS_TIMEOUT); if (timeout) { LOG.error("Bootstrap sequence timeout"); return false; } else { serversInfo = ServersInfoExtractor.getInfo(objectEnablers); LOG.info("Bootstrap finished {}", serversInfo); return true; } } else { LOG.error("Bootstrap failed: {}", response.getCode()); return false; } } finally { bootstrapHandler.closeSession(); } } else { LOG.info("Bootstrap sequence already started"); return false; } }
Source:
Builder codecRegistry(CodecRegistry registry) { this.codecRegistry = checkNotNull(registry, "registry"); this.fieldNamingStrategy = null; return this; }

Target:
public Builder codecRegistry(CodecRegistry registry) { return codecRegistry(registry, FieldNamingStrategy.DEFAULT); }
Source:
private void makeDelegate() throws IOException { CompressionFactory.LongEncodingWriter writer; long delta; try { delta = LongMath.checkedSubtract(maxVal, minVal); } catch (ArithmeticException e) { delta = -1; } if (uniqueValues.size() <= CompressionFactory.MAX_TABLE_SIZE) { writer = new TableLongEncodingWriter(uniqueValues, valuesAddedInOrder); } else if (delta != -1 && delta != Long.MAX_VALUE) { writer = new DeltaLongEncodingWriter(minVal, delta); } else { writer = new LongsLongEncodingWriter(order); } if (compression == CompressedObjectStrategy.CompressionStrategy.NONE) { delegate = new EntireLayoutLongSupplierSerializer( ioPeon, filenameBase, order, writer ); } else { delegate = new BlockLayoutLongSupplierSerializer( ioPeon, filenameBase, order, writer, compression ); } try (DataInputStream tempIn = new DataInputStream(new BufferedInputStream(ioPeon.makeInputStream(tempFile)))) { delegate.open(); int available = tempIn.available(); while (available > 0) { delegate.add(tempIn.readLong()); available -= Longs.BYTES; } } }

Target:
private void makeDelegate() throws IOException { CompressionFactory.LongEncodingWriter writer; long delta; try { delta = LongMath.checkedSubtract(maxVal, minVal); } catch (ArithmeticException e) { delta = -1; } if (uniqueValues.size() <= CompressionFactory.MAX_TABLE_SIZE) { writer = new TableLongEncodingWriter(uniqueValues, valuesAddedInOrder); } else if (delta != -1 && delta != Long.MAX_VALUE) { writer = new DeltaLongEncodingWriter(minVal, delta); } else { writer = new LongsLongEncodingWriter(order); } if (compression == CompressedObjectStrategy.CompressionStrategy.NONE) { delegate = new EntireLayoutLongSupplierSerializer( ioPeon, filenameBase, order, writer ); } else { delegate = new BlockLayoutLongSupplierSerializer( ioPeon, filenameBase, order, writer, compression ); } try (DataInputStream tempIn = new DataInputStream(new BufferedInputStream(ioPeon.makeInputStream(tempFile)))) { delegate.open(); int available = numInserted; while (available > 0) { delegate.add(tempIn.readLong()); available--; } } }
Source:
public boolean hasPermission(String sid, Permission p) { final SecurityRealm securityRealm = Jenkins.getInstance().getSecurityRealm(); final IdStrategy groupIdStrategy = securityRealm.getGroupIdStrategy(); final IdStrategy userIdStrategy = securityRealm.getUserIdStrategy(); for (; p != null; p = p.impliedBy) { if (!p.getEnabled()) { continue; } Set<String> set = grantedPermissions.get(p); if (set != null && set.contains(sid)) return true; if (set != null) { for (String s: set) { if (userIdStrategy.equals(s, sid) || groupIdStrategy.equals(s, sid)) { return true; } } } } return false; }

Target:
public boolean hasPermission(String sid, Permission p) { final SecurityRealm securityRealm = Jenkins.getActiveInstance().getSecurityRealm(); final IdStrategy groupIdStrategy = securityRealm.getGroupIdStrategy(); final IdStrategy userIdStrategy = securityRealm.getUserIdStrategy(); for (; p != null; p = p.impliedBy) { if (!p.getEnabled()) { continue; } Set<String> set = grantedPermissions.get(p); if (set != null && set.contains(sid)) return true; if (set != null) { for (String s: set) { if (userIdStrategy.equals(s, sid) || groupIdStrategy.equals(s, sid)) { return true; } } } } return false; }
Source:
void updateDataSourcesTable() { if ((null == db) || (null == sleuthKitCase)) { return ; } try { List<DataSource> dataSources = sleuthKitCase.getDataSources(); dataSources.forEach((dataSource) -> { db.insertDataSource(dataSource.getId()); }); } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Image Gallery failed to update data_sources table.", ex); } }

Target:
private void updateDataSourcesTable() { if ((null == getDatabase()) || (null == getSleuthKitCase())) { return; } try { List<DataSource> dataSources = getSleuthKitCase().getDataSources(); dataSources.forEach((dataSource) -> { getDatabase().insertDataSource(dataSource.getId()); }); } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Image Gallery failed to update data_sources table.", ex); } }
Source:
if (checkUse("use.SunJCE")) { try{ int max = Cipher.getMaxAllowedKeyLength("AES"); KeyGenerator kgen = KeyGenerator.getInstance("AES", "SunJCE"); kgen.init(256); } catch(Throwable e) { final String msg = "Error with SunJCE. Unlimited policy file not installed."; Logger.warning(NSSLoader.class, msg, e); } SunJCE = Security.getProvider("SunJCE"); }

Target:
if (checkUse("use.SunJCE")) { try{ KeyGenerator kgen = KeyGenerator.getInstance("AES", "SunJCE"); kgen.init(256); } catch(Throwable e) { Logger.warning(NSSLoader.class, "Error with SunJCE. Unlimited policy file not installed.", e); } SunJCE = Security.getProvider("SunJCE"); }
Source:
public void onSubscribe(Subscription subscription) { this.actual.onSubscribe(new Subscription() { @Override public void request(long n) { subscription.request(n); } @Override public void cancel() { terminateSpan(CancelledSubscriptionException.INSTANCE); subscription.cancel(); } }); }

Target:
public void onSubscribe(Subscription subscription) { this.actual.onSubscribe(subscription); }
Source:
public void nullToSynapseFriendlyNameThrowsException() { assertEquals("", BridgeUtils.toSynapseFriendlyName(null)); }

Target:
public void nullToSynapseFriendlyNameThrowsException() { BridgeUtils.toSynapseFriendlyName(null); }
Source:
public Map<String, Object> constructTimeframeArgs() { Map<String, Object> timeframe = null; if (start != null && end != null) { Map<String, Object> absoluteTimeframe = new HashMap<String, Object>(2); absoluteTimeframe.put(KeenQueryConstants.START, start); absoluteTimeframe.put(KeenQueryConstants.END, end); timeframe = new HashMap<String, Object>(1); timeframe.put(KeenQueryConstants.TIMEFRAME, absoluteTimeframe); return timeframe; } return timeframe; }

Target:
public Map<String, Object> constructTimeframeArgs() { Map<String, Object> timeframe = null; if (start != null && end != null) { Map<String, Object> absoluteTimeframe = new HashMap<String, Object>(3); absoluteTimeframe.put(KeenQueryConstants.START, start); absoluteTimeframe.put(KeenQueryConstants.END, end); timeframe = new HashMap<String, Object>(2); timeframe.put(KeenQueryConstants.TIMEFRAME, absoluteTimeframe); return timeframe; } return timeframe; }
Source:
private Map<String,String> splitURL(String url) throws DotDataException{ String hostId = Host.SYSTEM_HOST; int hostSplit = url.indexOf(":"); if(hostSplit != -1){ String hostName = url.substring(0, url.lastIndexOf(":")); url = url.substring(hostSplit+2); hostId = findHostId(hostName); } return map("siteId", hostId, "uri", url); }

Target:
private Map<String, String> splitURL(String url) throws DotDataException { String hostId = Host.SYSTEM_HOST; String newURL = ""; int hostSplit = url.indexOf(':'); if (hostSplit != -1) { String hostName = url.substring(0, url.lastIndexOf(':')); newURL = url.substring(hostSplit + INT_2); hostId = findHostId(hostName); } return map("siteId", hostId, "uri", newURL); }
Source:
private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property: ", NhincConstants.KEEP_ALIVE_PROP, ex); return null; } }

Target:
private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex.getLocalizedMessage()); return null; } }
Source:
private void fillTestData(TestData xml, ITDManager po) { for (String uniqueId : po.getUniqueIds()) { xml.addUniqueIds(uniqueId); } int rowCnt = 1; for (IDataSetPO row : po.getDataSets()) { TestDataRow xmlRow = xml.addNewRow(); xmlRow.setRowCount(rowCnt++); int colCnt = 1; for (int col = 0; col < row.getColumnCount(); col++) { TestDataCell xmlCell = xmlRow.addNewData(); xmlCell.setColumnCount(colCnt++); xmlCell.setValue(row.getValueAt(col)); } } }

Target:
private void fillTestData(TestData xml, ITDManager po) { for (String uniqueId : po.getUniqueIds()) { xml.addUniqueIds(uniqueId); } int rowCnt = 1; for (IDataSetPO row : po.getDataSets()) { TestDataRow xmlRow = xml.addNewRow(); xmlRow.setRowCount(rowCnt++); for (int col = 0; col < row.getColumnCount(); col++) { TestDataCell xmlCell = xmlRow.addNewData(); xmlCell.setColumnCount(col + 1); xmlCell.setValue(row.getValueAt(col)); } } }
Source:
public void getFileContentRest() throws Exception { Put.Input in = new Put.Input(); in.content = RestSession.newRawInput(CONTENT_NEW); assertEquals(204, session.putRaw(urlEditFile(), in.content).getStatusCode()); Optional<ChangeEdit> edit = editUtil.byChange(change); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( edit.get(), FILE_NAME, CONTENT_NEW2)); edit = editUtil.byChange(change); RestResponse r = session.get(urlEditFile()); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); String content = r.getEntityContent(); assertEquals(StringUtils.newStringUtf8(CONTENT_NEW2), StringUtils.newStringUtf8(Base64.decodeBase64(content))); }

Target:
public void getFileContentRest() throws Exception { Put.Input in = new Put.Input(); in.content = RestSession.newRawInput(CONTENT_NEW); assertEquals(SC_NO_CONTENT, session.putRaw(urlEditFile(), in.content).getStatusCode()); Optional<ChangeEdit> edit = editUtil.byChange(change); assertEquals(RefUpdate.Result.FORCED, modifier.modifyFile( edit.get(), FILE_NAME, CONTENT_NEW2)); edit = editUtil.byChange(change); RestResponse r = session.get(urlEditFile()); assertEquals(SC_OK, r.getStatusCode()); String content = r.getEntityContent(); assertEquals(StringUtils.newStringUtf8(CONTENT_NEW2), StringUtils.newStringUtf8(Base64.decodeBase64(content))); }
Source:
public void createDecorators(IDecoratorTarget decoratorTarget) { EditPart editPart = decoratorTarget.getAdapter(EditPart.class); if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { Object model = editPart.getModel(); if ((model instanceof View)) { View view = (View) model; if (!(view instanceof Edge) && !view.isSetElement()) { return; } } EditDomain ed = editPart.getViewer().getEditDomain(); if (!(ed instanceof DiagramEditDomain)) { return; } if (((DiagramEditDomain) ed).getEditorPart() instanceof SiriusDiagramEditor) { decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget)); } } }

Target:
public void createDecorators(IDecoratorTarget decoratorTarget) { EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class); if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) { Object model = editPart.getModel(); if ((model instanceof View)) { View view = (View) model; if (!(view instanceof Edge) && !view.isSetElement()) { return; } } EditDomain ed = editPart.getViewer().getEditDomain(); if (!(ed instanceof DiagramEditDomain)) { return; } if (((DiagramEditDomain) ed).getEditorPart() instanceof SiriusDiagramEditor) { decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget)); } } }
Source:
public CheServicesEnvironmentImpl parse(Environment environment) throws IllegalArgumentException, ServerException { checkNotNull(environment, "Environment should not be null"); EnvironmentRecipe recipe = environment.getRecipe(); checkNotNull(recipe, "Environment recipe should not be null"); checkNotNull(recipe.getType(), "Environment recipe type should not be null"); checkArgument(recipe.getContent() != null || recipe.getLocation() != null, "Recipe of environment must contain location or content"); CheServicesEnvironmentImpl cheServicesEnvironment; String envType = recipe.getType(); switch (envType) { case COMPOSE: EnvironmentRecipeParser composeParser = environmentParsers.get(COMPOSE); cheServicesEnvironment = composeParser.parse(recipe); break; case DOCKER_IMAGE: case DOCKER_FILE: cheServicesEnvironment = parseDocker(environment); break; default: throw new IllegalArgumentException(format("Environment type '%s' is not supported. " + "Supported environment types: %s", envType, Joiner.on(", ").join(envTypes))); } cheServicesEnvironment.getServices().forEach((name, service) -> { ExtendedMachine extendedMachine = environment.getMachines().get(name); if (extendedMachine != null) { normalizeMachine(name, service, extendedMachine); } }); return cheServicesEnvironment; }

Target:
public CheServicesEnvironmentImpl parse(Environment environment) throws IllegalArgumentException, ServerException { checkNotNull(environment, "Environment should not be null"); EnvironmentRecipe recipe = environment.getRecipe(); checkNotNull(recipe, "Environment recipe should not be null"); checkNotNull(recipe.getType(), "Environment recipe type should not be null"); checkArgument(recipe.getContent() != null || recipe.getLocation() != null, "Recipe of environment must contain location or content"); String envType = recipe.getType(); Set<String> envTypes = getEnvironmentTypes(); if (!envTypes.contains(envType)) { throw new IllegalArgumentException(format("Environment type '%s' is not supported. " + "Supported environment types: %s", envType, Joiner.on(", ").join(envTypes))); } TypeSpecificEnvironmentParser parser = environmentParsers.get(envType); CheServicesEnvironmentImpl cheServicesEnvironment = parser.parse(environment); cheServicesEnvironment.getServices().forEach((name, service) -> { ExtendedMachine extendedMachine = environment.getMachines().get(name); if (extendedMachine != null) { normalizeMachine(name, service, extendedMachine); } }); return cheServicesEnvironment; }
Source:
public void addQuotaPermissionSubject(List<PermissionSubject> quotaPermissionList) { if (getStoragePool() != null && getQuotaId() != null && !getStoragePool().getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED)) { VM vm = getVmDAO().get(getVmId()); if (vm != null && !getQuotaId().equals(vm.getQuotaId())) { quotaPermissionList.add(new PermissionSubject(getQuotaId(), VdcObjectType.Quota, ActionGroup.CONSUME_QUOTA)); } } }

Target:
public void addQuotaPermissionSubject(List<PermissionSubject> quotaPermissionList) { if (getStoragePool() != null && getQuotaId() != null && !getStoragePool().getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED)) { VM vm = getVm(); if (vm != null && !getQuotaId().equals(vm.getQuotaId())) { quotaPermissionList.add(new PermissionSubject(getQuotaId(), VdcObjectType.Quota, ActionGroup.CONSUME_QUOTA)); } } }
Source:
protected void updateAvatar(){ if (mUser == null || mAvatarController == null){ return; } if (Thread.currentThread() != Looper.getMainLooper().getThread()){ post(new Runnable() { @Override public void run() { updateAvatar(); } }); return; } final File avatarFile = mAvatarController.getAvatarFile(mUser.getId()); if (avatarFile.exists()){ mAvatar.setImageDrawable(Drawable.createFromPath(avatarFile.getAbsolutePath())); mAvatar.setVisibility(View.VISIBLE); mInitials.setVisibility(View.GONE); } else { String name = ""; if (mUser instanceof BoxCollaborator){ name = mUser.getName(); } else if (SdkUtils.isBlank(name) && mUser instanceof BoxUser){ name = ((BoxUser) mUser).getLogin(); } SdkUtils.setInitialsThumb(getContext(), mInitials, name); mAvatar.setVisibility(View.GONE); mInitials.setVisibility(View.VISIBLE); mAvatarDownloadTaskRef = new WeakReference<BoxFutureTask<BoxDownload>>(mAvatarController.executeAvatarDownloadRequest(mUser.getId(), this)); } }

Target:
protected void updateAvatar(){ if (mUser == null || mAvatarController == null){ return; } if (Thread.currentThread() != Looper.getMainLooper().getThread()){ post(new Runnable() { @Override public void run() { updateAvatar(); } }); return; } final File avatarFile = mAvatarController.getAvatarFile(mUser.getId()); if (avatarFile.exists()){ mAvatar.setImageDrawable(Drawable.createFromPath(avatarFile.getAbsolutePath())); mAvatar.setVisibility(View.VISIBLE); mInitials.setVisibility(View.GONE); } else { String name = DEFAULT_NAME; if (mUser instanceof BoxCollaborator){ name = mUser.getName(); } else if (SdkUtils.isBlank(name) && mUser instanceof BoxUser){ name = ((BoxUser) mUser).getLogin(); } SdkUtils.setInitialsThumb(getContext(), mInitials, name); mAvatar.setVisibility(View.GONE); mInitials.setVisibility(View.VISIBLE); mAvatarDownloadTaskRef = new WeakReference<BoxFutureTask<BoxDownload>>(mAvatarController.executeAvatarDownloadRequest(mUser.getId(), this)); } }
Source:
public void notifyEvent(ProtocolRead p_i_event) { for (IBticinoEventListener l_event_listener : m_event_listener_list) { try { l_event_listener.handleEvent(p_i_event); } catch (Exception p_ex) { logger.error("notifyEvent, Exception : " + p_ex.getMessage() + " / " + p_ex.toString() + " / " + p_i_event.toString()); } } }

Target:
public void notifyEvent(ProtocolRead p_i_event) { for (IBticinoEventListener l_event_listener : m_event_listener_list) { try { l_event_listener.handleEvent(p_i_event); } catch (Exception p_ex) { logger.warn("notifyEvent, Exception : {}", p_ex.getMessage()); } } }
Source:
protected void shutdownAndRestart(int extraneousNodePosition, boolean reverse) throws Throwable { Map<JGroupsAddress, PersistentUUID> addressMappings = createInitialCluster(); ConsistentHash oldConsistentHash = cache(0).getAdvancedCache().getDistributionManager().getConsistentHash(); cache(0).shutdown(); TestingUtil.killCacheManagers(this.cacheManagers); for (int i = 0; i < getClusterSize(); i++) { checkStateDirNotEmpty(manager(i).getCacheManagerConfiguration().globalState().persistentLocation()); } this.cacheManagers.clear(); JGroupsAddressCache.flushAddressCaches(); createStatefulCacheManagers(false, extraneousNodePosition, reverse); if(reverse) { Map<JGroupsAddress, PersistentUUID> reversed = new LinkedHashMap<>(); reverseLinkedMap(addressMappings.entrySet().iterator(), reversed); addressMappings = reversed; } switch (extraneousNodePosition) { case -1: { waitForClusterToForm(); checkClusterRestartedCorrectly(addressMappings); checkData(); ConsistentHash newConsistentHash = cache(0).getAdvancedCache().getDistributionManager().getConsistentHash(); assertTrue(isEquivalent(addressMappings, oldConsistentHash, newConsistentHash)); break; } case 0: { for(int i = 1; i < cacheManagers.size(); i++) { try { cache(i); fail("Cache with state should not have joined coordinator without state"); } catch (CacheException e) { } } break; } default: { try { cache(extraneousNodePosition); fail("Cache without state should not have joined coordinator with state"); } catch (CacheException e) { } } } }

Target:
protected void shutdownAndRestart(int extraneousNodePosition, boolean reverse) throws Throwable { Map<JGroupsAddress, PersistentUUID> addressMappings = createInitialCluster(); ConsistentHash oldConsistentHash = cache(0).getAdvancedCache().getDistributionManager().getConsistentHash(); cache(0).shutdown(); TestingUtil.killCacheManagers(this.cacheManagers); for (int i = 0; i < getClusterSize(); i++) { checkStateDirNotEmpty(manager(i).getCacheManagerConfiguration().globalState().persistentLocation()); } this.cacheManagers.clear(); createStatefulCacheManagers(false, extraneousNodePosition, reverse); if(reverse) { Map<JGroupsAddress, PersistentUUID> reversed = new LinkedHashMap<>(); reverseLinkedMap(addressMappings.entrySet().iterator(), reversed); addressMappings = reversed; } switch (extraneousNodePosition) { case -1: { waitForClusterToForm(); checkClusterRestartedCorrectly(addressMappings); checkData(); ConsistentHash newConsistentHash = cache(0).getAdvancedCache().getDistributionManager().getConsistentHash(); PersistentUUIDManager persistentUUIDManager = TestingUtil.extractGlobalComponent(manager(0), PersistentUUIDManager.class); assertTrue(isEquivalent(addressMappings, oldConsistentHash, newConsistentHash, persistentUUIDManager)); break; } case 0: { for(int i = 1; i < cacheManagers.size(); i++) { try { cache(i); fail("Cache with state should not have joined coordinator without state"); } catch (CacheException e) { } } break; } default: { try { cache(extraneousNodePosition); fail("Cache without state should not have joined coordinator with state"); } catch (CacheException e) { } } } }
Source:
public void writeParamsProps() { final String KEY1 = "key1"; final String VALUE1FIRST = "value1-preserve-this"; final String VALUE1SECOND = "value1prop"; final String KEY2 = "歌古事学週文原問業間革社。"; final String VALUE2 = "良治鮮猿性社費著併病極験。"; final Map<String, String> params = new HashMap<>(); params.put(KEY1, VALUE1FIRST); final KafkaExportParameters kafkaParams = new KafkaExportParameters(params); Properties props = new Properties(); props.put(KEY1, VALUE1SECOND); props.put(KEY2, VALUE2); kafkaParams.setProducerConfig(props); Properties propsAfter = kafkaParams.getProducerConfig(); assertEquals(props, propsAfter); assertEquals(params, params); assertEquals("Should not change identical parameters key", params.get(KEY1), VALUE1FIRST); assertEquals("Props should not have params's key", propsAfter.get(KEY1), VALUE1SECOND); assertNull("Should not have props key", params.get(KEY2)); }

Target:
public void writeParamsProps() { final String key1 = "key1"; final String value1First = "value1-preserve-this"; final String value1Second = "value1prop"; final String key2 = "歌古事学週文原問業間革社。"; final String value2 = "良治鮮猿性社費著併病極験。"; final Map<String, String> params = new HashMap<>(); params.put(key1, value1First); final KafkaExportParameters kafkaParams = new KafkaExportParameters(params); Properties props = new Properties(); props.put(key1, value1Second); props.put(key2, value2); kafkaParams.setProducerConfig(props); Properties propsAfter = kafkaParams.getProducerConfig(); assertEquals(props, propsAfter); assertEquals(params, params); assertEquals("Should change identical parameters key", params.get(key1), value1Second); assertEquals("Props should have params's key", propsAfter.get(key1), value1Second); assertNotNull("Should have props key", params.get(key2)); }
Source:
public void initialise() { sceneFinalFbo = displayResolutionDependentFBOs.get(SCENE_FINAL); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }

Target:
public void initialise() { sceneFinalFbo = displayResolutionDependentFBOs.get(FINAL_BUFFER); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }
Source:
private IResource getWorkspaceResourceFromGitPath(IPath gitPath) { Repository repository = Activator.getDefault().getRepositoryCache() .getRepository(gitPath); if (repository == null || repository.isBare()) { return null; } try { IPath repoRelativePath = gitPath.makeRelativeTo( new Path(repository.getWorkTree().getAbsolutePath())); IProject[] project = ProjectUtil.getProjectsContaining(repository, Collections.singleton(repoRelativePath.toString())); if (project != null && project.length > 0) { IPath projectRelativePath = gitPath .makeRelativeTo(project[0].getLocation()); IPath rootRelativePath = project[0].getFullPath() .append(projectRelativePath); return root.getFile(rootRelativePath); } } catch (CoreException e) { } return root.getFile(gitPath); }

Target:
private IResource getWorkspaceResourceFromGitPath(IPath gitPath) { Repository repository = Activator.getDefault().getRepositoryCache() .getRepository(gitPath); if (repository == null || repository.isBare()) { return null; } try { IPath repoRelativePath = gitPath.makeRelativeTo( new Path(repository.getWorkTree().getAbsolutePath())); IProject[] projects = ProjectUtil.getProjectsContaining(repository, Collections.singleton(repoRelativePath.toString())); if (projects.length > 0) { IPath projectRelativePath = gitPath .makeRelativeTo(projects[0].getLocation()); return projects[0].getFile(projectRelativePath); } } catch (CoreException e) { } return root.getFile(gitPath); }
Source:
private void setNavDrawerSize() { float screenPercent = getResources().getInteger(R.integer.nav_drawer_screen_size_percent) * 0.01f; int width = (int) (getScreenWidth() * screenPercent); int maxWidth = (int) dpInPx(getResources().getInteger(R.integer.nav_drawer_max_screen_size_dp)); if (width > maxWidth) { width = maxWidth; } navDrawer.getLayoutParams().width = width; }

Target:
private void setNavDrawerSize() { if (drawerToggle == null) { return; } float screenPercent = getResources().getInteger(R.integer.nav_drawer_screen_size_percent) * 0.01f; int width = (int) (getScreenWidth() * screenPercent); int maxWidth = (int) getResources().getDimension(R.dimen.nav_drawer_max_screen_size); navDrawer.getLayoutParams().width = Math.min(width, maxWidth); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) { configName = ((RemoteNode) selectedNode).getObject(); } else if (selectedNode instanceof PushNode) { configName = ((RemoteNode) selectedNode.getParent()).getObject(); } else { return null; } WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, true)); dlg.open(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) configName = ((RemoteNode) selectedNode).getObject(); else if (selectedNode instanceof PushNode) configName = ((RemoteNode) selectedNode.getParent()).getObject(); else return null; WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, true)); dlg.open(); return null; }
Source:
public Item build() { try { return item; } catch (Exception e) { return handleException(e); } }

Target:
public WorkspaceItem build() { return workspaceItem; }
Source:
static void setServerErrorCodes(ServerErrorCode[] serverErrorCodesInOrder, PartitionId partition, MockServerLayout serverLayout) { List<? extends ReplicaId> replicas = partition.getReplicaIds(); if (serverErrorCodesInOrder.length > replicas.size()) { throw new IllegalArgumentException("More server error codes provided than replicas in partition"); } int numOfNodesEachDatacenter = 3; ServerErrorCode[] serverErrorCodesInOperationTrackerOrder = new ServerErrorCode[serverErrorCodesInOrder.length]; for (int i = 0; i < numOfNodesEachDatacenter; i++) { serverErrorCodesInOperationTrackerOrder[i] = serverErrorCodesInOrder[numOfNodesEachDatacenter - 1 - i]; } for (int i = numOfNodesEachDatacenter; i < serverErrorCodesInOrder.length; i++) { serverErrorCodesInOperationTrackerOrder[i] = serverErrorCodesInOrder[serverErrorCodesInOrder.length + numOfNodesEachDatacenter - 1 - i]; } int i = 0; for (ReplicaId replica : partition.getReplicaIds()) { DataNodeId node = replica.getDataNodeId(); MockServer mockServer = serverLayout.getMockServer(node.getHostname(), node.getPort()); mockServer.setServerErrorForAllRequests(serverErrorCodesInOperationTrackerOrder[i++]); } }

Target:
static void setServerErrorCodes(ServerErrorCode[] serverErrorCodesInOrder, PartitionId partition, MockServerLayout serverLayout) { List<? extends ReplicaId> replicas = partition.getReplicaIds(); if (serverErrorCodesInOrder.length > replicas.size()) { throw new IllegalArgumentException("More server error codes provided than replicas in partition"); } int numOfNodesEachDatacenter = 3; List<ServerErrorCode> serverErrorInLocalDC = Arrays.asList(serverErrorCodesInOrder).subList(0, numOfNodesEachDatacenter); List<ServerErrorCode> serverErrorInOtherDCs = Arrays.asList(serverErrorCodesInOrder).subList(numOfNodesEachDatacenter, serverErrorCodesInOrder.length); Collections.reverse(serverErrorInLocalDC); Collections.reverse(serverErrorInOtherDCs); List<ServerErrorCode> serverErrorCodesInOperationTrackerOrder = new ArrayList<>(serverErrorInLocalDC); serverErrorCodesInOperationTrackerOrder.addAll(serverErrorInOtherDCs); for (int i = 0; i < partition.getReplicaIds().size(); i++) { DataNodeId node = partition.getReplicaIds().get(i).getDataNodeId(); MockServer mockServer = serverLayout.getMockServer(node.getHostname(), node.getPort()); mockServer.setServerErrorForAllRequests(serverErrorCodesInOperationTrackerOrder.get(i)); } }
Source:
public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType actionType, final VdcActionParametersBase parameters) { final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters); command.persistCommand(command.getParameters().getParentCommand(), true); try { return executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command); } }); } catch (RejectedExecutionException ex) { command.setCommandStatus(CommandStatus.REJECTED); cmdCallBackMap.put(command.getCommandId(), command.getCallBack() == null ? new CommandCallBack() : command.getCallBack()); return null; } }

Target:
public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType actionType, final VdcActionParametersBase parameters) { final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters); command.persistCommand(command.getParameters().getParentCommand(), true); return executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command); } }); }
Source:
protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { String type = getProfilingType(); if (ProviderLaunchConfigurationDelegate.getProviderIdToRun(type) == null) { handleFail(Messages.ProviderLaunchShortcut_0 + type); return null; } ILaunchConfiguration config = createConfiguration(bin, false); boolean exists = false; try { for (ILaunchConfiguration cfg : getLaunchManager().getLaunchConfigurations()){ if (areEqual(config, cfg)){ exists = true; } } } catch (CoreException e) { exists = true; } if (! exists) { createConfiguration(bin); } return super.findLaunchConfiguration(bin, mode); }

Target:
protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { String type = getProfilingType(); if (ProviderLaunchConfigurationDelegate.getProviderIdToRun(type) == null) { handleFail(Messages.ProviderLaunchShortcut_0 + " " + type); return null; } ILaunchConfiguration config = createConfiguration(bin, false); boolean exists = false; try { for (ILaunchConfiguration cfg : getLaunchManager().getLaunchConfigurations()){ if (areEqual(config, cfg)){ exists = true; } } } catch (CoreException e) { exists = true; } if (! exists) { createConfiguration(bin); } return super.findLaunchConfiguration(bin, mode); }