auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testFindPostCommitHook() throws Exception { assumeSupportedPlatform(); assertNull("no hook should be installed", FS.DETECTED.findHook(db, PostCommitHook.NAME)); File hookFile = writeHookFile(PostCommitHook.NAME, "#!/bin/bash\necho \"test $1 $2\""); assertEquals("expected to find pre-commit hook", hookFile, FS.DETECTED.findHook(db, PostCommitHook.NAME)); }

Target:
public void testFindPostCommitHook() throws Exception { assumeSupportedPlatform(); assertNull("no hook should be installed", FS.DETECTED.findHook(db, PostCommitHook.NAME)); File hookFile = writeHookFile(PostCommitHook.NAME, "#!/bin/bash\necho \"test $1 $2\""); assertEquals("expected to find post-commit hook", hookFile, FS.DETECTED.findHook(db, PostCommitHook.NAME)); }
Source:
public static List<IStorageModel> getDataStorageModels() { ArrayList<IStorageModel> models = new ArrayList<IStorageModel>(); NfsStorageModel nfsDataModel = new NfsStorageModel(); nfsDataModel.setRole(StorageDomainType.Data); models.add(nfsDataModel); IscsiStorageModel iscsiDataModel = new IscsiStorageModel(); iscsiDataModel.setRole(StorageDomainType.Data); iscsiDataModel.setIsGrouppedByTarget(true); models.add(iscsiDataModel); FcpStorageModel fcpDataModel = new FcpStorageModel(); fcpDataModel.setRole(StorageDomainType.Data); models.add(fcpDataModel); PosixStorageModel posixDataModel = new PosixStorageModel(); posixDataModel.setRole(StorageDomainType.Data); models.add(posixDataModel); GlusterStorageModel GlusterDataModel = new GlusterStorageModel(); GlusterDataModel.setRole(StorageDomainType.Data); models.add(GlusterDataModel); LocalStorageModel localDataModel = new LocalStorageModel(); localDataModel.setRole(StorageDomainType.Data); models.add(localDataModel); return models; }

Target:
public static List<IStorageModel> getDataStorageModels() { ArrayList<IStorageModel> models = new ArrayList<IStorageModel>(); NfsStorageModel nfsDataModel = new NfsStorageModel(); models.add(nfsDataModel); PosixStorageModel posixDataModel = new PosixStorageModel(); models.add(posixDataModel); GlusterStorageModel GlusterDataModel = new GlusterStorageModel(); models.add(GlusterDataModel); IscsiStorageModel iscsiDataModel = new IscsiStorageModel(); iscsiDataModel.setIsGrouppedByTarget(true); models.add(iscsiDataModel); FcpStorageModel fcpDataModel = new FcpStorageModel(); models.add(fcpDataModel); LocalStorageModel localDataModel = new LocalStorageModel(); models.add(localDataModel); for (IStorageModel model : models) { model.setRole(StorageDomainType.Data); } return models; }
Source:
public void collectLogs(DockerCompose dockerCompose) throws IOException, InterruptedException { dockerCompose.ps().stream() .map(ContainerName::semanticName) .forEachOrdered(container -> executor.execute(() -> { File outputFile = new File(logDirectory, container + ".log"); log.info("Writing logs for container '{}' to '{}'", container, outputFile.getAbsolutePath()); try (FileOutputStream outputStream = new FileOutputStream(outputFile)) { dockerCompose.writeLogs(container, outputStream); } catch (IOException e) { throw new SafeRuntimeException("Error reading log", e); } })); }

Target:
public void collectLogs(DockerCompose dockerCompose) throws IOException, InterruptedException { dockerCompose.ps().stream() .map(ContainerName::semanticName) .forEachOrdered(container -> executor.execute(() -> { File outputFile = new File(logDirectory, container + ".log"); log.info("Writing logs for container '{}' to '{}'", container, outputFile.getAbsolutePath()); try (FileOutputStream outputStream = new FileOutputStream(outputFile)) { dockerCompose.writeLogs(container, outputStream); } catch (IOException e) { throw new SafeRuntimeException("Error writing log", e); } })); }
Source:
ForControlFlow(CommandContext ctx, String varName, String iterable) throws CommandLineException { if (varName == null) { throw new IllegalArgumentException("Variable is null"); } if (iterable == null) { throw new IllegalArgumentException("Iterable is null"); } if (ctx.getVariable(varName) != null) { throw new CommandFormatException("Variable " + varName + " already exists."); } final ModelControllerClient client = ctx.getModelControllerClient(); if (client == null) { throw new CommandLineException("The connection to the controller has not been established."); } this.varName = varName; ModelNode forRequest = ctx.buildRequest(iterable); ModelNode targetValue; try { targetValue = ctx.execute(forRequest, "for iterable"); } catch (IOException e) { throw new CommandLineException("iterable request failed", e); } if (!targetValue.hasDefined(Util.RESULT)) { throw new CommandLineException("iterable request failed, no result"); } ModelNode mn = targetValue.get(Util.RESULT); try { result = mn.asList(); } catch (Exception ex) { throw new CommandLineException("for cannot be used with operations producing non iterable result"); } ctx.setVariable(varName, "null"); ctx.set(Scope.CONTEXT, CTX_KEY, this); }

