auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public JSONWithPadding getUserCredentials(@QueryParam("callback") @DefaultValue("callback") String callback ) throws Exception { logger.info( "UserResource.setUserPassword" ); final ApiResponse response = createApiResponse(); response.setAction( "get user password" ); final UUID applicationId = getApplicationId(); final UUID targetUserId = getUserUuid(); if ( applicationId == null ) { response.setError( "Application not found" ); return new JSONWithPadding( response, callback ); } if ( targetUserId == null ) { response.setError( "User not found" ); return new JSONWithPadding( response, callback ); } final CredentialsInfo credentialsInfo = management.getAppUserCredentialsInfo( applicationId, targetUserId ); response.setProperty( "credentials", credentialsInfo ); return new JSONWithPadding( response, callback ); }

Target:
public JSONWithPadding getUserCredentials(@QueryParam("callback") @DefaultValue("callback") String callback ) throws Exception { logger.info( "UserResource.getUserCredentials" ); final ApiResponse response = createApiResponse(); response.setAction( "get user credentials" ); final UUID applicationId = getApplicationId(); final UUID targetUserId = getUserUuid(); if ( applicationId == null ) { response.setError( "Application not found" ); return new JSONWithPadding( response, callback ); } if ( targetUserId == null ) { response.setError( "User not found" ); return new JSONWithPadding( response, callback ); } final CredentialsInfo credentialsInfo = management.getAppUserCredentialsInfo( applicationId, targetUserId ); response.setProperty( "credentials", credentialsInfo ); return new JSONWithPadding( response, callback ); }
Source:
public void stop(long timeout, TimeUnit timeUnit) throws InterruptedException { executor.shutdownNow(); kafkaConsumer.wakeup(); running = false; executor.awaitTermination(timeout, timeUnit); }

Target:
public void stop(long timeout, TimeUnit timeUnit) throws InterruptedException { kafkaConsumer.wakeup(); executor.shutdownNow(); running = false; if (!executor.awaitTermination(timeout, timeUnit)) { log.error("Failed to stop KafkaController in {}", timeout, timeUnit); } }
Source:
public synchronized boolean acceptMastership() { if (m_onMastership == null) { exportLog.info("Mastership Runnable not yet set for table " + getTableName() + " partition " + getPartitionId()); return false; } if (m_mastershipAccepted.get()) { exportLog.info("Export table " + getTableName() + " mastership already accepted for partition " + getPartitionId()); return true; } exportLog.info("Accepting mastership for export table " + getTableName() + " partition " + getPartitionId()); m_es.execute(new Runnable() { @Override public void run() { try { if (!m_es.isShutdown() || !m_closed) { exportLog.info("Export table " + getTableName() + " accepting mastership for partition " + getPartitionId()); if (m_onMastership != null) { if (m_mastershipAccepted.compareAndSet(false, true)) { m_onMastership.run(); } } } } catch (Exception e) { exportLog.error("Error in accepting mastership", e); } } }); return m_mastershipAccepted.get(); }

