auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Map<String,Serializable> getProcessedInput(ContractDefinition processContract, Map<String, Serializable> inputs, long maxSizeForTenant, long tenantId, boolean deleteFile) throws FileNotFoundException { this.deleteFile = deleteFile; return this.getProcessedInput(processContract, inputs, maxSizeForTenant, tenantId); }

Target:
public Map<String,Serializable> getProcessedInput(ContractDefinition processContract, Map<String, Serializable> inputs, long maxSizeForTenant, long tenantId, boolean deleteFile) throws FileNotFoundException { this.maxSizeForTenant = maxSizeForTenant; this.tenantId = tenantId; final Map<String, Serializable> processedInputs = new HashMap<String, Serializable>(); final Map<String, Serializable> contractDefinitionMap = processContract == null? Collections.<String, Serializable>emptyMap() : createContractInputMap(processContract.getInputs()); for (final Entry<String, Serializable> inputEntry : inputs.entrySet()) { processedInputs.put(inputEntry.getKey(), convertInputToExpectedType(inputEntry.getValue(), contractDefinitionMap.get(inputEntry.getKey()), deleteFile)); } return processedInputs; }
Source:
public AirGoogleMapOptions zOrderOnTop(boolean zOrderOnTop) { return this; }

Target:
public AirGoogleMapOptions zOrderOnTop(boolean zOrderOnTop) { options.zOrderOnTop(zOrderOnTop); return this; }
Source:
public synchronized boolean append(@NonNull ICTFPacketDescriptor entry) { ICTFPacketDescriptor entryToAdd = entry; if (entryToAdd.getTimestampBegin() > entryToAdd.getTimestampEnd()) { Activator.log(IStatus.WARNING, "Packet at offset " + entryToAdd.getOffsetBytes() + " begin timestamp is after end timestamp"); entryToAdd = new StreamInputPacketIndexEntry(entryToAdd, Long.MAX_VALUE); } if (!contains(entryToAdd)) { fEntries.add(entryToAdd); fEntries.sort(OFFSET_COMPARE); return true; } return false; }

Target:
public synchronized boolean append(@NonNull ICTFPacketDescriptor entry) { ICTFPacketDescriptor entryToAdd = entry; if (entryToAdd.getTimestampBegin() > entryToAdd.getTimestampEnd()) { Activator.log(IStatus.WARNING, "Packet at offset " + entryToAdd.getOffsetBytes() + " begin timestamp is after end timestamp"); entryToAdd = new StreamInputPacketIndexEntry(entryToAdd, Long.MAX_VALUE); } if (canAdd(entryToAdd)) { fEntries.add(entryToAdd); return true; } return false; }
Source:
public Response exportInventory() { try { return ResponseUtil.ok(inventoryService.buildExport()); } catch (Exception e) { return ResponseUtil.internalError(e); } }

Target:
public Response exportInventory() { try { StreamingOutput streamingOutput = inventoryService::buildExport; return ResponseUtil.ok(streamingOutput); } catch (Exception e) { return ResponseUtil.internalError(e); } }
Source:
void onJobProcessingStart() { cryptoJobMetrics.operationRate.mark(); jobProcessingStartTimeMs = System.currentTimeMillis(); cryptoJobMetrics.jobQueuingTimeInMs.update(jobProcessingStartTimeMs - jobSubmissionTimeMs); }

Target:
void onJobProcessingStart() { jobProcessingStartTimeMs = System.currentTimeMillis(); cryptoJobMetrics.jobQueuingTimeInMs.update(jobProcessingStartTimeMs - jobSubmissionTimeMs); }
Source:
public void testAlterTableAddPartition1() throws IOException { String sql = FileUtil.readTextFile(new File("src/test/resources/queries/default/alter_table_add_partition_1.sql")); Expr expr = parseQuery(sql); assertEquals(OpType.AlterTable, expr.getType()); AlterTable alterTable = (AlterTable)expr; assertEquals(alterTable.getAlterTableOpType(), AlterTableOpType.ADD_PARTITION); assertEquals(2, alterTable.getColumns().length); assertEquals(2, alterTable.getValues().length); assertEquals("col1", alterTable.getColumns()[0].getName()); assertEquals("col2", alterTable.getColumns()[1].getName()); LiteralValue value1 = (LiteralValue)alterTable.getValues()[0]; assertEquals("1", value1.getValue()); LiteralValue value2 = (LiteralValue)alterTable.getValues()[1]; assertEquals("2", value2.getValue()); }

Target:
public void testAlterTableAddPartition1() throws IOException { String sql = FileUtil.readTextFileFromResource("queries/default/alter_table_add_partition_1.sql"); Expr expr = parseQuery(sql); assertEquals(OpType.AlterTable, expr.getType()); AlterTable alterTable = (AlterTable)expr; assertEquals(alterTable.getAlterTableOpType(), AlterTableOpType.ADD_PARTITION); assertEquals(2, alterTable.getColumns().length); assertEquals(2, alterTable.getValues().length); assertEquals("col1", alterTable.getColumns()[0].getName()); assertEquals("col2", alterTable.getColumns()[1].getName()); LiteralValue value1 = (LiteralValue)alterTable.getValues()[0]; assertEquals("1", value1.getValue()); LiteralValue value2 = (LiteralValue)alterTable.getValues()[1]; assertEquals("2", value2.getValue()); }
Source:
private ConnectionStateListener getConnectionStateListener(){ return new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if (!newState.isConnected()) { LOG.error(" connection to zookeeper broken "); } } }; }

