auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final String jndiName = ManagedExecutorServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString(); final int priority = ManagedThreadFactoryResourceDefinition.PRIORITY_AD.resolveModelAttribute(context, model).asInt(); final ServiceName serviceName = ManagedThreadFactoryResourceDefinition.CAPABILITY.getCapabilityServiceName(name); final ManagedThreadFactoryService service = new ManagedThreadFactoryService(name, jndiName, priority); final ServiceBuilder<ManagedThreadFactoryImpl> serviceBuilder = context.getServiceTarget().addService(serviceName, service); String contextService = null; if(model.hasDefined(ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE)) { contextService = ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString(); } if (contextService != null) { serviceBuilder.addDependency(context.getCapabilityServiceName(ContextServiceResourceDefinition.CAPABILITY.getName(), contextService, ContextServiceImpl.class), ContextServiceImpl.class, service.getContextServiceInjector()); } serviceBuilder.install(); }

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final String jndiName = ManagedExecutorServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString(); final int priority = ManagedThreadFactoryResourceDefinition.PRIORITY_AD.resolveModelAttribute(context, model).asInt(); final ManagedThreadFactoryService service = new ManagedThreadFactoryService(name, jndiName, priority); final CapabilityServiceBuilder serviceBuilder = context.getCapabilityServiceTarget().addCapability(ManagedThreadFactoryResourceDefinition.CAPABILITY, service); String contextService = null; if(model.hasDefined(ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE)) { contextService = ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString(); } if (contextService != null) { serviceBuilder.addCapabilityRequirement(ContextServiceResourceDefinition.CAPABILITY.getName(), ContextServiceImpl.class, service.getContextServiceInjector(), contextService); } serviceBuilder.install(); }
Source:
protected Set<Identity> identities(Map<String, Object> jsonData) { Set<Identity> identities = new HashSet<>(); if (jsonData == null) { return identities; } List<String> idList = (List<String>) jsonData.get(ID_LIST); for (String id : idList) { Identity identityObj = Identity.fromId(id); if (identityObj != null) { identities.add(identityObj); } else { logger.trace("Identity is null for id: " + id); } } return identities; }

Target:
protected Set<Identity> identities(Map<String, Object> jsonData) { Set<Identity> identities = new HashSet<>(); if (jsonData == null) { return identities; } List<String> idList = (List<String>) jsonData.get(ID_LIST); for (String id : idList) { Identity identityObj = Identity.fromId(id); if (identityObj != null) { identities.add(identityObj); } else { log.trace("Identity is null for id: {}", id); } } return identities; }
Source:
public void load(final GameChooserEntry entry) { fileName = null; if (entry == null) { ClientSetting.defaultGameName.resetValue(); ClientSetting.defaultGameUri.resetValue(); ClientSetting.flush(); } else { setGameData(entry.getGameData()); ClientSetting.defaultGameName.setValue(entry.getGameData().getGameName()); ClientSetting.defaultGameUri.setValue(entry.getUri().toString()); ClientSetting.flush(); } }

Target:
public void load(final GameChooserEntry entry) { fileName = null; if (entry == null) { ClientSetting.defaultGameName.resetValue(); ClientSetting.defaultGameUri.resetValue(); } else { setGameData(entry.getGameData()); ClientSetting.defaultGameName.setValue(entry.getGameData().getGameName()); ClientSetting.defaultGameUri.setValue(entry.getUri().toString()); } ClientSetting.flush(); }
Source:
void findProperty_Success() { String[] dnsServers = { "server1", "server2" }; String[] dnsSearch = { "dnsjava.org", "example.com", "dnsjava.org" }; Name[] searchPath = Arrays.stream(dnsSearch) .map(s -> Name.fromConstantString(s, Name.root)) .toArray(Name[]::new); System.setProperty(ResolverConfig.DNS_SERVER_PROP, String.join(",", dnsServers)); System.setProperty(ResolverConfig.DNS_SEARCH_PROP, String.join(",", dnsSearch)); try { ResolverConfig.refresh(); ResolverConfig rc = ResolverConfig.getCurrentConfig(); assertTrue(rc.findProperty()); assertEquals("server1", rc.server()); assertEquals(2, rc.servers().length); assertEquals(2, rc.searchPath().length); assertEquals(searchPath[0], rc.searchPath()[0]); assertEquals(searchPath[1], rc.searchPath()[1]); } finally { System.clearProperty(ResolverConfig.DNS_SERVER_PROP); System.clearProperty(ResolverConfig.DNS_SEARCH_PROP); } }

Target:
void findProperty_Success() { String[] dnsServers = { "server1", "server2" }; String[] dnsSearch = { "dnsjava.org", "example.com", "dnsjava.org" }; Name[] searchPath = Arrays.stream(dnsSearch) .map(s -> Name.fromConstantString(s + ".")) .toArray(Name[]::new); System.setProperty(ResolverConfig.DNS_SERVER_PROP, String.join(",", dnsServers)); System.setProperty(ResolverConfig.DNS_SEARCH_PROP, String.join(",", dnsSearch)); try { ResolverConfig.refresh(); ResolverConfig rc = ResolverConfig.getCurrentConfig(); assertTrue(rc.findProperty()); assertEquals("server1", rc.server()); assertEquals(2, rc.servers().length); assertEquals(2, rc.searchPath().length); assertEquals(searchPath[0], rc.searchPath()[0]); assertEquals(searchPath[1], rc.searchPath()[1]); } finally { System.clearProperty(ResolverConfig.DNS_SERVER_PROP); System.clearProperty(ResolverConfig.DNS_SEARCH_PROP); } }
Source:
public <T> Query where(String name, QueryOperation<T> queryOperation, T... values) { checkNotEmpty(name, "Name cannot be empty/null, please specify a name to apply operations on."); checkNotNull(queryOperation, "QueryOperation cannot be null."); checkNotNull(values, "Values to be compared with need to be set to something."); if (values.length == 0 && !queryOperation.hasDefaultValue()) { throw new IllegalArgumentException("Please specify at least one value to be searched for."); } for (int i = 0; i < values.length; ++i) { final T value = values[i]; checkNotNull(value, "Value at position %d must not be null.", i); if (value instanceof CharSequence) { checkNotEmpty(value.toString(), "Value at position %d must not be empty.", i); } } if ((!name.startsWith("sys.") && !name.startsWith("fields.")) && !CDAContentType.class.isAssignableFrom(type)) { throw new IllegalArgumentException("Please specify either a \"sys.\" or a \"fields.\" " + "attribute to be searched for. (Remember to specify a ContentType for \"fields.\" " + "searches on Entries only.)"); } if (name.startsWith("fields.") && !hasContentTypeSet()) { throw new IllegalStateException("Cannot request fields of an entry without having a " + "content type set first."); } if (values.length == 0) { params.put(name + queryOperation.operator, queryOperation.defaultValue.toString()); } else { params.put(name + queryOperation.operator, join(values)); } return (Query) this; }

