auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private synchronized void onSubscription() { if (service.isRegistered(this)) { logger.debug("Checking WeMo GENA subscription for '{}'", this); ThingTypeUID thingTypeUID = thing.getThingTypeUID(); String subscription = null; if (thingTypeUID.equals(THING_TYPE_INSIGHT)) { subscription = "insight1"; } else { subscription = "basicevent1"; service.addSubscription(this, "basicevent1", SUBSCRIPTION_DURATION); } if ((subscriptionState.get(subscription) == null) || !subscriptionState.get(subscription).booleanValue()) { logger.debug("Setting up GENA subscription {}: Subscribing to service {}...", getUDN(), subscription); service.addSubscription(this, subscription, SUBSCRIPTION_DURATION); subscriptionState.put(subscription, true); } } else { logger.warn("Setting up WeMo GENA subscription for '{}' FAILED - service.isRegistered(this) is FALSE", this); } }

Target:
private synchronized void onSubscription() { if (service.isRegistered(this)) { logger.debug("Checking WeMo GENA subscription for '{}'", this); ThingTypeUID thingTypeUID = thing.getThingTypeUID(); String subscription = null; if (thingTypeUID.equals(THING_TYPE_INSIGHT)) { subscription = "insight1"; } else { subscription = "basicevent1"; } if ((subscriptionState.get(subscription) == null) || !subscriptionState.get(subscription).booleanValue()) { logger.debug("Setting up GENA subscription {}: Subscribing to service {}...", getUDN(), subscription); service.addSubscription(this, subscription, SUBSCRIPTION_DURATION); subscriptionState.put(subscription, true); } } else { logger.debug("Setting up WeMo GENA subscription for '{}' FAILED - service.isRegistered(this) is FALSE", this); } }
Source:
TcpIgniteClient( Function<ClientChannelConfiguration, ClientChannel> chFactory, ClientConfiguration cfg ) throws ClientException { final ClientBinaryMetadataHandler metadataHandler = new ClientBinaryMetadataHandler(); marsh = new ClientBinaryMarshaller(metadataHandler, new ClientMarshallerContext()); marsh.setBinaryConfiguration(cfg.getBinaryConfiguration()); serDes = new ClientUtils(marsh); binary = new ClientBinary(marsh); ch = new ReliableChannel(chFactory, cfg, binary); ch.initConnection(); ch.addChannelFailListener(() -> metadataHandler.onReconnect()); transactions = new TcpClientTransactions(ch, marsh, new ClientTransactionConfiguration(cfg.getTransactionConfiguration())); cluster = new ClientClusterImpl(ch, marsh); compute = new ClientComputeImpl(ch, marsh, cluster.defaultClusterGroup()); services = new ClientServicesImpl(ch, marsh, cluster.defaultClusterGroup()); }

Target:
TcpIgniteClient( Function<ClientChannelConfiguration, ClientChannel> chFactory, ClientConfiguration cfg ) throws ClientException { final ClientBinaryMetadataHandler metadataHandler = new ClientBinaryMetadataHandler(); marsh = new ClientBinaryMarshaller(metadataHandler, new ClientMarshallerContext()); marsh.setBinaryConfiguration(cfg.getBinaryConfiguration()); serDes = new ClientUtils(marsh); binary = new ClientBinary(marsh); ch = new ReliableChannel(chFactory, cfg, binary); ch.channelsInit(); ch.addChannelFailListener(() -> metadataHandler.onReconnect()); transactions = new TcpClientTransactions(ch, marsh, new ClientTransactionConfiguration(cfg.getTransactionConfiguration())); cluster = new ClientClusterImpl(ch, marsh); compute = new ClientComputeImpl(ch, marsh, cluster.defaultClusterGroup()); services = new ClientServicesImpl(ch, marsh, cluster.defaultClusterGroup()); }
Source:
private void resetData(AccountObject account) { mId = account.getId(); mUsername = account.getUsername(); mPassword = account.getPassword(); mEmail = account.getEmail(); mNickName = account.getNickName(); mEnable = account.getEnable(); mRoles = null; }

Target:
private void resetData(AccountObject account) { mId = account.getId(); mUsername = account.getUsername(); mPassword = account.getPassword(); mEmail = account.getEmail(); mNickName = account.getNickName(); mEnable = account.getEnable(); }
Source:
public void nonEmptyArrayToUnmodifiableNonNullListOfStrings() { Object[] array = {"1", "2", "3"}; List<String> list = InternalQueries.unmodifiableNonNullListOfStrings(array); assertThat(list.size()).isEqualTo(array.length); for (int i = 0; i < array.length; i++) { assertThat(list.get(i)).isEqualTo(array[i]); } }

Target:
public void nonEmptyArrayToUnmodifiableNonNullListOfStrings() { Object[] array = {"1", "2", "3"}; List<String> list = InternalQueries.unmodifiableNonNullListOfStrings(array); assertThat(list).hasSize(array.length); for (int i = 0; i < array.length; i++) { assertThat(list.get(i)).isEqualTo(array[i]); } }
Source:
private void connect() { LOG.trace("Connecting to {}", remoteId.address); this.channel = new Bootstrap().group(rpcClient.group).channel(rpcClient.channelClass) .option(ChannelOption.TCP_NODELAY, rpcClient.isTcpNoDelay()) .option(ChannelOption.SO_KEEPALIVE, rpcClient.tcpKeepAlive) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, rpcClient.connectTO) .handler(new BufferCallBeforeInitHandler()).localAddress(rpcClient.localAddr) .option(ChannelOption.WRITE_BUFFER_WATER_MARK, ((NettyRpcClient) rpcClient).writeBufferWaterMark) .remoteAddress(remoteId.address).connect().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { Channel ch = future.channel(); if (!future.isSuccess()) { failInit(ch, toIOE(future.cause())); rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause()); return; } ch.writeAndFlush(connectionHeaderPreamble.retainedDuplicate()); if (useSasl) { saslNegotiate(ch); } else { ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch); } } }).channel(); }