Target:
private ConnectionStateListener getConnectionStateListener(){ return new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if (!newState.isConnected()) { LOG.error( " connection to zookeeper broken. It is in "+ newState.name()+" state."); } } }; }
Source:
public Response getRunningTasks(@Context final HttpServletRequest req) { return workItemsResponse( new Function<TaskRunner, Collection<? extends TaskRunnerWorkItem>>() { @Override public Collection<? extends TaskRunnerWorkItem> apply(TaskRunner taskRunner) { if (authConfig.isEnabled()) { final AuthorizationInfo authorizationInfo = (AuthorizationInfo) req.getAttribute(AuthConfig.DRUID_AUTH_TOKEN); return Collections2.filter( taskRunner.getRunningTasks(), new Predicate<TaskRunnerWorkItem>() { @Override public boolean apply(TaskRunnerWorkItem input) { final String taskId = input.getTaskId(); final Optional<Task> optionalTask = taskStorageQueryAdapter.getTask(taskId); if (!optionalTask.isPresent()) { throw new WebApplicationException( Response.serverError().entity( String.format("No task information found for task with id: [%s]", taskId) ).build() ); } return authorizationInfo.isAuthorized( new Resource(optionalTask.get().getDataSource(), ResourceType.DATASOURCE), Action.READ ).isAllowed(); } } ); } else { return taskRunner.getRunningTasks(); } } } ); }

Target:
public Response getRunningTasks(@Context final HttpServletRequest req) { return workItemsResponse( new Function<TaskRunner, Collection<? extends TaskRunnerWorkItem>>() { @Override public Collection<? extends TaskRunnerWorkItem> apply(TaskRunner taskRunner) { if (authConfig.isEnabled()) { return securedTaskRunnerWorkItem(taskRunner.getRunningTasks(), req); } else { return taskRunner.getRunningTasks(); } } } ); }
Source:
private boolean isVirtual(ContextInfo info) { if (info.isVirtual != null) return info.isVirtual; info.isVirtual = ClassTypeHelper.isVirtual(info.method); return info.isVirtual; }

Target:
private boolean isVirtual(ContextInfo info) { if (info.isVirtual == null) { info.isVirtual = ClassTypeHelper.isVirtual(info.method); } return info.isVirtual; }
Source:
protected void contentChanged(ITmfTreeViewerEntry rootEntry) { String selectedThread = fSelectedThread; if (selectedThread != null) { for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) { if (entry instanceof CpuUsageEntry) { if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) { List<ITmfTreeViewerEntry> list = Collections.singletonList(entry); if (list != null) { super.setSelection(list); } return; } } } } }

Target:
protected void contentChanged(ITmfTreeViewerEntry rootEntry) { String selectedThread = fSelectedThread; if (selectedThread != null) { for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) { if (entry instanceof CpuUsageEntry) { if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) { @SuppressWarnings("null") @NonNull List<ITmfTreeViewerEntry> list = Collections.singletonList(entry); super.setSelection(list); return; } } } } }
Source:
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String repository = request.getParameter("repository"); String workspace = request.getParameter("workspace"); String path = request.getParameter("path"); String property = request.getParameter("property"); Connector connector = (Connector) request.getSession().getAttribute("connector"); try { Session session = connector.find(repository).session(workspace); Node node = session.getNode(path); Property p; try { p = node.getProperty(property); } catch (PathNotFoundException e) { response.setContentType("text/html"); PrintWriter writer = response.getWriter(); writer.write("<html>"); writer.write("Empty"); writer.write("</html>"); return; } Binary binary = p.getBinary(); InputStream in = binary.getStream(); String contentType = node.getProperty("jcr:mimeType").getString(); response.setContentType(contentType); int b; while ((b = in.read()) != -1) { response.getOutputStream().write(b); } binary.dispose(); } catch (Exception e) { throw new ServletException(e); } }

Target:
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String repository = request.getParameter("repository"); String workspace = request.getParameter("workspace"); String path = request.getParameter("path"); String property = request.getParameter("property"); Connector connector = (Connector) request.getSession().getAttribute("connector"); try { Session session = connector.find(repository).session(workspace); Node node = session.getNode(path); Property p; try { p = node.getProperty(property); } catch (PathNotFoundException e) { response.setContentType("text/html"); PrintWriter writer = response.getWriter(); writer.write("<html>"); writer.write("<p>Content not found or recently removed</p>"); writer.write("</html>"); return; } Binary binary = p.getBinary(); InputStream in = binary.getStream(); String contentType = node.getProperty("jcr:mimeType").getString(); response.setContentType(contentType); int b; while ((b = in.read()) != -1) { response.getOutputStream().write(b); } binary.dispose(); } catch (Exception e) { throw new ServletException(e); } }
Source:
private static Connection makeConnection(String url, Properties props) throws SQLException { return new ${JDBCCONNECTCLASS}(hostSpecs(props), user(props), database(props), props, url); }

Target:
private static Connection makeConnection(String url, Properties props) throws SQLException { return new ${template.jdbc.connect.class}(hostSpecs(props), user(props), database(props), props, url); }
Source:
public String asString() throws Exception { return this.print(); }

Target:
public String asString() throws IOException { return this.print(); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Select select = (Select) o; return Objects.equals(element, select.element); }

Target:
public boolean equals(Object o) { if (!(o instanceof Select)) { return false; } Select select = (Select) o; return Objects.equals(element, select.element); }
Source:
protected void handleEvent(Event event) { EventContext ctx = event.getContext(); if (ctx instanceof DocumentEventContext) { String name = event.getName(); DocumentEventContext docCtx = (DocumentEventContext) ctx; CoreSession session = docCtx.getCoreSession(); DocumentModel doc = docCtx.getSourceDocument(); if (doc == null) { return; } String docId = doc.getId(); TagService tagService = Framework.getLocalService(TagService.class); boolean nxtagsEnabled = Framework.getService(ConfigurationService.class) .isBooleanPropertyTrue(TagServiceImpl.FACETED_TAG_SERVICE_ENABLED); if (doc instanceof DeletedDocumentModel && !nxtagsEnabled) { tagService.removeTags(session, docId); return; } switch (name) { case DOCUMENT_PROXY_PUBLISHED: if (doc.isProxy()) { DocumentModel version = session.getSourceDocument(doc.getRef()); tagService.copyTags(session, version.getId(), docId); } break; case DOCUMENT_RESTORED: String versionUUID = (String) ctx.getProperty(VersioningDocument.RESTORED_VERSION_UUID_KEY); tagService.replaceTags(session, versionUUID, docId); break; case DOCUMENT_REMOVED: if (!nxtagsEnabled) { tagService.removeTags(session, docId); } break; case TRANSITION_EVENT: tagService.removeTags(session, docId); break; default: break; } } }

