auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String[] appendBookmarksIfFolder(String selection, String[] selectionArgs) { final SQLiteDatabase db = mOpenHelper.getReadableDatabase(); final String[] bookmarksProjection = new String[] { Bookmarks._ID, Bookmarks.IS_FOLDER }; List<String> newSelectionArgs = new ArrayList<String>(); Cursor cursor = null; try { cursor = db.query(TABLE_BOOKMARKS, bookmarksProjection, selection, selectionArgs, null, null, null); if (cursor != null) { while (cursor.moveToNext()) { String id = Long.toString(cursor.getLong(0)); newSelectionArgs.add(id); if (cursor.getInt(1) != 0) { String[] bookmarks = appendBookmarksIfFolder( Bookmarks.PARENT + "=?", new String[] { id }); for (String bookmark : bookmarks) { newSelectionArgs.add(bookmark); } } } } } finally { if (cursor != null) { cursor.close(); } } return newSelectionArgs.toArray(new String[newSelectionArgs.size()]); }

Target:
private Object[] appendBookmarksIfFolder(String selection, String[] selectionArgs) { final SQLiteDatabase db = mOpenHelper.getReadableDatabase(); final String[] bookmarksProjection = new String[] { Bookmarks._ID, Bookmarks.IS_FOLDER }; StringBuilder newSelection = new StringBuilder(selection); newSelection.append(" OR " + TABLE_BOOKMARKS + "._id IN ("); List<String> newSelectionArgs = new ArrayList<String>(); Cursor cursor = null; try { cursor = db.query(TABLE_BOOKMARKS, bookmarksProjection, selection, selectionArgs, null, null, null); if (cursor != null) { while (cursor.moveToNext()) { String id = Long.toString(cursor.getLong(0)); newSelectionArgs.add(id); if (cursor.getInt(1) != 0) { Object[] bookmarks = appendBookmarksIfFolder( Bookmarks.PARENT + "=?", new String[] { id }); String[] bookmarkIds = (String[]) bookmarks[1]; for (String bookmarkId : bookmarkIds) { newSelection.append("'" + bookmarkId + "',"); newSelectionArgs.add(bookmarkId); } newSelection.deleteCharAt(newSelection.length() - 1); } } } } finally { if (cursor != null) { cursor.close(); } } newSelection.append(")"); return new Object[] { newSelection.toString(), newSelectionArgs.toArray(new String[newSelectionArgs.size()]) }; }
Source:
public boolean equals(Object other) { if (other == null) { return false; } if (other == this) { return true; } if (!(other instanceof JcrManagedConnectionFactory)) { return false; } return this == (JcrManagedConnectionFactory) other; }

Target:
public boolean equals(Object other) { if (other == this) { return true; } if (other instanceof JcrManagedConnectionFactory) { return this == other; } return false; }
Source:
public IStatus releaseResourceAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { return null; }

Target:
public IStatus releaseResourceAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { return new Status(IStatus.ERROR, SiriusPlugin.ID, 1, Messages.AbstractResourceStrategyImpl_methodReleaseNotHandleMsg, null); }
Source:
public BugzillaRestConnector connector() { if (connector == null) { connector = new BugzillaRestConnector(); } return connector; }

Target:
public BugzillaRestConnector connector() { return connector; }
Source:
public Settings overrideSettings(final Settings settings) { final String nameOfTest = name.getMethodName(); switch (nameOfTest) { case "shouldRebindTraversalSourceVariables": try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); settings.scriptEngines.get("gremlin-groovy").scripts = Arrays.asList(p); } catch (Exception ex) { throw new RuntimeException(ex); } break; case "shouldWorkOverNioTransport": settings.channelizer = NioChannelizer.class.getName(); break; case "shouldFailWithBadClientSideSerialization": final List<String> custom = Arrays.asList( JsonBuilder.class.getName() + ";" + JsonBuilderGryoSerializer.class.getName(), java.awt.Color.class.getName()); settings.serializers.stream().filter(s -> s.config.containsKey("custom")) .findFirst().get().config.put("custom", custom); break; case "shouldExecuteScriptInSessionOnTransactionalGraph": case "shouldExecuteSessionlessScriptOnTransactionalGraph": case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; } return settings; }

Target:
public Settings overrideSettings(final Settings settings) { final String nameOfTest = name.getMethodName(); switch (nameOfTest) { case "shouldRebindTraversalSourceVariables": try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); settings.scriptEngines.get("gremlin-groovy").scripts = Arrays.asList(p); } catch (Exception ex) { throw new RuntimeException(ex); } break; case "shouldWorkOverNioTransport": settings.channelizer = NioChannelizer.class.getName(); break; case "shouldFailWithBadClientSideSerialization": final List<String> custom = Arrays.asList( JsonBuilder.class.getName() + ";" + JsonBuilderGryoSerializer.class.getName(), java.awt.Color.class.getName()); settings.serializers.stream().filter(s -> s.config.containsKey("custom")) .findFirst().get().config.put("custom", custom); break; case "shouldExecuteScriptInSessionOnTransactionalGraph": case "shouldExecuteSessionlessScriptOnTransactionalGraph": case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph": case "shouldExecuteInSessionAndSessionlessWithoutOpeningTransaction": deleteDirectory(new File("/tmp/neo4j")); settings.graphs.put("graph", "conf/neo4j-empty.properties"); break; } return settings; }
Source:
public Map<String, String> getGenericInformation() { return genericInformation; }

Target:
public ImmutableMap<String, String> getGenericInformation() { return genericInformation; }
Source:
public void should_return_422_if_organisation_unit_id_not_in_correct_format() throws Exception { var validIssuer = "54i0917n10va4428b69l5id0"; var validJwtMacKey = "4cabd5d2-0133-4e82-b0e5-2024dbeddaa9"; var jsonFields = new HashMap<String, String>(); jsonFields.put("issuer", validIssuer); jsonFields.put("organisational_unit_id", "incorrectFormat"); jsonFields.put("jwt_mac_key", validJwtMacKey); var payload = objectMapper.writeValueAsString(jsonFields); givenSetup() .body(payload) .post(format(VALIDATE_3DS_FLEX_CREDENTIALS_URL, accountId)) .then() .statusCode(HttpStatus.SC_UNPROCESSABLE_ENTITY) .body("error_identifier", is(ErrorIdentifier.GENERIC.name())) .body("message[0]", is("Field [organisational_unit_id] must be 24 lower-case hexadecimal characters")); }