Target:
private void connect() { LOG.trace("Connecting to {}", remoteId.address); this.channel = new Bootstrap().group(rpcClient.group).channel(rpcClient.channelClass) .option(ChannelOption.TCP_NODELAY, rpcClient.isTcpNoDelay()) .option(ChannelOption.SO_KEEPALIVE, rpcClient.tcpKeepAlive) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, rpcClient.connectTO) .option(ChannelOption.SO_REUSEADDR, rpcClient.tcpReuseAddr) .handler(new BufferCallBeforeInitHandler()).localAddress(rpcClient.localAddr) .option(ChannelOption.WRITE_BUFFER_WATER_MARK, rpcClient.writeBufferWaterMark) .remoteAddress(remoteId.address).connect().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { Channel ch = future.channel(); if (!future.isSuccess()) { failInit(ch, toIOE(future.cause())); rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause()); return; } ch.writeAndFlush(connectionHeaderPreamble.retainedDuplicate()); if (useSasl) { saslNegotiate(ch); } else { ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch); } } }).channel(); }
Source:
public byte[] convertToByteArray() { byte[] secreteKeyBytes = secretKey.getEncoded(); byte[] retVal = new byte[SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH + secreteKeyBytes.length]; System.arraycopy(initializationVector, 0, retVal, 0, SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH); System.arraycopy(secreteKeyBytes, 0, retVal, SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH, secreteKeyBytes.length); return retVal; }

Target:
public byte[] convertToByteArray() { byte[] secretKeyBytes = secretKey.getEncoded(); byte[] retVal = new byte[SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH + secretKeyBytes.length]; System.arraycopy(initializationVector, 0, retVal, 0, SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH); System.arraycopy(secretKeyBytes, 0, retVal, SecretKeyUtil.INITIALIZATION_VECTOR_LENGTH, secretKeyBytes.length); return retVal; }
Source:
public ServiceCache<S> build() { if (_cachingPolicy.useSingletonPolicy()) { return new SingletonServiceCache<>(_serviceFactory); } else { return new ServiceCache<>(_cachingPolicy, _serviceFactory, _metricRegistry); } }

Target:
public ServiceCache<S> build() { checkNotNull(_cachingPolicy); if (_cachingPolicy.useMultiThreadedClientPolicy()) { checkArgument(_cachingPolicy.evictionTTLForMultiThreadedClientPolicy() >= 0); checkNotNull(_serviceFactory); if(!(_serviceFactory instanceof ThreadSafeServiceFactory)) { throw new IllegalArgumentException("Please implement ThreadSafeServiceFactory to construct MultiThreadedClientServiceCache"); } return new MultiThreadedClientServiceCache<>((ThreadSafeServiceFactory<S>) _serviceFactory, _cachingPolicy.evictionTTLForMultiThreadedClientPolicy(), _metricRegistry); } else { checkNotNull(_serviceFactory); checkNotNull(_metricRegistry); return new SingleThreadedClientServiceCache<>(_cachingPolicy, _serviceFactory, _metricRegistry); } }
Source:
protected IPersonAttributes getSinglePerson(final Set<IPersonAttributes> people) { IPersonAttributes person; try { person = DataAccessUtils.singleResult(people); } catch (final IncorrectResultSizeDataAccessException e) { logger.debug("Unexpected multiple people returned from person attribute DAO: : ", e.getClass().getName(), e.getMessage()); people.stream().forEach(p -> { logger.debug("Person: {}", p); }); throw e; } return person; }

Target:
protected IPersonAttributes getSinglePerson(final Set<IPersonAttributes> people) { IPersonAttributes person; try { person = DataAccessUtils.singleResult(people); } catch (final IncorrectResultSizeDataAccessException e) { logger.warn("Unexpected multiple people returned from person attribute DAO: : ", e.getClass().getName(), e.getMessage()); people.forEach(p -> logger.debug("Person: {}", p)); throw e; } return person; }
Source:
public void testValue() throws Exception { ModelNode address = getAddress(); ModelNode operation = getOperation(address); ModelNode res = executeOperation(operation); ModelNode node = res.get("java: contexts", "java:jboss/exported", "test", "children", "Bean!org.jboss.as.test.integration.naming.remote.ejb.Remote", "class-name"); Assert.assertEquals("org.jboss.as.test.integration.naming.remote.ejb.Remote", node.asString()); }

Target:
public void testValue() throws Exception { ModelNode operation = Util.createEmptyOperation("jndi-view", PathAddress.pathAddress("subsystem", "naming")); ModelNode res = ManagementOperations.executeOperation(managementClient.getControllerClient(), operation); ModelNode node = res.get("java: contexts", "java:jboss/exported", "test", "children", "Bean!org.jboss.as.test.integration.naming.remote.ejb.Remote", "class-name"); Assert.assertEquals("org.jboss.as.test.integration.naming.remote.ejb.Remote", node.asString()); }
Source:
protected void executeVdsBrokerCommand() { String volumeName = getParameters().getVolumeName(); result = getBroker().glusterVolumeRebalanceStop(volumeName); GlusterVolumeTaskStatusEntity entity = result.getStatusDetails(); entity.setStatusTime(new Date()); entity.setStopTime(new Date()); proceedProxyReturnValue(); setReturnValue(entity); }