Target:
protected void handleEvent(Event event) { EventContext ctx = event.getContext(); if (ctx instanceof DocumentEventContext) { String name = event.getName(); DocumentEventContext docCtx = (DocumentEventContext) ctx; CoreSession session = docCtx.getCoreSession(); DocumentModel doc = docCtx.getSourceDocument(); if (doc == null) { return; } String docId = doc.getId(); TagService tagService = Framework.getLocalService(TagService.class); boolean facetedTags = Framework.getService(ConfigurationService.class) .isBooleanPropertyTrue(TagServiceImpl.FACETED_TAG_SERVICE_ENABLED); if (doc instanceof DeletedDocumentModel && !facetedTags) { tagService.removeTags(session, docId); return; } switch (name) { case DOCUMENT_PROXY_PUBLISHED: if (doc.isProxy()) { DocumentModel version = session.getSourceDocument(doc.getRef()); tagService.copyTags(session, version.getId(), docId); } break; case DOCUMENT_RESTORED: String versionUUID = (String) ctx.getProperty(VersioningDocument.RESTORED_VERSION_UUID_KEY); tagService.replaceTags(session, versionUUID, docId); break; case DOCUMENT_REMOVED: if (!facetedTags) { tagService.removeTags(session, docId); } break; case TRANSITION_EVENT: tagService.removeTags(session, docId); break; default: break; } } }
Source:
private ApplicationReportModel createAppDependencyGraphReport(GraphContext context) { ApplicationReportService applicationReportService = new ApplicationReportService(context); ApplicationReportModel report = applicationReportService.create(); report.setReportPriority(104); report.setReportIconClass("glyphicon glyphicon-tree-deciduous"); report.setTemplatePath(TEMPLATE); report.setTemplateType(TemplateType.FREEMARKER); report.setDisplayInApplicationReportIndex(Boolean.TRUE); report.setDescription(REPORT_DESCRIPTION); return report; }

Target:
private ApplicationReportModel createAppDependencyGraphReport(GraphContext context) { ApplicationReportService applicationReportService = new ApplicationReportService(context); ApplicationReportModel report = applicationReportService.create(); report.setReportPriority(104); report.setReportIconClass("glyphicon glyphicon-tree-deciduous"); report.setTemplatePath(TEMPLATE); report.setTemplateType(TemplateType.FREEMARKER); report.setDisplayInApplicationReportIndex(Boolean.TRUE); return report; }
Source:
public void requestBannerAd(Context context, MediationBannerListener mediationBannerListener, Bundle serverParameters, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { vungleBannerAdapter = new VungleBannerAdapter(context, VungleInterstitialAdapter.this, mediationBannerListener); bannerAdContainer = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); vungleBannerAdapter.attach(this); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); vungleBannerAdapter.detach(); } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(mAdConfig.getAdSize().getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); bannerAdContainer.setLayoutParams(adViewLayoutParams); vungleBannerAdapter .requestBannerAd(adSize, mediationAdRequest, serverParameters, mediationExtras); }