Target:
public <T> Query where(String name, QueryOperation<T> queryOperation, T... values) { checkNotEmpty(name, "Name cannot be empty/null, please specify a name to apply operations on."); checkNotNull(queryOperation, "QueryOperation cannot be null."); checkNotNull(values, "Values to be compared with need to be set to something."); if (values.length == 0 && !queryOperation.hasDefaultValue()) { throw new IllegalArgumentException("Please specify at least one value to be searched for."); } for (int i = 0; i < values.length; ++i) { final T value = values[i]; checkNotNull(value, "Value at position %d must not be null.", i); if (value instanceof CharSequence) { checkNotEmpty(value.toString(), "Value at position %d must not be empty.", i); } } if ((!name.startsWith("sys.") && !name.startsWith("fields.")) && !CDAContentType.class.isAssignableFrom(type)) { throw new IllegalArgumentException("Please specify either a \"sys.\" or a \"fields.\" " + "attribute to be searched for. (Remember to specify a ContentType for \"fields.\" " + "searches when querying entries.)"); } if (name.startsWith("fields.") && !hasContentTypeSet()) { throw new IllegalStateException("Cannot request fields of an entry without having a " + "content type set first."); } if (values.length == 0) { params.put(name + queryOperation.operator, queryOperation.defaultValue.toString()); } else { params.put(name + queryOperation.operator, join(values)); } return (Query) this; }
Source:
private void initializeSpaceUpdaterHelper() { String name = spaceSystemDriver.getName(); if (name.equals(GPFSSpaceSystem.class.getName())) { spaceUpdater = new NullSpaceUpdaterHelper(); return; } spaceUpdater = new SimpleSpaceUpdaterHelper(); }

Target:
private void initializeSpaceUpdaterHelper() { spaceUpdater = SpaceUpdaterHelperFactory.getSpaceUpdaterHelper(this); }
Source:
public AttributeTypeBuilder() { this( CommonFactoryFinder.getFeatureTypeFactory(null) ); }

Target:
public AttributeTypeBuilder() { this( CommonFactoryFinder.getFeatureTypeFactory(null) ); init(); }
Source:
private void onBoardDelete(String boardName) { logger.info("Menu: Boards > Delete > " + boardName); Alert dlg = new Alert(AlertType.CONFIRMATION, ""); dlg.initModality(Modality.APPLICATION_MODAL); dlg.setTitle("Confirmation"); dlg.getDialogPane().setHeaderText("Delete board '" + boardName + "'?"); dlg.getDialogPane().setContentText("Are you sure you want to delete this board?"); Optional<ButtonType> response = dlg.showAndWait(); if (response.isPresent() && response.get().getButtonData() == ButtonData.OK_DONE) { prefs.removeBoard(boardName); if (prefs.getLastOpenBoard().equals(boardName)) { prefs.setLastOpenBoard(""); } ui.triggerEvent(new BoardSavedEvent()); logger.info(boardName + " was deleted"); } else { logger.info(boardName + " was not deleted"); } }