Target:
protected void executeVdsBrokerCommand() { String volumeName = getParameters().getVolumeName(); result = getBroker().glusterVolumeRebalanceStop(volumeName); proceedProxyReturnValue(); GlusterVolumeTaskStatusEntity entity = result.getStatusDetails(); entity.setStatusTime(new Date()); entity.setStopTime(new Date()); setReturnValue(entity); }
Source:
private void onSessionStateChange(final Session session, SessionState state, Exception exception) { if (state.isOpened()) { Request request = Request.newMeRequest(session, new Request.GraphUserCallback() { @Override public void onCompleted(GraphUser user, Response response) { if (session.equals(Session.getActiveSession()) && user != null) { String name = user.getName(); String tokenString = String.format(getString(R.string.facebook_token_format), session.getAccessToken()); loginSuccessCallback.onLoginSuccess(name, tokenString); } } }); Request.executeBatchAsync(request); } }

Target:
private void onSessionStateChange(final Session session, SessionState state, Exception exception) { if (exception != null) { Timber.e("Facebook error: %s", exception.getMessage()); } if (state.isOpened()) { Request request = Request.newMeRequest(session, new Request.GraphUserCallback() { @Override public void onCompleted(GraphUser user, Response response) { if (session.equals(Session.getActiveSession()) && user != null) { String name = user.getName(); String tokenString = String.format(getString(R.string.facebook_token_format), session.getAccessToken()); loginSuccessCallback.onLoginSuccess(name, tokenString); } } }); Request.executeBatchAsync(request); } }
Source:
private void walkAST(LanguageConnectionContext lcc, Visitable queryTree, CompilationPhase phase) throws StandardException { ASTVisitor visitor = lcc.getASTVisitor(); try { if (visitor != null) { visitor.begin(statementText, phase); queryTree.accept(visitor); } } catch (StandardException e) { throw e; } finally { visitor.end(phase); } }

Target:
private void walkAST(LanguageConnectionContext lcc, Visitable queryTree, CompilationPhase phase) throws StandardException { ASTVisitor visitor = lcc.getASTVisitor(); if (visitor != null) { try { visitor.begin(statementText, phase); queryTree.accept(visitor); } finally { visitor.end(phase); } } }
Source:
private Container createContainer() throws DotSecurityException, DotDataException { Container container = new Container(); container.setFriendlyName("test container"); container.setTitle("this is the title"); container.setMaxContentlets(5); container.setPreLoop("preloop code"); container.setPostLoop("postloop code"); final Structure st=CacheLocator.getContentTypeCache().getStructureByVelocityVarName("host"); final List<ContainerStructure> csList = new ArrayList<>(); ContainerStructure cs = new ContainerStructure(); cs.setStructureId(st.getInode()); cs.setCode("this is the code"); csList.add(cs); return containerAPI.save(container, csList, defaultHost, user, false); }

Target:
private Container createContainer() throws DotSecurityException, DotDataException { Container container = new Container(); container.setFriendlyName("test container"); container.setTitle("this is the title"); container.setMaxContentlets(5); container.setPreLoop("preloop code"); container.setPostLoop("postloop code"); final List<ContainerStructure> csList = new ArrayList<>(); ContainerStructure cs = new ContainerStructure(); cs.setStructureId(contentTypeAPI.find("host").inode()); cs.setCode("this is the code"); csList.add(cs); return containerAPI.save(container, csList, defaultHost, user, false); }
Source:
public Poller(Duration pollInterval, Function<PollResponse<T>, Mono<PollResponse<T>>> pollOperation) { Objects.requireNonNull(pollInterval, "The poll interval input parameter cannot be null."); if (pollInterval.toNanos() <= 0) { throw new IllegalArgumentException("Negative or zero value for poll interval not allowed."); } Objects.requireNonNull(pollOperation, "The poll operation input parameter cannot be null."); this.pollInterval = pollInterval; this.pollOperation = pollOperation; this.pollResponse = new PollResponse<>(PollResponse.OperationStatus.NOT_STARTED, null); this.fluxHandle = asyncPollRequestWithDelay() .flux() .repeat() .takeUntil(pollResponse -> pollResponse != null && pollResponse.isDone()) .share(); this.fluxDisposable = fluxHandle.subscribe(); this.autoPollingEnabled = true; }

Target:
public Poller(Duration pollInterval, Function<PollResponse<T>, Mono<PollResponse<T>>> pollOperation) { Objects.requireNonNull(pollInterval, "The poll interval input parameter cannot be null."); if (pollInterval.toNanos() <= 0) { throw new IllegalArgumentException("Negative or zero value for poll interval not allowed."); } Objects.requireNonNull(pollOperation, "The poll operation input parameter cannot be null."); this.pollInterval = pollInterval; this.pollOperation = pollOperation; this.pollResponse = new PollResponse<>(PollResponse.OperationStatus.NOT_STARTED, null); this.fluxHandle = asyncPollRequestWithDelay() .flux() .repeat() .takeUntil(pollResponse -> hasCompleted()) .share(); this.fluxDisposable = fluxHandle.subscribe(); this.autoPollingEnabled = true; }
Source:
public Response getInsertionDetails(@PathParam("programUuid") long programUuid, @PathParam("uuid") long uuid) throws Exception { ArtifactReadable configArt = atsServer.getQuery().andUuid(uuid).getResults().getExactlyOne(); return getResponse(atsServer.getConfigItemFactory().getInsertion(configArt)); }