Target:
public void requestBannerAd(Context context, MediationBannerListener mediationBannerListener, Bundle serverParameters, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { vungleBannerAdapter = new VungleBannerAdapter(context, VungleInterstitialAdapter.this, mediationBannerListener); AdConfig.AdSize vungleAdSize = VungleBannerAdapter.getSupportedAdSize(context, adSize); if (vungleAdSize == null) { String message = "Failed to load ad from Vungle: Invalid banner size."; Log.w(TAG, message); mediationBannerListener .onAdFailedToLoad(VungleInterstitialAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); return; } bannerAdContainer = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (vungleBannerAdapter != null) { vungleBannerAdapter.attach(this); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (vungleBannerAdapter != null) { vungleBannerAdapter.detach(); } } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(vungleAdSize.getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); bannerAdContainer.setLayoutParams(adViewLayoutParams); vungleBannerAdapter .requestBannerAd(vungleAdSize, mediationAdRequest, serverParameters, mediationExtras); }
Source:
public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { getPerunBl().getAuditer().log(sess,new AttributeDeleted(attribute)); this.deleteAllAttributeAuthz(sess, attribute); getAttributesManagerImpl().deleteAttribute(sess, attribute); AttributeDefinition attributeDef = new AttributeDefinition(attribute); synchronized (dependenciesMonitor) { removeOppositeDependenciesForAttribute(attributeDef); if (dependencies.containsKey(attributeDef)) { dependencies.remove(attributeDef); } else { log.warn("Dependencies inconsistency. Dependencies should contain information about {}. ", attributeDef); } if (strongDependencies.containsKey(attributeDef)) { strongDependencies.remove(attributeDef); } else { log.warn("Strong dependencies inconsistency. Strong dependencies should contain information about {}. ", attributeDef); } if (inverseDependencies.containsKey(attributeDef)) { inverseDependencies.remove(attributeDef); } else { log.warn("Inverse dependencies inconsistency. Inverse dependencies should contain information about {}. ", attributeDef); } if (inverseStrongDependencies.containsKey(attributeDef)) { inverseStrongDependencies.remove(attributeDef); } else { log.warn("Inverse strong dependencies inconsistency. Inverse strong dependencies should contain information about {}. ", attributeDef); } } }

Target:
public void deleteAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException { this.deleteAllAttributeAuthz(sess, attribute); getAttributesManagerImpl().deleteAttribute(sess, attribute); getPerunBl().getAuditer().log(sess, new AttributeDeleted(attribute)); AttributeDefinition attributeDef = new AttributeDefinition(attribute); synchronized (dependenciesMonitor) { removeOppositeDependenciesForAttribute(attributeDef); if (dependencies.containsKey(attributeDef)) { dependencies.remove(attributeDef); } else { log.warn("Dependencies inconsistency. Dependencies should contain information about {}. ", attributeDef); } if (strongDependencies.containsKey(attributeDef)) { strongDependencies.remove(attributeDef); } else { log.warn("Strong dependencies inconsistency. Strong dependencies should contain information about {}. ", attributeDef); } if (inverseDependencies.containsKey(attributeDef)) { inverseDependencies.remove(attributeDef); } else { log.warn("Inverse dependencies inconsistency. Inverse dependencies should contain information about {}. ", attributeDef); } if (inverseStrongDependencies.containsKey(attributeDef)) { inverseStrongDependencies.remove(attributeDef); } else { log.warn("Inverse strong dependencies inconsistency. Inverse strong dependencies should contain information about {}. ", attributeDef); } } }
Source:
private boolean shouldCheck(final DetailAST ast) { final Scope customScope; if (ScopeUtil.isInInterfaceOrAnnotationBlock(ast)) { customScope = Scope.PUBLIC; } else { final DetailAST mods = ast.findFirstToken(TokenTypes.MODIFIERS); customScope = ScopeUtil.getScopeFromMods(mods); } final Scope surroundingScope = ScopeUtil.getSurroundingScope(ast); return customScope.isIn(scope) && (surroundingScope == null || surroundingScope.isIn(scope)) && (excludeScope == null || !customScope.isIn(excludeScope) || surroundingScope != null && !surroundingScope.isIn(excludeScope)) && !AnnotationUtil.containsAnnotation(ast, allowedAnnotations); }

Target:
private boolean shouldCheck(final DetailAST ast) { final Scope customScope; if (ScopeUtil.isInInterfaceOrAnnotationBlock(ast)) { customScope = Scope.PUBLIC; } else { final DetailAST mods = ast.findFirstToken(TokenTypes.MODIFIERS); customScope = ScopeUtil.getScopeFromMods(mods); } final Scope surroundingScope = ScopeUtil.getSurroundingScope(ast); return customScope.isIn(scope) && (surroundingScope == null || surroundingScope.isIn(scope)) && (excludeScope == null || !customScope.isIn(excludeScope) || surroundingScope != null && !surroundingScope.isIn(excludeScope)) && !AnnotationUtil.containsAnnotation(ast, skipAnnotations); }
Source:
public String getCardType() { return cardType; }

Target:
public Optional<String> getCardType() { return Optional.ofNullable(cardType); }
Source:
public static String selfRedirect(String suffix) { String path = Location.getPath(); if (path == null || path.isEmpty()) { path = "/"; } else { while (path.startsWith(" path = path.substring(1); } while (path.endsWith(" path = path.substring(0, path.length() - 1); } if (!path.endsWith("/")) { path = path + "/"; } } if (suffix != null) { while (suffix.startsWith("/")) { suffix = suffix.substring(1); } path += suffix; } UrlBuilder builder = new UrlBuilder(); builder.setProtocol(Location.getProtocol()); builder.setHost(Location.getHost()); String port = Location.getPort(); if (port != null && !port.isEmpty()) { builder.setPort(Integer.parseInt(port)); } return builder.buildString() + path; }

Target:
public static String selfRedirect(String suffix) { String path = Location.getPath(); if (path == null || path.isEmpty()) { path = "/"; } else { while (path.startsWith(" path = path.substring(1); } while (path.endsWith(" path = path.substring(0, path.length() - 1); } if (!path.endsWith("/")) { path = path + "/"; } } if (suffix != null) { while (suffix.startsWith("/")) { suffix = suffix.substring(1); } path += suffix; } UrlBuilder builder = new UrlBuilder(); builder.setProtocol(Location.getProtocol()); builder.setHost(Location.getHost()); String port = Location.getPort(); if (port != null && !port.isEmpty()) { builder.setPort(Integer.parseInt(port)); } builder.setPath(path); return builder.buildString(); }
Source:
protected void addSlots() { if (itemConduit != null) { addSlotToContainer(slotInputFilter = new FilterSlot(getItemHandler(), 3, 23, 71)); addSlotToContainer(slotOutputFilter = new FilterSlot(getItemHandler(), 2, 113, 71)); addSlotToContainer(slotSpeedUpgrades = new SlotItemHandler(getItemHandler(), 0, 131, 71) { @Override public boolean isItemValid(@Nonnull ItemStack itemStack) { return itemStack.getItem() instanceof ItemExtractSpeedUpgrade; } @Override public int getSlotStackLimit() { return speedUpgradeSlotLimit; } }); addSlotToContainer(slotFunctionUpgrades = new SlotItemHandler(getItemHandler(), 1, 157, 71) { @Override public boolean isItemValid(@Nonnull ItemStack itemStack) { return false; } @Override public int getSlotStackLimit() { return 1; } }); } }

Target:
protected void addSlots() { if (itemConduit != null) { addSlotToContainer(slotInputFilter = new FilterSlot(getItemHandler(), 3, 23, 71)); addSlotToContainer(slotOutputFilter = new FilterSlot(getItemHandler(), 2, 113, 71)); addSlotToContainer(slotSpeedUpgrades = new SlotItemHandler(getItemHandler(), 0, 131, 71) { @Override public boolean isItemValid(@Nonnull ItemStack itemStack) { return inventory.isItemValidForSlot(0, itemStack); } @Override public int getSlotStackLimit() { return speedUpgradeSlotLimit; } }); addSlotToContainer(slotFunctionUpgrades = new SlotItemHandler(getItemHandler(), 1, 157, 71) { @Override public boolean isItemValid(@Nonnull ItemStack itemStack) { return false; } @Override public int getSlotStackLimit() { return 1; } }); } }
Source:
public boolean hasNext() { if (dataStream == null) { return false; } if (currentIterator == null || !currentIterator.hasNext()) { try { if (pageIndex < pageSizeArray.length) { byte[] nextPage = new byte[pageSizeArray[pageIndex]]; dataStream.read(nextPage); currentPage = new CookiePage(nextPage); currentIterator = currentPage.iterator(); } else { closeStream(); return false; } pageIndex++; } catch (IOException ex) { closeStream(); logger.log(Level.WARNING, "A read error occured for file {0} page {1} {2}", new Object[]{cookieFile.getName(), pageIndex, ex}); return false; } } return currentIterator.hasNext(); }

Target:
public boolean hasNext() { if (dataStream == null) { return false; } if (currentIterator == null || !currentIterator.hasNext()) { try { if (pageIndex < pageSizeArray.length) { byte[] nextPage = new byte[pageSizeArray[pageIndex]]; dataStream.read(nextPage); currentPage = new CookiePage(nextPage); currentIterator = currentPage.iterator(); } else { closeStream(); return false; } pageIndex++; } catch (IOException ex) { closeStream(); String errorMessage = String.format("A read error occured for file %s (pageIndex = %d)", cookieFile.getName(), pageIndex); LOG.log(Level.WARNING, errorMessage, ex); return false; } } return currentIterator.hasNext(); }
Source:
public byte[] transform(ClassLoader classLoader, String className, Class<?> aClass, ProtectionDomain protectionDomain, byte[] originalBuffer) throws IllegalClassFormatException { byte[] transformedBuffer = originalBuffer; boolean transformed = false; for (javax.persistence.spi.ClassTransformer transformer : persistenceUnitMetadata.getTransformers()) { byte[] result = transformer.transform(classLoader, className, aClass, protectionDomain, transformedBuffer); if (result != null) { transformedBuffer = result; transformed = true; } } return transformed ? transformedBuffer : null; }

Target:
public byte[] transform(ClassLoader classLoader, String className, Class<?> aClass, ProtectionDomain protectionDomain, byte[] originalBuffer) { return getBytes(transform(classLoader, className, protectionDomain, ByteBuffer.wrap(originalBuffer))); }
Source:
protected Stream<T> fetchFromProvider(int offset, int limit) { Stream<T> stream; QueryTrace query = null; if (pagingEnabled) { final int pages = (limit - 1) / pageSize + 1; if (limit > pageSize) { final Collection<T> fetchedPages = new LinkedList<>(); for (int page = 0; page < pages; page++) { final int newOffset = offset + page * pageSize; query = new QueryTrace(newOffset, pageSize, backEndSorting, inMemorySorting, filter); Stream<T> fetchedPageStream = getDataProvider().fetch(query); List<T> fetchedPage = fetchedPageStream.collect(Collectors.toList()); fetchedPages.addAll(fetchedPage); if (fetchedPage.size() < pageSize) { break; } } stream = fetchedPages.stream(); } else { query = new QueryTrace(offset, pageSize, backEndSorting, inMemorySorting, filter); stream = getDataProvider().fetch(query); } limit = pages * pageSize; } else { query = new QueryTrace(offset, limit, backEndSorting, inMemorySorting, filter); stream = getDataProvider().fetch(query); } if (stream.isParallel()) { LoggerFactory.getLogger(DataCommunicator.class) .debug("Data provider has returned " + "parallel stream on 'fetch' call", getDataProvider().getClass()); stream = stream.collect(Collectors.toList()).stream(); assert !stream.isParallel(); } SizeVerifier verifier = new SizeVerifier<>(limit); stream = stream.peek(verifier); assert query != null : "Fetch query cannot be null"; if (!query.isLimitCalled()) { throw new IllegalStateException( getInvalidContractMessage("getLimit or getPageSize")); } if (!query.isOffsetCalled()) { throw new IllegalStateException( getInvalidContractMessage("getOffset or getPage")); } return stream; }

Target:
protected Stream<T> fetchFromProvider(int offset, int limit) { Stream<T> stream; if (pagingEnabled) { final int pages = (limit - 1) / pageSize + 1; if (limit > pageSize) { final Stream.Builder<T> streamBuilder = Stream.builder(); final AtomicInteger fetchedPerPage = new AtomicInteger(0); Consumer<T> addItemAndCheckConsumer = item -> { streamBuilder.add(item); fetchedPerPage.getAndIncrement(); }; int page = 0; do { final int newOffset = offset + page * pageSize; doFetchFromDataProvider(newOffset, pageSize) .forEach(addItemAndCheckConsumer); page++; } while (page < pages && fetchedPerPage.getAndSet(0) == pageSize); stream = streamBuilder.build(); } else { stream = doFetchFromDataProvider(offset, pageSize); } limit = pages * pageSize; } else { stream = doFetchFromDataProvider(offset, limit); } if (stream.isParallel()) { LoggerFactory.getLogger(DataCommunicator.class) .debug("Data provider has returned " + "parallel stream on 'fetch' call", getDataProvider().getClass()); stream = stream.collect(Collectors.toList()).stream(); assert !stream.isParallel(); } SizeVerifier verifier = new SizeVerifier<>(limit); return stream.peek(verifier); }
Source:
public void replicateNewProject(Project.NameKey projectName, String head) { if (!isEnabled()) { return; } for (ReplicationConfig config : configs) { List<URIish> uriList = config.getURIs(projectName, "*"); String adminUrl = config.getAdminUrl(); URIish adminURI = null; try { if (adminUrl != null && !adminUrl.isEmpty()) { adminURI = new URIish(adminUrl); } } catch (URISyntaxException e) { } boolean adminURLUsed = false; if (adminURI != null) { final String replacedPath = replace(adminURI.getPath(), "name", projectName.get()); if (replacedPath != null) { adminURI = adminURI.setPath(replacedPath); if (usingSSH(adminURI)) { replicateProject(adminURI, head); adminURLUsed = true; } } } if (!adminURLUsed) { for (URIish uri : uriList) { replicateProject(uri, head); } } } }

Target:
public void replicateNewProject(Project.NameKey projectName, String head) { if (!isEnabled()) { return; } for (ReplicationConfig config : configs) { List<URIish> uriList = config.getURIs(projectName, "*"); String[] adminUrls = config.getAdminUrls(); boolean adminURLUsed = false; for (String url : adminUrls) { URIish adminURI = null; try { if (url != null && !url.isEmpty()) { adminURI = new URIish(url); } } catch (URISyntaxException e) { log.error("The URL '" + url + "' is invalid"); } if (adminURI != null) { final String replacedPath = replace(adminURI.getPath(), "name", projectName.get()); if (replacedPath != null) { adminURI = adminURI.setPath(replacedPath); if (usingSSH(adminURI)) { replicateProject(adminURI, head); adminURLUsed = true; } else { log.error("The adminURL '" + url + "' is non-SSH which is not allowed"); } } } } if (!adminURLUsed) { for (URIish uri : uriList) { replicateProject(uri, head); } } } }
Source:
protected boolean requireRootAclUpdate( ACLEditor editor ) throws RepositoryException { final String rootPath = session.getRootNode().getPath(); final AccessControlPolicy[] acls = editor.getPolicies( rootPath ); if ( acls != null && acls.length > 0 ) { final PrincipalManager pMgr = session.getPrincipalManager(); final AccessControlManager acMgr = session.getAccessControlManager(); final Privilege jcrReadAccessControlPriv = acMgr.privilegeFromName( Privilege.JCR_READ_ACCESS_CONTROL ); final Principal everyone = pMgr.getEveryone(); final AccessControlList acList = (AccessControlList) acls[0]; final AccessControlEntry[] acEntries = acList.getAccessControlEntries(); if ( acEntries != null ) { for ( AccessControlEntry acEntry : acEntries ) { if ( acEntry.getPrincipal() != null && acEntry.getPrincipal().equals( everyone ) ) { if ( acEntry.getPrivileges() != null ) { for ( Privilege privilege : acEntry.getPrivileges() ) { if ( jcrReadAccessControlPriv.equals( privilege ) ) { return false; } } } } } } } return true; }

Target:
protected boolean requireRootAclUpdate( ACLEditor editor ) throws RepositoryException { final String rootPath = session.getRootNode().getPath(); final AccessControlPolicy[] acls = editor.getPolicies( rootPath ); if ( acls != null && acls.length > 0 ) { final PrincipalManager pMgr = session.getPrincipalManager(); final AccessControlManager acMgr = session.getAccessControlManager(); final Privilege jcrReadAccessControlPriv = acMgr.privilegeFromName( Privilege.JCR_READ_ACCESS_CONTROL ); final Principal everyone = pMgr.getEveryone(); final AccessControlList acList = (AccessControlList) acls[0]; final AccessControlEntry[] acEntries = acList.getAccessControlEntries(); if ( acEntries != null ) { for ( AccessControlEntry acEntry : acEntries ) { if ( acEntry.getPrincipal() != null && acEntry.getPrincipal().equals( everyone ) && acEntry.getPrivileges() != null ) { return !Arrays.asList( acEntry.getPrivileges() ).contains( jcrReadAccessControlPriv ); } } } } return true; }
Source:
private boolean isDiskImage() { return getOldDisk() != null && getNewDisk() != null && DiskStorageType.IMAGE == getOldDisk().getDiskStorageType(); }

Target:
private boolean isDiskImage() { return isDiskStorageType(DiskStorageType.IMAGE); }
Source:
public void theMbusDeviceIsNotCoupledToTheDevice(final String gMeter, final String eMeter) { Wait.until(() -> { final SmartMeter mbusDevice = this.smartMeterRepository.findByDeviceIdentification(gMeter); final Device gatewayDevice = this.deviceRepository.findByDeviceIdentification(eMeter); Assert.assertNotNull("No GatewayDevice found", gatewayDevice); Assert.assertNotNull("No MbusDevice found", mbusDevice); Assert.assertNotEquals("GatewayDevice must be coupled to other MbusDevice", gatewayDevice, mbusDevice.getGatewayDevice()); }); }

Target:
public void theMbusDeviceIsNotCoupledToTheDevice(final String gMeter, final String eMeter) { Wait.until(() -> { final SmartMeter mbusDevice = this.smartMeterRepository.findByDeviceIdentification(gMeter); final Device gatewayDevice = this.deviceRepository.findByDeviceIdentification(eMeter); Assert.assertNotNull("No GatewayDevice found", gatewayDevice); Assert.assertNotNull("No MbusDevice found", mbusDevice); Assert.assertNotEquals("MbusDevice should not be coupled to this GatewayDevice", gatewayDevice, mbusDevice.getGatewayDevice()); }); }
Source:
public String toString() { return "ConstraintCheckError [annotationMirror=" + annotationMirror + ", element=" + element + ", messageKey=" + messageKey + ", messageParameters=" + Arrays.toString( messageParameters ) + "]"; }

Target:
public String toString() { return "ConstraintCheckIssue [annotationMirror=" + annotationMirror + ", element=" + element + ", kind=" + kind + ", messageKey=" + messageKey + ", messageParameters=" + Arrays.toString( messageParameters ) + "]"; }
Source:
public void testSimpleCaseHorizontallyNodeSelectionEdgeSelectableZonePresent() { openDiagram(DIAGRAM_DESCRIPTION, DIAGRAM_INSTANCE_NAME); SWTBotGefEditPart sourceNodePart = editor.getEditPart("C2"); Point sourceNodePartLocation = editor.getLocation(sourceNodePart); CheckSelectedCondition checkc1Selected = new CheckSelectedCondition(editor, sourceNodePart.part().getParent()); editor.click(new Point(sourceNodePartLocation.x - 7, sourceNodePartLocation.y)); bot.waitUntil(checkc1Selected); }

Target:
public void testSimpleCaseHorizontallyNodeSelectionEdgeSelectableZonePresent() { openDiagram(DIAGRAM_DESCRIPTION, DIAGRAM_INSTANCE_NAME, ZoomLevel.ZOOM_75); SWTBotGefEditPart sourceNodePart = editor.getEditPart("C2"); Point sourceNodePartLocation = editor.getLocation(sourceNodePart); CheckSelectedCondition checkc1Selected = new CheckSelectedCondition(editor, sourceNodePart.part().getParent()); editor.click(new Point(sourceNodePartLocation.x - LENGTH_TO_REACH_LAST_PIXEL_OF_EXPANDED_NODE, sourceNodePartLocation.y)); bot.waitUntil(checkc1Selected); }
Source:
private String createIntermediateTable() { if (DbConnectionFactory.isMySql()) { return MYSQL_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isOracle()) { return ORACLE_CREATE_INTERMEDIATE_TABLE; } else { return StringUtils.EMPTY; } }

Target:
private String createIntermediateTable() { String sql = StringUtils.EMPTY; if (DbConnectionFactory.isMySql()) { sql = MYSQL_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_CREATE_INTERMEDIATE_TABLE; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_CREATE_INTERMEDIATE_TABLE; } return sql; }
Source:
Parent( String parentAttribute ) { this.parentAttribute = parentAttribute; }

Target:
public Parent( String parentAttribute ) { this.parentAttribute = parentAttribute; }
Source:
@Before public void prepareTest() throws Exception{ Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); conn = DriverManager.getConnection(getUrl(), props); schemaName = generateUniqueName(); dataTableName = generateUniqueName(); viewName = generateUniqueName(); dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); viewFullName = SchemaUtil.getTableName(schemaName, viewName); globalIndexName = generateUniqueName(); globalIndexFullName = SchemaUtil.getTableName(schemaName, globalIndexName); createTestTable(getUrl(), String.format(DATA_TABLE_DDL, dataTableFullName)); createTestTable(getUrl(), String.format(VIEW_DDL, viewFullName, dataTableFullName)); String dataTableUpsert = String.format(UPSERT_SQL, dataTableFullName); PreparedStatement stmt = conn.prepareStatement(dataTableUpsert); upsertRow(stmt, "tenantID1",1, "name1", 9991); upsertRow(stmt, "tenantID1",2, "name2", 9992); upsertRow(stmt, "tenantID1",3, "name3", 9993); conn.commit(); }

Target:
public void prepareTest() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); conn = DriverManager.getConnection(getUrl(), props); schemaName = generateUniqueName(); dataTableName = generateUniqueName(); viewName = generateUniqueName(); dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); viewFullName = SchemaUtil.getTableName(schemaName, viewName); globalIndexName = "GLBL_IDX_" + generateUniqueName(); globalIndexFullName = SchemaUtil.getTableName(schemaName, globalIndexName); createTestTable(getUrl(), String.format(DATA_TABLE_DDL, dataTableFullName)); createTestTable(getUrl(), String.format(VIEW_DDL, viewFullName, dataTableFullName)); String dataTableUpsert = String.format(UPSERT_SQL, dataTableFullName); PreparedStatement stmt = conn.prepareStatement(dataTableUpsert); for (int i=1; i < 4; i++) { upsertRow(stmt, "tenantID1", i, "name" + i, 9990+i); } conn.commit(); }
Source:
public Collection<IProjectAdapter> getProjectsFor(final IOpenShiftConnection conn) { String key = getCacheKey(conn); Set<IProjectAdapter> adapters = null; if (!contains(key)) { adapters = createEntry(key); Collection<IProject> projects = conn.<IProject>getResources(ResourceKind.PROJECT); for (IProject project : projects) { IProjectAdapter adapter = addNewProjectAdapter(adapters, conn, project); notifyAdd(adapter); } } else { adapters = getEntry(key); } return new ArrayList<>(adapters); }