Target:
private void onBoardDelete(String boardName) { logger.info("Menu: Boards > Delete > " + boardName); Alert dlg = new Alert(AlertType.CONFIRMATION, ""); dlg.initModality(Modality.APPLICATION_MODAL); dlg.setTitle("Confirmation"); dlg.getDialogPane().setHeaderText("Delete board '" + boardName + "'?"); dlg.getDialogPane().setContentText("Are you sure you want to delete this board?"); Optional<ButtonType> response = dlg.showAndWait(); if (response.isPresent() && response.get().getButtonData() == ButtonData.OK_DONE) { prefs.removeBoard(boardName); if (prefs.getLastOpenBoard().isPresent()) { if (prefs.getLastOpenBoard().get().equals(boardName)) { prefs.clearLastOpenBoard(); } } ui.triggerEvent(new BoardSavedEvent()); logger.info(boardName + " was deleted"); } else { logger.info(boardName + " was not deleted"); } }
Source:
public void testPreloadSplitsForRewindableSplitSource() throws Exception { ConnectorSession session = new TestingConnectorSession( new HiveSessionProperties( new HiveClientConfig().setUseRewindableSplitSource(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig()).getSessionProperties()); HiveSplitSource hiveSplitSource = HiveSplitSource.bucketedRewindable( session, "database", "table", TupleDomain.all(), 10, new DataSize(1, MEGABYTE), new TestingHiveSplitLoader(), EXECUTOR, new CounterStat()); for (int i = 0; i < 10; i++) { hiveSplitSource.addToQueue(new TestSplit(i, OptionalInt.of(0))); assertEquals(hiveSplitSource.getBufferedInternalSplitCount(), i + 1); } SettableFuture<List<ConnectorSplit>> splits = SettableFuture.create(); CountDownLatch started = new CountDownLatch(1); Thread getterThread = new Thread(() -> { try { started.countDown(); List<ConnectorSplit> batch = getSplits(hiveSplitSource, OptionalInt.of(0), 10); splits.set(batch); } catch (Throwable e) { splits.setException(e); } }); getterThread.start(); try { assertTrue(started.await(1, SECONDS)); MILLISECONDS.sleep(200); assertFalse(splits.isDone()); hiveSplitSource.noMoreSplits(); List<ConnectorSplit> connectorSplits = splits.get(800, MILLISECONDS); assertEquals(connectorSplits.size(), 10); for (int i = 0; i < 10; i++) { assertEquals(((HiveSplit) connectorSplits.get(i)).getSchema().getProperty("id"), Integer.toString(i)); } } finally { getterThread.interrupt(); } }

Target:
public void testPreloadSplitsForRewindableSplitSource() throws Exception { ConnectorSession session = new TestingConnectorSession( new HiveSessionProperties( new HiveClientConfig().setUseRewindableSplitSource(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig()).getSessionProperties()); HiveSplitSource hiveSplitSource = HiveSplitSource.bucketedRewindable( session, "database", "table", TupleDomain.all(), 10, new DataSize(1, MEGABYTE), new TestingHiveSplitLoader(), EXECUTOR, new CounterStat()); for (int i = 0; i < 10; i++) { hiveSplitSource.addToQueue(new TestSplit(i, OptionalInt.of(0))); assertEquals(hiveSplitSource.getBufferedInternalSplitCount(), i + 1); } SettableFuture<List<ConnectorSplit>> splits = SettableFuture.create(); CountDownLatch started = new CountDownLatch(1); Thread getterThread = new Thread(() -> { try { started.countDown(); List<ConnectorSplit> batch = getSplits(hiveSplitSource, OptionalInt.of(0), 10); splits.set(batch); } catch (Throwable e) { splits.setException(e); } }); getterThread.start(); try { assertTrue(started.await(10, SECONDS)); MILLISECONDS.sleep(200); assertFalse(splits.isDone()); hiveSplitSource.noMoreSplits(); List<ConnectorSplit> connectorSplits = splits.get(10, SECONDS); assertEquals(connectorSplits.size(), 0); assertFalse(hiveSplitSource.isFinished()); connectorSplits = getSplits(hiveSplitSource, OptionalInt.of(0), 10); for (int i = 0; i < 10; i++) { assertEquals(((HiveSplit) connectorSplits.get(i)).getSchema().getProperty("id"), Integer.toString(i)); } assertTrue(hiveSplitSource.isFinished()); } finally { getterThread.interrupt(); } }
Source:
protected void doOpen() throws Throwable { final NettyClientHandler nettyClientHandler = new NettyClientHandler(getUrl(), this); bootstrap = new Bootstrap(); bootstrap.group(nioEventLoopGroup) .option(ChannelOption.SO_KEEPALIVE, true) .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) .channel(NioSocketChannel.class); if (getConnectTimeout() < 3000) { bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 3000); } else { bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, getConnectTimeout()); } bootstrap.handler(new ChannelInitializer() { @Override protected void initChannel(Channel ch) throws Exception { int heartbeatInterval = UrlUtils.getIdleTimeout(getUrl()); NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this); ch.pipeline() .addLast("decoder", adapter.getDecoder()) .addLast("encoder", adapter.getEncoder()) .addLast("client-idle-handler", new IdleStateHandler(heartbeatInterval, 0, 0, MILLISECONDS)) .addLast("handler", nettyClientHandler); String socksProxyHost = System.getProperty(SOCKS_PROXY_HOST); if(socksProxyHost != null) { Integer socksProxyPort = Integer.getInteger(SOCKS_PROXY_PORT, DEFAULT_SOCKS_PROXY_PORT); Socks5ProxyHandler socks5ProxyHandler = new Socks5ProxyHandler(new InetSocketAddress(socksProxyHost, socksProxyPort)); ch.pipeline().addFirst(socks5ProxyHandler); } } }); }

Target:
protected void doOpen() throws Throwable { final NettyClientHandler nettyClientHandler = new NettyClientHandler(getUrl(), this); bootstrap = new Bootstrap(); bootstrap.group(nioEventLoopGroup) .option(ChannelOption.SO_KEEPALIVE, true) .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) .channel(NioSocketChannel.class); if (getConnectTimeout() < 3000) { bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 3000); } else { bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, getConnectTimeout()); } bootstrap.handler(new ChannelInitializer() { @Override protected void initChannel(Channel ch) throws Exception { int heartbeatInterval = UrlUtils.getHeartbeat(getUrl()); NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this); ch.pipeline() .addLast("decoder", adapter.getDecoder()) .addLast("encoder", adapter.getEncoder()) .addLast("client-idle-handler", new IdleStateHandler(heartbeatInterval, 0, 0, MILLISECONDS)) .addLast("handler", nettyClientHandler); String socksProxyHost = ConfigUtils.getProperty(SOCKS_PROXY_HOST); if(socksProxyHost != null) { int socksProxyPort = Integer.parseInt(ConfigUtils.getProperty(SOCKS_PROXY_PORT, DEFAULT_SOCKS_PROXY_PORT)); Socks5ProxyHandler socks5ProxyHandler = new Socks5ProxyHandler(new InetSocketAddress(socksProxyHost, socksProxyPort)); ch.pipeline().addFirst(socks5ProxyHandler); } } }); }
Source:
public <ContextType> ContextType getContextValue(String key) { return context == null ? null : (ContextType) context.get(key); }

Target:
public Object getContextValue(String key) { return context == null ? null : context.get(key); }
Source:
private synchronized void stopWithRequirement( AvailabilityRequirement requirement ) throws Throwable { log.info( "Stopping, reason: " + requirement.description() ); databaseHealth = null; localCommit = null; dataSourceManager.stop(); raiseAvailabilityGuard( requirement ); }

Target:
private synchronized void stopWithRequirement( AvailabilityRequirement requirement ) throws Throwable { log.info( "Stopping, reason: " + requirement.description() ); raiseAvailabilityGuard( requirement ); databaseHealth = null; localCommit = null; dataSourceManager.stop(); }
Source:
public Set<Permission> permissionsFor(DataverseRequest req, DvObject dvo) { Set<Permission> permissions = permissionsForSingleRoleAssignee(req.getUser(), dvo); for (Group g : groupService.groupsFor(req, dvo)) { permissionsForSingleRoleAssignee(g, dvo, permissions); } if (!req.getUser().isAuthenticated()) { permissions.removeAll(PERMISSIONS_FOR_AUTHENTICATED_USERS_ONLY); } return permissions; }