Target:
public synchronized void acceptMastership() { if (m_onMastership == null) { exportLog.info("Mastership Runnable not yet set for table " + getTableName() + " partition " + getPartitionId()); return; } if (m_mastershipAccepted.get()) { exportLog.info("Export table " + getTableName() + " mastership already accepted for partition " + getPartitionId()); return; } exportLog.info("Accepting mastership for export table " + getTableName() + " partition " + getPartitionId()); m_es.execute(new Runnable() { @Override public void run() { try { if (!m_es.isShutdown() || !m_closed) { exportLog.info("Export table " + getTableName() + " accepting mastership for partition " + getPartitionId()); if (m_onMastership != null) { if (m_mastershipAccepted.compareAndSet(false, true)) { m_onMastership.run(); } } } } catch (Exception e) { exportLog.error("Error in accepting mastership", e); } } }); }
Source:
private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new VariantLoaderStepParametersValidator()); jobParametersValidators.add(new LoadFileStepParametersValidator()); Boolean skipAnnotation = Boolean.valueOf(jobParameters.getString(JobParametersNames.ANNOTATION_SKIP)); if (!skipAnnotation) { jobParametersValidators.add(new VepInputGeneratorStepParametersValidator()); jobParametersValidators.add(new VepAnnotationGeneratorStepParametersValidator()); jobParametersValidators.add(new AnnotationLoaderStepParametersValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }

Target:
private CompositeJobParametersValidator compositeJobParametersValidator(JobParameters jobParameters) { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); jobParametersValidators.add(new VariantLoaderStepParametersValidator()); jobParametersValidators.add(new FileLoaderStepParametersValidator()); Boolean skipAnnotation = Boolean.valueOf(jobParameters.getString(JobParametersNames.ANNOTATION_SKIP)); if (!skipAnnotation) { jobParametersValidators.add(new VepInputGeneratorStepParametersValidator()); jobParametersValidators.add(new VepAnnotationGeneratorStepParametersValidator()); jobParametersValidators.add(new AnnotationLoaderStepParametersValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
private void startBrowser() { if (web != null) { String url = web.getURL(); if (urlText != null) { urlText.setText(url); } long now = System.nanoTime(); if (lastOpen == 0 || lastOpen + TimeUnit.MILLISECONDS.toNanos(100) < now) { lastOpen = now; openBrowser(url); } } }

Target:
private void startBrowser() { if (web != null) { String url = web.getURL(); if (urlText != null) { urlText.setText(url); } long now = System.nanoTime(); if (lastOpenNs == 0 || lastOpenNs + TimeUnit.MILLISECONDS.toNanos(100) < now) { lastOpenNs = now; openBrowser(url); } } }
Source:
private Map<String, Serializable> addTaskVariablesAndBackupInheritedVariables(Map<String, Serializable> variables, ImmutableMap<String, TaskVariable> taskVariables) { Map<String, Serializable> taskAndBackupVariables = new HashMap<>(); for (TaskVariable taskVariable : taskVariables.values()) { if (!taskVariable.isJobInherited() || (taskVariable.isJobInherited() && variables.get(taskVariable.getName()) == null)) { if (variables.get(taskVariable.getName()) != null) { taskAndBackupVariables.put(SchedulerVars.PA_PROPAGATED_VARIABLE_PREFIX.toString() + taskVariable.getName(), variables.get(taskVariable.getName())); } else { taskAndBackupVariables.put(SchedulerVars.PA_TASK_VARIABLE_PREFIX.toString() + taskVariable.getName(), variables.get(taskVariable.getName())); } taskAndBackupVariables.put(taskVariable.getName(), taskVariable.getValue()); } } return taskAndBackupVariables; }

Target:
private void addTaskVariablesAndBackupInheritedVariables(Map<String, Serializable> variables, ImmutableMap<String, TaskVariable> taskVariables) { Map<String, Serializable> taskAndBackupVariables = new HashMap<>(); for (TaskVariable taskVariable : taskVariables.values()) { String taskName = taskVariable.getName(); if (!taskVariable.isJobInherited() || (taskVariable.isJobInherited() && variables.get(taskName) == null)) { if (variables.get(taskName) != null) { taskAndBackupVariables.put(SchedulerVars.PA_FLAG_PROPAGATED_VAR_TO_RESTORE.toString() + taskName, variables.get(taskName)); } else { taskAndBackupVariables.put(SchedulerVars.PA_FLAG_TASK_VAR_TO_CLEAR.toString() + taskName, taskVariable.getValue()); } taskAndBackupVariables.put(taskName, taskVariable.getValue()); } } variables.putAll(taskAndBackupVariables); }
Source:
public HealthCheckResult getOrRunHealthChecks() { int refreshSeconds = Integer.parseInt(Framework.getProperty(DEFAULT_HEALTH_CHECK_INTERVAL_SECONDS_PROPERTY, DEFAULT_HEALTH_CHECK_INTERVAL_SECONDS)); for (Entry<String, ProbeInfo> es : probesForHealthCheck.entrySet()) { String probeName = es.getKey(); ProbeInfo probe = es.getValue(); if (probe == null) { log.warn("Probe:" + probeName + " does not exist, skipping it for the health check"); continue; } getStatusOrRunProbe(probe, refreshSeconds); } return new HealthCheckResult(probesForHealthCheck.values()); }

Target:
public HealthCheckResult getOrRunHealthChecks() { for (Entry<String, ProbeInfo> es : probesForHealthCheck.entrySet()) { String probeName = es.getKey(); ProbeInfo probe = es.getValue(); if (probe == null) { log.warn("Probe:" + probeName + " does not exist, skipping it for the health check"); continue; } getStatusOrRunProbe(probe, getDefaultCheckInterval()); } return new HealthCheckResult(probesForHealthCheck.values()); }
Source:
void closeExpiredConnections() { List<CachedConnection> expiredConnections; synchronized (this) { ConnectionPool pool = getConnectionPool(); expiredConnections = pool.removeExpiredConnections(killTime); synchronized (errorCount) { Iterator<Entry<ThriftTransportKey,Long>> iter = errorTime.entrySet().iterator(); while (iter.hasNext()) { Entry<ThriftTransportKey,Long> entry = iter.next(); long delta = System.currentTimeMillis() - entry.getValue(); if (delta >= STUCK_THRESHOLD) { errorCount.remove(entry.getKey()); iter.remove(); } } } } expiredConnections.forEach((c) -> c.transport.close()); }

Target:
void closeExpiredConnections() { List<CachedConnection> expiredConnections; ConnectionPool pool = getConnectionPool(); expiredConnections = pool.removeExpiredConnections(killTime); synchronized (errorCount) { Iterator<Entry<ThriftTransportKey,Long>> iter = errorTime.entrySet().iterator(); while (iter.hasNext()) { Entry<ThriftTransportKey,Long> entry = iter.next(); long delta = System.currentTimeMillis() - entry.getValue(); if (delta >= STUCK_THRESHOLD) { errorCount.remove(entry.getKey()); iter.remove(); } } } expiredConnections.forEach((c) -> c.transport.close()); }
Source:
public InterestChannelImpl(final SourcedEurekaRegistry<InstanceInfo> registry, final MessageConnection transport, final ServerInterestChannelMetrics metrics) { super(STATE.Idle, transport, registry, metrics); this.metrics = metrics; this.notificationMultiplexer = new InterestNotificationMultiplexer(registry); this.channelSubscriptionMonitor = new ChannelSubscriptionMonitor(metrics); subscribeToTransportInput(new Action1<Object>() { @Override public void call(Object message) { if (message instanceof SnapshotRegistration) { switch (state.get()) { case Idle: moveToState(STATE.Idle, STATE.Open); sendSnapshot(((SnapshotRegistration) message).getInterests()); moveToState(STATE.Idle); break; case Open: sendErrorOnTransport(SNAPSHOT_REQUEST_NOT_ALLOWED); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else if (message instanceof InterestRegistration) { Interest<InstanceInfo> interest = ((InterestRegistration) message).toComposite(); switch (state.get()) { case Idle: case Open: change(interest); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else if (message instanceof UnregisterInterestSet) { switch (state.get()) { case Idle: case Open: change(Interests.forNone()); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else { sendErrorOnTransport(new EurekaProtocolError("Unexpected message " + message)); } } }); }

Target:
public InterestChannelImpl(final SourcedEurekaRegistry<InstanceInfo> registry, final MessageConnection transport, final ServerInterestChannelMetrics metrics) { super(STATE.Idle, transport, registry, metrics); this.metrics = metrics; this.notificationMultiplexer = new InterestNotificationMultiplexer(registry); this.channelSubscriptionMonitor = new ChannelSubscriptionMonitor(metrics); subscribeToTransportInput(new Action1<Object>() { @Override public void call(Object message) { if (message instanceof SnapshotRegistration) { switch (state.get()) { case Idle: moveToState(STATE.Idle, STATE.Open); sendSnapshot(((SnapshotRegistration) message).getInterests()); moveToState(STATE.Closed); break; case Open: sendErrorOnTransport(SNAPSHOT_REQUEST_NOT_ALLOWED); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else if (message instanceof InterestRegistration) { Interest<InstanceInfo> interest = ((InterestRegistration) message).toComposite(); switch (state.get()) { case Idle: case Open: change(interest); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else if (message instanceof UnregisterInterestSet) { switch (state.get()) { case Idle: case Open: change(Interests.forNone()); break; case Closed: sendErrorOnTransport(CHANNEL_CLOSED_EXCEPTION); break; } } else { sendErrorOnTransport(new EurekaProtocolError("Unexpected message " + message)); } } }); }
Source:
public boolean onNetworkAddition(INetwork network) { return NetworkHelpers.getEnergyNetwork(network).addPosition(PartPos.of(getPos(), null), 0, 0); }

Target:
public boolean onNetworkAddition(INetwork network) { return NetworkHelpers.getEnergyNetwork(network).addPosition(PartPos.of(getPos(), null), 0, IChanneledNetwork.DEFAULT_CHANNEL); }
Source:
public Integer getUriOpenedSockets(String uri) { Integer numberOpenedSockets = 0; for (WebSocketDispatcher dispatcher : dispatchers) { numberOpenedSockets += dispatcher.getNumberOpenedSocketsByUri(uri); } return numberOpenedSockets; }

Target:
public Integer getUriOpenedSockets(String uri) { Integer numberOpenedSockets = 0; synchronized (this) { for (WebSocketDispatcher dispatcher : dispatchers) { numberOpenedSockets += dispatcher.getNumberOpenedSocketsByUri(uri); } } return numberOpenedSockets; }
Source:
public void testContainerNotRunningVariation() throws Throwable { final ContainerInfo stopped = new ContainerInfo() { @Override public ContainerState state() { final ContainerState state = mock(ContainerState.class); when(state.running()).thenReturn(false); when(state.error()).thenReturn("container is a potato"); return state; } }; doReturn("potato").when(mockCreation).id(); doReturn(stopped).when(mockDocker).inspectContainer(anyString()); doReturn(mockImageInfo).when(mockDocker).inspectImage(IMAGE); doReturn(mockCreation).when(mockDocker) .createContainer(any(ContainerConfig.class), anyString()); doReturn(false).when(mockHealthChecker).check(anyString()); final TaskRunner tr = TaskRunner.builder() .delayMillis(0) .config(TaskConfig.builder() .namespace("test") .host(HOST) .job(JOB) .containerDecorators(ImmutableList.of(containerDecorator)) .build()) .docker(mockDocker) .listener(mockListener) .healthChecker(mockHealthChecker) .build(); tr.run(); try { tr.resultFuture().get(); fail("this should throw"); } catch (Exception t) { assertTrue(t instanceof ExecutionException); assertEquals(RuntimeException.class, t.getCause().getClass()); verify(mockListener).failed(t.getCause(), "container is a potato"); } }

Target:
public void testContainerNotRunningVariation() throws Throwable { final TaskRunner.NopListener mockListener = mock(TaskRunner.NopListener.class); final ImageInfo mockImageInfo = mock(ImageInfo.class); final ContainerCreation mockCreation = mock(ContainerCreation.class); final HealthChecker mockHealthChecker = mock(HealthChecker.class); final ContainerInfo stopped = new ContainerInfo() { @Override public ContainerState state() { final ContainerState state = mock(ContainerState.class); when(state.running()).thenReturn(false); when(state.error()).thenReturn("container is a potato"); return state; } }; when(mockCreation.id()).thenReturn("potato"); when(mockDocker.inspectContainer(anyString())).thenReturn(stopped); when(mockDocker.inspectImage(IMAGE)).thenReturn(mockImageInfo); when(mockDocker.createContainer(any(ContainerConfig.class), anyString())) .thenReturn(mockCreation); when(mockHealthChecker.check(anyString())).thenReturn(false); final TaskRunner tr = TaskRunner.builder() .delayMillis(0) .config(TaskConfig.builder() .namespace("test") .host(HOST) .job(JOB) .containerDecorators(ImmutableList.of(containerDecorator)) .build()) .docker(mockDocker) .listener(mockListener) .healthChecker(mockHealthChecker) .build(); tr.run(); try { tr.resultFuture().get(); fail("this should throw"); } catch (Exception t) { assertTrue(t instanceof ExecutionException); assertEquals(RuntimeException.class, t.getCause().getClass()); verify(mockListener).failed(t.getCause(), "container is a potato"); } }
Source:
protected void executeCommand() { if (getDiskImage() != null) { try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = performDeleteImageVdsmOperation(); getTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getStorageDomainId())); } catch (EngineException e) { if (e.getErrorCode() == EngineError.ImageDoesNotExistInDomainError) { log.info("Disk '{}' doesn't exist on storage domain '{}', rolling forward", getDiskImage().getId(), getStorageDomainId()); } else if (e.getErrorCode() == EngineError.ImageDeleteError && isImageRemovedFromStorage()) { log.info("Disk '{}' was deleted from storage domain '{}'", getDiskImage().getId(), getStorageDomainId()); } else { throw e; } } if (getParameters().getParentCommand() != ActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != ActionType.RemoveVmTemplateFromImportExport && getParameters().getParentCommand() != ActionType.RemoveUnregisteredVmTemplate && getParameters().getParentCommand() != ActionType.RemoveUnregisteredVm) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = performDeleteImageVdsmOperation(); getTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getStorageDomainId())); } catch (EngineException e) { if (e.getErrorCode() == EngineError.ImageDoesNotExistInDomainError) { log.info("Disk '{}' doesn't exist on storage domain '{}', rolling forward", getDiskImage().getId(), getStorageDomainId()); } else if (e.getErrorCode() == EngineError.ImageDeleteError && isImageRemovedFromStorage()) { log.info("Disk '{}' was deleted from storage domain '{}'", getDiskImage().getId(), getStorageDomainId()); } else { throw e; } } if (!actionsNotRequiredDbOperation.contains(getParameters().getParentCommand())) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
private void offerPaymentStateTransitionEvents(long currentId, ChargeEventEntity chargeEventEntity, PaymentStateTransition transition) { Event event = EventFactory.createPaymentEvent(chargeEventEntity, transition.getStateTransitionEventClass()); final boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); if (doNotForceEmission && emittedBefore) { logger.info("[{}] - found - charge event emitted before", currentId, chargeEventEntity.getId()); } else { logger.info("[{}] - found - emitting for charge event ", currentId, event, chargeEventEntity.getId()); stateTransitionQueue.offer(transition); persistEventEmittedRecord(event); } }

Target:
private void offerPaymentStateTransitionEvents(long currentId, ChargeEventEntity chargeEventEntity, PaymentStateTransition transition) { Event event = EventFactory.createPaymentEvent(chargeEventEntity, transition.getStateTransitionEventClass()); if (shouldForceEmission) { offerStateTransitionEvent(currentId, chargeEventEntity, transition, event); } else { final boolean emittedBefore = emittedEventDao.hasBeenEmittedBefore(event); if (emittedBefore) { logger.info("[{}] - found - charge event emitted before", currentId, chargeEventEntity.getId()); } else { offerStateTransitionEvent(currentId, chargeEventEntity, transition, event); } } }
Source:
Column<ObjectProperty, List<ImageWrapper>> createPropertyTypeBrowseColumn() { final Column<ObjectProperty, List<ImageWrapper>> column = new Column<ObjectProperty, List<ImageWrapper>>(new MultiImageCell()) { int maxColumnWidth = 40; @Override public List<ImageWrapper> getValue(final ObjectProperty property) { List<ImageWrapper> imageWrapperList = fieldMetadataProviderList.stream() .map(p -> p.getFieldMetadata(property)) .flatMap(s -> s.map(Stream::of).orElseGet(Stream::empty)) .map(FieldMetadata::getImageWrapper) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!imageWrapperList.isEmpty()) { int targetColumnWidth = imageWrapperList.size() * 30; if (targetColumnWidth > maxColumnWidth) { maxColumnWidth = targetColumnWidth; } propertiesTable.setColumnWidth(this, maxColumnWidth, Style.Unit.PX); } return imageWrapperList; } }; return column; }

Target:
Column<ObjectProperty, List<ImageWrapper>> createPropertyTypeBrowseColumn() { final int defaultColumnWidth = 40; final Column<ObjectProperty, List<ImageWrapper>> column = new Column<ObjectProperty, List<ImageWrapper>>(new MultiImageCell()) { int maxColumnWidth = defaultColumnWidth; @Override public List<ImageWrapper> getValue(final ObjectProperty property) { List<ImageWrapper> imageWrapperList = fieldMetadataProviderList.stream() .map(p -> p.getFieldMetadata(property)) .flatMap(s -> s.map(Stream::of).orElseGet(Stream::empty)) .map(FieldMetadata::getImageWrapper) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!imageWrapperList.isEmpty()) { int targetColumnWidth = imageWrapperList.size() * (MultiImageCell.IMAGE_WIDTH + 5) + 20; if (targetColumnWidth > maxColumnWidth) { maxColumnWidth = targetColumnWidth; } propertiesTable.setColumnWidth(this, maxColumnWidth, Style.Unit.PX); } return imageWrapperList; } }; propertiesTable.setColumnWidth(column, defaultColumnWidth, Style.Unit.PX); return column; }
Source:
public Dataset open(final Assembler assembler, final Resource root, final Mode mode) { checkType(root, MemoryDataset); final Dataset dataset = createTxnMem(); setContext(root, dataset.getContext()); final Resource defaultGraphDef = root.hasProperty(pDefaultGraph) ? getResourceValue(root, pDefaultGraph) : root.hasProperty(pGraph) ? getResourceValue(root, pGraph) : null; if (defaultGraphDef != null) dataset.setDefaultModel(retrieve(defaultGraphDef, assembler, mode)); final Predicate<RDFNode> isResource = n -> { if (n.isResource()) return true; throw new DatasetAssemblerException(root, "Not a resource: " + stringForRDFNode(n)); }; multiValue(root, data).parallelStream().filter(isResource) .forEach(defaultGraphNode -> read(dataset, defaultGraphNode.asResource().getURI())); multiValue(root, pNamedGraph).parallelStream().filter(isResource).forEach(namedGraphNode -> { final Resource namedGraphResource = namedGraphNode.asResource(); final String graphName = getAsStringValue(namedGraphResource, pGraphName); if (namedGraphResource.hasProperty(data)) { multiValue(namedGraphResource, data).parallelStream().filter(isResource).forEach(namedGraphData -> { final Model namedGraph = loadModel(namedGraphData.asResource().getURI()); dataset.addNamedModel(graphName, namedGraph); }); } else { final Model namedGraph = retrieve(namedGraphResource, assembler, mode); dataset.addNamedModel(graphName, namedGraph); } }); return dataset; }

Target:
public Dataset open(final Assembler assembler, final Resource root, final Mode mode) { checkType(root, MemoryDataset); final Dataset dataset = createTxnMem(); setContext(root, dataset.getContext()); dataset.begin(WRITE); if (root.hasProperty(data)) multiValueResource(root, data) .forEach(defaultGraphDocument -> read(dataset, defaultGraphDocument.getURI())); multiValueResource(root, pNamedGraph).forEach(namedGraphResource -> { final String graphName = getAsStringValue(namedGraphResource, pGraphName); if (namedGraphResource.hasProperty(data)) multiValueResource(namedGraphResource, data) .forEach(namedGraphData -> read(dataset.getNamedModel(graphName), namedGraphData.getURI())); }); dataset.commit(); return dataset; }
Source:
public void testMqttSessionPresent() throws MqttException { MockMqttClient mockClient = new MockMqttClient(); final boolean actualSessionPresent; actualSessionPresent = mockClient.testToken.getSessionPresent(); final AWSIotMqttManager testSessionPresentFlag = new AWSIotMqttManager("test-sessionPresent-flag", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testSessionPresentFlag.setMqttClient(mockClient); KeyStore testKeystore = AWSIotKeystoreHelper.getIotKeystore(CERT_ID, KEYSTORE_PATH, KEYSTORE_NAME, KEYSTORE_PASSWORD); testSessionPresentFlag.connect(testKeystore, new AWSIotMqttClientStatusCallback() { @Override public void onStatusChanged(AWSIotMqttClientStatus status, Throwable throwable) { if (status == AWSIotMqttClientStatus.Connecting) { System.out.println("Client persistent-client-id connecton status: " + status); System.out.println("getSessionPresent: " + testSessionPresentFlag.getSessionPresent()); assertEquals(testSessionPresentFlag.getSessionPresent(), actualSessionPresent); } else if (status == AWSIotMqttClientStatus.Connected) { System.out.println("Client persistent-client-id connecton status: " + status); System.out.println("getSessionPresent: " + testSessionPresentFlag.getSessionPresent()); assertEquals(testSessionPresentFlag.getSessionPresent(), actualSessionPresent); } } }); }

Target:
public void testMqttSessionPresent() throws MqttException, InterruptedException { MockMqttClient mockClient = new MockMqttClient(); final boolean actualSessionPresent; actualSessionPresent = mockClient.testToken.getSessionPresent(); final CountDownLatch countDownLatch = new CountDownLatch(1); final AWSIotMqttManager testSessionPresentFlag = new AWSIotMqttManager("test-sessionPresent-flag", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testSessionPresentFlag.setMqttClient(mockClient); KeyStore testKeystore = AWSIotKeystoreHelper.getIotKeystore(CERT_ID, KEYSTORE_PATH, KEYSTORE_NAME, KEYSTORE_PASSWORD); testSessionPresentFlag.connect(testKeystore, new AWSIotMqttClientStatusCallback() { @Override public void onStatusChanged(AWSIotMqttClientStatus status, Throwable throwable) { if (status == AWSIotMqttClientStatus.Connecting || status == AWSIotMqttClientStatus.Connected) { System.out.println("Client persistent-client-id connection status: " + status); System.out.println("getSessionPresent: " + testSessionPresentFlag.getSessionPresent()); countDownLatch.countDown(); } } }); if (countDownLatch.await(2, TimeUnit.SECONDS)) { assertEquals(testSessionPresentFlag.getSessionPresent(), actualSessionPresent); } else { fail("CountDownLatch timed out."); } }
Source:
public TemplateWatcher( final MonitoringManager manager, final File templateDir, final long pollInterval ) throws IOException { this.manager = manager; this.handlebars.registerHelper( AllHelper.NAME, AllHelper.INSTANCE ); this.templateDir = templateDir.getCanonicalFile(); final FileAlterationObserver observer = new FileAlterationObserver( this.templateDir, TemplateEntry.getTemplateFileFilter( this.templateDir ) ); observer.addListener( this ); this.monitor = new FileAlterationMonitor( pollInterval, observer ); this.monitor.setThreadFactory( new ThreadFactory() { @Override public Thread newThread( final Runnable r ) { return new Thread( r, "Roboconf.TemplateWatcher" ); } } ); this.logger.fine( "Template watcher configured with templateDir=" + this.templateDir.toString() + " and pollInterval=" + pollInterval ); }

Target:
public TemplateWatcher( final MonitoringManager manager, final File templateDir, final long pollInterval ) throws IOException { this.manager = manager; this.handlebars.registerHelper(AllHelper.NAME, AllHelper.INSTANCE); this.templateDir = templateDir.getCanonicalFile(); final FileAlterationObserver observer = new FileAlterationObserver( this.templateDir, TemplateEntry.getTemplateFileFilter(this.templateDir)); observer.addListener(this); this.monitor = new FileAlterationMonitor(pollInterval, observer); this.monitor.setThreadFactory(THREAD_FACTORY); this.logger.fine("Template watcher configured with templateDir=" + this.templateDir.toString() + " and pollInterval=" + pollInterval); }
Source:
private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } if (linkPreviewFunnel.getVersion() == 0 || app.getReleaseType() == WikipediaApp.RELEASE_PROD) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); ((PageActivity) getActivity()).displayNewPage(title, historyEntry); linkPreviewFunnel.logLinkClick(); linkPreviewFunnel.logNavigate(); } else { LinkPreviewDialog dialog = LinkPreviewDialog.newInstance(title, linkPreviewFunnel.getVersion()); dialog.show(getActivity().getSupportFragmentManager(), "link_preview_dialog"); } }

Target:
private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } LinkPreviewFunnel linkPreviewFunnel = new LinkPreviewFunnel(app, title); if (linkPreviewFunnel.getVersion() == 0 || app.getReleaseType() == WikipediaApp.RELEASE_PROD) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); ((PageActivity) getActivity()).displayNewPage(title, historyEntry); linkPreviewFunnel.logLinkClick(); } else { LinkPreviewDialog dialog = LinkPreviewDialog.newInstance(title, linkPreviewFunnel.getVersion()); dialog.show(getActivity().getSupportFragmentManager(), "link_preview_dialog"); } }
Source:
public void testFinalLocalVariableSwitchExpressions() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(FinalLocalVariableCheck.class); final String[] expected = { "19:19: " + getCheckMessage(MSG_KEY, "e"), "57:19: " + getCheckMessage(MSG_KEY, "e"), "95:19: " + getCheckMessage(MSG_KEY, "e"), "129:19: " + getCheckMessage(MSG_KEY, "e"), }; verify(checkConfig, getNonCompilablePath("InputFinalLocalVariableCheckSwitchExpressions.java"), expected); }