Target:
public Collection<IProjectAdapter> getProjectsFor(final IOpenShiftConnection conn) { String key = getCacheKey(conn); Set<IProjectAdapter> adapters = getOrCreateEntry(key); if (adapters.isEmpty()) { Collection<IProject> projects = conn.<IProject>getResources(ResourceKind.PROJECT); for (IProject project : projects) { IProjectAdapter adapter = addNewProjectAdapter(adapters, conn, project); notifyAdd(adapter); } } else { adapters = getEntry(key); } return new ArrayList<>(adapters); }
Source:
public void setRequestInputStream(InputStream is) { ClonedInputStream cis = new ClonedInputStream(is); is = cis; try { while (cis.read() != -1) { } } catch (IOException ioe) { } copy = cis.getOutput(); int size = copy.size(); if (size != 0) size--; inputStreamEntity = new RepeatableInputStreamRequestEntity(new ByteArrayInputStream(copy.toByteArray()), size); }

Target:
public void setRequestInputStream(InputStream is) { ClonedInputStream cis = new ClonedInputStream(is); is = cis; try { while (cis.read() != -1) { } } catch (IOException ioe) { LOG.warn("Error reading input stream", ioe); } copy = cis.getOutput(); int size = copy.size(); if (size != 0) size--; inputStreamEntity = new RepeatableInputStreamRequestEntity(new ByteArrayInputStream(copy.toByteArray()), size); }
Source:
protected void doRun() throws Exception { List<GitHubRepositoryName> names; synchronized (this) { names = new ArrayList<GitHubRepositoryName>(couldHaveBeenRemoved); couldHaveBeenRemoved.clear(); } for (Job<?,?> job : Jenkins.getInstance().getAllItems(Job.class)) { ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) job; for (Trigger trigger : pJob.getTriggers().values()) { if(trigger instanceof GitHubPushTrigger) { names.removeAll(GitHubRepositoryNameContributor.parseAssociatedNames(job)); break; } } } OUTER: for (GitHubRepositoryName r : names) { for (GHRepository repo : r.resolve()) { try { removeHook(repo, Trigger.all().get(DescriptorImpl.class).getHookUrl()); LOGGER.info("Removed a hook from "+r+""); continue OUTER; } catch (Throwable e) { LOGGER.log(Level.WARNING,"Failed to remove hook from "+r,e); } } } }