Target:
public void should_return_422_if_organisation_unit_id_not_in_correct_format() throws Exception { var validIssuer = "54i0917n10va4428b69l5id0"; var validJwtMacKey = "4cabd5d2-0133-4e82-b0e5-2024dbeddaa9"; var payload = objectMapper.writeValueAsString(Map.of("issuer", validIssuer, "organisational_unit_id", "incorrectFormat", "jwt_mac_key", validJwtMacKey)); givenSetup() .body(payload) .post(format(VALIDATE_3DS_FLEX_CREDENTIALS_URL, accountId)) .then() .statusCode(HttpStatus.SC_UNPROCESSABLE_ENTITY) .body("error_identifier", is(ErrorIdentifier.GENERIC.name())) .body("message[0]", is("Field [organisational_unit_id] must be 24 lower-case hexadecimal characters")); }
Source:
void epollInReady() { assert eventLoop().inEventLoop(); DatagramChannelConfig config = config(); if (shouldBreakEpollInReady(config)) { clearEpollIn0(); return; } final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle(); allocHandle.edgeTriggered(isFlagSet(Native.EPOLLET)); final ChannelPipeline pipeline = pipeline(); final ByteBufAllocator allocator = config.getAllocator(); allocHandle.reset(config); epollInBefore(); Throwable exception = null; try { try { boolean connected = isConnected(); do { ByteBuf byteBuf = allocHandle.allocate(allocator); final boolean read; int datagramSize = config().getMaxDatagramPayloadSize(); int numDatagram = datagramSize == 0 ? 1 : byteBuf.writableBytes() / datagramSize; try { if (numDatagram <= 1) { if (connected) { read = connectedRead(allocHandle, byteBuf); } else { read = read(allocHandle, byteBuf, datagramSize); } } else { read = scatteringRead(allocHandle, byteBuf, datagramSize, numDatagram); } } catch (NativeIoException e) { if (connected) { throw translateForConnected(e); } throw e; } if (read) { readPending = false; } else { break; } } while (allocHandle.continueReading()); } catch (Throwable t) { exception = t; } allocHandle.readComplete(); pipeline.fireChannelReadComplete(); if (exception != null) { pipeline.fireExceptionCaught(exception); } } finally { epollInFinally(config); } }

Target:
void epollInReady() { assert eventLoop().inEventLoop(); DatagramChannelConfig config = config(); if (shouldBreakEpollInReady(config)) { clearEpollIn0(); return; } final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle(); allocHandle.edgeTriggered(isFlagSet(Native.EPOLLET)); final ChannelPipeline pipeline = pipeline(); final ByteBufAllocator allocator = config.getAllocator(); allocHandle.reset(config); epollInBefore(); Throwable exception = null; try { try { boolean connected = isConnected(); do { ByteBuf byteBuf = allocHandle.allocate(allocator); final boolean read; int datagramSize = config().getMaxDatagramPayloadSize(); int numDatagram = datagramSize == 0 ? 1 : byteBuf.writableBytes() / datagramSize; try { if (numDatagram <= 1) { if (connected) { read = connectedRead(allocHandle, byteBuf, datagramSize); } else { read = read(allocHandle, byteBuf, datagramSize); } } else { read = scatteringRead(allocHandle, byteBuf, datagramSize, numDatagram); } } catch (NativeIoException e) { if (connected) { throw translateForConnected(e); } throw e; } if (read) { readPending = false; } else { break; } } while (allocHandle.continueReading()); } catch (Throwable t) { exception = t; } allocHandle.readComplete(); pipeline.fireChannelReadComplete(); if (exception != null) { pipeline.fireExceptionCaught(exception); } } finally { epollInFinally(config); } }
Source:
private String AvailableName(ArrayList<String> list) { String commonName = getCommonName(); ArrayList<Integer> notAvailableNumberList = new ArrayList<Integer>(); String temp; for (String str : list) { temp = str.replace(getCommonName(), ""); if (StringHelper.isNullOrEmpty(temp)) { temp = "0"; } ListUtils.nullSafeElemAdd(notAvailableNumberList, IntegerCompat.tryParse(temp)); } Collections.sort(notAvailableNumberList); int i; for (i = 0; i < notAvailableNumberList.size(); i++) { if (notAvailableNumberList.get(i) == i) { continue; } break; } if (i > 0) { commonName = getCommonName() + (Integer.valueOf(i)).toString(); } return commonName; }

Target:
private String AvailableName(ArrayList<String> list) { String commonName = getCommonName(); ArrayList<Integer> notAvailableNumberList = new ArrayList<Integer>(); String temp; for (String str : list) { temp = str.replace(getCommonName(), ""); if (StringHelper.isNullOrEmpty(temp)) { temp = "0"; } ListUtils.nullSafeElemAdd(notAvailableNumberList, IntegerCompat.tryParse(temp)); } Collections.sort(notAvailableNumberList); int i; for (i = 0; i < notAvailableNumberList.size(); i++) { if (notAvailableNumberList.get(i) == i) { continue; } break; } if (i > 0) { commonName = getCommonName() + String.valueOf(i); } return commonName; }
Source:
private String handleException(Exception e) { logger.error(e.getMessage(), e); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("message", e.getMessage()); Gson gson = new Gson(); return gson.toJson(jsonObject); }

Target:
private MotechMessage handleException(Exception e) { logger.error(e.getMessage(), e); return new MotechMessage(e.getMessage()); }
Source:
public void onProjectInitialized(String projectFolder) throws ServerException, ForbiddenException, ConflictException, NotFoundException { if (!languageServerLauncher.get().isStarted()) { return; } String wsPath = absolutize(projectFolder); ProjectConfig project = projectRegistryProvider .get() .get(wsPath) .orElseThrow(() -> new ServerException("Can't find a project: " + wsPath)); List<String> library = project.getAttributes().get(LIBRARY_FOLDER); if (library != null && !library.isEmpty()) { extensionService.get().addJars(project.getPath(), library.get(0)); } }