Target:
public Response getInsertionDetails(@PathParam("programUuid") long programUuid, @PathParam("uuid") long uuid) throws Exception { ArtifactReadable configArt = atsServer.getArtifactByUuid(uuid); if (configArt == null) { throw new OseeCoreException("Given uuid not found"); } return Response.ok().entity(atsServer.getConfigItemFactory().getInsertion(configArt)).build(); }
Source:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (isSearching()) { return false; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem shareItem = menu.findItem(R.id.menu_page_share); MenuItem addToListItem = menu.findItem(R.id.menu_page_add_to_list); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); MenuItem tabsItem = menu.findItem(R.id.menu_page_show_tabs); tabsItem.setIcon(ResourceUtil.getTabListIcon(pageFragment.getTabCount())); if (pageFragment.isLoading() || pageFragment.getErrorState()) { otherLangItem.setEnabled(false); shareItem.setEnabled(false); addToListItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(pageFragment.getPage() != null && pageFragment.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); shareItem.setEnabled(pageFragment.getPage() != null && pageFragment.getPage().isArticle()); addToListItem.setEnabled(pageFragment.getPage() != null && pageFragment.getPage().isArticle()); findInPageItem.setEnabled(true); updateMenuPageInfo(menu); themeChooserItem.setEnabled(true); } return true; }

Target:
public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (isSearching()) { return false; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem shareItem = menu.findItem(R.id.menu_page_share); MenuItem addToListItem = menu.findItem(R.id.menu_page_add_to_list); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); MenuItem tabsItem = menu.findItem(R.id.menu_page_show_tabs); tabsItem.setIcon(ResourceUtil.getTabListIcon(pageFragment.getTabCount())); if (pageFragment.isLoading() || pageFragment.getErrorState()) { otherLangItem.setEnabled(false); shareItem.setEnabled(false); addToListItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(pageFragment.getPage() != null && pageFragment.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); shareItem.setEnabled(pageFragment.getPage() != null && pageFragment.getPage().isArticle()); addToListItem.setEnabled(pageFragment.getPage() != null && pageFragment.getPage().isArticle()); findInPageItem.setEnabled(true); themeChooserItem.setEnabled(true); updateMenuPageInfo(menu); } return true; }
Source:
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount())); GlusterVolumeTaskStatusEntity entity = setStartTime((GlusterVolumeTaskStatusEntity) returnValue.getReturnValue()); return updateHostDetails(entity); }

Target:
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount())); return updateStatusEntity((GlusterVolumeTaskStatusEntity) returnValue.getReturnValue()); }
Source:
void subscribe(@Nonnull StreamListener streamListener, @Nonnull String namespace, @Nonnull String streamTag, @Nonnull List<String> tablesOfInterest, @Nullable Timestamp timestamp) { runtime.getTableRegistry().getStreamManager() .subscribe(streamListener, namespace, streamTag, tablesOfInterest, (timestamp == null) ? getTimestamp().getSequence() : timestamp.getSequence()); }

Target:
public void subscribe(@Nonnull StreamListener streamListener, @Nonnull String namespace, @Nonnull String streamTag, @Nonnull List<String> tablesOfInterest, @Nullable Timestamp timestamp) { runtime.getTableRegistry().getStreamManager() .subscribe(streamListener, namespace, streamTag, tablesOfInterest, (timestamp == null) ? getTimestamp().getSequence() : timestamp.getSequence()); }
Source:
public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAccessingContentProviderAsSingle() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.get()).thenReturn(new PreparedGet.Builder(storIOContentResolver)); final TestSubscriber<List<TestItem>> testSubscriber = new TestSubscriber<List<TestItem>>(); storIOContentResolver .get() .listOfObjects(TestItem.class) .withQuery(Query.builder().uri(mock(Uri.class)).build()) .prepare() .asRxSingle() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); assertThat(testSubscriber.getOnErrorEvents().get(0)) .isInstanceOf(StorIOException.class) .hasCauseInstanceOf(IllegalStateException.class); verify(storIOContentResolver).get(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).query(any(Query.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }

Target:
public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAccessingContentProviderAsSingle() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.get()).thenReturn(new PreparedGet.Builder(storIOContentResolver)); final TestSubscriber<List<TestItem>> testSubscriber = new TestSubscriber<List<TestItem>>(); storIOContentResolver .get() .listOfObjects(TestItem.class) .withQuery(Query.builder().uri(mock(Uri.class)).build()) .prepare() .asRxSingle() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); assertThat(testSubscriber.getOnErrorEvents().get(0)) .isInstanceOf(StorIOException.class) .hasCauseInstanceOf(IllegalStateException.class) .hasMessage(IllegalStateException.class.getName() + ": This type does not have type mapping: type = " + TestItem.class + ",ContentProvider was not touched by this operation, please add type mapping for this type"); verify(storIOContentResolver).get(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).query(any(Query.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }
Source:
protected void updateExpiration(final String token, long expiration) { if (isUnknown(token)) { log.unknownToken(getTokenDisplayText(token)); throw new IllegalArgumentException("Unknown or revoked token."); } try { aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME, token); aliasService.addAliasForCluster(AliasService.NO_CLUSTER_NAME, token, String.valueOf(expiration)); } catch (AliasServiceException e) { log.failedToUpdateTokenExpiration(e); } }

Target:
protected void updateExpiration(final String token, long expiration) { if (isUnknown(token)) { log.unknownToken(getTokenDisplayText(token)); throw new IllegalArgumentException("Unknown token."); } try { aliasService.removeAliasForCluster(AliasService.NO_CLUSTER_NAME, token); aliasService.addAliasForCluster(AliasService.NO_CLUSTER_NAME, token, String.valueOf(expiration)); } catch (AliasServiceException e) { log.failedToUpdateTokenExpiration(e); } }
Source:
public String toGss() { try { CssStylesheet sheet = GenerateCssAst.exec(new PrintWriterTreeLogger(printWriter), cssFile); DefCollectorVisitor defCollectorVisitor = new DefCollectorVisitor(); defCollectorVisitor.accept(sheet); Set<String> gssVarariableNames; if (extractContantNames.isEmpty()) { gssVarariableNames = new HashSet<String>(defCollectorVisitor.getDefMapping().values()); } else { gssVarariableNames = extractContantNames; } ExternalClassesCollector externalClassesCollector = new ExternalClassesCollector(); externalClassesCollector.accept(sheet); SortedSet<String> classes = externalClassesCollector.getClasses(); removeWrongEntries(classes); new UndefinedConstantVisitor(gssVarariableNames, lenient).accept(sheet); new ElseNodeCreator().accept(sheet); new AlternateAnnotationCreatorVisitor().accept(sheet); new FontFamilyVisitor().accept(sheet); GssGenerationVisitor gssGenerationVisitor = new GssGenerationVisitor(new DefaultTextOutput (false), defCollectorVisitor.getDefMapping(), classes, lenient); gssGenerationVisitor.accept(sheet); return gssGenerationVisitor.getContent(); } catch (Exception e) { printWriter.flush(); throw new RuntimeException(e); } }