Target:
protected void doRun() throws Exception { URL url = GitHubPlugin.configuration().getHookUrl(); List<Job> jobs = Jenkins.getInstance().getAllItems(Job.class); List<GitHubRepositoryName> aliveRepos = from(jobs) .filter(isAlive()) .transformAndConcat(associatedNames()).toList(); while (!сleanQueue.isEmpty()) { GitHubRepositoryName name = сleanQueue.poll(); WebhookManager.forHookUrl(url).unregisterFor(name, aliveRepos); } }
Source:
public Order cloneForRevision() { DrugOrder newOrder = new DrugOrder(); newOrder.setCareSetting(this.getCareSetting()); newOrder.setConcept(this.getConcept()); newOrder.setAction(Action.REVISE); newOrder.setPreviousOrder(this); newOrder.setPatient(this.getPatient()); newOrder.setOrderer(this.getOrderer()); newOrder.setInstructions(this.getInstructions()); newOrder.setUrgency(this.getUrgency()); newOrder.setCommentToFulfiller(this.getCommentToFulfiller()); newOrder.setAccessionNumber(this.getAccessionNumber()); newOrder.setAutoExpireDate(this.getAutoExpireDate()); newOrder.setOrderReason(this.getOrderReason()); newOrder.setOrderReasonNonCoded(this.getOrderReasonNonCoded()); newOrder.setDose(this.getDose()); newOrder.setDoseUnits(this.getDoseUnits()); newOrder.setFrequency(this.getFrequency()); newOrder.setAsNeeded(this.getAsNeeded()); newOrder.setAsNeededCondition(this.getAsNeededCondition()); newOrder.setQuantity(this.getQuantity()); newOrder.setQuantityUnits(this.getQuantityUnits()); newOrder.setDrug(this.getDrug()); newOrder.setDosingType(this.getDosingType()); newOrder.setDosingInstructions(this.getDosingInstructions()); newOrder.setDuration(this.getDuration()); newOrder.setDurationUnits(this.getDurationUnits()); newOrder.setRoute(this.getRoute()); newOrder.setAdministrationInstructions(this.getAdministrationInstructions()); newOrder.setNumRefills(this.getNumRefills()); return newOrder; }