Target:
public Set<Permission> permissionsFor(DataverseRequest req, DvObject dvo) { if (req.getUser().isSuperuser()) { return EnumSet.allOf(Permission.class); } Set<Permission> permissions = getInferredPermissions(dvo); Set<RoleAssignee> ras = new HashSet<>(groupService.groupsFor(req, dvo)); ras.add(req.getUser()); addGroupPermissionsFor(ras, dvo, permissions); if (!req.getUser().isAuthenticated()) { permissions.removeAll(PERMISSIONS_FOR_AUTHENTICATED_USERS_ONLY); } return permissions; }
Source:
public void start(IProgressMonitor progressMonitor) { List<IResource> resourcesToMonitor = getResourcesToMonitor(); SubMonitor subMonitor = SubMonitor.convert(progressMonitor, resourcesToMonitor.size() + 1); boolean refreshNeeded = false; for (Iterator<IResource> i = resourcesToMonitor.iterator(); i.hasNext();) refreshNeeded |= !monitor(i.next(), subMonitor.split(1)); workspace.getPathVariableManager().addChangeListener(this); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); ((Workspace) workspace).addLifecycleListener(this); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting monitor manager."); if (refreshNeeded) { new PollingMonitor(refreshManager).runOnce(); subMonitor.worked(1); } else { subMonitor.setWorkRemaining(0); } }

Target:
public void start(IProgressMonitor progressMonitor) { List<IResource> resourcesToMonitor = getResourcesToMonitor(); SubMonitor subMonitor = SubMonitor.convert(progressMonitor, resourcesToMonitor.size() + 1); boolean refreshNeeded = false; for (Iterator<IResource> i = resourcesToMonitor.iterator(); i.hasNext();) refreshNeeded |= !monitor(i.next(), subMonitor.split(1)); workspace.getPathVariableManager().addChangeListener(this); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); ((Workspace) workspace).addLifecycleListener(this); if (Policy.DEBUG_AUTO_REFRESH) Policy.debug(RefreshManager.DEBUG_PREFIX + " starting monitor manager."); if (refreshNeeded) { new PollingMonitor(refreshManager).runOnce(); } subMonitor.step(1); }
Source:
public PopupMenuExportResponse() { super(Constant.messages.getString("history.export.response.popup")); this.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { List<HistoryReference> hrefs = extension.getSelectedHistoryReferences(); if (hrefs.size() == 0) { extension.getView().showWarningDialog(Constant.messages.getString("history.export.response.select.warning")); return; } HttpMessage msg = null; try { msg = hrefs.get(0).getHttpMessage(); } catch (Exception e1) { extension.getView().showWarningDialog(Constant.messages.getString("history.export.response.read.warning")); return; } if (msg.getResponseHeader().isEmpty() || msg.getResponseBody().length() == 0) { extension.getView().showWarningDialog(Constant.messages.getString("history.export.response.body.warning")); return; } File file = getOutputFile(msg); if (file == null) { return; } boolean isAppend = true; if (file.exists()) { int rc = extension.getView().showYesNoCancelDialog(Constant.messages.getString("file.overwrite.warning")); if (rc == JOptionPane.CANCEL_OPTION) { return; } else if (rc == JOptionPane.YES_OPTION) { isAppend = false; } } BufferedOutputStream bos = null; try { bos = new BufferedOutputStream(new FileOutputStream(file, isAppend)); for (HistoryReference href : hrefs) { exportHistory(href.getHttpMessage(), bos); } } catch (Exception e1) { extension.getView().showWarningDialog(Constant.messages.getString("file.save.error") + file.getAbsolutePath() + "."); log.warn(e1.getMessage(), e1); } finally { try { bos.close(); } catch (Exception e2) { log.warn(e2.getMessage(), e2); } } } }); }

Target:
public PopupMenuExportResponse() { super(Constant.messages.getString("history.export.response.popup")); this.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { List<HistoryReference> hrefs = extension.getSelectedHistoryReferences(); if (hrefs.size() == 0) { extension.getView().showWarningDialog(Constant.messages.getString("history.export.response.select.warning")); return; } File file = getOutputFile(); if (file == null) { return; } boolean isAppend = true; if (file.exists()) { int rc = extension.getView().showYesNoCancelDialog(Constant.messages.getString("file.overwrite.warning")); if (rc == JOptionPane.CANCEL_OPTION) { return; } else if (rc == JOptionPane.YES_OPTION) { isAppend = false; } } BufferedOutputStream bos = null; try { bos = new BufferedOutputStream(new FileOutputStream(file, isAppend)); for (HistoryReference href : hrefs) { HttpMessage msg = null; msg = href.getHttpMessage(); exportHistory(msg, bos); } } catch (Exception e1) { extension.getView().showWarningDialog(Constant.messages.getString("file.save.error") + file.getAbsolutePath() + "."); log.warn(e1.getMessage(), e1); } finally { try { bos.close(); } catch (Exception e2) { log.warn(e2.getMessage(), e2); } } } }); }
Source:
public WorkerCoordinatorMetrics(Metrics metrics, String metricGrpPrefix) { this.metricGrpName = metricGrpPrefix + "-coordinator-metrics"; Measurable numConnectors = new Measurable() { @Override public double measure(MetricConfig config, long now) { return assignmentSnapshot.connectors().size(); } }; Measurable numTasks = new Measurable() { @Override public double measure(MetricConfig config, long now) { return assignmentSnapshot.tasks().size(); } }; if (assignmentSnapshot != null) { metrics.addMetric(metrics.metricName("assigned-connectors", this.metricGrpName, "The number of connector instances currently assigned to this consumer"), numConnectors); metrics.addMetric(metrics.metricName("assigned-tasks", this.metricGrpName, "The number of tasks currently assigned to this consumer"), numTasks); } }