Target:
public void onProjectInitialized(String projectFolder) throws ServerException, ForbiddenException, ConflictException, NotFoundException { if (!languageServerLauncher.get().isStarted()) { return; } String wsPath = absolutize(projectFolder); ProjectConfig project = projectRegistryProvider .get() .get(wsPath) .orElseThrow(() -> new ServerException("Can't find a project: " + wsPath)); List<String> library = project.getAttributes().get(LIBRARY_FOLDER); if (library != null && !library.isEmpty()) { String libraryFolder = library.get(0); if (!isNullOrEmpty(libraryFolder)) { extensionService.get().addJars(project.getPath(), libraryFolder); } } }
Source:
private Collection<Contact> fillContacts(Collection<RosterEntry> entryIter, Set<String> skipList) { Roster roster = mConnection.getRoster(); Collection<Contact> contacts = new ArrayList<Contact>(); for (RosterEntry entry : entryIter) { String address = entry.getUser(); if (skipList != null && !skipList.add(address)) continue; String name = entry.getName(); if (name == null) name = address; XmppAddress xaddress = new XmppAddress(name, address); org.jivesoftware.smack.packet.Presence presence = roster.getPresence(address); String status = presence.getStatus(); String resource = null; String from = presence.getFrom(); if (from != null && from.lastIndexOf("/") > 0) { resource = from.substring(from.lastIndexOf("/") + 1); if (resource.indexOf('.')!=-1) resource = resource.substring(0,resource.indexOf('.')); } if (resource != null) xaddress.appendResource(resource); Contact contact = mContactListManager.getContact(xaddress.getFullName()); if (contact == null) contact = new Contact(xaddress, name); contact.setPresence(new Presence(parsePresence(presence), status, null, null, Presence.CLIENT_TYPE_DEFAULT)); contacts.add(contact); } return contacts; }

Target:
private Collection<Contact> fillContacts(Collection<RosterEntry> entryIter, Set<String> skipList) { Roster roster = mConnection.getRoster(); Collection<Contact> contacts = new ArrayList<Contact>(); for (RosterEntry entry : entryIter) { String address = entry.getUser(); if (skipList != null && !skipList.add(address)) continue; String name = entry.getName(); if (name == null) name = address; XmppAddress xaddress = new XmppAddress(name, address); org.jivesoftware.smack.packet.Presence presence = roster.getPresence(address); String status = presence.getStatus(); String resource = null; Presence p = new Presence(parsePresence(presence), status, null, null, Presence.CLIENT_TYPE_DEFAULT); String from = presence.getFrom(); if (from != null && from.lastIndexOf("/") > 0) { resource = from.substring(from.lastIndexOf("/") + 1); if (resource.indexOf('.')!=-1) resource = resource.substring(0,resource.indexOf('.')); p.setResource(resource); } Contact contact = mContactListManager.getContact(xaddress.getFullName()); if (contact == null) contact = new Contact(xaddress, xaddress.getScreenName()); contact.setPresence(p); contacts.add(contact); } return contacts; }
Source:
private void verifyUserMetadataHeaders(JSONObject expectedHeaders, MockRestResponseChannel restResponseChannel) throws JSONException { Iterator itr = expectedHeaders.keys(); while (itr.hasNext()) { String key = (String) itr.next(); if (key.startsWith(RestUtils.Headers.UserMetaData_Header_Prefix)) { String outValue = restResponseChannel.getHeader(key, MockRestResponseChannel.DataStatus.Flushed); assertTrue("Key " + key + "value does not match in user metadata, input " + expectedHeaders.getString(key) + ", output " + outValue, expectedHeaders.getString(key).equals(outValue)); } } }

Target:
private void verifyUserMetadataHeaders(JSONObject expectedHeaders, MockRestResponseChannel restResponseChannel) throws JSONException { Iterator itr = expectedHeaders.keys(); while (itr.hasNext()) { String key = (String) itr.next(); if (key.startsWith(RestUtils.Headers.UserMetaData_Header_Prefix)) { String outValue = restResponseChannel.getHeader(key, MockRestResponseChannel.DataStatus.Flushed); assertEquals("Value for " + key + "does not match in user metadata", expectedHeaders.getString(key), outValue); } } }
Source:
public void intraWikiSearch_016_communityPushToTopWikiResult() { IntraWikiSearchPageObject search = new IntraWikiSearchPageObject(driver, testedWiki); search.goToSearchPage(wikiCommunityURL); search.searchCommunityFor(searchWiki); search.verifyPushToTopWikiTitle(searchWiki); search.verifyPushToTopWikiThumbnail(); }

Target:
public void intraWikiSearch_016_communityPushToTopWikiResult() { IntraWikiSearchPageObject search = new IntraWikiSearchPageObject(driver); search.openWikiPage(communityWiki); search.searchFor(searchWiki); search.verifyPushToTopWikiTitle(searchWiki); search.verifyPushToTopWikiThumbnail(); }
Source:
private static Channel createChannel(ChannelDefinition channelDefinition, ThingUID thingUID, String groupId, ConfigDescriptionRegistry configDescriptionRegistry) { ChannelType type = withChannelTypeRegistry(channelTypeRegistry -> { return (channelTypeRegistry != null) ? channelTypeRegistry.getChannelType(channelDefinition.getChannelTypeUID()) : null; }); if (type == null) { logger.warn( "Could not create channel '{}' for thing type '{}', because channel type '{}' could not be found.", channelDefinition.getId(), thingUID, channelDefinition.getChannelTypeUID()); return null; } ChannelUID channelUID = new ChannelUID(thingUID, groupId, channelDefinition.getId()); ChannelBuilder channelBuilder = createChannelBuilder(channelUID, type, configDescriptionRegistry); if (channelDefinition.getLabel() != null) { channelBuilder = channelBuilder.withLabel(channelDefinition.getLabel()); } if (channelDefinition.getDescription() != null) { channelBuilder = channelBuilder.withDescription(channelDefinition.getDescription()); } channelBuilder = channelBuilder.withProperties(channelDefinition.getProperties()); Channel channel = channelBuilder.build(); return channel; }