Target:
public String toGss() { try { CssStylesheet sheet = GenerateCssAst.exec(new PrintWriterTreeLogger(printWriter), cssFile); DefCollectorVisitor defCollectorVisitor = new DefCollectorVisitor(); defCollectorVisitor.accept(sheet); Set<String> gssVariableNames = new HashSet<String>(defCollectorVisitor.getDefMapping().values()); ExternalClassesCollector externalClassesCollector = new ExternalClassesCollector(); externalClassesCollector.accept(sheet); SortedSet<String> classes = externalClassesCollector.getClasses(); removeWrongEntries(classes); removeWrongEscaping(classes); new UndefinedConstantVisitor(gssVariableNames, lenient).accept(sheet); new ElseNodeCreator().accept(sheet); new AlternateAnnotationCreatorVisitor().accept(sheet); new FontFamilyVisitor().accept(sheet); ConstantsCollector constantsCollector = new ConstantsCollector(); constantsCollector.accept(sheet); GssGenerationVisitor gssGenerationVisitor = new GssGenerationVisitor( new DefaultTextOutput(false), defCollectorVisitor.getDefMapping(), classes, constantsCollector.getConstantNodes(), lenient); gssGenerationVisitor.accept(sheet); return gssGenerationVisitor.getContent(); } catch (Exception e) { printWriter.flush(); throw new RuntimeException(e); } }
Source:
public EventType evolve(final EventType original, final EventTypeBase eventType) throws InvalidEventTypeException { final Optional<SchemaEvolutionIncompatibility> incompatibility = schemaEvolutionConstraints.stream() .map(c -> c.validate(original, eventType)).filter(Optional::isPresent).findFirst() .orElse(Optional.empty()); if (incompatibility.isPresent()) { throw new InvalidEventTypeException(incompatibility.get().getReason()); } final List<SchemaChange> changes = schemaDiff.collectChanges(schema(original), schema(eventType)); final Version.Level changeLevel = semanticOfChange(changes, original.getCompatibilityMode()); if (changeLevel == NO_CHANGES && !original.getSchema().getSchema().equals(eventType.getSchema().getSchema())) { LOG.error("undetected schema changes from to {}", original.getSchema().getSchema(), eventType.getSchema().getSchema()); throw new MyNakadiRuntimeException1("undetected schema changes"); } if (isForwardToCompatibleUpgrade(original, eventType)) { validateCompatibilityModeMigration(original, eventType, changes); } else if (original.getCompatibilityMode() != CompatibilityMode.NONE) { validateCompatibleChanges(original, changes, changeLevel); } return this.bumpVersion(original, eventType, changeLevel); }

Target:
public EventType evolve(final EventType original, final EventTypeBase eventType) throws InvalidEventTypeException { final Optional<SchemaEvolutionIncompatibility> incompatibility = schemaEvolutionConstraints.stream() .map(c -> c.validate(original, eventType)).filter(Optional::isPresent).findFirst() .orElse(Optional.empty()); if (incompatibility.isPresent()) { throw new InvalidEventTypeException(incompatibility.get().getReason()); } final List<SchemaChange> changes = schemaDiff.collectChanges(schema(original), schema(eventType)); final Version.Level changeLevel = semanticOfChange(changes, original.getCompatibilityMode()); if (changeLevel == NO_CHANGES && !original.getSchema().getSchema().equals(eventType.getSchema().getSchema())) { LOG.error("undetected schema changes from to {}", original.getSchema().getSchema(), eventType.getSchema().getSchema()); throw new UnexpectedSchemaChangeException("undetected schema changes"); } if (isForwardToCompatibleUpgrade(original, eventType)) { validateCompatibilityModeMigration(original, eventType, changes); } else if (original.getCompatibilityMode() != CompatibilityMode.NONE) { validateCompatibleChanges(original, changes, changeLevel); } return this.bumpVersion(original, eventType, changeLevel); }
Source:
private void checkCreatingCustomHasher(AstNode classDef) { AstNode argList = classDef.getFirstChild(PythonGrammar.ARGLIST); if (argList != null) { argList.getDescendants(PythonGrammar.ATOM) .forEach(atom -> { if (questionableDjangoHashers.contains(getQualifiedName(atom))) { addIssue(atom, MESSAGE); } }); } }

Target:
private void checkCreatingCustomHasher(AstNode classDef) { AstNode argList = classDef.getFirstChild(PythonGrammar.ARGLIST); if (argList != null) { argList.getDescendants(PythonGrammar.ATOM) .stream() .filter(atom -> questionableDjangoHashers.contains(getQualifiedName(atom))) .forEach(atom -> addIssue(atom, MESSAGE)); } }
Source:
public String getAdbPort() { return (String) getCapability(AndroidMobileCapabilityType.ADB_PORT); }

Target:
public Integer getAdbPort() { return (Integer) getCapability(AndroidMobileCapabilityType.ADB_PORT); }
Source:
public void visitReturnStatement(ReturnStatementTree returnStatement) { ExpressionTree expression = returnStatement.expression(); if (!checkNull(expression) && expression.is(Kind.CONDITIONAL_EXPRESSION)) { ConditionalExpressionTree conditionalExpression = (ConditionalExpressionTree)expression; checkNull(conditionalExpression.trueExpression()); checkNull(conditionalExpression.falseExpression()); } }