Target:
public WorkerCoordinatorMetrics(Metrics metrics, String metricGrpPrefix) { this.metricGrpName = metricGrpPrefix + "-coordinator-metrics"; Measurable numConnectors = new Measurable() { @Override public double measure(MetricConfig config, long now) { if (assignmentSnapshot == null) { return 0.0; } return assignmentSnapshot.connectors().size(); } }; Measurable numTasks = new Measurable() { @Override public double measure(MetricConfig config, long now) { if (assignmentSnapshot == null) { return 0.0; } return assignmentSnapshot.tasks().size(); } }; metrics.addMetric(metrics.metricName("assigned-connectors", this.metricGrpName, "The number of connector instances currently assigned to this consumer"), numConnectors); metrics.addMetric(metrics.metricName("assigned-tasks", this.metricGrpName, "The number of tasks currently assigned to this consumer"), numTasks); }
Source:
public BlobId(byte flag, byte datacenterId, short accountId, short containerId, PartitionId partitionId) { if (partitionId == null) { throw new IllegalArgumentException("partitionId cannot be null"); } version = getCurrentVersion(); switch (version) { case BLOB_ID_V1: this.flag = DEFAULT_FLAG; this.datacenterId = LEGACY_DATACENTER_ID; this.accountId = LEGACY_ACCOUNT_ID; this.containerId = LEGACY_CONTAINER_ID; break; case BLOB_ID_V2: this.flag = flag; this.datacenterId = datacenterId; this.accountId = accountId; this.containerId = containerId; break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } this.partitionId = partitionId; uuid = UUID.randomUUID().toString(); }

Target:
public BlobId(byte flag, byte datacenterId, short accountId, short containerId, PartitionId partitionId) { if (partitionId == null) { throw new IllegalArgumentException("partitionId cannot be null"); } version = getCurrentVersion(); switch (version) { case BLOB_ID_V1: this.flag = DEFAULT_FLAG; this.datacenterId = UNKNOWN_DATACENTER_ID; this.accountId = UNKNOWN_ACCOUNT_ID; this.containerId = UNKNOWN_CONTAINER_ID; break; case BLOB_ID_V2: this.flag = flag; this.datacenterId = datacenterId; this.accountId = accountId; this.containerId = containerId; break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } this.partitionId = partitionId; uuid = UUID.randomUUID().toString(); }
Source:
public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { return Templates.populateTemplate( FormTemplates.TEXT_SUBMISSION_FORM, Slots.IS_SESSION_OPEN, sessionIsOpen ? "true" : "false", Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), "${recommendedLengthDisplay}", recommendedLength == 0 ? "style=\"display:none\"" : "", "${recommendedLength}", Integer.toString(recommendedLength), Slots.TEXT_EXISTING_RESPONSE, SanitizationHelper.sanitizeForRichText(existingResponseDetails.getAnswerString())); }

Target:
public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { return Templates.populateTemplate( FormTemplates.TEXT_SUBMISSION_FORM, Slots.IS_SESSION_OPEN, Boolean.toString(sessionIsOpen), Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), "${recommendedLengthDisplay}", recommendedLength == 0 ? "style=\"display:none\"" : "", "${recommendedLength}", Integer.toString(recommendedLength), Slots.TEXT_EXISTING_RESPONSE, SanitizationHelper.sanitizeForRichText(existingResponseDetails.getAnswerString())); }
Source:
protected boolean isMemoryStateRemovable(String memoryVolume) { if (memoryVolume.isEmpty()) { return false; } return enclosingCommand.getParameters().getParentCommand() == VdcActionType.RemoveVm ? getSnapshotDao().getNumOfSnapshotsByMemory(memoryVolume) == 0 : getSnapshotDao().getNumOfSnapshotsByMemory(memoryVolume) == 1; }

Target:
protected boolean isMemoryStateRemovable(String memoryVolume) { if (memoryVolume.isEmpty()) { return false; } int numOfSnapshotsUsingThisMemory = getSnapshotDao().getNumOfSnapshotsByMemory(memoryVolume); return enclosingCommand.getParameters().getParentCommand() == VdcActionType.RemoveVm ? numOfSnapshotsUsingThisMemory == 0 : numOfSnapshotsUsingThisMemory == 1; }
Source:
public PartitionWideEntryBackupOperation(String name, EntryBackupProcessor backupProcessor) { super(name, backupProcessor); Thread.dumpStack(); }

Target:
public PartitionWideEntryBackupOperation(String name, EntryBackupProcessor backupProcessor) { super(name, backupProcessor); }
Source:
protected void build(UnitVmModel frontend, VM backend) { backend.setCpuPinning((String) frontend.getCpuPinning().getEntity()); VDS defaultHost = (VDS) frontend.getDefaultHost().getSelectedItem(); if ((Boolean) frontend.getIsAutoAssign().getEntity()) { backend.setDedicatedVmForVds(null); } else { backend.setDedicatedVmForVds(defaultHost.getId()); } backend.setMigrationSupport((MigrationSupport) frontend.getMigrationMode().getSelectedItem()); backend.setUseHostCpuFlags((Boolean) frontend.getHostCpu().getEntity()); }

Target:
protected void build(UnitVmModel frontend, VM backend) { backend.setCpuPinning((String) frontend.getCpuPinning().getEntity()); backend.setUseHostCpuFlags((Boolean) frontend.getHostCpu().getEntity()); }
Source:
public NetworkAccess(CoreNode coreNode, SocialNetwork social, ContentAddressedStorage dhtClient, MutablePointers mutable, MutableTree tree, WriteSynchronizer synchronizer, InstanceAdmin instanceAdmin, SpaceUsage spaceUsage, List<String> usernames, boolean isJavascript) { this.coreNode = coreNode; this.social = social; this.dhtClient = new HashVerifyingStorage(dhtClient, isJavascript ? new ScryptJS() : new ScryptJava()); this.mutable = mutable; this.tree = tree; this.synchronizer = synchronizer; this.instanceAdmin = instanceAdmin; this.spaceUsage = spaceUsage; this.usernames = usernames; this.creationTime = LocalDateTime.now(); this.isJavascript = isJavascript; }