Target:
private static Channel createChannel(ChannelDefinition channelDefinition, ThingUID thingUID, String groupId, ConfigDescriptionRegistry configDescriptionRegistry) { ChannelType type = withChannelTypeRegistry(channelTypeRegistry -> { return (channelTypeRegistry != null) ? channelTypeRegistry.getChannelType(channelDefinition.getChannelTypeUID()) : null; }); if (type == null) { logger.warn( "Could not create channel '{}' for thing type '{}', because channel type '{}' could not be found.", channelDefinition.getId(), thingUID, channelDefinition.getChannelTypeUID()); return null; } ChannelUID channelUID = new ChannelUID(thingUID, groupId, channelDefinition.getId()); ChannelBuilder channelBuilder = createChannelBuilder(channelUID, type, configDescriptionRegistry); if (channelDefinition.getLabel() != null) { channelBuilder = channelBuilder.withLabel(channelDefinition.getLabel()); } if (channelDefinition.getDescription() != null) { channelBuilder = channelBuilder.withDescription(channelDefinition.getDescription()); } channelBuilder = channelBuilder.withProperties(channelDefinition.getProperties()); return channelBuilder.build(); }
Source:
private void registerEventHandlers(EventBus eventBus) { eventBus.addHandler(WorkspaceReadyEvent.getType(), new WorkspaceReadyEvent.WorkspaceReadyHandler() { @Override public void onWorkspaceReady(WorkspaceReadyEvent event) { breakpointStorage.readAll().then(new Operation<List<Breakpoint>>() { @Override public void apply(List<Breakpoint> breakpoints) throws OperationException { for (Breakpoint breakpoint : breakpoints) { addBreakpoint(breakpoint); } } }); } }); eventBus.addHandler(EditorOpenedEvent.TYPE, new EditorOpenedEventHandler() { @Override public void onEditorOpened(EditorOpenedEvent event) { onOpenEditor(event.getFile().getLocation().toString(), event.getEditor()); } }); eventBus.addHandler(DeleteProjectEvent.TYPE, new DeleteProjectHandler() { @Override public void onProjectDeleted(DeleteProjectEvent event) { if (breakpoints.isEmpty()) { return; } ProjectConfigDto config = event.getProjectConfig(); String path = config.getPath() + "/"; deleteBreakpoints(getBreakpointPaths(path)); } }); eventBus.addHandler(ResourceChangedEvent.getType(), new ResourceChangedEvent.ResourceChangedHandler() { @Override public void onResourceChanged(ResourceChangedEvent event) { if (event.getDelta().getKind() == ResourceDelta.REMOVED) { if (breakpoints.isEmpty()) { return; } final Resource resource = event.getDelta().getResource(); Path path = resource.getLocation(); if (resource.isFolder()) { path.addTrailingSeparator(); deleteBreakpoints(getBreakpointPaths(path.toString())); } else if (resource.isFile()) { deleteBreakpoints(Collections.singleton(path.toString())); } } } }); }

Target:
private void registerEventHandlers(EventBus eventBus) { eventBus.addHandler(WorkspaceReadyEvent.getType(), new WorkspaceReadyEvent.WorkspaceReadyHandler() { @Override public void onWorkspaceReady(WorkspaceReadyEvent event) { breakpointStorage.readAll().then(breakpoints -> { breakpoints.forEach(BreakpointManagerImpl.this::addBreakpoint); }); } }); eventBus.addHandler(EditorOpenedEvent.TYPE, event -> onOpenEditor(event.getFile().getLocation().toString(), event.getEditor())); eventBus.addHandler(DeleteProjectEvent.TYPE, event -> { if (breakpoints.isEmpty()) { return; } ProjectConfigDto config = event.getProjectConfig(); String path = config.getPath() + "/"; deleteBreakpoints(getBreakpointPaths(path)); }); eventBus.addHandler(ResourceChangedEvent.getType(), event -> { if (event.getDelta().getKind() == ResourceDelta.REMOVED) { if (breakpoints.isEmpty()) { return; } final Resource resource = event.getDelta().getResource(); Path path = resource.getLocation(); if (resource.isFolder()) { path.addTrailingSeparator(); deleteBreakpoints(getBreakpointPaths(path.toString())); } else if (resource.isFile()) { deleteBreakpoints(Collections.singleton(path.toString())); } } }); }
Source:
public boolean processBarrier( CheckpointBarrier receivedBarrier, int channelIndex, long bufferedBytes) throws Exception { long barrierId = receivedBarrier.getId(); if (currentCheckpointId < barrierId) { handleNewCheckpoint(barrierId); notifyCheckpointAsync(receivedBarrier, bufferedBytes, 0); } barrierConsumedChannels[channelIndex] = true; return false; }

Target:
public boolean processBarrier( CheckpointBarrier receivedBarrier, int channelIndex, long bufferedBytes) throws Exception { long barrierId = receivedBarrier.getId(); if (currentConsumedCheckpointId < barrierId) { currentConsumedCheckpointId = barrierId; numBarrierConsumed = 0; Arrays.fill(hasInflightBuffers, true); } if (currentConsumedCheckpointId == barrierId) { hasInflightBuffers[channelIndex] = false; numBarrierConsumed++; } threadSafeUnaligner.notifyBarrierReceived(receivedBarrier, channelInfos[channelIndex]); return false; }
Source:
public FeedInbound(Properties properties, String name, SynapseEnvironment synapseEnvironment, long scanInterval, String injectingSeq, String onErrorSeq, boolean coordination, boolean sequential) { super(properties, name, synapseEnvironment, scanInterval, injectingSeq, onErrorSeq, coordination, sequential); registryHandler = new FeedRegistryHandler(); this.name = name; log.info("Scan Interval Passing " + scanInterval); this.scanInterval = scanInterval; this.sequential = true; this.host = properties.getProperty(FeedEPConstant.FEED_URL); this.feedType = properties.getProperty(FeedEPConstant.FEED_TYPE); log.info("URL : " + host + "Feed Type : " + feedType); if (!StringUtils.isEmpty(properties.getProperty(FeedEPConstant.FEED_TIME_FORMAT))) { this.dateFormat = properties.getProperty(FeedEPConstant.FEED_TIME_FORMAT); } this.sequential = sequential; this.coordination = true; this.coordination = coordination; this.injectingSeq = injectingSeq; this.onErrorSeq = onErrorSeq; this.synapseEnvironment = synapseEnvironment; init(); }