Target:
ForControlFlow(CommandContext ctx, String varName, String iterable) throws CommandLineException { if (varName == null) { throw new IllegalArgumentException("Variable is null"); } if (iterable == null) { throw new IllegalArgumentException("Iterable is null"); } if (ctx.getVariable(varName) != null) { throw new CommandFormatException("Variable " + varName + " already exists."); } final ModelControllerClient client = ctx.getModelControllerClient(); if (client == null) { throw new CommandLineException("The connection to the controller has not been established."); } this.varName = varName; ModelNode forRequest = ctx.buildRequest(iterable); ModelNode targetValue; try { targetValue = ctx.execute(forRequest, "for iterable"); } catch (IOException e) { throw new CommandLineException("iterable request failed", e); } if (!targetValue.hasDefined(Util.RESULT)) { throw new CommandLineException("iterable request failed, no result"); } ModelNode mn = targetValue.get(Util.RESULT); try { result = mn.asList(); } catch (Exception ex) { throw new CommandLineException("for cannot be used with operations that produce a non-iterable result"); } ctx.setVariable(varName, "null"); ctx.set(Scope.CONTEXT, CTX_KEY, this); }
Source:
private ZapMenuItem getMenuImportLocalWSDL() { if (menuImportLocalWSDL == null) { menuImportLocalWSDL = new ZapMenuItem( "soap.topmenu.import.importWSDL", getView() .getMenuShortcutKeyStroke( KeyEvent.VK_I, KeyEvent.SHIFT_DOWN_MASK, false)); menuImportLocalWSDL.setToolTipText( Constant.messages.getString("soap.topmenu.import.importWSDL.tooltip")); menuImportLocalWSDL.addActionListener( (java.awt.event.ActionEvent e) -> { final JFileChooser chooser = new JFileChooser( Model.getSingleton().getOptionsParam().getUserDirectory()); FileNameExtensionFilter filter = new FileNameExtensionFilter( Constant.messages.getString( "soap.topmenu.import.importWSDL.filter.description"), "wsdl"); chooser.setFileFilter(filter); int rc = chooser.showOpenDialog(View.getSingleton().getMainFrame()); if (rc == JFileChooser.APPROVE_OPTION) { fileUrlWSDLImport(chooser.getSelectedFile()); } }); } return menuImportLocalWSDL; }

Target:
private ZapMenuItem getMenuImportLocalWSDL() { if (menuImportLocalWSDL == null) { menuImportLocalWSDL = new ZapMenuItem( "soap.topmenu.import.importWSDL", getView() .getMenuShortcutKeyStroke( KeyEvent.VK_I, KeyEvent.SHIFT_DOWN_MASK, false)); menuImportLocalWSDL.setToolTipText( Constant.messages.getString("soap.topmenu.import.importWSDL.tooltip")); menuImportLocalWSDL.addActionListener( e -> { final JFileChooser chooser = new JFileChooser( Model.getSingleton().getOptionsParam().getUserDirectory()); FileNameExtensionFilter filter = new FileNameExtensionFilter( Constant.messages.getString( "soap.topmenu.import.importWSDL.filter.description"), "wsdl"); chooser.setFileFilter(filter); int rc = chooser.showOpenDialog(View.getSingleton().getMainFrame()); if (rc == JFileChooser.APPROVE_OPTION) { fileUrlWSDLImport(chooser.getSelectedFile()); } }); } return menuImportLocalWSDL; }
Source:
private void removeCloudReplica(String partitionName) throws ReplicationException { if (!localPartitionNameToPartition.containsKey(partitionName)) { logger.error("Got partition standby notification for partition that is not present on the node", partitionName); return; } PartitionId partitionId = localPartitionNameToPartition.get(partitionName); PartitionInfo partitionInfo = partitionToPartitionInfo.remove(partitionId); if (partitionInfo == null) { logger.error("Partition not exist when remove from {}. ", partitionId, dataNodeId); throw new ReplicationException("Partition not found"); } removeRemoteReplicaInfoFromReplicaThread(partitionInfo.getRemoteReplicaInfos()); if (replicationConfig.replicationPersistTokenOnShutdownOrReplicaRemove) { try { persistor.write(partitionInfo.getLocalReplicaId().getMountPath(), false); } catch (IOException | ReplicationException e) { logger.error("Exception on token write when remove Partition from {}: ", partitionId, dataNodeId, e); throw new ReplicationException("Exception on token write."); } } logger.info("Cloud Partition removed from {}", partitionId, dataNodeId); }

Target:
private void removeCloudReplica(String partitionName) { if (!localPartitionNameToPartition.containsKey(partitionName)) { logger.warn("Got partition standby notification for partition that is not present on the node", partitionName); return; } PartitionId partitionId = localPartitionNameToPartition.get(partitionName); stopPartitionReplication(partitionId); logger.info("Cloud Partition removed from {}", partitionId, dataNodeId); }
Source:
private LookupExtractionFn ensureDelegate() { LookupExtractionFn delegate = delegateRef.get(); if (null == delegate) { synchronized (delegateRef) { delegate = delegateRef.get(); if (null == delegate) { delegate = new LookupExtractionFn( Preconditions.checkNotNull(manager.get(getLookup()), "Lookup [%s] not found", getLookup()).get(), isRetainMissingValue(), getReplaceMissingValueWith(), isInjective(), isOptimize() ); delegateRef.set(delegate); } } } return delegate; }

Target:
private LookupExtractionFn ensureDelegate() { if (null == delegate) { synchronized (delegateLock) { if (null == delegate) { delegate = new LookupExtractionFn( Preconditions.checkNotNull(manager.get(getLookup()), "Lookup [%s] not found", getLookup()).get(), isRetainMissingValue(), getReplaceMissingValueWith(), isInjective(), isOptimize() ); } } } return delegate; }
Source:
public void testCollect_oneDevice() { HashMap<String, Metric> metrics = new HashMap<>(); mCollector.testStarted(mTest); mCollector.testEnded(mTest, metrics); verify(mMockReceiver).start(); verify(mMockReceiver).stop(); assertEquals(2, metrics.size()); assertTrue(metrics.containsKey("metric1")); Metric metric1 = metrics.get("metric1"); assertEquals(1, (long) metric1.getMeasurements().getDoubleValues().getDoubleValue(0)); assertTrue(metrics.containsKey("metric2")); Metric metric2 = metrics.get("metric2"); List<Double> values = metric2.getMeasurements().getDoubleValues().getDoubleValueList(); assertEquals(2, values.size()); assertEquals(1, values.get(0).longValue()); assertEquals(2, values.get(1).longValue()); }