Target:
public Order cloneForRevision() { DrugOrder newOrder = new DrugOrder(); newOrder.setCareSetting(this.getCareSetting()); newOrder.setConcept(this.getConcept()); newOrder.setAction(Action.REVISE); newOrder.setPreviousOrder(this); newOrder.setPatient(this.getPatient()); newOrder.setInstructions(this.getInstructions()); newOrder.setUrgency(this.getUrgency()); newOrder.setCommentToFulfiller(this.getCommentToFulfiller()); newOrder.setAccessionNumber(this.getAccessionNumber()); newOrder.setAutoExpireDate(this.getAutoExpireDate()); newOrder.setOrderReason(this.getOrderReason()); newOrder.setOrderReasonNonCoded(this.getOrderReasonNonCoded()); newOrder.setDose(this.getDose()); newOrder.setDoseUnits(this.getDoseUnits()); newOrder.setFrequency(this.getFrequency()); newOrder.setAsNeeded(this.getAsNeeded()); newOrder.setAsNeededCondition(this.getAsNeededCondition()); newOrder.setQuantity(this.getQuantity()); newOrder.setQuantityUnits(this.getQuantityUnits()); newOrder.setDrug(this.getDrug()); newOrder.setDosingType(this.getDosingType()); newOrder.setDosingInstructions(this.getDosingInstructions()); newOrder.setDuration(this.getDuration()); newOrder.setDurationUnits(this.getDurationUnits()); newOrder.setRoute(this.getRoute()); newOrder.setAdministrationInstructions(this.getAdministrationInstructions()); newOrder.setNumRefills(this.getNumRefills()); return newOrder; }
Source:
public static boolean openRepositoryTask(String connectorKind, String repositoryUrl, String id, TaskOpenListener listener, long timestamp) { String taskUrl = getTaskUrl(connectorKind, repositoryUrl, id); if (taskUrl == null) { return false; } IWorkbenchWindow window = getWindow(); if (window == null) { return false; } IWorkbenchPage page = window.getActivePage(); OpenRepositoryTaskJob job = new OpenRepositoryTaskJob(connectorKind, repositoryUrl, id, taskUrl, timestamp, page); job.setListener(listener); job.schedule(); return true; }