Target:
public FeedInbound(Properties properties, String name, SynapseEnvironment synapseEnvironment, long scanInterval, String injectingSeq, String onErrorSeq, boolean coordination, boolean sequential) { super(properties, name, synapseEnvironment, scanInterval, injectingSeq, onErrorSeq, coordination, sequential); registryHandler = new FeedRegistryHandler(); this.name = name; this.scanInterval = scanInterval; this.sequential = true; this.host = properties.getProperty(FeedEPConstant.FEED_URL); this.feedType = properties.getProperty(FeedEPConstant.FEED_TYPE); if (!StringUtils.isEmpty(properties.getProperty(FeedEPConstant.FEED_TIME_FORMAT))) { this.dateFormat = properties.getProperty(FeedEPConstant.FEED_TIME_FORMAT); } this.sequential = sequential; this.coordination = true; this.coordination = coordination; this.injectingSeq = injectingSeq; this.onErrorSeq = onErrorSeq; this.synapseEnvironment = synapseEnvironment; init(); }
Source:
public void confirmExternalNameUniqueForProjectIfRequired(String newExternalName, Sample sample) throws IOException, ConstraintViolationException { if (!isUniqueExternalNameWithinProjectRequired()) return; Collection<SampleIdentity> matches = getIdentitiesByExactExternalNameAndProject(newExternalName, sample.getProject().getId()); if(matches.size() != 0) { SampleIdentity existingIdentity = matches.iterator().next(); throw new ConstraintViolationException("Duplicate external names not allowed within a project: External name " + newExternalName + " is already associated with Identity " + existingIdentity.getAlias() + " (" + existingIdentity.getExternalName() + ")", null, "externalName"); } }

Target:
public void confirmExternalNameUniqueForProjectIfRequired(String newExternalName, Sample sample) throws IOException, ConstraintViolationException { if (!isUniqueExternalNameWithinProjectRequired()) return; Collection<SampleIdentity> matches = getIdentitiesByExactExternalNameAndProject(newExternalName, sample.getProject().getId()); if (!matches.isEmpty()) { SampleIdentity existingIdentity = matches.iterator().next(); throw new ConstraintViolationException("Duplicate external names not allowed within a project: External name " + newExternalName + " is already associated with Identity " + existingIdentity.getAlias() + " (" + existingIdentity.getExternalName() + ")", null, "externalName"); } }
Source:
public Model read(InputStream input, Map<String, ?> options) throws IOException, ModelParseException { String location = PolyglotModelUtil.getLocation(options); String fixLocation = fixLocation(location); File file = new File(fixLocation); if (!fixLocation.equals(location)) { try (FileInputStream stream = new FileInputStream(file)) { return read(new InputStreamReader(stream, getPrimaryArtifactCharset()), file, options); } } return read(new InputStreamReader(input, getPrimaryArtifactCharset()), file, options); }

Target:
public Model read(InputStream input, Map<String, ?> options) throws IOException, ModelParseException { String location = PolyglotModelUtil.getLocation(options); String fixLocation = fixLocation(location); File file = new File(fixLocation); if (!fixLocation.equals(location)) { try (InputStreamReader stream = new InputStreamReader(new FileInputStream(file), getPrimaryArtifactCharset())) { return read(stream, file, options); } } try (InputStreamReader stream = new InputStreamReader(input, getPrimaryArtifactCharset())) { return read(stream, file, options); } }
Source:
public GrimlockFerociousKing(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},""); this.addSuperType(SuperType.LEGENDARY); this.subtype.add("Dinosaur"); this.power = new MageInt(8); this.toughness = new MageInt(8); this.color.setRed(true); this.color.setGreen(true); this.color.setWhite(true); this.transformable = true; this.nightCard = true; this.addAbility(TrampleAbility.getInstance()); this.addAbility(new TransformAbility()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(false), new ManaCostsImpl("{2}"))); }

Target:
public GrimlockFerociousKing(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},""); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DINOSAUR); this.power = new MageInt(8); this.toughness = new MageInt(8); this.color.setRed(true); this.color.setGreen(true); this.color.setWhite(true); this.transformable = true; this.nightCard = true; this.addAbility(TrampleAbility.getInstance()); this.addAbility(new TransformAbility()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(false), new ManaCostsImpl("{2}"))); }
Source:
public ConfigurationElement[] getChildren(String childrenName) { if (getRawChildren().length == 0) return ConfigurationElement.EMPTY_ARRAY; ConfigurationElement[] result = new ConfigurationElement[1]; int idx = 0; RegistryObjectManager objectManager = registry.getObjectManager(); for (int element : children) { ConfigurationElement toTest = (ConfigurationElement) objectManager.getObject(element, noExtraData() ? RegistryObjectManager.CONFIGURATION_ELEMENT : RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); if (toTest.name.equals(childrenName)) { if (idx != 0) { ConfigurationElement[] copy = new ConfigurationElement[result.length + 1]; System.arraycopy(result, 0, copy, 0, result.length); result = copy; } result[idx++] = toTest; } } if (idx == 0) result = ConfigurationElement.EMPTY_ARRAY; return result; }