Target:
public void testCollect_oneDevice() { HashMap<String, Metric> metrics = new HashMap<>(); mCollector.testRunStarted(RUN_NAME, 1); mCollector.testStarted(mTest); mCollector.testEnded(mTest, metrics); mCollector.testRunEnded(0, metrics); verify(mMockReceiver).start(); verify(mMockReceiver).stop(); verify(mMockReceiver).clear(); assertEquals(2, metrics.size()); assertTrue(metrics.containsKey("metric1")); Metric metric1 = metrics.get("metric1"); assertEquals(1, (long) metric1.getMeasurements().getDoubleValues().getDoubleValue(0)); assertTrue(metrics.containsKey("metric2")); Metric metric2 = metrics.get("metric2"); List<Double> values = metric2.getMeasurements().getDoubleValues().getDoubleValueList(); assertEquals(2, values.size()); assertEquals(1, values.get(0).longValue()); assertEquals(2, values.get(1).longValue()); }
Source:
public static ArrayList<String> runNative(String cmdToRun) { Process p = null; try { p = Runtime.getRuntime().exec(cmdToRun); } catch (IOException e) { return null; } BufferedReader reader = new BufferedReader(new InputStreamReader( p.getInputStream())); String line = ""; ArrayList<String> sa = new ArrayList<String>(); try { while ((line = reader.readLine()) != null) { sa.add(line); } } catch (IOException e) { return null; } p.destroy(); return sa; }

Target:
public static ArrayList<String> runNative(String cmdToRun) { Process p = null; try { p = Runtime.getRuntime().exec(cmdToRun); p.waitFor(); } catch (IOException e) { return null; } catch (InterruptedException e) { return null; } BufferedReader reader = new BufferedReader(new InputStreamReader( p.getInputStream())); String line = ""; ArrayList<String> sa = new ArrayList<String>(); try { while ((line = reader.readLine()) != null) { sa.add(line); } } catch (IOException e) { return null; } return sa; }
Source:
public void saveFieldmapProperties(final List<FieldMapInfo> infos) throws MiddlewareQueryException { for (final FieldMapInfo info : infos) { for (final FieldMapDatasetInfo dataset : info.getDatasets()) { for (final FieldMapTrialInstanceInfo trial : dataset.getTrialInstances()) { int locationId = trial.getInstanceId(); if (trial.getInstanceId() != null && trial.getInstanceId().intValue() == 1) { locationId = this.getExperimentModelSaver().moveStudyToNewGeolocation(info.getFieldbookId()); this.saveOrUpdate(locationId, TermId.LOCATION_ID.getId(), trial.getLocationId().toString()); } if (trial.getBlockId() != null) { this.saveOrUpdate(locationId, TermId.BLOCK_ID.getId(), trial.getBlockId().toString()); } } } } }

Target:
public void saveFieldmapProperties(final List<FieldMapInfo> infos) throws MiddlewareQueryException { for (final FieldMapInfo info : infos) { for (final FieldMapDatasetInfo dataset : info.getDatasets()) { for (final FieldMapTrialInstanceInfo trial : dataset.getTrialInstances()) { int locationId = trial.getInstanceId(); if (trial.getInstanceId() != null && trial.getInstanceId().intValue() == 1) { locationId = this.getExperimentModelSaver().moveStudyToNewGeolocation(info.getFieldbookId()); if (trial.getLocationId() != null) { this.saveOrUpdate(locationId, TermId.LOCATION_ID.getId(), trial.getLocationId().toString()); } } if (trial.getBlockId() != null) { this.saveOrUpdate(locationId, TermId.BLOCK_ID.getId(), trial.getBlockId().toString()); } } } } }
Source:
public SimplePromise<Patient> registerPatient(final Patient patient, @Nullable final DefaultResponseCallbackListener callbackListener) { patientDao.savePatient(patient).subscribe(); if (callbackListener != null) { return syncPatient(patient, callbackListener); } else { return syncPatient(patient); } }

Target:
public void registerPatient(final Patient patient, @Nullable final DefaultResponseCallbackListener callbackListener) { patientDao.savePatient(patient) .observeOn(AndroidSchedulers.mainThread()) .subscribe(id -> { if (callbackListener != null) { syncPatient(patient, callbackListener); } else { syncPatient(patient); } }); }
Source:
public Builder autoPersist(boolean autoPersist) { this.autoPersist = autoPersist; return this; }

Target:
public Builder<T> autoPersist(boolean autoPersist) { this.autoPersist = autoPersist; return this; }
Source:
private int getUnionSchema(Object instanceValue, Schema unionSchema) { int unionSchemaPos = 0; for (Schema currentSchema : unionSchema.getTypes()) { Schema.Type schemaType = currentSchema.getType(); if (instanceValue instanceof CharSequence && schemaType.equals(Schema.Type.STRING)) return unionSchemaPos; else if (instanceValue instanceof ByteBuffer && schemaType.equals(Schema.Type.BYTES)) return unionSchemaPos; else if (instanceValue instanceof byte[] && schemaType.equals(Schema.Type.BYTES)) return unionSchemaPos; else if (instanceValue instanceof Integer && schemaType.equals(Schema.Type.INT)) return unionSchemaPos; else if (instanceValue instanceof Long && schemaType.equals(Schema.Type.LONG)) return unionSchemaPos; else if (instanceValue instanceof Double && schemaType.equals(Schema.Type.DOUBLE)) return unionSchemaPos; else if (instanceValue instanceof Float && schemaType.equals(Schema.Type.FLOAT)) return unionSchemaPos; else if (instanceValue instanceof Boolean && schemaType.equals(Schema.Type.BOOLEAN)) return unionSchemaPos; else if (instanceValue instanceof Map && schemaType.equals(Schema.Type.MAP)) return unionSchemaPos; else if (instanceValue instanceof List && schemaType.equals(Schema.Type.ARRAY)) return unionSchemaPos; else if (instanceValue instanceof Persistent && schemaType.equals(Schema.Type.RECORD)) return unionSchemaPos; unionSchemaPos++; } return 0; }