Target:
public void testFinalLocalVariableSwitchExpressions() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(FinalLocalVariableCheck.class); final String[] expected = { "12:19: " + getCheckMessage(MSG_KEY, "e"), "50:19: " + getCheckMessage(MSG_KEY, "e"), "88:19: " + getCheckMessage(MSG_KEY, "e"), "122:19: " + getCheckMessage(MSG_KEY, "e"), }; verify(checkConfig, getNonCompilablePath("InputFinalLocalVariableCheckSwitchExpressions.java"), expected); }
Source:
private void changeValue(String itemName, String deviceIP, EdimaxBindingConfiguration config, Command cmd) { if (cmd instanceof OnOffType) { try { Boolean currentState = createSender(config).getState(deviceIP); OnOffType targetState = (OnOffType) cmd; if (targetState == OnOffType.ON && !currentState) { createSender(config).switchState(deviceIP, Boolean.TRUE); } else if (targetState == OnOffType.OFF && currentState) { createSender(config).switchState(deviceIP, Boolean.FALSE); } } catch (IOException e) { logger.error("Error in communication with device: " + itemName + ". Cannot set update to device.", e); } } else { logger.error("Unsupported command: " + cmd); } }

Target:
private void changeValue(String itemName, String deviceIP, EdimaxBindingConfiguration config, Command cmd) { if (cmd instanceof OnOffType) { try { Boolean currentState = createSender(config).getState(deviceIP); OnOffType targetState = (OnOffType) cmd; if (targetState == OnOffType.ON && !currentState) { createSender(config).switchState(deviceIP, Boolean.TRUE); } else if (targetState == OnOffType.OFF && currentState) { createSender(config).switchState(deviceIP, Boolean.FALSE); } } catch (IOException e) { logger.error("Error in communication with device: {}. Cannot set update to device.", itemName, e); } } else { logger.error("Unsupported command: {}.", cmd); } }
Source:
public String marshal(ZonedDateTime zonedDateTime) throws Exception { if (null == zonedDateTime) { return null; } return zonedDateTime.withZoneSameInstant(ZoneOffset.UTC).format(formatter); }