Target:
public static boolean openRepositoryTask(String connectorKind, String repositoryUrl, String id, TaskOpenListener listener, long timestamp) { String taskUrl = getTaskUrl(connectorKind, repositoryUrl, id); if (taskUrl == null) { return false; } IWorkbenchWindow window = getWorkbenchWindow(); if (window == null) { return false; } IWorkbenchPage page = window.getActivePage(); OpenRepositoryTaskJob job = new OpenRepositoryTaskJob(connectorKind, repositoryUrl, id, taskUrl, timestamp, page); job.setListener(listener); job.schedule(); return true; }
Source:
public void configure(Binder binder) { binder.bind(RaptorConnectorId.class).toInstance(new RaptorConnectorId(connectorId)); binder.bind(RaptorConnector.class).in(Scopes.SINGLETON); binder.bind(RaptorMetadataFactory.class).in(Scopes.SINGLETON); binder.bind(RaptorSplitManager.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSourceProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSinkProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorHandleResolver.class).in(Scopes.SINGLETON); binder.bind(RaptorNodePartitioningProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorSessionProperties.class).in(Scopes.SINGLETON); binder.bind(RaptorTableProperties.class).in(Scopes.SINGLETON); binder.bind(TemporalFunction.class).in(Scopes.SINGLETON); Multibinder<SystemTable> tableBinder = newSetBinder(binder, SystemTable.class); tableBinder.addBinding().to(ShardMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableStatsSystemTable.class).in(Scopes.SINGLETON); }

Target:
public void configure(Binder binder) { binder.bind(RaptorConnectorId.class).toInstance(new RaptorConnectorId(connectorId)); binder.bind(RaptorConnector.class).in(Scopes.SINGLETON); binder.bind(RaptorMetadataFactory.class).in(Scopes.SINGLETON); binder.bind(RaptorSplitManager.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSourceProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorPageSinkProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorHandleResolver.class).in(Scopes.SINGLETON); binder.bind(RaptorNodePartitioningProvider.class).in(Scopes.SINGLETON); binder.bind(RaptorSessionProperties.class).in(Scopes.SINGLETON); binder.bind(RaptorTableProperties.class).in(Scopes.SINGLETON); Multibinder<SystemTable> tableBinder = newSetBinder(binder, SystemTable.class); tableBinder.addBinding().to(ShardMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableMetadataSystemTable.class).in(Scopes.SINGLETON); tableBinder.addBinding().to(TableStatsSystemTable.class).in(Scopes.SINGLETON); }