Target:
public ConfigurationElement[] getChildren(String childrenName) { if (getRawChildren().length == 0) return ConfigurationElement.EMPTY_ARRAY; ConfigurationElement[] result = new ConfigurationElement[1]; int idx = 0; RegistryObjectManager objectManager = registry.getObjectManager(); for (int child : children) { ConfigurationElement toTest = (ConfigurationElement) objectManager.getObject(child, noExtraData() ? RegistryObjectManager.CONFIGURATION_ELEMENT : RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); if (toTest.name.equals(childrenName)) { if (idx != 0) { ConfigurationElement[] copy = new ConfigurationElement[result.length + 1]; System.arraycopy(result, 0, copy, 0, result.length); result = copy; } result[idx++] = toTest; } } if (idx == 0) result = ConfigurationElement.EMPTY_ARRAY; return result; }
Source:
private void initServer(String intf, int portReq) { QueuedThreadPool qtp = null; Server server = null; ServerConnector connector = null; try { qtp = new QueuedThreadPool(POOLSIZE, 0, REQTMO, new ArrayBlockingQueue<>(QUEUELIM)); qtp.setName("status-thread-pool"); server = new Server(qtp); connector = initConnector(server, intf, portReq); server.addConnector(connector); ServletContextHandler ctxHandler = new ServletContextHandler(); ctxHandler.setContextPath("/"); ctxHandler.setMaxFormContentSize(MAXQUERY); ctxHandler.setMaxFormKeys(MAXKEYS); ctxHandler.addServlet(StatusServlet.class, "/status").setAsyncSupported(true); server.setHandler(ctxHandler); } catch (Exception ex) { logError("StatusListener: initialization failure: %s", ex); try { connector.close(); } catch (Exception e2) { } try { server.destroy(); } catch (Exception e2) { } try { qtp.join(); } catch (Exception e2) { } throw new RuntimeException("Failed to initialize status listener", ex); } m_server = server; m_connector = connector; }

Target:
private void initServer(String intf, int portReq) throws InitException { QueuedThreadPool qtp = null; Server server = null; ServerConnector connector = null; try { qtp = new QueuedThreadPool(POOLSIZE, 0, REQTMO, new ArrayBlockingQueue<>(QUEUELIM)); qtp.setName("status-thread-pool"); server = new Server(qtp); connector = initConnector(server, intf, portReq); server.addConnector(connector); ServletContextHandler ctxHandler = new ServletContextHandler(); ctxHandler.setContextPath("/"); ctxHandler.setMaxFormContentSize(MAXQUERY); ctxHandler.setMaxFormKeys(MAXKEYS); ctxHandler.addServlet(StatusServlet.class, "/status").setAsyncSupported(true); server.setHandler(ctxHandler); } catch (Exception ex) { logError("StatusListener: initialization failure: %s", ex); try { connector.close(); } catch (Exception e2) { } try { server.destroy(); } catch (Exception e2) { } try { qtp.join(); } catch (Exception e2) { } throw new InitException("Failed to initialize status listener", ex); } m_server = server; m_connector = connector; }
Source:
Credentials addThirdPartyCredentials(Credentials creds) throws KeyException, IllegalAccessException { String privateKeyPath = PASchedulerProperties.getAbsolutePath(PASchedulerProperties.SCHEDULER_AUTH_PRIVKEY_PATH.getValueAsString()); String publicKeyPath = PASchedulerProperties.getAbsolutePath(PASchedulerProperties.SCHEDULER_AUTH_PUBKEY_PATH.getValueAsString()); PrivateKey privateKey = Credentials.getPrivateKey(privateKeyPath); PublicKey publicKey = Credentials.getPublicKey(publicKeyPath); CredData credData = creds.decrypt(privateKey); SchedulerDBManager dbManager = getInfrastructure().getDBManager(); if (dbManager != null) { Map<String, HybridEncryptedData> thirdPartyCredentials = null; thirdPartyCredentials = dbManager.thirdPartyCredentialsMap(credData.getLogin()); if (thirdPartyCredentials == null) { logger.error("Failed to retrieve Third Party Credentials!"); throw new KeyException("Failed to retrieve thirdPartyCredentials!"); } else { for (Map.Entry<String, HybridEncryptedData> thirdPartyCredential : thirdPartyCredentials.entrySet()) { String decryptedValue = HybridEncryptionUtil.decryptString(thirdPartyCredential.getValue(), privateKey); credData.addThirdPartyCredential(thirdPartyCredential.getKey(), decryptedValue); } } } Credentials nodeEncryptedUserCredentials = Credentials.createCredentials(credData, publicKey); return nodeEncryptedUserCredentials; }

Target:
Credentials addThirdPartyCredentials(Credentials creds) throws KeyException, IllegalAccessException { String privateKeyPath = PASchedulerProperties.getAbsolutePath(PASchedulerProperties.SCHEDULER_AUTH_PRIVKEY_PATH.getValueAsString()); String publicKeyPath = PASchedulerProperties.getAbsolutePath(PASchedulerProperties.SCHEDULER_AUTH_PUBKEY_PATH.getValueAsString()); PrivateKey privateKey = Credentials.getPrivateKey(privateKeyPath); PublicKey publicKey = Credentials.getPublicKey(publicKeyPath); CredData credData = creds.decrypt(privateKey); SchedulerDBManager dbManager = getInfrastructure().getDBManager(); if (dbManager != null) { Map<String, HybridEncryptedData> thirdPartyCredentials = dbManager.thirdPartyCredentialsMap(credData.getLogin()); if (thirdPartyCredentials == null) { logger.error("Failed to retrieve Third Party Credentials!"); throw new KeyException("Failed to retrieve thirdPartyCredentials!"); } else { for (Map.Entry<String, HybridEncryptedData> thirdPartyCredential : thirdPartyCredentials.entrySet()) { String decryptedValue = HybridEncryptionUtil.decryptString(thirdPartyCredential.getValue(), privateKey); credData.addThirdPartyCredential(thirdPartyCredential.getKey(), decryptedValue); } } } return Credentials.createCredentials(credData, publicKey); }
Source:
public void punctuate(final ProcessorNode node, final long timestamp, final PunctuationType type, final Punctuator punctuator) { if (processorContext.currentNode() != null) { throw new IllegalStateException(String.format("%sCurrent node is not null", logPrefix)); } updateProcessorContext(new StampedRecord(DUMMY_RECORD, timestamp), node); if (log.isTraceEnabled()) { log.trace("Punctuating processor with timestamp and punctuation type {}", node.name(), timestamp, type); } try { StreamsMetricsImpl.maybeMeasureLatency( () -> { node.punctuate(timestamp, punctuator); return null; }, time, punctuateLatencySensor ); } catch (final ProducerFencedException fatal) { throw new TaskMigratedException(this, fatal); } catch (final KafkaException e) { throw new StreamsException(String.format("%sException caught while punctuating processor '%s'", logPrefix, node.name()), e); } finally { processorContext.setCurrentNode(null); } }