Target:
private int getUnionSchema(Object instanceValue, Schema unionSchema) { int unionSchemaPos = 0; for (Schema currentSchema : unionSchema.getTypes()) { Schema.Type schemaType = currentSchema.getType(); if (instanceValue instanceof CharSequence && schemaType.equals(Schema.Type.STRING)) { return unionSchemaPos; } if (instanceValue instanceof ByteBuffer && schemaType.equals(Schema.Type.BYTES)) { return unionSchemaPos; } if (instanceValue instanceof byte[] && schemaType.equals(Schema.Type.BYTES)) { return unionSchemaPos; } if (instanceValue instanceof Integer && schemaType.equals(Schema.Type.INT)) { return unionSchemaPos; } if (instanceValue instanceof Long && schemaType.equals(Schema.Type.LONG)) { return unionSchemaPos; } if (instanceValue instanceof Double && schemaType.equals(Schema.Type.DOUBLE)) { return unionSchemaPos; } if (instanceValue instanceof Float && schemaType.equals(Schema.Type.FLOAT)) { return unionSchemaPos; } if (instanceValue instanceof Boolean && schemaType.equals(Schema.Type.BOOLEAN)) { return unionSchemaPos; } if (instanceValue instanceof Map && schemaType.equals(Schema.Type.MAP)) { return unionSchemaPos; } if (instanceValue instanceof List && schemaType.equals(Schema.Type.ARRAY)) { return unionSchemaPos; } if (instanceValue instanceof Persistent && schemaType.equals(Schema.Type.RECORD)) { return unionSchemaPos; } unionSchemaPos++; } return 0; }
Source:
public void testBadHost() throws InterruptedException { CachingConnectionFactory cf = new CachingConnectionFactory("this.host.does.not.exist"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("client-"); executor.afterPropertiesSet(); cf.setExecutor(executor); DirectMessageListenerContainer container = new DirectMessageListenerContainer(cf); container.setQueueNames("dummy"); container.setConsumersPerQueue(2); container.setMessageListener(in -> { }); container.setBeanName("simple"); container.setConsumerTagStrategy(new Tag()); CountDownLatch latch = new CountDownLatch(1); container.setApplicationEventPublisher(ev -> { if (ev instanceof ListenerContainerConsumerFailedEvent) { latch.countDown(); } }); container.setRecoveryInterval(100); container.afterPropertiesSet(); container.start(); assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); container.stop(); }

Target:
public void testBadHost() throws InterruptedException { CachingConnectionFactory cf = new CachingConnectionFactory("this.host.does.not.exist"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("client-"); executor.afterPropertiesSet(); cf.setExecutor(executor); DirectMessageListenerContainer container = new DirectMessageListenerContainer(cf); container.setQueueNames("dummy"); container.setConsumersPerQueue(2); container.setMessageListener(in -> { }); container.setBeanName("badHost"); container.setConsumerTagStrategy(new Tag()); CountDownLatch latch = new CountDownLatch(1); container.setApplicationEventPublisher(ev -> { if (ev instanceof ListenerContainerConsumerFailedEvent) { latch.countDown(); } }); container.setRecoveryInterval(100); container.afterPropertiesSet(); container.start(); assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); container.stop(); cf.destroy(); executor.destroy(); }
Source:
public static void schedule(String thingUID, AstroThingHandler astroHandler, Job job, Calendar eventAt) { try { Calendar today = Calendar.getInstance(); if (isSameDay(eventAt, today) && isTimeGreaterEquals(eventAt, today)) { ExpressionThreadPoolExecutor executor = astroHandler.getScheduler(); if (executor != null) { Expression cron = new CronExpression(createCronFromCalendar(eventAt)); executor.schedule(job, cron); astroHandler.addJobToQueue(job); String formattedDate = ISO_DATETIME_FORMAT.format(eventAt); logger.debug("Scheduled Astro Job for thing at {}", thingUID, formattedDate); } } } catch (Exception ex) { logger.error("{}", ex.getMessage(), ex); } }

Target:
public static void schedule(String thingUID, AstroThingHandler astroHandler, Job job, Calendar eventAt) { try { Calendar today = Calendar.getInstance(); if (isSameDay(eventAt, today) && isTimeGreaterEquals(eventAt, today)) { ExpressionThreadPoolExecutor executor = astroHandler.getScheduler(); if (executor != null) { Expression cron = new CronExpression(createCronFromCalendar(eventAt)); if (astroHandler.addJobToQueue(job)) { executor.schedule(job, cron); } String formattedDate = ISO_DATETIME_FORMAT.format(eventAt); logger.debug("Scheduled Astro Job for thing at {}", thingUID, formattedDate); } } } catch (Exception ex) { logger.error("{}", ex.getMessage(), ex); } }
Source:
void inPool(CassandraClientPool cassandraClientPool) { CassandraClientPoolingContainer container = mock(CassandraClientPoolingContainer.class); when(container.getHost()).thenReturn(address); try { OngoingStubbing<Object> stubbing = when(container.runWithPooledResource( Mockito.<FunctionCheckedException<CassandraClient, Object, Exception>>any())); for (Exception ex : exceptions) { stubbing = stubbing.thenThrow(ex); } if (returnsValue) { stubbing.thenReturn("Response"); } } catch (Exception ex) { Throwables.throwIfUnchecked(ex); } cassandraClientPool.getCurrentPools().put(address, container); }

Target:
void inPool(CassandraClientPool cassandraClientPool) { CassandraClientPoolingContainer container = mock(CassandraClientPoolingContainer.class); when(container.getHost()).thenReturn(address); try { OngoingStubbing<Object> stubbing = when(container.runWithPooledResource( Mockito.<FunctionCheckedException<CassandraClient, Object, Exception>>any())); for (Exception ex : exceptions) { stubbing = stubbing.thenThrow(ex); } if (returnsValue) { stubbing.thenReturn("Response"); } } catch (Exception ex) { throw new RuntimeException(ex); } cassandraClientPool.getCurrentPools().put(address, container); }
Source:
public final void onSuccess(Object message) { Result result = Result.EMPTY_RESULT; try { if (message instanceof Result) { result = (Result) message; } } catch (Throwable throwable) { onFailure(throwable); return; } resultsArray[index] = result; resultFuture.set(result); if (callback != null) { try { callback.update(NO_REGION, row.getRow(), (T) result); } catch (Throwable t) { LOG.error("User callback threw an exception for " + Bytes.toString(result.getRow())); } } }

Target:
public final void onSuccess(Object message) { final Result result; if (message instanceof Result) { result = (Result) message; } else { result = Result.EMPTY_RESULT; } resultsArray[index] = result; resultFuture.set(result); if (callback != null) { try { callback.update(NO_REGION, row.getRow(), (T) result); } catch (Throwable t) { LOG.error("User callback threw an exception for " + Bytes.toString(result.getRow())); } } }
Source:
public static Test suite() throws Exception { final SftpProviderTestSuite suite = new SftpProviderTestSuite(new SftpProviderClosedExecChannelTestCase()); suite.addTests(PermissionsTests.class); return suite; }