Target:
protected NetworkAccess(CoreNode coreNode, SocialNetwork social, ContentAddressedStorage dhtClient, MutablePointers mutable, MutableTree tree, WriteSynchronizer synchronizer, InstanceAdmin instanceAdmin, SpaceUsage spaceUsage, List<String> usernames, boolean isJavascript) { this.coreNode = coreNode; this.social = social; this.dhtClient = new HashVerifyingStorage(dhtClient, isJavascript ? new ScryptJS() : new ScryptJava()); this.mutable = mutable; this.tree = tree; this.synchronizer = synchronizer; this.instanceAdmin = instanceAdmin; this.spaceUsage = spaceUsage; this.usernames = usernames; this.creationTime = LocalDateTime.now(); this.isJavascript = isJavascript; }
Source:
public Response export() throws IOException { String exportFile = dataTransferServices.doExport(DataTransferExportModel.exportAll()); org.uberfire.java.nio.file.Path path = Paths.get(exportFile); return Response.ok(ioService.readAllBytes(path)).build(); }

Target:
public Response export() { try { String exportFile = dataTransferServices.doExport(DataTransferExportModel.exportAll()); org.uberfire.java.nio.file.Path path = Paths.get(exportFile); return Response.ok(ioService.readAllBytes(path)).build(); } catch (Exception e) { String errorMessage = "Error creating export: " + e.getMessage(); logger.error(errorMessage); logger.debug("Not able to create export.", e); return Response.serverError() .entity(errorMessage) .build(); } }
Source:
private String getKeyForRecord(final SAMRecord record) { boolean t = record.getReadPairedFlag() && record.getSecondOfPairFlag(); return record.getReadName() + "-" + (t ? "first" : "second"); }

Target:
private String getKeyForRecord(final SAMRecord record) { final boolean isSecondOfPair = record.getReadPairedFlag() && record.getSecondOfPairFlag(); return record.getReadName() + "-" + (isSecondOfPair ? "second" : "first"); }
Source:
public void process(Document document) { Element body = document.body(); CssParser cssParser = new CssParser(); for (Element element : Selector.select("[style]", body)) { String style = element.attr("style"); String newStyle = ""; List<CssRule> rules = null; CssRule newRule = null; if (style != null && style.length() > 0) { rules = cssParser.parseBlockContent(style); Iterator<CssRule> ruleIt = rules.iterator(); while (ruleIt.hasNext()) { CssRule rule = ruleIt.next(); if ("color".equals(rule.name)) { String color = rule.value; Matcher invalidHexColorMatcher = Pattern.compile( "^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})(\\s+(!)\\s*important)?\\s*$") .matcher(color); if (invalidHexColorMatcher.find()) { String newColor = "#" + invalidHexColorMatcher.group(1); boolean importantExists = invalidHexColorMatcher.group(2) != null; if (importantExists) { newColor += " !important"; } ruleIt.remove(); newRule = new CssRule("color", newColor.trim(), 0, 0, 0, 0); } } } } if (rules != null && newRule != null) { newStyle = addRuleToStyle(newStyle, newRule); for (CssRule rule : rules) { newStyle = addRuleToStyle(newStyle, rule); } element.attr("style", newStyle); } } }