Target:
public String marshal(ZonedDateTime zonedDateTime) { if (null == zonedDateTime) { return null; } return zonedDateTime.withZoneSameInstant(ZoneOffset.UTC).format(formatter); }
Source:
public List<Server> getReachableServers() { return getServerList(true); }

Target:
public List<Server> getReachableServers() { return null; }
Source:
public final boolean include(RevWalk walker, RevCommit cmit) { BitmapIndex index = bitmap.getBitmapIndex(); Bitmap visitedBitmap; if (bitmap.contains(cmit)) { } else if ((visitedBitmap = index.getBitmap(cmit)) != null) { bitmap.or(visitedBitmap); } else { bitmap.addObject(cmit, Constants.OBJ_COMMIT); return true; } for (RevCommit p : cmit.getParents()) { p.add(RevFlag.SEEN); } return false; }

Target:
public final boolean include(RevWalk walker, RevCommit cmit) { Bitmap visitedBitmap; if (bitmap.contains(cmit)) { } else if ((visitedBitmap = bitmap.getBitmapIndex().getBitmap(cmit)) != null) { bitmap.or(visitedBitmap); } else { bitmap.addObject(cmit, Constants.OBJ_COMMIT); return true; } for (RevCommit p : cmit.getParents()) { p.add(RevFlag.SEEN); } return false; }
Source:
@Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { super.getItemOffsets(outRect, view, parent, state); outRect.set(offsets); if (parent.getChildAdapterPosition(view) == 0) { outRect.top = firstItemTopOffset; } }