Target:
public static Test suite() throws Exception { final SftpProviderTestSuite suite = new SftpProviderTestSuite(new SftpProviderClosedExecChannelTestCase()){ @Override protected void addBaseTests() throws Exception { addTests(ProviderReadTests.class); addTests(ProviderWriteTests.class); addTests(ProviderDeleteTests.class); addTests(ProviderRenameTests.class); addTests(NamingTests.class); addTests(PermissionsTests.class); } }; return suite; }
Source:
public View addViewModel(int layoutResID, ViewModel viewModel, String id) { if (getBoundActivity() == null) { throw new RuntimeException("Bound Activity is null!"); } if (viewModel == null) { throw new RuntimeException("viewModel is null!"); } if (mViewModels == null) { mViewModels = new HashMap<>(); } if (mViewModels.values().contains(viewModel)) { throw new RuntimeException("cannot add same instance of viewModel twice!"); } if (viewModel instanceof INeedsActivity) { ((INeedsActivity) viewModel).setParentActivity(new WeakReference<>(getBoundActivity())); } if (viewModel instanceof INeedsFragmentManager) { ((INeedsFragmentManager) viewModel).setFragmentManager(getBoundActivity().getFragmentManager()); } viewModel.setLogger(getLogger()); mViewModels.put(id, viewModel); View view = getViewBinder().inflate(getBoundActivity(), viewModel, layoutResID, null); if (isShouldCallCreate()) { onCreate(mCreateBundle); } return view; }

Target:
public View addViewModel(int layoutResID, ViewModel viewModel, String id) { if (getBoundActivity() == null) { throw new RuntimeException("Bound Activity is null!"); } if (viewModel == null) { throw new RuntimeException("viewModel is null!"); } if (mViewModels == null) { mViewModels = new HashMap<>(); } if (mViewModels.values().contains(viewModel)) { throw new RuntimeException("cannot add same instance of viewModel twice!"); } if (viewModel instanceof INeedsActivity) { ((INeedsActivity) viewModel).setParentActivity(getBoundActivity()); } if (viewModel instanceof INeedsFragmentManager) { ((INeedsFragmentManager) viewModel).setFragmentManager(getBoundActivity().getFragmentManager()); } viewModel.setLogger(getLogger()); mViewModels.put(id, viewModel); View view = getViewBinder().inflate(getBoundActivity(), viewModel, layoutResID, null); if (isShouldCallCreate()) { onCreate(mCreateBundle); } return view; }
Source:
public AboutDialogE4(final Shell parentShell) { super(parentShell); product = Platform.getProduct(); if (product != null) { productName = product.getName(); } if (productName == null) { productName = E4DialogMessages.AboutDialog_defaultProductName; } }

Target:
public AboutDialogE4(final Shell parentShell) { super(parentShell); product = new ProductInformation(Platform.getProduct()); }
Source:
public ModelServiceImpl(IEclipseContext appContext) { if (appContext == null) { throw new NullPointerException("No application context given!"); } this.appContext = appContext; IEventBroker eventBroker = appContext.get(IEventBroker.class); if (eventBroker == null) { StringBuilder msg = new StringBuilder(); msg.append("Could not retrieve event broker!"); Bundle bundle = Platform.getBundle("org.eclipse.equinox.event"); if (bundle == null) { msg.append(" Bundle 'org.eclipse.equinox.event' is missing. Please check your configuration."); } else if (bundle.getState() != Bundle.ACTIVE) { msg.append(" Bundle 'org.eclipse.equinox.event' is not active. Please check your configuration."); } throw new IllegalStateException(msg.toString()); } eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, hostedElementHandler); mApplicationElementFactory = new GenericMApplicationElementFactoryImpl( appContext.get(IExtensionRegistry.class)); }

Target:
public ModelServiceImpl(IEclipseContext appContext) { if (appContext == null) { throw new NullPointerException("No application context given!"); } this.appContext = appContext; IEventBroker eventBroker = appContext.get(IEventBroker.class); if (eventBroker == null) { throw new IllegalStateException( "Could not get an IEventBroker instance. Please check your configuration that a providing bundle is present and active."); } eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, hostedElementHandler); mApplicationElementFactory = new GenericMApplicationElementFactoryImpl( appContext.get(IExtensionRegistry.class)); }
Source:
private String createResults() { QueryResults queryResults = new QueryResults( "20160128_214710_00012_rk68b", server.url("query.html?20160128_214710_00012_rk68b").uri(), null, null, ImmutableList.of(new Column("_col0", BigintType.BIGINT)), ImmutableList.of(ImmutableList.of(123)), StatementStats.builder().setState("FINISHED").build(), null, null, null); return QUERY_RESULTS_CODEC.toJson(queryResults); }

Target:
private String createResults() { QueryResults queryResults = new QueryResults( "20160128_214710_00012_rk68b", server.url("/query.html?20160128_214710_00012_rk68b").uri(), null, null, ImmutableList.of(new Column("_col0", BigintType.BIGINT)), ImmutableList.of(ImmutableList.of(123)), StatementStats.builder().setState("FINISHED").build(), null, null, null); return QUERY_RESULTS_CODEC.toJson(queryResults); }
Source:
public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType actionType, final VdcActionParametersBase parameters, final CommandContext cmdContext) { final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters, cmdContext); command.persistCommand(command.getParameters().getParentCommand(), cmdContext, true); CommandCallBack callBack = command.getCallBack(); if (callBack != null) { cmdCallBackMap.put(command.getCommandId(), callBack); } Future<VdcReturnValueBase> future = null; try { future = executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command, cmdContext); } }); } catch(RejectedExecutionException ex) { command.setCommandStatus(CommandStatus.FAILED); } return future; }

Target:
public Guid executeAsyncCommand(final VdcActionType actionType, final VdcActionParametersBase parameters, final CommandContext cmdContext) { final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters, cmdContext); command.persistCommand(command.getParameters().getParentCommand(), cmdContext, true); CommandCallBack callBack = command.getCallBack(); if (callBack != null) { cmdCallBackMap.put(command.getCommandId(), callBack); } try { executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command, cmdContext); } }); } catch(RejectedExecutionException ex) { command.setCommandStatus(CommandStatus.FAILED); } return command.getCommandId(); }
Source:
public Object[] getElements(Object inputElement) { Set<RepositoryTreeNode> output = new HashSet<RepositoryTreeNode>(); for (Repository repo : ((List<Repository>) inputElement)) { output.add(new RepositoryTreeNode<Repository>(null, RepositoryTreeNodeType.REPO, repo, repo)); } return output.toArray(); }