Target:
public void visitReturnStatement(ReturnStatementTree returnStatement) { checkNull(returnStatement.expression()); super.visitReturnStatement(returnStatement); }
Source:
Script(JavaScriptValidator validator, String name, String script) throws RedPenException { this.name = name; ScriptEngine engine = manager.getEngineByName("nashorn"); try { engine.put("redpenToBeBound", validator); engine.eval("var addError = Function.prototype.bind.call(redpenToBeBound.addError, redpenToBeBound);" + "var addErrorWithPosition = Function.prototype.bind.call(redpenToBeBound.addErrorWithPosition, redpenToBeBound);" + "var addLocalizedError = Function.prototype.bind.call(redpenToBeBound.addLocalizedError, redpenToBeBound);" + "var addLocalizedErrorFromToken = Function.prototype.bind.call(redpenToBeBound.addLocalizedErrorFromToken, redpenToBeBound);" + "var addLocalizedErrorWithPosition = Function.prototype.bind.call(redpenToBeBound.addLocalizedErrorWithPosition, redpenToBeBound);"); applySandbox(engine); CompiledScript compiledScript = ((Compilable) engine).compile(script); compiledScript.eval(); this.message = (String)engine.get("message"); this.invocable = (Invocable) engine; } catch (ScriptException e) { throw new RedPenException(e); } }

Target:
Script(JavaScriptValidator validator, String name, String script) throws RedPenException { this.name = name; ScriptEngine engine = manager.getEngineByName("nashorn"); try { engine.put("redpenToBeBound", validator); engine.eval("var addError = Function.prototype.bind.call(redpenToBeBound.addError, redpenToBeBound);" + "var addErrorWithPosition = Function.prototype.bind.call(redpenToBeBound.addErrorWithPosition, redpenToBeBound);" + "var addLocalizedError = Function.prototype.bind.call(redpenToBeBound.addLocalizedError, redpenToBeBound);" + "var addLocalizedErrorFromToken = Function.prototype.bind.call(redpenToBeBound.addLocalizedErrorFromToken, redpenToBeBound);" + "var addLocalizedErrorWithPosition = Function.prototype.bind.call(redpenToBeBound.addLocalizedErrorWithPosition, redpenToBeBound);" + "var _JavaScriptValidatorTest = Java.type('cc.redpen.validator.JavaScriptValidatorTest');" + "java = undefined; javax = undefined; Java = undefined; load = undefined; redpenToBeBound = undefined;"); CompiledScript compiledScript = ((Compilable) engine).compile(script); compiledScript.eval(); this.message = (String)engine.get("message"); this.invocable = (Invocable) engine; } catch (ScriptException e) { throw new RedPenException(e); } }
Source:
public void satisfiesEqualsContract() throws IOException { final List<String> dispositions = Arrays.asList( Joiner.on(RqMultipartTest.CRLF).join( "Content-Disposition: form-data; name=\"addres\"", "", "449 N Wolfe Rd, Sunnyvale, CA 94085" ), "Content-Disposition: form-data; name=\"data\"; filename=\"a.bin\"" ); final String boundary = "AaB02x"; final Collection<String> parts = new LinkedList<String>(); for (final String disposition : dispositions) { parts.add(String.format("--%s", boundary)); parts.add(disposition); } parts.add("Content-Transfer-Encoding: utf-8"); parts.add(String.format("--%s--", boundary)); final Request req = new RqFake( Arrays.asList( "POST /h?u=3 HTTP/1.1", "Host: www.example.com", "Content-Type: multipart/form-data; boundary=AaB02x", "Content-Length: 100001" ), Joiner.on(RqMultipartTest.CRLF).join(parts) ); MatcherAssert.assertThat( new RqMultipart.Base(req), Matchers.equalTo(new RqMultipart.Base(req)) ); }

Target:
public void satisfiesEqualsContract() throws IOException { final Request req = new RqMultipart.Fake( Joiner.on(RqMultipartTest.CRLF).join( "Content-Disposition: form-data; name=\"addres\"", "", "449 N Wolfe Rd, Sunnyvale, CA 94085" ), "Content-Disposition: form-data; name=\"data\"; filename=\"a.bin\"" ); MatcherAssert.assertThat( new RqMultipart.Base(req), Matchers.equalTo(new RqMultipart.Base(req)) ); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || !(obj instanceof LazilyParsedNumber)) { return false; } LazilyParsedNumber other = (LazilyParsedNumber) obj; return equals(value, other.value); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LazilyParsedNumber) { LazilyParsedNumber other = (LazilyParsedNumber) obj; return value == other.value || value.equals(other.value); } return false; }
Source:
private void handleUpdatedFeedStatus(Feed feed) { if (feed != null) { if (DownloadRequester.getInstance().isDownloadingFile(feed.getDownload_url())) { viewBinding.subscribeButton.setEnabled(false); viewBinding.subscribeButton.setText(R.string.subscribing_label); if (UserPreferences.isEnableAutodownload()) { LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) viewBinding.subscribeButton.getLayoutParams(); layoutParams.setMargins(16, 16, 16, 0); viewBinding.subscribeButton.setLayoutParams(layoutParams); viewBinding.autoDownloadCheckBox.setVisibility(View.VISIBLE); } } else if (feedInFeedlist(feed)) { viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.open_podcast); if (didPressSubscribe) { didPressSubscribe = false; if (viewBinding.autoDownloadCheckBox.getVisibility() == View.VISIBLE) { Feed feed1 = DBReader.getFeed(getFeedId(feed)); FeedPreferences feedPreferences = feed1.getPreferences(); feedPreferences.setAutoDownload(viewBinding.autoDownloadCheckBox.isChecked()); feed1.savePreferences(); } openFeed(); } } else { if (UserPreferences.isEnableAutodownload()) { LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) viewBinding.subscribeButton.getLayoutParams(); layoutParams.setMargins(16, 16, 16, 0); viewBinding.subscribeButton.setLayoutParams(layoutParams); viewBinding.autoDownloadCheckBox.setVisibility(View.VISIBLE); } viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.subscribe_label); } } }