Target:
@Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { super.getItemOffsets(outRect, view, parent, state); outRect.set(offsets); }
Source:
public ConstantExpression(final ByteBuffer value) { this(Type.BLOB_TYPE, String.valueOf(value)); }

Target:
public ConstantExpression(final ByteBuffer value) { throw new UnsupportedOperationException(); }
Source:
public void nothing_to_do_when_new_assignee_is_same_as_old_one() throws Exception { IssueDto issue = newIssueWithBrowsePermission(); UserDto userDto = db.users().insertUser(PREVIOUS_ASSIGNEE); addUserAsMemberOfDefaultOrganization(userDto); tester.newRequest() .setParam("issue", issue.getKey()) .setParam("assignee", PREVIOUS_ASSIGNEE) .execute(); IssueDto issueReloaded = db.getDbClient().issueDao().selectByKey(db.getSession(), issue.getKey()).get(); assertThat(issueReloaded.getAssignee()).isEqualTo(PREVIOUS_ASSIGNEE); assertThat(issueReloaded.getUpdatedAt()).isEqualTo(PAST); assertThat(issueReloaded.getIssueUpdateTime()).isEqualTo(PAST); }

Target:
public void nothing_to_do_when_new_assignee_is_same_as_old_one() throws Exception { IssueDto issue = newIssueWithBrowsePermission(); UserDto userDto = db.users().insertUser(PREVIOUS_ASSIGNEE); addUserAsMemberOfDefaultOrganization(userDto); ws.newRequest() .setParam("issue", issue.getKey()) .setParam("assignee", PREVIOUS_ASSIGNEE) .execute(); IssueDto issueReloaded = db.getDbClient().issueDao().selectByKey(db.getSession(), issue.getKey()).get(); assertThat(issueReloaded.getAssignee()).isEqualTo(PREVIOUS_ASSIGNEE); assertThat(issueReloaded.getUpdatedAt()).isEqualTo(PAST); assertThat(issueReloaded.getIssueUpdateTime()).isEqualTo(PAST); }
Source:
public void testAddModuleRequiresAndImportProposal() throws Exception { StringBuffer buf= new StringBuffer(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); buf= new StringBuffer(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" One one;\n"); buf.append("}\n"); ICompilationUnit cu= pack.createCompilationUnit("Cls.java", buf.toString(), false, null); CompilationUnit astRoot= getASTRoot(cu); ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot); String[] args = {"java.defaultProject"}; String requiresStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_add_requires_module_info, args); String[] args2 = {"One", "java.defaultProject"}; final String importStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_importtype_description, args2); requiresStr= requiresStr.substring(0, 1).toLowerCase() + requiresStr.substring(1); String proposalStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_combine_two_proposals_info, new String[] { importStr, requiresStr }); assertProposalExists(proposals, proposalStr); }