Target:
public Object[] getElements(Object inputElement) { Comparator<RepositoryTreeNode<Repository>> sorter = new Comparator<RepositoryTreeNode<Repository>>() { public int compare(RepositoryTreeNode<Repository> o1, RepositoryTreeNode<Repository> o2) { return getRepositoryName(o1.getObject()).compareTo( getRepositoryName(o2.getObject())); } }; Set<RepositoryTreeNode<Repository>> output = new TreeSet<RepositoryTreeNode<Repository>>( sorter); for (Repository repo : ((List<Repository>) inputElement)) { output.add(new RepositoryTreeNode<Repository>(null, RepositoryTreeNodeType.REPO, repo, repo)); } return output.toArray(); }
Source:
public AsyncContext startAsync() throws IllegalStateException { if (_asyncNotSupportedSource != null) throw new IllegalStateException("!asyncSupported: " + _asyncNotSupportedSource); HttpChannelState state = getHttpChannelState(); if (_async == null) _async = new AsyncContextState(state); AsyncContextEvent event = new AsyncContextEvent(_context, _async, state, this, this, getResponse(), false); state.startAsync(event); return _async; }

Target:
public AsyncContext startAsync() throws IllegalStateException { if (_asyncNotSupportedSource != null) throw new IllegalStateException("!asyncSupported: " + _asyncNotSupportedSource); HttpChannelState state = getHttpChannelState(); if (_async == null) _async = new AsyncContextState(state); AsyncContextEvent event = new AsyncContextEvent(_context, _async, state, this, this, getResponse()); state.startAsync(event); return _async; }
Source:
public void kill(DataSegment segment) throws SegmentLoadingException { final File path = getDirectory(segment); try { if (path.getName().endsWith(".zip")) { File partitionNumDir = path.getParentFile(); FileUtils.deleteDirectory(partitionNumDir); File versionDir = partitionNumDir.getParentFile(); if (versionDir.delete()) { File intervalDir = versionDir.getParentFile(); if (intervalDir.delete()) { File dataSourceDir = intervalDir.getParentFile(); dataSourceDir.delete(); } } } else { throw new SegmentLoadingException("Unknown file type[%s]", path); } } catch (IOException e) { throw new SegmentLoadingException(e, "Unable to kill segment"); } }

Target:
public void kill(DataSegment segment) throws SegmentLoadingException { final File path = getPath(segment); log.info("killing segment[%s] mapped to path[%s]", segment.getIdentifier(), path); try { if (path.getName().endsWith(".zip")) { File partitionNumDir = path.getParentFile(); FileUtils.deleteDirectory(partitionNumDir); File versionDir = partitionNumDir.getParentFile(); if (versionDir.delete()) { File intervalDir = versionDir.getParentFile(); if (intervalDir.delete()) { File dataSourceDir = intervalDir.getParentFile(); dataSourceDir.delete(); } } } else { throw new SegmentLoadingException("Unknown file type[%s]", path); } } catch (IOException e) { throw new SegmentLoadingException(e, "Unable to kill segment"); } }
Source:
public static boolean waitForJobComplete( final Ds3Client client, final UUID jobId) throws InterruptedException, IOException { int retries = 0; final int max_retries = 12; while (JobStatus.IN_PROGRESS == client.getJobSpectraS3(new GetJobSpectraS3Request(jobId)).getMasterObjectListResult().getStatus()) { LOG.info("Sleeping 5 minutes while waiting for job to finish..."); sleep(300 * 1000); if (++retries > max_retries) { return false; } } return true; }

Target:
public static boolean waitForJobComplete( final Ds3Client client, final UUID jobId) throws Exception { final String getJobCmd = "--http --output-format json -c get_job -i " + jobId.toString(); final int maxRetries = 512; final int pollingInterval = 5 * 60 * 1000; final Predicate<String> predicate = new Predicate<String>() { @Override public boolean apply(@Nullable final String input) { return input.contains("\"status\" : \"COMPLETED\""); } }; return waitForMessage(client, getJobCmd, predicate, maxRetries, pollingInterval); }
Source:
public void onSceneRemoved(InternalScene scene) { scene = null; if (this.getThing().getStatus().equals(ThingStatus.ONLINE)) { updateStatus(ThingStatus.OFFLINE); } logger.debug("Set status on {}", getThing().getStatus()); }

Target:
public void onSceneRemoved(InternalScene scene) { scene = null; updateStatus(ThingStatus.OFFLINE); logger.debug("Set status on {}", getThing().getStatus()); }
Source:
public void isAliveShouldReturnTrueWhenRemoteRepositoryCachedValueIsTrue() { RemoteRepository remoteRepository = createMockedRemoteRepository(); initializeCache(true); boolean alive = remoteRepositoryAlivenessCacheManager.isAlive(remoteRepository); assertTrue(alive); }

Target:
public void isAliveShouldReturnTrueWhenRemoteRepositoryCachedValueIsTrue() { initializeCache(true); boolean alive = remoteRepositoryAlivenessCacheManager.isAlive(remoteRepository); assertThat(alive).isTrue(); }
Source:
public void testReestablishConnectionWithNewAM() throws InterruptedException { this.containerHeartbeatMonitor = spy(new ContainerHeartbeatMonitor(this.onExpired, this.containerHeartbeatClient, this.scheduler, COORDINATOR_URL, "0", coordinatorStreamStore, true, 10)); CoordinatorStreamValueSerde serde = new CoordinatorStreamValueSerde(SetConfig.TYPE); byte[] newCoordinatorUrl = serde.toBytes("<LINK_0>"); ContainerHeartbeatResponse response1 = new ContainerHeartbeatResponse(false); ContainerHeartbeatResponse response2 = new ContainerHeartbeatResponse(true); when(this.containerHeartbeatClient.requestHeartbeat()).thenReturn(response1).thenReturn(response2); when(this.containerHeartbeatMonitor.getContainerHeartbeatClient()).thenReturn(this.containerHeartbeatClient); when(this.coordinatorStreamStore.get(CoordinationConstants.YARN_COORDINATOR_URL)).thenReturn(newCoordinatorUrl); this.containerHeartbeatMonitor.start(); boolean fixedRateTaskCompleted = this.schedulerFixedRateExecutionLatch.await(2, TimeUnit.SECONDS); assertTrue("Did not complete heartbeat check", fixedRateTaskCompleted); verify(this.scheduler, never()).schedule(any(Runnable.class), anyLong(), any()); verify(this.onExpired, never()).run(); this.containerHeartbeatMonitor.stop(); verify(this.scheduler).shutdown(); }