Target:
private void handleUpdatedFeedStatus(Feed feed) { if (feed != null) { if (DownloadRequester.getInstance().isDownloadingFile(feed.getDownload_url())) { viewBinding.subscribeButton.setEnabled(false); viewBinding.subscribeButton.setText(R.string.subscribing_label); } else if (feedInFeedlist(feed)) { viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.open_podcast); if (didPressSubscribe) { didPressSubscribe = false; if (UserPreferences.isEnableAutodownload()) { Feed feed1 = DBReader.getFeed(getFeedId(feed)); FeedPreferences feedPreferences = feed1.getPreferences(); feedPreferences.setAutoDownload(viewBinding.autoDownloadCheckBox.isChecked()); feed1.savePreferences(); } openFeed(); } } else { viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.subscribe_label); if (UserPreferences.isEnableAutodownload()) { viewBinding.autoDownloadCheckBox.setVisibility(View.VISIBLE); } } } }
Source:
public void getAllPositionsShouldReturnEmptyListWhenThereAreNoPositions() { given(positionRepository.findAll()).willReturn(EMPTY_POSITION_ENTITY_LIST); given(modelMapper.map(EMPTY_POSITION_ENTITY_LIST, POSITIONDTO_LIST_TYPE)) .willReturn(EMPTY_POSITION_DTO_LIST); Collection<PositionDTO> positions = positionService.getAllPositions(); assertThat(positions, notNullValue()); assertThat(positions.isEmpty(), is(true)); }

Target:
public void getAllPositionsShouldReturnEmptyListWhenThereAreNoPositions() { given(positionRepository.findAll()).willReturn(EMPTY_POSITION_ENTITY_LIST); given(modelMapper.map(EMPTY_POSITION_ENTITY_LIST, POSITIONDTO_LIST_TYPE)) .willReturn(EMPTY_POSITION_DTO_LIST); Collection<PositionDTO> positions = positionService.getAllPositions(); assertThat(positions, notNullValue()); assertThat(positions.isEmpty(), is(true)); then(positionRepository).should(times(1)).findAll(); }
Source:
public String getHostName() { byte[] hostnameBuffer = new byte[4097]; int result = LibC.INSTANCE.gethostname(hostnameBuffer, hostnameBuffer.length); if (result != 0) { throw new RuntimeException("gethostname call failed"); } return Native.toString(hostnameBuffer); }

Target:
public String getHostName() { byte[] hostnameBuffer = new byte[HOST_NAME_MAX + 1]; if (0 != SYS.gethostname(hostnameBuffer, hostnameBuffer.length)) { return super.getHostName(); } return Native.toString(hostnameBuffer); }
Source:
private List<TriggerAction> createActions(SlaOption sla, int execId) { List<TriggerAction> actions = new ArrayList<>(); List<String> slaActions = sla.getActions(); for (String act : slaActions) { TriggerAction action = null; switch (act) { case SlaOption.ACTION_ALERT: action = new SlaAlertAction("slaAlert", sla, execId); break; case SlaOption.ACTION_CANCEL_FLOW: action = new KillExecutionAction("killExecution", execId); break; default: break; } if (action != null) { actions.add(action); } } return actions; }

Target:
private List<TriggerAction> createActions(SlaOption sla, int execId) { List<TriggerAction> actions = new ArrayList<>(); List<String> slaActions = sla.getActions(); for (String act : slaActions) { TriggerAction action = null; switch (act) { case SlaOption.ACTION_ALERT: action = new SlaAlertAction("slaAlert", sla, execId); break; case SlaOption.ACTION_CANCEL_FLOW: action = new KillExecutionAction("killExecution", execId); break; default: logger.info("Unknown action type " + act); break; } if (action != null) { actions.add(action); } } return actions; }
Source:
private void addSpinnerToGraph(WebView graphView, ViewGroup graphLayout) { final ProgressBar spinner = new ProgressBar(this.getContext(), null, android.R.attr.progressBarStyleLarge); spinner.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER)); GraphLoader graphLoader = new GraphLoader((Activity) this.getContext(), spinner); ((WebView)graphView).addJavascriptInterface(graphLoader, "Android"); Timer spinnerTimer = new Timer(); spinnerTimer.schedule(graphLoader, 10000); graphLayout.addView(spinner); }

Target:
private void addSpinnerToGraph(WebView graphView, ViewGroup graphLayout) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { return; } final ProgressBar spinner = new ProgressBar(this.getContext(), null, android.R.attr.progressBarStyleLarge); spinner.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER)); GraphLoader graphLoader = new GraphLoader((Activity) this.getContext(), spinner); graphView.addJavascriptInterface(graphLoader, "Android"); Timer spinnerTimer = new Timer(); spinnerTimer.schedule(graphLoader, 10000); graphLayout.addView(spinner); }
Source:
Mono<EncryptResult> encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, byte[] iv, byte[] authenticationData) { Objects.requireNonNull(algorithm); if(key == null){ this.key = getKey().block().value().keyMaterial(); } if (!checkKeyPermissions(this.key.keyOps(), KeyOperation.ENCRYPT)){ return Mono.error(new UnsupportedOperationException(String.format("Encrypt Operation is not supported for key with id %s", key.kid()))); } switch(key.kty()){ case RSA: case RSA_HSM: return rsaKeyCryptographyClient.encryptAsync(algorithm, plaintext, iv, authenticationData, context, key); case EC: case EC_HSM: return ecKeyCryptographyClient.encryptAsync(algorithm, plaintext, iv, authenticationData, context, key); case OCT: return symmetricKeyCryptographyClient.encryptAsync(algorithm, plaintext, iv, authenticationData, context, key); default: throw new UnsupportedOperationException(String.format("Encrypt Async is not allowed for Key Type: %s", key.kty().toString())); } }