Target:
public void punctuate(final ProcessorNode node, final long timestamp, final PunctuationType type, final Punctuator punctuator) { if (processorContext.currentNode() != null) { throw new IllegalStateException(String.format("%sCurrent node is not null", logPrefix)); } updateProcessorContext(new StampedRecord(DUMMY_RECORD, timestamp), node); if (log.isTraceEnabled()) { log.trace("Punctuating processor with timestamp and punctuation type {}", node.name(), timestamp, type); } try { StreamsMetricsImpl.maybeMeasureLatency( () -> { node.punctuate(timestamp, punctuator); }, time, punctuateLatencySensor ); } catch (final ProducerFencedException fatal) { throw new TaskMigratedException(this, fatal); } catch (final KafkaException e) { throw new StreamsException(String.format("%sException caught while punctuating processor '%s'", logPrefix, node.name()), e); } finally { processorContext.setCurrentNode(null); } }
Source:
private VersionDto createResultVersionIfNoneExist(ProjectDto targetProject) { final List<VersionDto> projectVersions = jiraService.project().getProjectVersions(targetProject.key); final Optional<VersionDto> targetVersion = projectVersions.stream() .filter(versionDto -> versionDto.name.equals(Property.RESULT_VERSION.getValue())) .findFirst(); targetVersion.ifPresent(foundVersion -> logger.info(() -> format("Found in Zephyr; resultVersion: \"{0}\" with resultVersionId: \"{1}\"", Property.RESULT_VERSION.getValue(), foundVersion.id))); return targetVersion.orElseGet(() -> { final VersionDto createdVersion = jiraService.version().createVersion(VersionDto.newBuilder() .projectId(targetProject.id) .name(Property.RESULT_VERSION.getValue()) .build()); logger.info(() -> format("Created in Zephyr; resultVersion: \"{0}\" with resultVersionId: \"{1}\"", Property.RESULT_VERSION.getValue(), createdVersion.id)); return createdVersion; }); }

Target:
private VersionDto createResultVersionIfNoneExist(ProjectDto targetProject) { final List<VersionDto> projectVersions = jiraService.project().getProjectVersions(targetProject.key); final Optional<VersionDto> targetVersion = projectVersions.stream() .filter(versionDto -> versionDto.name.equals(Property.RESULT_VERSION.getValue())) .findFirst(); targetVersion.ifPresent(foundVersion -> logger.info(() -> format("Found in Zephyr; [ resultVersion: %s ] with [ resultVersionId: %s ]", Property.RESULT_VERSION.getValue(), foundVersion.id))); return targetVersion.orElseGet(() -> { final VersionDto createdVersion = jiraService.version() .createVersion(VersionDto.newBuilder() .projectId(targetProject.id) .name(Property.RESULT_VERSION.getValue()) .build()); logger.info(() -> format("Created in Zephyr; [ resultVersion: %s ] with [ resultVersionId: %s ]", Property.RESULT_VERSION.getValue(), createdVersion.id)); return createdVersion; }); }
Source:
public void anonCanNotLogInWithInvalidPassword() { ArticlePage article = new ArticlePage(); SignInPage signIn = article.open(MercurySubpages.MAIN_PAGE) .getTopbar() .openNavigation() .clickOnSignInRegisterButton() .navigateToSignIn(); signIn.login(Configuration.getCredentials().userName10, "someinvalidpassw0rd"); assertTrue(signIn.getError().contains(expectedErrorMessage)); }

Target:
public void anonCanNotLogInWithInvalidPassword() { ArticlePage article = new ArticlePage(); SignInPage signIn = article.open(MercurySubpages.MAIN_PAGE) .getTopbar() .openNavigation() .clickOnSignInRegisterButton() .navigateToSignIn(); signIn.login(Configuration.getCredentials().userName10, "someinvalidpassw0rd"); assertTrue(signIn.getError().contains(EXPECTED_ERROR_MESSAGE)); }
Source:
public static int getApplicationIconBadgeNumber(Context context){ SharedPreferences settings = context.getSharedPreferences("badge", Context.MODE_PRIVATE); int badge = settings.getInt("badge", 0); return badge; }

Target:
public static int getApplicationIconBadgeNumber(Context context){ SharedPreferences settings = context.getSharedPreferences(BADGE, Context.MODE_PRIVATE); return settings.getInt(BADGE, 0); }
Source:
public void testDoNotExtendWidgetOrProvideElement() throws FileNotFoundException { final List<Diagnostic<? extends JavaFileObject>> diagnostics = compile( getProcessorUnderTest(), "org/uberfire/annotations/processors/WorkbenchClientEditorTest2"); assertFailedCompilation(diagnostics); assertCompilationMessage(diagnostics, Kind.ERROR, Diagnostic.NOPOS, Diagnostic.NOPOS, "org.uberfire.annotations.processors.WorkbencPhClientEditorTest2Activity: The WorkbenchClientEditor must either extend IsWidget or provide a @WorkbenchPartView annotated method to return a com.google.gwt.user.client.ui.IsWidget."); assertNull(result.getActualCode()); }

Target:
public void testDoNotExtendWidgetOrProvideElement() throws FileNotFoundException { final List<Diagnostic<? extends JavaFileObject>> diagnostics = compile( getProcessorUnderTest(), "org/uberfire/annotations/processors/WorkbenchClientEditorTest2"); assertFailedCompilation(diagnostics); assertCompilationMessage(diagnostics, Kind.ERROR, Diagnostic.NOPOS, Diagnostic.NOPOS, "org.uberfire.annotations.processors.WorkbenchClientEditorTest2Activity: The WorkbenchClientEditor must either extend IsWidget or provide a @WorkbenchPartView annotated method to return a com.google.gwt.user.client.ui.IsWidget."); assertNull(result.getActualCode()); }
Source:
public boolean onTarget() { return super.onTarget() && derivativeTolerance != 0 && Math.abs(lastErrorDerivative) < derivativeTolerance; }