Target:
public void testReestablishConnectionWithNewAM() throws InterruptedException { String containerExecutionId = "0"; String newCoordinatorUrl = "<LINK_0>"; this.containerHeartbeatMonitor = spy(new ContainerHeartbeatMonitor(this.onExpired, this.containerHeartbeatClient, this.scheduler, COORDINATOR_URL, containerExecutionId, coordinatorStreamStore, true, 5, 10)); CoordinatorStreamValueSerde serde = new CoordinatorStreamValueSerde(SetConfig.TYPE); when(this.containerHeartbeatClient.requestHeartbeat()).thenReturn(FAILURE_RESPONSE).thenReturn(SUCCESS_RESPONSE); when(this.containerHeartbeatMonitor.createContainerHeartbeatClient(newCoordinatorUrl, containerExecutionId)).thenReturn(this.containerHeartbeatClient); when(this.coordinatorStreamStore.get(CoordinationConstants.YARN_COORDINATOR_URL)).thenReturn(serde.toBytes(newCoordinatorUrl)); this.containerHeartbeatMonitor.start(); boolean fixedRateTaskCompleted = this.schedulerFixedRateExecutionLatch.await(2, TimeUnit.SECONDS); assertTrue("Did not complete heartbeat check", fixedRateTaskCompleted); verify(this.scheduler, never()).schedule(any(Runnable.class), anyLong(), any()); verify(this.onExpired, never()).run(); this.containerHeartbeatMonitor.stop(); verify(this.scheduler).shutdown(); }
Source:
void resetCounter() { versionCounter.compareAndSet(versionCounter.get(), 0); }

Target:
void resetCounter() { versionCounter.set(0); }
Source:
private void notifyTermChange(PartitionId partitionId, PrimaryTerm term) { getLogger().debug("Changed " + term + ", listeners=" + listeners.size()); listeners.values().forEach(session -> session.publish(CHANGE, new PrimaryElectionEvent(PrimaryElectionEvent.Type.CHANGED, partitionId, term))); }

Target:
private void notifyTermChange(PartitionId partitionId, PrimaryTerm term) { getLogger().debug("Changed {}, num listeners={}", term, listeners.size()); listeners.values().forEach(session -> session.publish(CHANGE, new PrimaryElectionEvent(PrimaryElectionEvent.Type.CHANGED, partitionId, term))); }
Source:
public void setPorts(List<PortMapping> ports) { if (ports != null) { this.ports.clear(); this.ports.addAll(ports); } }

Target:
public void setPorts(List<PortMapping> ports) { this.ports = ports; }
Source:
private void createDirectoryStructureIfNotExists(final File dir) { if (!dir.exists()) { try { Files.createParentDirs(new File(dir, DUMMY_FILE_NAME)); } catch (final IOException e) { throw new RuntimeException("Failed to create directory: " + dir.getAbsolutePath(), e); } } else if (!dir.isDirectory()) { throw new RuntimeException("This location is not a directory: " + dir.getAbsolutePath()); } }

Target:
private void createDirectoryStructureIfNotExists(final File dir) throws IOException { if (!dir.exists()) { try { Files.createParentDirs(new File(dir, DUMMY_FILE_NAME)); } catch (final IOException e) { throw new IOException("Failed to create directory: " + dir.getAbsolutePath(), e); } } else if (!dir.isDirectory()) { throw new IOException("This location is not a directory: " + dir.getAbsolutePath()); } }
Source:
public TriggerResource toResource(CronTriggerDto trigger) { TriggerResource triggerResource = instantiateResource(trigger); addSelfLink(triggerResource); addEditLink(triggerResource); return triggerResource; }

Target:
public TriggerResource toResource(CronTriggerDto trigger) { TriggerResource triggerResource = instantiateResource(trigger); addSelfLink(triggerResource); return triggerResource; }
Source:
public void stop(BundleContext context) throws Exception { SiriusEditPlugin.getPlugin().removeSessionFileLoadingListener(modelingProjectExpansionListener); modelingProjectExpansionListener = null; super.stop(context); }

Target:
public void stop(BundleContext context) throws Exception { SiriusEditPlugin.getPlugin().removeSessionFileLoadingListener(modelingProjectExpansionListener); modelingProjectExpansionListener = null; pageRegistry = null; super.stop(context); }
Source:
public static void readMockFile() throws IOException { JsonToObjectMapper objectMapper = new JsonToObjectMapper(); HOTSPOTS = objectMapper.readHotspots("hotspots_db_dump.json"); }

Target:
public static void readMockFile() throws IOException { JsonToObjectMapper objectMapper = new JsonToObjectMapper(); HOTSPOTS = objectMapper.readHotspots("hotspots_integration_test.json"); }
Source:
private static Object handleUnknownError(ResponseMsg msg, ChannelHandlerContext ctx, IClientRouter r) throws Throwable { ByteString bs = msg.getPayload().getServerError().getUnknownError().getThrowable(); byte[] bytes = new byte[bs.size()]; bs.copyTo(bytes, 0); ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream ois = new ObjectInputStream(bis); throw (Throwable) ois.readObject(); }

Target:
private static Object handleUnknownError(ResponseMsg msg, ChannelHandlerContext ctx, IClientRouter r) throws Throwable { ByteString bs = msg.getPayload().getServerError().getUnknownError().getThrowable(); byte[] bytes = new byte[bs.size()]; bs.copyTo(bytes, 0); try (ByteArrayInputStream bis = new ByteArrayInputStream(bytes)) { try (ObjectInputStream ois = new ObjectInputStream(bis)) { throw (Throwable) ois.readObject(); } } }
Source:
public List<Node> getChildren() { List<Node> children = new ArrayList<Node>(); children.add(variable); children.add(expression); return children; }