Target:
public void testAddModuleRequiresAndImportProposal() throws Exception { StringBuffer buf= new StringBuffer(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); buf= new StringBuffer(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" One one;\n"); buf.append("}\n"); ICompilationUnit cu= pack.createCompilationUnit("Cls.java", buf.toString(), false, null); CompilationUnit astRoot= getASTRoot(cu); ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot); String[] args= { "java.defaultProject" }; String requiresStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_add_requires_module_info, args); requiresStr= requiresStr.substring(0, 1).toLowerCase() + requiresStr.substring(1); String[] args2= { "One", "java.defaultProject" }; final String importStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_importtype_description, args2); String proposalStr= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_combine_two_proposals_info, new String[] { importStr, requiresStr }); assertProposalExists(proposals, proposalStr); }
Source:
cepStatelessRulesTranslator( final ContinuousStream<Map<String, Object>> inputMap, final List<CepStatelessRule> cepStatelessRules) { int ruleNum = cepStatelessRules.size(); for(int i=0; i<ruleNum; i++){ CepStatelessRule rule = cepStatelessRules.get(i); CepAction action = rule.getAction(); CepSink sink = action.getCepSink(); ContinuousStream<Map<String, Object>> temp = inputMap; if(action.getCepActionType() == CepActionType.TEXT_WRITE) { temp = cepConditionTranslator(temp, rule.getCondition()); } else { continue; } if(sink.getCepSinkType() == CepSinkType.TEXT_SOCKET_OUTPUT) { final List<Object> params = action.getParams(); final String separator = sink.getSeparator(); final MISTFunction<Map<String, Object>, String> mapFunction = s -> CepTuple.mapToString(s, params, separator); temp.map(mapFunction) .textSocketOutput((String)sink.getSinkConfigs().get("SOCKET_SINK_ADDRESS"), (int)sink.getSinkConfigs().get("SOCKET_SINK_PORT")); } else { throw new IllegalStateException("Only TEXT_SOCKET_OUTPUT is supported now!"); } } return inputMap; }