Target:
public boolean onTarget() { return super.onTarget() && derivativeOnTarget(); }
Source:
private String getDefaultErrorMessage(MergeResult mergeResult) { return new StringBuilder().append("Unsupported merge status '").append( mergeResult.getMergeStatus().toString()).append("'\n").toString(); }

Target:
private String getDefaultErrorMessage(MergeResult mergeResult) { return new StringBuilder().append("Unsupported merge status '").append( mergeResult.getMergeStatus().toString()).append("'").append(EOL).toString(); }
Source:
public void setAllowedHostnames(Predicate<String> allowedHostnames) { if (allowedHostnames != null) { this.allowedHostnames = allowedHostnames; } }

Target:
public void setAllowedHostnames(Predicate<String> allowedHostnames) { if (allowedHostnames == null) { throw new IllegalArgumentException("allowedHostnames cannot be null"); } this.allowedHostnames = allowedHostnames; }
Source:
public List<Item> contents() { return Collections.unmodifiableList((contents == null) ? new LinkedList<>() : contents); }

Target:
public List<Contents> contents() { return emptyIfNull(contents); }
Source:
public void claimTaskCmdExecutorTest() { ClaimTaskCmd claimTaskCmd = new ClaimTaskCmd("taskId", "assignee"); assertThat(claimTaskCmdExecutor).isNotNull(); assertThat(claimTaskCmdExecutor.getHandledType()).isEqualTo(ClaimTaskCmd.class); claimTaskCmdExecutor.execute(claimTaskCmd); verify(processEngine).claimTask(claimTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<ClaimTaskResults>>any()); }

Target:
public void claimTaskCmdExecutorTest() { ClaimTaskCmd claimTaskCmd = new ClaimTaskCmd("taskId", "assignee"); assertThat(claimTaskCmdExecutor.getHandledType()).isEqualTo(ClaimTaskCmd.class); claimTaskCmdExecutor.execute(claimTaskCmd); verify(processEngine).claimTask(claimTaskCmd); verify(commandResults).send(ArgumentMatchers.<Message<ClaimTaskResults>>any()); }
Source:
public List<GridColumn.HeaderMetaData> makeHeaderMetaData( final BaseColumn column ) { return new ArrayList<GridColumn.HeaderMetaData>() {{ if ( column instanceof ActionSetFieldCol52 ) { ActionSetFieldCol52 actionSetFieldColumn = ( ActionSetFieldCol52 ) column; if ( actionSetFieldColumn.getBoundName() != null && !actionSetFieldColumn.getBoundName().isEmpty() ) { add( new BaseHeaderMetaData( actionSetFieldColumn.getBoundName(), ActionCol52.class.getName() ) ); } add( new BaseHeaderMetaData( column.getHeader(), actionSetFieldColumn.getBoundName() ) ); } else { add( new BaseHeaderMetaData( column.getHeader(), ActionCol52.class.getName() ) ); } }}; }

Target:
public List<GridColumn.HeaderMetaData> makeHeaderMetaData( final BaseColumn column ) { return new ArrayList<GridColumn.HeaderMetaData>() {{ if ( column instanceof ActionSetFieldCol52 ) { ActionSetFieldCol52 actionSetFieldColumn = ( ActionSetFieldCol52 ) column; if ( actionSetFieldColumn.getBoundName() != null && !actionSetFieldColumn.getBoundName().isEmpty() ) { add( new BaseHeaderMetaData( actionSetFieldColumn.getBoundName(), ActionCol52.class.getName() ) ); add( new BaseHeaderMetaData( column.getHeader(), actionSetFieldColumn.getBoundName() ) ); } } else { add( new BaseHeaderMetaData( column.getHeader(), ActionCol52.class.getName() ) ); } }}; }
Source:
public Builder useEdgeFunctionMiddleware(JSMiddleware middleware) { assertNotNull(middleware, "middleware"); this.edgeFunctionMiddleware = middleware; return this; }

Target:
public Builder useEdgeFunctionMiddleware(JSMiddleware middleware) { assertNotNull(middleware, "middleware"); if (this.sourceMiddleware != null || this.destinationMiddleware != null) { throw new IllegalStateException( "Can not use native middleware and edge function middleware"); } this.edgeFunctionMiddleware = middleware; return this; }
Source:
public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int systemMetadataRelativeOffset, int userMetadataRelativeOffset, int dataRelativeOffset) { int startOffset = outputBuffer.position(); outputBuffer.putShort((short)1); outputBuffer.putLong(totalSize); outputBuffer.putInt(systemMetadataRelativeOffset); outputBuffer.putInt(userMetadataRelativeOffset); outputBuffer.putInt(dataRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); }

Target:
public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int systemMetadataRelativeOffset, int userMetadataRelativeOffset, int dataRelativeOffset) { int startOffset = outputBuffer.position(); outputBuffer.putShort(Message_Header_Version_V1); outputBuffer.putLong(totalSize); outputBuffer.putInt(systemMetadataRelativeOffset); outputBuffer.putInt(userMetadataRelativeOffset); outputBuffer.putInt(dataRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); }
Source:
public void processServer(Server server) throws Exception { final ThreadPoolExecutor executor = queryExecutorRepository.getExecutor(server); for (Query query : server.getQueries()) { if(query.getQueryType() != Query.QueryType.NOTIFICATIONS) { ProcessQueryThread pqt = new ProcessQueryThread(resultProcessor, server, query); try { executor.submit(pqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit query {}. You could try to size the 'queryProcessorExecutor' to a larger size.", pqt, ree); } } } }

Target:
public void processServer(Server server) throws Exception { final ThreadPoolExecutor executor = queryExecutorRepository.getExecutor(server); for (Query query : server.getQueries()) { switch (query.getQueryType()) { case NOTIFICATIONS: SubscribeToNotificationsForQueryThread sqt = new SubscribeToNotificationsForQueryThread(server, query); try { executor.submit(sqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit runnable for periodic subscription check {}. ", sqt, ree); } break; case POLL: ProcessQueryThread pqt = new ProcessQueryThread(resultProcessor, server, query); try { executor.submit(pqt); } catch (RejectedExecutionException ree) { logger.error("Could not submit query {}. You could try to size the 'queryProcessorExecutor' to a larger size.", pqt, ree); } break; } } }