Target:
public void process(Document document) { Element body = document.body(); CssParser cssParser = new CssParser(); for (Element element : Selector.select("[style]", body)) { String style = element.attr("style"); String newStyle = ""; List<CssRule> rules = null; CssRule newRule = null; if (style != null && style.length() > 0) { rules = cssParser.parseBlockContent(style); Iterator<CssRule> ruleIt = rules.iterator(); while (ruleIt.hasNext()) { CssRule rule = ruleIt.next(); if ("color".equals(rule.name)) { String color = rule.value; Matcher invalidHexColorMatcher = Pattern.compile( "^\\s*([0-9a-fA-F]{6}|[0-9a-fA-F]{3})(?:\\s+(.*))?\\s*$") .matcher(color); if (invalidHexColorMatcher.matches()) { String newColor = "#" + invalidHexColorMatcher.group(1); String additionalDeclarations = invalidHexColorMatcher.group(2); if (additionalDeclarations != null) { newColor += " " + additionalDeclarations; } ruleIt.remove(); newRule = new CssRule("color", newColor.trim(), 0, 0, 0, 0); } } } } if (rules != null && newRule != null) { newStyle = addRuleToStyle(newStyle, newRule); for (CssRule rule : rules) { newStyle = addRuleToStyle(newStyle, rule); } element.attr("style", newStyle); } } }
Source:
public RuleViolations evaluate(final Occurrences rule, final CardinalityContext context) { final String ruleRole = rule.getRole(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final Set<String> candidateRoles = context.getRoles(); final int candidatesCount = context.getCandidateCount(); final CardinalityContext.Operation operation = context.getOperation(); final DefaultRuleViolations results = new DefaultRuleViolations(); if (candidateRoles.contains(ruleRole)) { final int count = operation.equals(CardinalityContext.Operation.NONE) ? candidatesCount : (operation.equals(CardinalityContext.Operation.ADD) ? candidatesCount + 1 : candidatesCount - 1); if (count < minOccurrences) { results.addViolation(new CardinalityMinRuleViolation(candidateRoles.toString(), ruleRole, (int) minOccurrences, candidatesCount)); } else if (maxOccurrences > -1 && count > maxOccurrences) { results.addViolation(new CardinalityMaxRuleViolation(candidateRoles.toString(), ruleRole, (int) maxOccurrences, candidatesCount)); } } return results; }

Target:
public RuleViolations evaluate(final Occurrences rule, final CardinalityContext context) { final String ruleRole = rule.getRole(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final Set<String> candidateRoles = context.getRoles(); final int candidatesCount = context.getCandidateCount(); final CardinalityContext.Operation operation = context.getOperation(); final DefaultRuleViolations results = new DefaultRuleViolations(); if (candidateRoles.contains(ruleRole)) { final int count = operation.equals(CardinalityContext.Operation.NONE) ? candidatesCount : (operation.equals(CardinalityContext.Operation.ADD) ? candidatesCount + 1 : candidatesCount - 1); if (count < minOccurrences) { results.addViolation(new CardinalityMinRuleViolation(candidateRoles.toString(), ruleRole, minOccurrences, candidatesCount)); } else if (maxOccurrences > -1 && count > maxOccurrences) { results.addViolation(new CardinalityMaxRuleViolation(candidateRoles.toString(), ruleRole, maxOccurrences, candidatesCount)); } } return results; }
Source:
public void TextSize(int fontSize) { if(fontSize>1000) textSize = 999; else textSize = fontSize; setAdapterData(); }

Target:
public void TextSize(int fontSize) { if (fontSize > 1000 || fontSize < 1) textSize = 999; else textSize = fontSize; setAdapterData(); }
Source:
public void clickedOnNavDrawerSection(@NonNull String sectionName) { trackEvent(clickedOnNavDrawerSectionEventName, sectionNameMapKey, sectionName); }

Target:
public void clickedOnNavDrawerSection(@NonNull String sectionName) { trackEventWithProperties(CLICKED_ON_NAV_DRAWER_SECTION_EVENT_NAME, SECTION_NAME_MAP_KEY, sectionName); }
Source:
protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { RatingWidgetAnswerBinding binding = RatingWidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); View answerView = binding.getRoot(); RangeQuestion rangeQuestion = (RangeQuestion) prompt.getQuestion(); int numberOfStars = rangeQuestion.getRangeEnd().intValue(); int columns = calculateColumns(48); int rows = (int) Math.ceil((double) numberOfStars / columns); if (rows == 1) { binding.ratingBar.setVisibility(VISIBLE); this.ratingBar = binding.ratingBar; } else { binding.ratingBar.setVisibility(GONE); columns = calculateColumns(36); rows = (int) Math.ceil((double) numberOfStars / columns); if (rows == 1) { binding.ratingBar2.setVisibility(VISIBLE); this.ratingBar = binding.ratingBar2; } else { binding.ratingBar3.setVisibility(VISIBLE); this.ratingBar = binding.ratingBar3; } } ratingBar.setNumStars(rangeQuestion.getRangeEnd().intValue()); ratingBar.setOnRatingBarChangeListener((ratingBar, rating, fromUser) -> widgetValueChanged()); ratingBar.setEnabled(!prompt.isReadOnly()); if (prompt.getAnswerText() != null) { ratingBar.setRating(Integer.parseInt(prompt.getAnswerText())); } return answerView; }

Target:
protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = RatingWidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); View answerView = binding.getRoot(); int numberOfStars = getTotalStars((RangeQuestion) prompt.getQuestion()); int maxNumberOfStars = calculateMaximumStarsInOneLine(); if (maxNumberOfStars < numberOfStars) { binding.ratingBar1.setNumStars(maxNumberOfStars); binding.ratingBar1.setMax(maxNumberOfStars); binding.ratingBar2.setNumStars(Math.min(numberOfStars - maxNumberOfStars, maxNumberOfStars)); binding.ratingBar2.setMax(Math.min(numberOfStars - maxNumberOfStars, maxNumberOfStars)); binding.ratingBar2.setVisibility(View.VISIBLE); } else { binding.ratingBar1.setNumStars(numberOfStars); binding.ratingBar1.setMax(numberOfStars); } if (prompt.isReadOnly()) { binding.ratingBar1.setEnabled(false); binding.ratingBar2.setEnabled(false); } else { setUpRatingBar(maxNumberOfStars); } if (prompt.getAnswerText() != null) { int rating = Integer.parseInt(prompt.getAnswerText()); if (rating > maxNumberOfStars) { binding.ratingBar2.setRating(rating - maxNumberOfStars); } else { binding.ratingBar1.setRating(rating); } } return answerView; }
Source:
protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); List<URIish> uris = remoteConfig.getURIs(); if (uris.isEmpty()) throw die(MessageFormat.format( CLIText.get().noRemoteUriSubscribe, remote)); String uriRoot = PubSubConfig.getUriRoot(uris.get(0)); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) p.addSubscriber(new Subscriber(p, remote, dir)); try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { throw die(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); } out.println(MessageFormat.format( CLIText.get().didSubscribe, remote, uriRoot)); }

Target:
protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); List<URIish> uris = remoteConfig.getURIs(); if (uris.isEmpty()) throw die(MessageFormat.format( CLIText.get().noRemoteUriSubscribe, remote)); URIish uri = uris.get(0); String uriRoot = PubSubConfig.getUriRoot(uri); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) { Subscriber newSubscriber = new Subscriber(p, remote, dir); for (Subscriber oldSubscriber : p.getSubscribers()) { if (newSubscriber.getName() == oldSubscriber.getName()) throw die(MessageFormat.format( CLIText.get().cannotSubscribeTwice, uri, oldSubscriber.getDirectory())); } p.addSubscriber(newSubscriber); } try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { throw die(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); } out.println(MessageFormat.format( CLIText.get().didSubscribe, remote, uriRoot)); }
Source:
private void buildAnchorUri(ProductDto product) { PlaceRequest request = new PlaceRequest.Builder() .nameToken(NameTokens.PRODUCT) .with("productId", String.valueOf(product.getId())) .build(); String token = tokenFormatter.toPlaceToken(request); shopAnchor.setHref("#" + token); }

Target:
private void buildAnchorUri(ProductDto product) { String productId = String.valueOf(product.getId()); PlaceRequest request = new PlaceRequest.Builder() .nameToken(NameTokens.PRODUCT) .with("productId", productId) .build(); String token = tokenFormatter.toPlaceToken(request); shopAnchor.setHref("#" + token); }
Source:
private UniqueTeamErrorOutput validateTeamName(List<StudentAttributes> existingStudents, List<StudentAttributes> studentsToEnroll) { Map<String, String> teamInSection = new HashMap<>(); for (StudentAttributes existingStudent : existingStudents) { teamInSection.put(existingStudent.getTeam(), existingStudent.getSection()); } for (StudentAttributes studentToEnroll : studentsToEnroll) { if (teamInSection.containsKey(studentToEnroll.getTeam()) && !teamInSection.get(studentToEnroll.getTeam()).equals(studentToEnroll.getSection())) { return new UniqueTeamErrorOutput(studentToEnroll.getTeam(), teamInSection.get(studentToEnroll.getTeam()), studentToEnroll.getSection()); } teamInSection.put(studentToEnroll.getTeam(), studentToEnroll.getSection()); } return null; }