Target:
private static ContinuousStream<Map<String, Object>> cepStatelessRulesTranslator( final ContinuousStream<Map<String, Object>> inputMap, final List<CepStatelessRule> cepStatelessRules) { final int ruleNum = cepStatelessRules.size(); for (int i = 0; i < ruleNum; i++) { final CepStatelessRule rule = cepStatelessRules.get(i); final CepAction action = rule.getAction(); final CepSink sink = action.getCepSink(); ContinuousStream<Map<String, Object>> temp = inputMap; switch (action.getCepActionType()) { case TEXT_WRITE: { switch (sink.getCepSinkType()) { case TEXT_SOCKET_OUTPUT: { temp = cepConditionTranslator(temp, rule.getCondition()); final List<Object> params = action.getParams(); final String separator = sink.getSeparator(); temp.map(new CepMapToStringFunction(params, separator)) .textSocketOutput((String)sink.getSinkConfigs().get("SOCKET_SINK_ADDRESS"), (int)sink.getSinkConfigs().get("SOCKET_SINK_PORT")); break; } default: throw new IllegalStateException("Only TEXT_SOCKET_OUTPUT is supported now!"); } break; } default: continue; } } return inputMap; }
Source:
public RabbitmqProducer(MaxwellContext context) { super(context); this.exchangeName = context.getConfig().rabbitmqExchange; ConnectionFactory factory = new ConnectionFactory(); factory.setHost(context.getConfig().rabbitmqHost); try { this.connection = factory.newConnection(); this.channel = connection.createChannel(); this.channel.exchangeDeclare(exchangeName, context.getConfig().rabbitmqExchangeType); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } }

Target:
public RabbitmqProducer(MaxwellContext context) { super(context); exchangeName = context.getConfig().rabbitmqExchange; ConnectionFactory factory = new ConnectionFactory(); factory.setHost(context.getConfig().rabbitmqHost); try { this.channel = factory.newConnection().createChannel(); this.channel.exchangeDeclare(exchangeName, context.getConfig().rabbitmqExchangeType); } catch (IOException | TimeoutException e) { throw new RuntimeException(e); } }
Source:
public final String toHaskellType() { final StringBuilder out = new StringBuilder(); for (final Type type : this.types) { out.append("instance ").append(this.name).append(" ").append(type.toHaskellType()).append("\n"); } return out.toString().trim(); }

Target:
public final String toHaskellType() { final StringBuilder out = new StringBuilder(); for (final Type type : this.types) { out.append("instance ").append(this.name).append(" ").append(type.toHaskellType()) .append(System.lineSeparator()); } return out.toString().trim(); }
Source:
private IGraphicalEditPart getEditPart(Diagram diagram, String semanticElement) { modelSetFixture.getPageManager().openPage(diagram); View diagramView = DiagramUtils.findShape(diagram, semanticElement); if (diagramView == null) { diagramView = DiagramUtils.findEdge(diagram, semanticElement); } if (diagramView == null) { Iterator<?> iterator = diagram.eAllContents(); while (null == diagramView && iterator.hasNext()) { Object object = iterator.next(); if (object instanceof View) { diagramView = DiagramUtils.findShape((View) object, semanticElement); if (diagramView == null) { diagramView = DiagramUtils.findEdge((View) object, semanticElement); } } } } assertNotNull(diagramView); IGraphicalEditPart semanticEP = DiagramUtils.findEditPartforView(modelSetFixture.getEditor(), diagramView, IGraphicalEditPart.class); assertNotNull(semanticEP); return semanticEP; }