Target:
Mono<EncryptResult> encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context, byte[] iv, byte[] authenticationData) { Objects.requireNonNull(algorithm, "Encryption algorithm cannot be null."); Objects.requireNonNull(plaintext, "Plain text content to be encrypted cannot be null."); boolean keyAvailableLocally = ensureValidKeyAvailable(); if (!keyAvailableLocally) { return cryptographyServiceClient.encrypt(algorithm, plaintext, context); } if (!checkKeyPermissions(this.key.keyOps(), KeyOperation.ENCRYPT)) { return Mono.error(new UnsupportedOperationException(String.format("Encrypt Operation is missing permission/not supported for key with id %s", key.kid()))); } return localKeyCryptographyClient.encryptAsync(algorithm, plaintext, iv, authenticationData, context, key); }
Source:
public void handle(Message req, org.jgroups.blocks.Response response) throws Exception { if (isValid(req)) { ReplicableCommand cmd = null; try { cmd = (ReplicableCommand) req_marshaller.objectFromBuffer(req.getRawBuffer(), req.getOffset(), req.getLength()); if (cmd == null) throw new NullPointerException("Unable to execute a null command! Message was " + req); JGroupsAsyncInvocationRequest callback = fromJGroupsResponse(response); Object retVal; if (req.getSrc() instanceof SiteAddress) { retVal = executeCommandFromRemoteSite(cmd, (SiteAddress)req.getSrc(), callback); } else { retVal = executeCommandFromLocalCluster(cmd, req, callback); } if (!cmd.isProcessedAsynchronously()) { transport.sendResponse(cmd, null, callback, retVal, false); } } catch (InterruptedException e) { log.warnf("Shutdown while handling command %s", cmd); if (response != null) { response.send(new ExceptionResponse(new CacheException("Cache is shutting down")), false); } } catch (Throwable x) { if (cmd == null) log.warnf(x, "Problems unmarshalling remote command from byte buffer"); else log.warnf(x, "Problems invoking command %s", cmd); if (response != null) { response.send(new ExceptionResponse(new CacheException("Problems invoking command.", x)), false); } } } else if (response != null) { response.send(null, false); } }

Target:
public void handle(Message req, org.jgroups.blocks.Response response) throws Exception { if (isValid(req)) { boolean cannotBeReordered = !req.isFlagSet(Message.Flag.OOB); ReplicableCommand cmd = null; try { cmd = (ReplicableCommand) req_marshaller.objectFromBuffer(req.getRawBuffer(), req.getOffset(), req.getLength()); if (cmd == null) throw new NullPointerException("Unable to execute a null command! Message was " + req); if (req.getSrc() instanceof SiteAddress) { executeCommandFromRemoteSite(cmd, (SiteAddress) req.getSrc(), response, cannotBeReordered); } else { executeCommandFromLocalCluster(cmd, req, response, cannotBeReordered); } } catch (InterruptedException e) { log.warnf("Shutdown while handling command %s", cmd); reply(response, new ExceptionResponse(new CacheException("Cache is shutting down"))); } catch (Throwable x) { if (cmd == null) log.warnf(x, "Problems unmarshalling remote command from byte buffer"); else log.warnf(x, "Problems invoking command %s", cmd); reply(response, new ExceptionResponse(new CacheException("Problems invoking command.", x))); } } else { reply(response, null); } }
Source:
private void handleErrors(List<Throwable> tooLargemessageException, List<Throwable> otherMessageException) { StringBuffer messageExceptionForDialog = new StringBuffer(); if (!tooLargemessageException.isEmpty()) { messageExceptionForDialog.append(Messages.ExportAction_imagesTooLargeMessage); } for (Throwable thr : tooLargemessageException) { messageExceptionForDialog.append("\n"); messageExceptionForDialog.append(" - "); messageExceptionForDialog.append(thr.getMessage()); } for (Throwable thr : otherMessageException) { messageExceptionForDialog.append("\n"); messageExceptionForDialog.append(" - "); messageExceptionForDialog.append(thr.getMessage()); } final Shell shell = Display.getCurrent().getActiveShell(); MessageDialog.openError(shell, Messages.ExportAction_exportImpossibleTitle, messageExceptionForDialog.toString()); SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, messageExceptionForDialog.toString())); }

Target:
private void handleErrors(List<Throwable> tooLargemessageException, List<Throwable> otherMessageException) { StringBuffer messageExceptionForDialog = new StringBuffer(); if (!tooLargemessageException.isEmpty()) { messageExceptionForDialog.append(Messages.ExportAction_imagesTooLargeMessage); } for (Throwable thr : tooLargemessageException) { messageExceptionForDialog.append("\n"); messageExceptionForDialog.append(" - "); messageExceptionForDialog.append(thr.getMessage()); } for (Throwable thr : otherMessageException) { if (!tooLargemessageException.isEmpty()) { messageExceptionForDialog.append("\n"); } if (tooLargemessageException.size() > 1) { messageExceptionForDialog.append(" - "); } messageExceptionForDialog.append(thr.getMessage()); } final Shell shell = Display.getCurrent().getActiveShell(); MessageDialog.openError(shell, Messages.ExportAction_exportImpossibleTitle, messageExceptionForDialog.toString()); SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, messageExceptionForDialog.toString())); }