Target:
public List<Node> getChildren() { return Arrays.asList(variable, expression); }
Source:
private void addNewFilter(ITmfFilter filter) { CLabel label = new CLabel(this, SWT.SHADOW_OUT); label.setBackground(fLabelBackground); String text; if (filter instanceof TmfFilterNode) { text = ((TmfFilterNode) filter).getFilterName(); } else { text = filter.toString(); } if (fCollapsed) { label.setToolTipText(text); label.setTopMargin(0); label.setBottomMargin(0); label.setRightMargin(COLLAPSED_RIGHT_MARGIN); } else { label.setImage(DELETE); label.setText(text); } label.setData(filter); label.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { Rectangle bounds; if (fCollapsed) { bounds = new Rectangle(0, 0, 2 * COLLAPSED_IMAGE_MARGIN + DELETE_SMALL.getBounds().width, label.getBounds().height); } else { bounds = DELETE.getBounds(); bounds.x += label.getLeftMargin(); bounds.y = (label.getSize().y - bounds.height) / 2; } if (bounds.contains(e.x, e.y)) { fListener.filterRemoved((ITmfFilter) label.getData()); } else { fListener.filterSelected((ITmfFilter) label.getData()); getParent().layout(true, true); } } }); label.addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(DELETE_SMALL, COLLAPSED_IMAGE_MARGIN, COLLAPSED_IMAGE_MARGIN); } }); }

Target:
private void addNewFilter(ITmfFilter filter) { CLabel label = new CLabel(this, SWT.SHADOW_OUT); label.setBackground(fLabelBackground); String text; if (filter instanceof TmfFilterNode) { text = ((TmfFilterNode) filter).getFilterName(); label.setData(TOOLTIP_KEY, filter.toString()); } else { text = filter.toString(); } if (fCollapsed) { label.setToolTipText(text); label.setTopMargin(0); label.setBottomMargin(0); label.setRightMargin(COLLAPSED_RIGHT_MARGIN); } else { label.setImage(DELETE); label.setText(text); label.setToolTipText((String) label.getData(TOOLTIP_KEY)); } label.setData(filter); label.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { Rectangle bounds; if (fCollapsed) { bounds = new Rectangle(0, 0, 2 * COLLAPSED_IMAGE_MARGIN + DELETE_SMALL.getBounds().width, label.getBounds().height); } else { bounds = DELETE.getBounds(); bounds.x += label.getLeftMargin(); bounds.y = (label.getSize().y - bounds.height) / 2; } if (bounds.contains(e.x, e.y)) { fListener.filterRemoved((ITmfFilter) label.getData()); } else { fListener.filterSelected((ITmfFilter) label.getData()); getParent().layout(true, true); } } }); label.addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(DELETE_SMALL, COLLAPSED_IMAGE_MARGIN, COLLAPSED_IMAGE_MARGIN); } }); }
Source:
public String decryptFile(String filePathOrEncrypted) { if (!EncryptedSecret.isEncryptedSecret(filePathOrEncrypted)) { return filePathOrEncrypted; } EncryptedSecret encryptedSecret = EncryptedSecret.parse(filePathOrEncrypted); SecretEngine secretEngine = secretEngineRegistry.getEngine(encryptedSecret.getEngineIdentifier()); if (secretEngine == null) { throw new InvalidSecretFormatException("Secret Engine does not exist: " + encryptedSecret.getEngineIdentifier()); } else { secretEngine.validate(encryptedSecret); return decryptedFilePath(secretEngine, encryptedSecret); } }

Target:
public Path decryptFile(String filePathOrEncrypted) { if (!EncryptedSecret.isEncryptedSecret(filePathOrEncrypted)) { return null; } EncryptedSecret encryptedSecret = EncryptedSecret.parse(filePathOrEncrypted); SecretEngine secretEngine = secretEngineRegistry.getEngine(encryptedSecret.getEngineIdentifier()); if (secretEngine == null) { throw new InvalidSecretFormatException("Secret Engine does not exist: " + encryptedSecret.getEngineIdentifier()); } else { secretEngine.validate(encryptedSecret); return decryptedFilePath(secretEngine, encryptedSecret); } }
Source:
public static void preInit() { zonePlanner = BlockBCBase_Neptune.register(new BlockZonePlanner(Material.ROCK, "block.zone_planner")); TileBC_Neptune.registerTile(TileZonePlanner.class, "tile.zone_planner"); }

Target:
public static void preInit() { if (BCLib.DEV) { zonePlanner = BlockBCBase_Neptune.register(new BlockZonePlanner(Material.ROCK, "block.zone_planner")); TileBC_Neptune.registerTile(TileZonePlanner.class, "tile.zone_planner"); } }
Source:
public boolean validateConnection() { boolean status = false; final String constructedURL = String.format(URL_GET_PROJECTS, getUrl()); final HttpResponse response = get(constructedURL); int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { final HttpEntity entity = response.getEntity(); String string = null; try { string = EntityUtils.toString(entity); if (string.startsWith("[") && string.endsWith("]")) return true; } catch (IOException e) { ZephyrPlugin.log(e); } } else if (statusCode == 401) { return true; } else if (statusCode == 404) { return false; } else { ZephyrPlugin.log("Unexpected response status: " + statusCode); } return status; }

Target:
public boolean validateConnection() { boolean status = false; final String constructedURL = String.format(URL_GET_PROJECTS, getUrl()); try (final CloseableHttpResponse response = get(constructedURL)) { int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { final HttpEntity entity = response.getEntity(); String string = null; try { string = EntityUtils.toString(entity); if (string.startsWith("[") && string.endsWith("]")) return true; } catch (IOException e) { ZephyrPlugin.log(e); } } else if (statusCode == 401) { return true; } else if (statusCode == 404) { return false; } else { ZephyrPlugin.log(String.format("Unexpected response status <%s> upon validate connection <%s>", statusCode, constructedURL)); } } catch (IOException e) { ZephyrPlugin.log(e); } return status; }