Target:
private void validateTeamName(List<StudentAttributes> existingStudents, List<StudentAttributes> studentsToEnroll) throws InvalidHttpRequestBodyException { Map<String, String> teamInSection = new HashMap<>(); for (StudentAttributes existingStudent : existingStudents) { teamInSection.put(existingStudent.getTeam(), existingStudent.getSection()); } for (StudentAttributes studentToEnroll : studentsToEnroll) { if (teamInSection.containsKey(studentToEnroll.getTeam()) && !teamInSection.get(studentToEnroll.getTeam()).equals(studentToEnroll.getSection())) { throw new InvalidHttpRequestBodyException(String.format(ERROR_MESSAGE_SAME_TEAM_IN_DIFFERENT_SECTION, studentToEnroll.getTeam(), teamInSection.get(studentToEnroll.getTeam()), studentToEnroll.getSection())); } teamInSection.put(studentToEnroll.getTeam(), studentToEnroll.getSection()); } }
Source:
public HttpResponse doIndex(StaplerRequest request) { return HttpResponses.redirectTo(Jenkins.getActiveInstance().getRootUrlFromRequest() + computation.getUrl() ); }

Target:
public HttpResponse doIndex(StaplerRequest request) { return HttpResponses.redirectViaContextPath(computation.getUrl()); }
Source:
public void flushBuffer(final ByteBuf byteBuf, final boolean requestedSync, final List<IOCallback> callbacks) { final int bytes = byteBuf.readableBytes(); if (bytes > 0) { final ByteBuffer buffer = newBuffer(byteBuf.capacity(), bytes, false); buffer.limit(bytes); byteBuf.getBytes(byteBuf.readerIndex(), buffer); buffer.flip(); writeDirect(buffer, requestedSync, new DelegateCallback(callbacks)); } else { IOCallback.done(callbacks); } }

Target:
public void flushBuffer(final ByteBuf byteBuf, final boolean requestedSync, final List<IOCallback> callbacks) { final int bytes = byteBuf.readableBytes(); if (bytes > 0) { final ByteBuffer buffer = newBuffer(bytes, false); final int alignedLimit = buffer.limit(); assert alignedLimit == factory.calculateBlockSize(bytes); buffer.limit(bytes); byteBuf.getBytes(byteBuf.readerIndex(), buffer); final int missingNonZeroedBytes = alignedLimit - bytes; if (missingNonZeroedBytes > 0) { ByteUtil.zeros(buffer, bytes, missingNonZeroedBytes); } buffer.flip(); writeDirect(buffer, requestedSync, new DelegateCallback(callbacks)); } else { IOCallback.done(callbacks); } }
Source:
private static boolean shouldRewriteTableLayout(TableScanNode source) { return !source.getLayout().isPresent() || source.getOriginalConstraint().equals(BooleanLiteral.TRUE_LITERAL); }

Target:
private static boolean shouldRewriteTableLayout(TableScanNode source) { return !source.getLayout().isPresent() || source.getCurrentConstraint().isAll(); }
Source:
public void initialize() { try { lock.lock(); product = Products.getLikelyProduct(getThing().getThingTypeUID()); macAddress = new MACAddress((String) getConfig().get(LifxBindingConstants.CONFIG_PROPERTY_DEVICE_ID), true); macAsHex = this.macAddress.getHex(); logger.debug("Initializing the LIFX handler for light '{}'.", macAsHex); fadeTime = getFadeTime(); powerOnBrightness = getPowerOnBrightness(); channelStates = new HashMap<>(); currentLightState = new CurrentLightState(); pendingLightState = new LifxLightState(); communicationHandler = new LifxLightCommunicationHandler(macAddress, currentLightState); currentStateUpdater = new LifxLightCurrentStateUpdater(macAddress, currentLightState, communicationHandler, product); onlineStateUpdater = new LifxLightOnlineStateUpdater(macAddress, currentLightState, communicationHandler); lightStateChanger = new LifxLightStateChanger(macAddress, pendingLightState, communicationHandler, product, fadeTime); communicationHandler.start(); currentStateUpdater.start(); onlineStateUpdater.start(); lightStateChanger.start(); } catch (Exception e) { logger.debug("Error occurred while initializing LIFX handler: " + e.getMessage(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); } finally { lock.unlock(); } }

Target:
public void initialize() { try { lock.lock(); product = Products.getLikelyProduct(getThing().getThingTypeUID()); macAddress = new MACAddress((String) getConfig().get(LifxBindingConstants.CONFIG_PROPERTY_DEVICE_ID), true); macAsHex = this.macAddress.getHex(); logger.debug("Initializing the LIFX handler for light '{}'.", macAsHex); fadeTime = getFadeTime(); powerOnBrightness = getPowerOnBrightness(); channelStates = new HashMap<>(); currentLightState = new CurrentLightState(); pendingLightState = new LifxLightState(); communicationHandler = new LifxLightCommunicationHandler(macAddress, currentLightState); currentStateUpdater = new LifxLightCurrentStateUpdater(macAddress, currentLightState, communicationHandler, product); onlineStateUpdater = new LifxLightOnlineStateUpdater(macAddress, currentLightState, communicationHandler); lightStateChanger = new LifxLightStateChanger(macAddress, pendingLightState, communicationHandler, product, fadeTime); communicationHandler.start(); currentStateUpdater.start(); onlineStateUpdater.start(); lightStateChanger.start(); } catch (Exception e) { logger.debug("Error occurred while initializing LIFX handler: {}", e.getMessage(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); } finally { lock.unlock(); } }