Target:
private IGraphicalEditPart getEditPart(Diagram diagram, String semanticElement) { modelSetFixture.getPageManager().openPage(diagram); View diagramView = DiagramUtils.findShape(diagram, semanticElement); if (null == diagramView) { diagramView = DiagramUtils.findEdge(diagram, semanticElement); } if (null == diagramView) { Iterator<?> iterator = diagram.eAllContents(); while (null == diagramView && iterator.hasNext()) { Object object = iterator.next(); if (object instanceof View) { diagramView = DiagramUtils.findShape((View) object, semanticElement); if (null == diagramView) { diagramView = DiagramUtils.findEdge((View) object, semanticElement); } } } } assertNotNull(diagramView); IGraphicalEditPart semanticEP = DiagramUtils.findEditPartforView(modelSetFixture.getEditor(), diagramView, IGraphicalEditPart.class); assertNotNull(semanticEP); return semanticEP; }
Source:
public void deserializeJetpackRestResponse(SiteModel site, JSONObject response) { if (site == null || response == null) return; JSONObject settingsObject = response.optJSONObject("settings"); mRemoteSettings.monitorActive = settingsObject.optBoolean(JP_MONITOR_ACTIVE_KEY, false); mRemoteSettings.emailNotifications = settingsObject.optBoolean(JP_MONITOR_EMAIL_NOTES_KEY, false); mRemoteSettings.wpNotifications = settingsObject.optBoolean(JP_MONITOR_WP_NOTES_KEY, false); }

Target:
private void deserializeJetpackRestResponse(SiteModel site, JSONObject response) { if (site == null || response == null) return; JSONObject settingsObject = response.optJSONObject("settings"); mRemoteSettings.monitorActive = settingsObject.optBoolean(JP_MONITOR_ACTIVE_KEY, false); mRemoteSettings.emailNotifications = settingsObject.optBoolean(JP_MONITOR_EMAIL_NOTES_KEY, false); mRemoteSettings.wpNotifications = settingsObject.optBoolean(JP_MONITOR_WP_NOTES_KEY, false); }
Source:
private Map<String, ?> resolveConfigVariables(Map<String, ?> configProviderProps, Map<String, Object> originals) { Map<String, String> providerConfigString; Map<String, ?> configProperties; Map<String, Object> originalsMutable = new HashMap<>(); originalsMutable.putAll(originals); Map<String, String> indirectVariables = extractPotentialVariables(originals); if (configProviderProps == null || configProviderProps.isEmpty()) { providerConfigString = indirectVariables; configProperties = originals; } else { providerConfigString = extractPotentialVariables(configProviderProps); configProperties = configProviderProps; } Map<String, ConfigProvider> providers = instantiateConfigProviders(providerConfigString, configProperties); if (!providers.isEmpty()) { ConfigTransformer configTransformer = new ConfigTransformer(providers); ConfigTransformerResult result = configTransformer.transform(indirectVariables); originalsMutable.putAll(result.data()); } return originalsMutable; }

Target:
private Map<String, ?> resolveConfigVariables(Map<String, ?> configProviderProps, Map<String, Object> originals) { Map<String, String> providerConfigString; Map<String, ?> configProperties; Map<String, Object> resolvedOriginals = new HashMap<>(); Map<String, String> indirectVariables = extractPotentialVariables(originals); resolvedOriginals.putAll(originals); if (configProviderProps == null || configProviderProps.isEmpty()) { providerConfigString = indirectVariables; configProperties = originals; } else { providerConfigString = extractPotentialVariables(configProviderProps); configProperties = configProviderProps; } Map<String, ConfigProvider> providers = instantiateConfigProviders(providerConfigString, configProperties); if (!providers.isEmpty()) { ConfigTransformer configTransformer = new ConfigTransformer(providers); ConfigTransformerResult result = configTransformer.transform(indirectVariables); if (!result.data().isEmpty()) { resolvedOriginals.putAll(result.data()); } } return new ResolvingMap<>(resolvedOriginals, originals); }
Source:
private JPanel getTechPanel() { if (techPanel == null) { techPanel = new JPanel(new GridBagLayout()); JScrollPane scrollPane = new JScrollPane(); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setViewportView(getTechTree()); scrollPane.setBorder( javax.swing.BorderFactory.createEtchedBorder( javax.swing.border.EtchedBorder.RAISED)); techPanel.add(scrollPane, LayoutHelper.getGBC(0, 0, 1, 1, 1.0D, 1.0D)); } else { getTechTree().refresh(); } return techPanel; }

Target:
private JPanel getTechPanel() { if (techPanel == null) { techPanel = new JPanel(new GridBagLayout()); JScrollPane scrollPane = new JScrollPane(); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setViewportView(getTechTree()); scrollPane.setBorder( javax.swing.BorderFactory.createEtchedBorder( javax.swing.border.EtchedBorder.RAISED)); techPanel.add(scrollPane, LayoutHelper.getGBC(0, 0, 1, 1, 1.0D, 1.0D)); } return techPanel; }
Source:
public void onAddAccountsToGroup(Account.Id me, Collection<AccountGroupMember> added) { List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); for (AccountGroupMember m : added) { AccountGroupMemberAudit audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); auditInserts.add(audit); } try { db.get().accountGroupMembersAudit().insert(auditInserts); } catch (OrmException e) { String header = "Cannot log add accounts to group event performed by user "; logOrmExceptionForAccounts(me, added, e, header); } }

Target:
public void onAddAccountsToGroup(Account.Id me, Collection<AccountGroupMember> added) { List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); for (AccountGroupMember m : added) { AccountGroupMemberAudit audit = new AccountGroupMemberAudit(m, me, TimeUtil.nowTs()); auditInserts.add(audit); } try { db.get().accountGroupMembersAudit().insert(auditInserts); } catch (OrmException e) { logOrmExceptionForAccounts( "Cannot log add accounts to group event performed by user", me, added, e); } }