auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public MessageResponse onReceiveMessage(IMessageRecipient sender, String message) { if (!isReachable()) { return MessageResponse.UNREACHABLE; } User user = getUser(this); boolean afk = false; boolean isLastMessageReplyRecipient = ess.getSettings().isLastMessageReplyRecipient(); if (user != null) { if (user.isIgnoreMsg() && sender instanceof IUser && !((IUser) sender).isAuthorized("essentials.msgtoggle.bypass")) { return MessageResponse.MESSAGES_IGNORED; } afk = user.isAfk(); isLastMessageReplyRecipient = user.isLastMessageReplyRecipient(); if (sender instanceof IUser && user.isIgnoredPlayer((IUser) sender)) { return MessageResponse.SENDER_IGNORED; } } sendMessage(tl("msgFormat", sender.getDisplayName(), tl("meRecipient"), message)); if (user != null && !user.isIgnoreMsgSound()) { Sound dingSound; if (VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_9_R01)) { dingSound = Sound.ENTITY_EXPERIENCE_ORB_PICKUP; } else { dingSound = Sound.valueOf("ORB_PICKUP"); } Bukkit.getPlayer(user.getConfigUUID()).playSound(user.getLocation(), dingSound, 2.0f, 1.0f); } if (isLastMessageReplyRecipient) { long timeout = ess.getSettings().getLastMessageReplyRecipientTimeout() * 1000; if (getReplyRecipient() == null || !getReplyRecipient().isReachable() || System.currentTimeMillis() - this.lastMessageMs > timeout) { setReplyRecipient(sender); } } else { setReplyRecipient(sender); } this.lastMessageMs = System.currentTimeMillis(); return afk ? MessageResponse.SUCCESS_BUT_AFK : MessageResponse.SUCCESS; }

Target:
public MessageResponse onReceiveMessage(IMessageRecipient sender, String message) { if (!isReachable()) { return MessageResponse.UNREACHABLE; } User user = getUser(this); boolean afk = false; boolean isLastMessageReplyRecipient = ess.getSettings().isLastMessageReplyRecipient(); if (user != null) { if (user.isIgnoreMsg() && sender instanceof IUser && !((IUser) sender).isAuthorized("essentials.msgtoggle.bypass")) { return MessageResponse.MESSAGES_IGNORED; } afk = user.isAfk(); isLastMessageReplyRecipient = user.isLastMessageReplyRecipient(); if (sender instanceof IUser && user.isIgnoredPlayer((IUser) sender)) { return MessageResponse.SENDER_IGNORED; } } sendMessage(tl("msgFormat", sender.getDisplayName(), tl("meRecipient"), message)); if (user != null && !user.isIgnoreMsgSound()) { user.getBase().playSound(user.getLocation(), ORB_SOUND, 2.0f, 1.0f); } if (isLastMessageReplyRecipient) { long timeout = ess.getSettings().getLastMessageReplyRecipientTimeout() * 1000; if (getReplyRecipient() == null || !getReplyRecipient().isReachable() || System.currentTimeMillis() - this.lastMessageMs > timeout) { setReplyRecipient(sender); } } else { setReplyRecipient(sender); } this.lastMessageMs = System.currentTimeMillis(); return afk ? MessageResponse.SUCCESS_BUT_AFK : MessageResponse.SUCCESS; }
Source:
public MailSender(MailSessionProvider mailSessionProvider) { this.mailSessionProvider = mailSessionProvider; this.executor = newFixedThreadPool( 2 * Runtime.getRuntime().availableProcessors(), new ThreadFactoryBuilder() .setNameFormat("MailNotificationsPool-%d") .setDaemon(false) .build()); }

Target:
public MailSender(MailSessionProvider mailSessionProvider) { this.mailSessionProvider = mailSessionProvider; this.executor = newFixedThreadPool( 2 * Runtime.getRuntime().availableProcessors(), new ThreadFactoryBuilder() .setNameFormat("MailNotificationsPool-%d") .setDaemon(false) .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .build()); }
Source:
public static String getProperty(String key) { String value = null; Properties props = KuranetConfig.getProperties(); if (!props.isEmpty()) { value = props.getProperty(key); s_logger.debug("Got property " + key + " :: " + value); } return value; }

Target:
public static String getProperty(String key) { Properties props = KuranetConfig.getProperties(); String value = props.getProperty(key); s_logger.debug("Got property :: {}", key, value); return value; }
Source:
public ResourceGroupNameTemplate(String name) { this.name = requireNonNull(name, "name is null"); checkArgument(!name.isEmpty(), "Resource group name is empty"); checkArgument(name.indexOf('.') < 0, "Invalid resource group name. '%s' contains a '.'", name); String nameNoVariables = VARIABLE_PATTERN.matcher(name).replaceAll(""); checkArgument(!(nameNoVariables.contains("{") || nameNoVariables.contains("}") || nameNoVariables.contains("$")), "Invalid resource group name. '%s' contains '$', '{', or '}", name); }

Target:
public ResourceGroupNameTemplate(String name) { checkArgument(!name.isEmpty(), "Resource group name is empty"); checkArgument(name.indexOf('.') < 0, "Invalid resource group name. '%s' contains a '.'", name); String nameNoVariables = VARIABLE_PATTERN.matcher(name).replaceAll(""); checkArgument( !(nameNoVariables.contains("{") || nameNoVariables.contains("}") || nameNoVariables.contains("$")), "Invalid resource group name. '%s' contains extraneous '$', '{', or '}", name); ImmutableList.Builder<NameFragment> builder = ImmutableList.builder(); Matcher matcher = VARIABLE_PATTERN.matcher(name); int lastMatchEnd = 0; while (matcher.find()) { int matchBegin = matcher.start(); int matchEnd = matcher.end(); if (matchBegin > lastMatchEnd) { builder.add(NameFragment.literal(name.substring(lastMatchEnd, matchBegin))); } builder.add(NameFragment.variable(name.substring(matchBegin + 2, matchEnd - 1))); lastMatchEnd = matchEnd; } if (lastMatchEnd != name.length()) { builder.add(NameFragment.literal(name.substring(lastMatchEnd, name.length()))); } this.fragments = builder.build(); }
Source:
public static void updateGraphicsDevices(VmBase vmBase, Version clusterVersion) { if (vmBase == null || vmBase.getManagedDeviceMap() == null || clusterVersion == null) { return; } if (Version.v4_0.lessOrEquals(clusterVersion)) { if (removeVideoDevice(VmDeviceType.VNC, VmDeviceType.CIRRUS, vmBase.getManagedDeviceMap())) { vmBase.setDefaultDisplayType(DisplayType.qxl); } } List<VmDevice> videoDevs = getDevicesOfType(VmDeviceGeneralType.VIDEO, vmBase.getManagedDeviceMap()); boolean hasNoGraphics = getDevicesOfType(VmDeviceGeneralType.GRAPHICS, vmBase.getManagedDeviceMap()).isEmpty(); if (!videoDevs.isEmpty() && hasNoGraphics) { GraphicsDevice compatibleGraphics = getCompatibleGraphics(VmDeviceType.getByName(videoDevs.get(0).getDevice()), clusterVersion, vmBase); if (compatibleGraphics != null) { vmBase.getManagedDeviceMap().put(compatibleGraphics.getDeviceId(), compatibleGraphics); } } }

Target:
public static void updateGraphicsDevices(VmBase vmBase, Version clusterVersion) { if (vmBase == null || vmBase.getManagedDeviceMap() == null || clusterVersion == null) { return; } if (Version.v4_0.lessOrEquals(clusterVersion)) { if (removeVideoDevice(VmDeviceType.VNC, VmDeviceType.CIRRUS, vmBase.getManagedDeviceMap())) { vmBase.setDefaultDisplayType(DisplayType.qxl); addVideoDevice(vmBase); } } List<VmDevice> videoDevs = getDevicesOfType(VmDeviceGeneralType.VIDEO, vmBase.getManagedDeviceMap()); boolean hasNoGraphics = getDevicesOfType(VmDeviceGeneralType.GRAPHICS, vmBase.getManagedDeviceMap()).isEmpty(); if (!videoDevs.isEmpty() && hasNoGraphics) { GraphicsDevice compatibleGraphics = getCompatibleGraphics(VmDeviceType.getByName(videoDevs.get(0).getDevice()), clusterVersion, vmBase); if (compatibleGraphics != null) { vmBase.getManagedDeviceMap().put(compatibleGraphics.getDeviceId(), compatibleGraphics); } } }
Source:
private static JsonObject convertBooleanQuery(BooleanQuery booleanQuery) { JsonArray musts = new JsonArray(); JsonArray shoulds = new JsonArray(); JsonArray mustNots = new JsonArray(); JsonArray filters = new JsonArray(); for ( BooleanClause clause : booleanQuery.clauses() ) { switch ( clause.getOccur() ) { case MUST: musts.add( fromLuceneQuery( clause.getQuery() ) ); break; case FILTER: filters.add( fromLuceneQuery( clause.getQuery() ) ); break; case MUST_NOT: mustNots.add( fromLuceneQuery( clause.getQuery() ) ); break; case SHOULD: shoulds.add( fromLuceneQuery( clause.getQuery() ) ); break; } } JsonBuilder.Object clauses = JsonBuilder.object(); if ( musts.size() > 1 ) { clauses.add( "must", musts ); } else if ( musts.size() == 1 ) { clauses.add( "must", musts.iterator().next() ); } if ( shoulds.size() > 1 ) { clauses.add( "should", shoulds ); } else if ( shoulds.size() == 1 ) { clauses.add( "should", shoulds.iterator().next() ); } if ( mustNots.size() > 1 ) { clauses.add( "must_not", mustNots ); } else if ( mustNots.size() == 1 ) { clauses.add( "must_not", mustNots.iterator().next() ); } if ( filters.size() > 1 ) { clauses.add( "filter", filters ); } else if ( filters.size() == 1 ) { clauses.add( "filter", filters.iterator().next() ); } clauses.append( boostAppender( booleanQuery ) ); int minimumShouldMatch = booleanQuery.getMinimumNumberShouldMatch(); if ( minimumShouldMatch != 0 ) { clauses.addProperty( "minimum_should_match", minimumShouldMatch ); } JsonObject bool = new JsonObject(); bool.add( "bool", clauses.build() ); return bool; }

Target:
private static JsonObject convertBooleanQuery(BooleanQuery booleanQuery) { JsonArray musts = new JsonArray(); JsonArray shoulds = new JsonArray(); JsonArray mustNots = new JsonArray(); JsonArray filters = new JsonArray(); for ( BooleanClause clause : booleanQuery.clauses() ) { switch ( clause.getOccur() ) { case MUST: musts.add( fromLuceneQuery( clause.getQuery() ) ); break; case FILTER: filters.add( fromLuceneQuery( clause.getQuery() ) ); break; case MUST_NOT: mustNots.add( fromLuceneQuery( clause.getQuery() ) ); break; case SHOULD: shoulds.add( fromLuceneQuery( clause.getQuery() ) ); break; } } JsonBuilder.Object clauses = JsonBuilder.object(); if ( musts.size() > 1 ) { clauses.add( "must", musts ); } else if ( musts.size() == 1 ) { clauses.add( "must", musts.iterator().next() ); } if ( shoulds.size() > 1 ) { clauses.add( "should", shoulds ); } else if ( shoulds.size() == 1 ) { clauses.add( "should", shoulds.iterator().next() ); } if ( mustNots.size() > 1 ) { clauses.add( "must_not", mustNots ); } else if ( mustNots.size() == 1 ) { clauses.add( "must_not", mustNots.iterator().next() ); } if ( filters.size() > 1 ) { clauses.add( "filter", filters ); } else if ( filters.size() == 1 ) { clauses.add( "filter", filters.iterator().next() ); } clauses.append( boostAppender( booleanQuery ) ); int minimumShouldMatchNumber = booleanQuery.getMinimumNumberShouldMatch(); if ( minimumShouldMatchNumber != 0 ) { clauses.addProperty( "minimum_should_match", minimumShouldMatchNumber ); } JsonObject bool = new JsonObject(); bool.add( "bool", clauses.build() ); return bool; }
Source:
IgnoreNode load() throws IOException { IgnoreNode r; if (entry != null) { r = super.load(); if (r == null) r = new IgnoreNode(); } else { r = new IgnoreNode(); } String p = repository.getConfig().getString( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_EXCLUDESFILE); File excludesfile; if (p.startsWith("~/")) excludesfile = new File(repository.getFS().userHome(), p.substring(2)); else excludesfile = new File(p); loadRulesFromFile(r, excludesfile); File exclude = new File(repository.getDirectory(), "info/exclude"); loadRulesFromFile(r, exclude); return r.getRules().isEmpty() ? null : r; }

Target:
IgnoreNode load() throws IOException { IgnoreNode r; if (entry != null) { r = super.load(); if (r == null) r = new IgnoreNode(); } else { r = new IgnoreNode(); } FS fs = repository.getFS(); String path = repository.getConfig().get(CoreConfig.KEY) .getExcludesFile(); if (path != null) { File excludesfile; if (path.startsWith("~/")) excludesfile = fs.resolve(fs.userHome(), path.substring(2)); else excludesfile = fs.resolve(null, path); loadRulesFromFile(r, excludesfile); } File exclude = fs .resolve(repository.getDirectory(), "info/exclude"); loadRulesFromFile(r, exclude); return r.getRules().isEmpty() ? null : r; }
Source:
public PageRankVertexProgram generateProgram(final Memory memory, final Graph... graphs) { final Traversal.Admin<Vertex, Edge> detachedTraversal = this.edgeTraversal.getPure(); detachedTraversal.setStrategies(TraversalStrategies.GlobalCache.getStrategies(graphs[0].getClass())); final PageRankVertexProgram.Builder builder = PageRankVertexProgram.build() .property(this.pageRankProperty) .iterations(this.times + 1) .alpha(this.alpha) .edges(detachedTraversal); if (this.previousTraversalVertexProgram()) builder.initialRank(new HaltedTraversersCountTraversal()); return builder.create(graphs); }

Target:
public PageRankVertexProgram generateProgram(final Memory memory, final Graph... graphs) { if (graphs.length != 1) { throw new IllegalArgumentException("Must provide one graph to use, received " + graphs.length); } final Graph graph = graphs[0]; final Traversal.Admin<Vertex, Edge> detachedTraversal = this.edgeTraversal.getPure(); detachedTraversal.setStrategies(TraversalStrategies.GlobalCache.getStrategies(graph.getClass())); final PageRankVertexProgram.Builder builder = PageRankVertexProgram.build() .property(this.pageRankProperty) .iterations(this.times + 1) .alpha(this.alpha) .edges(detachedTraversal); if (this.previousTraversalVertexProgram()) builder.initialRank(new HaltedTraversersCountTraversal()); return builder.create(graph); }
Source:
protected boolean validateAttributes() { boolean validate = false; try { validate = PropertyAccessor.getInstance().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.VALIDATE_ATTRIBUTES_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property for validating SAML attributes due to: {}", ex.getLocalizedMessage()); } return validate; }

Target:
protected boolean validateAttributes() { boolean validate = false; try { validate = PropertyAccessor.getInstance().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.VALIDATE_ATTRIBUTES_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property for validating SAML attributes due to: {}", ex.getLocalizedMessage(), ex); } return validate; }
Source:
private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) { Map<Node,Computer> computers = getComputerMap(); Computer c; c = byNameMap.get(n.getNodeName()); if (c!=null) { try { c.setNode(n); used.add(c); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "Error updating node " + n.getNodeName() + ", continuing", e); } } else { if(n.getNumExecutors()>0 || n==Jenkins.getInstance()) { try { c = n.createComputer(); } catch(RuntimeException ex) { LOGGER.log(Level.WARNING, "Error retrieving computer for node " + n.getNodeName() + ", continuing", ex); } if (c == null) { LOGGER.log(Level.WARNING, "Cannot create computer for node {0}, the {1}#createComputer() method returned null. Skipping this node", new Object[]{n.getNodeName(), n.getClass().getName()}); return; } computers.put(n, c); if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) { RetentionStrategy retentionStrategy = c.getRetentionStrategy(); if (retentionStrategy != null) { retentionStrategy.start(c); } else { c.connect(true); } } used.add(c); } else { LOGGER.log(Level.WARNING, "Node {0} has not executors. Cannot udate the Computer instance for it", n.getNodeName()); } } }

Target:
private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) { Map<Node,Computer> computers = getComputerMap(); Computer c; c = byNameMap.get(n.getNodeName()); if (c!=null) { try { c.setNode(n); used.add(c); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "Error updating node " + n.getNodeName() + ", continuing", e); } } else { if(n.getNumExecutors()>0 || n==Jenkins.getInstance()) { try { c = n.createComputer(); } catch(RuntimeException ex) { LOGGER.log(Level.WARNING, "Error retrieving computer for node " + n.getNodeName() + ", continuing", ex); } if (c == null) { LOGGER.log(Level.WARNING, "Cannot create computer for node {0}, the {1}#createComputer() method returned null. Skipping this node", new Object[]{n.getNodeName(), n.getClass().getName()}); return; } computers.put(n, c); if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) { RetentionStrategy retentionStrategy = c.getRetentionStrategy(); if (retentionStrategy != null) { retentionStrategy.start(c); } else { c.connect(true); } } used.add(c); } else { LOGGER.log(Level.WARNING, "Node {0} has no executors. Cannot update the Computer instance of it", n.getNodeName()); } } }
Source:
protected void doInitialise(MuleContext muleContext) throws InitialisationException { super.doInitialise(muleContext); Optional<ProcessingStrategy> processingStrategy = empty(); if (flowLocation.isPresent()) { processingStrategy = getProcessingStrategy(locator, flowLocation.get()); } else if (getLocation() != null) { processingStrategy = getProcessingStrategy(locator, getRootContainerLocation()); } configuredMessageProcessors = newChain(processingStrategy, getMessageProcessors()); if (configuredMessageProcessors != null) { configuredMessageProcessors.setMuleContext(muleContext); } errorTypeMatcher = createErrorType(muleContext.getErrorTypeRepository(), errorType, configurationProperties); if (this.getLocation() != null) { errorHandlerLocation = this.getLocation().getLocation(); isLocalErrorHandlerLocation = ERROR_HANDLER_LOCATION_PATTERN.matcher(errorHandlerLocation).find(); if (isLocalErrorHandlerLocation) { errorHandlerLocation = errorHandlerLocation.substring(0, errorHandlerLocation.lastIndexOf('/')); errorHandlerLocation = errorHandlerLocation.substring(0, errorHandlerLocation.lastIndexOf('/')); } } }

Target:
protected void doInitialise(MuleContext muleContext) throws InitialisationException { super.doInitialise(muleContext); this.location = this.getLocation(); Optional<ProcessingStrategy> processingStrategy = empty(); if (flowLocation.isPresent()) { processingStrategy = getProcessingStrategy(locator, flowLocation.get()); } else if (location != null) { processingStrategy = getProcessingStrategy(locator, getRootContainerLocation()); } configuredMessageProcessors = newChain(processingStrategy, getMessageProcessors()); if (configuredMessageProcessors != null) { configuredMessageProcessors.setMuleContext(muleContext); } errorTypeMatcher = createErrorType(muleContext.getErrorTypeRepository(), errorType, configurationProperties); if (!inDefaultErrorHandler()) { errorHandlerLocation = this.location.getLocation(); isLocalErrorHandlerLocation = ERROR_HANDLER_LOCATION_PATTERN.matcher(errorHandlerLocation).find(); if (isLocalErrorHandlerLocation) { errorHandlerLocation = errorHandlerLocation.substring(0, errorHandlerLocation.lastIndexOf('/')); errorHandlerLocation = errorHandlerLocation.substring(0, errorHandlerLocation.lastIndexOf('/')); } } }
Source:
private MetadataValue getRelationMetadataFromOtherItem(Item otherItem, String relationName) { MetadataValue metadataValue = constructMetadataValue("relation." + relationName); metadataValue.setAuthority("virtual"); metadataValue.setValue(otherItem.getID().toString()); return metadataValue; }

Target:
private MetadataValue getRelationMetadataFromOtherItem(Item otherItem, String relationName) { MetadataValue metadataValue = constructMetadataValue( MetadataSchemaEnum.RELATION.getName() + "." + relationName); metadataValue.setAuthority("virtual"); metadataValue.setValue(otherItem.getID().toString()); return metadataValue; }
Source:
void cacheData(Resource res, File file) throws IOException { assert res.getType()==Type.RESOURCE; OutputStream out = new FileOutputStream(file); try { InputStream in = res.in(); try { IOUtils.copy(in, out); } finally { in.close(); } } finally { out.close(); } }

Target:
void cacheData(Resource res, File file) throws IOException { assert res.getType()==Type.RESOURCE; try (OutputStream out = new FileOutputStream(file)) { try (InputStream in = res.in()) { IOUtils.copy(in, out); } } }
Source:
public boolean isServerReadyToHandleMsg(RequestMsg request) { if (getState() != ServerState.READY) return false; if ((sequencerEpoch != serverContext.getServerEpoch()) && (!request.getPayload().getPayloadCase() .equals(PayloadCase.BOOTSTRAP_SEQUENCER_REQUEST))) { log.warn("Rejecting msg at sequencer : sequencerStateEpoch:{}, serverEpoch:{}, " + "header:{}", sequencerEpoch, serverContext.getServerEpoch(), request.getHeader()); return false; } return true; }

Target:
public boolean isServerReadyToHandleMsg(RequestMsg request) { if (getState() != ServerState.READY) { return false; } if ((sequencerEpoch != serverContext.getServerEpoch()) && (!request.getPayload().getPayloadCase() .equals(PayloadCase.BOOTSTRAP_SEQUENCER_REQUEST))) { log.warn("Rejecting msg at sequencer : sequencerStateEpoch:{}, serverEpoch:{}, " + "header:{}", sequencerEpoch, serverContext.getServerEpoch(), request.getHeader()); return false; } return true; }
Source:
boolean isSelected(MPart part) { MElementContainer<?> parent = part.getParent(); if (parent == null) { MPlaceholder placeholder = part.getCurSharedRef(); if (placeholder == null) { return false; } parent = placeholder.getParent(); return parent instanceof MGenericStack ? parent.getSelectedElement() == placeholder : parent != null; } return parent instanceof MGenericStack ? parent.getSelectedElement() == part : true; }

Target:
boolean isSelected(MPart part) { MElementContainer<?> parent = part.getParent(); if (parent == null) { MPlaceholder placeholder = part.getCurSharedRef(); if (placeholder == null) { return false; } parent = placeholder.getParent(); return parent instanceof MGenericStack ? parent.getSelectedElement() == placeholder : parent != null; } return !(parent instanceof MGenericStack) || parent.getSelectedElement() == part; }
Source:
protected String scanTokenForRangeSymbol(String token) { char character; for (int charIndex = 0; charIndex < token.length(); charIndex++) { character = token.charAt(charIndex); if (rangeSymbols.contains(character)) { return String.valueOf(character); } } return null; }

Target:
String scanTokenForRangeSymbol(String token) { for (String whitelistValue : getWhitelistedValues()) { if (token.contains(whitelistValue)) { return null; } } if (!token.matches(".*\\d+[.]\\d+.*")) { return null; } for (char character : token.toCharArray()) { if (rangeSymbols.contains(character)) { return String.valueOf(character); } } return null; }
Source:
private PlanNode getCostBasedJoin(JoinNode joinNode, Context context) { List<PlanNodeWithCost> possibleJoinNodes = new ArrayList<>(); if (joinNode.getCriteria().isEmpty() && joinNode.getType() == LEFT) { addJoinsWithDifferentDistributions(joinNode, possibleJoinNodes, context); } else if (joinNode.getCriteria().isEmpty() && joinNode.getType() == RIGHT) { addJoinsWithDifferentDistributions(joinNode.flipChildren(), possibleJoinNodes, context); } else { addJoinsWithDifferentDistributions(joinNode, possibleJoinNodes, context); addJoinsWithDifferentDistributions(joinNode.flipChildren(), possibleJoinNodes, context); } if (possibleJoinNodes.stream().anyMatch(result -> result.getCost().hasUnknownComponents()) || possibleJoinNodes.isEmpty()) { return getSyntacticOrderJoin(joinNode, context, AUTOMATIC); } Ordering<PlanNodeWithCost> planNodeOrderings = costComparator.forSession(context.getSession()).onResultOf(PlanNodeWithCost::getCost); return planNodeOrderings.min(possibleJoinNodes).getPlanNode(); }

Target:
private PlanNode getCostBasedJoin(JoinNode joinNode, Context context) { List<PlanNodeWithCost> possibleJoinNodes = new ArrayList<>(); addJoinsWithDifferentDistributions(joinNode, possibleJoinNodes, context); addJoinsWithDifferentDistributions(joinNode.flipChildren(), possibleJoinNodes, context); if (possibleJoinNodes.stream().anyMatch(result -> result.getCost().hasUnknownComponents()) || possibleJoinNodes.isEmpty()) { return getSyntacticOrderJoin(joinNode, context, AUTOMATIC); } Ordering<PlanNodeWithCost> planNodeOrderings = costComparator.forSession(context.getSession()).onResultOf(PlanNodeWithCost::getCost); return planNodeOrderings.min(possibleJoinNodes).getPlanNode(); }
Source:
public NavigationHelperImpl(Notifier emfRoot, BaseIndexOptions options, Logger logger) throws ViatraBaseException { this.baseIndexOptions = options.copy(); this.logger = logger; assert (logger != null); this.comprehension = new EMFModelComprehension(baseIndexOptions); this.wildcardMode = baseIndexOptions.getWildcardLevel(); this.subscribedInstanceListeners = new HashMap<InstanceListener, Set<EClass>>(); this.subscribedFeatureListeners = new HashMap<FeatureListener, Set<EStructuralFeature>>(); this.subscribedDataTypeListeners = new HashMap<DataTypeListener, Set<EDataType>>(); this.lightweightObservers = new HashMap<LightweightEObjectObserver, Collection<EObject>>(); this.observedFeatures = new HashMap<Object, IndexingLevel>(); this.ignoreResolveNotificationFeatures = new HashSet<Object>(); this.observedDataTypes = new HashMap<Object, IndexingLevel>(); metaStore = new EMFBaseIndexMetaStore(this); instanceStore = new EMFBaseIndexInstanceStore(this, logger, options.isStrictNotificationMode()); statsStore = new EMFBaseIndexStatisticsStore(); this.contentAdapter = new NavigationHelperContentAdapter(this); this.baseIndexChangeListeners = new HashSet<EMFBaseIndexChangeListener>(); this.errorListeners = new LinkedHashSet<IEMFIndexingErrorListener>(); this.notifier = emfRoot; this.modelRoots = new HashSet<Notifier>(); this.expansionAllowed = false; if (emfRoot != null) { addRootInternal(emfRoot); } }

Target:
public NavigationHelperImpl(Notifier emfRoot, BaseIndexOptions options, Logger logger) throws ViatraBaseException { this.baseIndexOptions = options.copy(); this.logger = logger; assert (logger != null); this.comprehension = new EMFModelComprehension(baseIndexOptions); this.wildcardMode = baseIndexOptions.getWildcardLevel(); this.subscribedInstanceListeners = new HashMap<InstanceListener, Set<EClass>>(); this.subscribedFeatureListeners = new HashMap<FeatureListener, Set<EStructuralFeature>>(); this.subscribedDataTypeListeners = new HashMap<DataTypeListener, Set<EDataType>>(); this.lightweightObservers = new HashMap<LightweightEObjectObserver, Collection<EObject>>(); this.observedFeatures = new HashMap<Object, IndexingLevel>(); this.ignoreResolveNotificationFeatures = new HashSet<Object>(); this.observedDataTypes = new HashMap<Object, IndexingLevel>(); metaStore = new EMFBaseIndexMetaStore(this); instanceStore = new EMFBaseIndexInstanceStore(this, logger, options); statsStore = new EMFBaseIndexStatisticsStore(); this.contentAdapter = new NavigationHelperContentAdapter(this); this.baseIndexChangeListeners = new HashSet<EMFBaseIndexChangeListener>(); this.errorListeners = new LinkedHashSet<IEMFIndexingErrorListener>(); this.notifier = emfRoot; this.modelRoots = new HashSet<Notifier>(); this.expansionAllowed = false; if (emfRoot != null) { addRootInternal(emfRoot); } }
Source:
private Optional<Cookie> findCookieWithName(String cookieName, HttpClient httpClient) { Optional<Cookie> cookie = Arrays.stream(httpClient.getState().getCookies()) .filter(c -> cookieName.equals(c.getName())) .findFirst(); return cookie; }

Target:
private Optional<Cookie> findCookieWithName(String cookieName, HttpClient httpClient) { return Arrays.stream(httpClient.getState().getCookies()) .filter(c -> cookieName.equals(c.getName())) .findFirst(); }
Source:
private void updateBottomViews() { View currentBottomView = getCurrentBottomView(); if (currentBottomView != null) { if (mCurrentDragEdge == DragEdge.Left || mCurrentDragEdge == DragEdge.Right) { mDragDistance = currentBottomView.getMeasuredWidth() - dp2px(getCurrentOffset()); } else mDragDistance = currentBottomView.getMeasuredHeight() - dp2px(getCurrentOffset()); } if (mShowMode == ShowMode.PullOut) layoutPullOut(); else if (mShowMode == ShowMode.LayDown) layoutLayDown(); safeBottomView(); }

Target:
private void updateBottomViews() { View currentBottomView = getCurrentBottomView(); if (currentBottomView != null) { if (mCurrentDragEdge == DragEdge.Left || mCurrentDragEdge == DragEdge.Right) { mDragDistance = currentBottomView.getMeasuredWidth() - dp2px(getCurrentOffset()); } else { mDragDistance = currentBottomView.getMeasuredHeight() - dp2px(getCurrentOffset()); } } if (mShowMode == ShowMode.PullOut) { layoutPullOut(); } else if (mShowMode == ShowMode.LayDown) { layoutLayDown(); } safeBottomView(); }
Source:
public static void store(ConsumerWithException<OutputStream> store, File target) throws Exception { target.getParentFile() .mkdirs(); File tmp = createTempFile(target.getParentFile(), target.getName(), ".tmp"); try { try (FileOutputStream outputStream = new FileOutputStream(tmp)) { store.accept(outputStream); } rename(tmp, target); assert target.isFile(); } finally { if (tmp.exists()) tmp.delete(); } }

Target:
public static void store(ConsumerWithException<OutputStream> store, File target) throws Exception { target.getParentFile() .mkdirs(); File tmp = createTempFile(target.getParentFile(), target.getName(), ".tmp"); try { try (OutputStream outputStream = outputStream(tmp)) { store.accept(outputStream); } rename(tmp, target); assert target.isFile(); } finally { if (tmp.exists()) tmp.delete(); } }
Source:
protected Control createContents(final Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); GridData fill = new GridData(); fill.horizontalAlignment = SWT.FILL; fill.verticalAlignment = SWT.FILL; fill.heightHint = 150; TableViewer tableViewer = new TableViewer(composite, SWT.SINGLE); tableViewer.getTable().setLayoutData(fill); tableViewer.setContentProvider(contentProvider); tableViewer.setLabelProvider(labelProvider); tableViewer.setInput(new Object()); tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(final SelectionChangedEvent event) { selected = ((StructuredSelection) event.getSelection()).getFirstElement(); } }); return super.createContents(parent); }

Target:
protected Control createContents(final Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); GridData fill = new GridData(); fill.horizontalAlignment = SWT.FILL; fill.verticalAlignment = SWT.FILL; fill.heightHint = 150; TableViewer tableViewer = new TableViewer(composite, SWT.SINGLE); tableViewer.getTable().setLayoutData(fill); tableViewer.setContentProvider(contentProvider); tableViewer.setLabelProvider(labelProvider); tableViewer.setInput(new Object()); tableViewer.addSelectionChangedListener( event -> selected = ((StructuredSelection) event.getSelection()).getFirstElement()); return super.createContents(parent); }
Source:
public List getLoggerNameList() { List<String> copy = new ArrayList<String>(); synchronized (loggers) { copy.addAll(loggers.keySet()); } return copy; }

Target:
public List getLoggerNameList() { return new ArrayList<String>(loggers.keySet()); }
Source:
public SecurityGroup createSecurityGroup(final String name, Location location) { checkNotNull(name, "name"); checkNotNull(location, "location"); final NetworkSecurityGroup networkSecurityGroup = NetworkSecurityGroup.create(name, name, location.getId(), null); String createNSGRequestId = api.getNetworkSecurityGroupApi().create(networkSecurityGroup); operationSucceededPredicate.apply(createNSGRequestId); return transformNetworkSecurityGroupToSecurityGroup(name); }

Target:
public SecurityGroup createSecurityGroup(final String name, Location location) { checkNotNull(name, "name"); checkNotNull(location, "location"); final NetworkSecurityGroup networkSecurityGroup = NetworkSecurityGroup.create(name, name, location.getId(), null); String createNSGRequestId = api.getNetworkSecurityGroupApi().create(networkSecurityGroup); if (operationSucceededPredicate.apply(createNSGRequestId)) { final String message = generateIllegalStateExceptionMessage(createNSGRequestId, azureComputeConstants.operationTimeout()); logger.warn(message); throw new IllegalStateException(message); } return transformNetworkSecurityGroupToSecurityGroup(name); }
Source:
private Object resolveExpression(String value) { if (!(value.startsWith("#{") && value.endsWith("}"))) { return resolve(value); } return this.resolver.evaluate(value, this.expressionContext); }

Target:
private Object resolveExpression(String value) { String resolvedValue = resolve(value); if (!(resolvedValue.startsWith("#{") && value.endsWith("}"))) { return resolvedValue; } return this.resolver.evaluate(resolvedValue, this.expressionContext); }
Source:
protected String loadStyleSheet() { URL styleSheetURL = JFaceUtilsActivator.getInstance().getBundle() .getEntry(styleSheetFileName); if (styleSheetURL != null) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader( styleSheetURL.openStream())); StringBuffer buffer = new StringBuffer(1500); String line = reader.readLine(); while (line != null) { buffer.append(line); buffer.append('\n'); line = reader.readLine(); } return buffer.toString(); } catch (IOException ex) { return ""; } finally { try { if (reader != null) reader.close(); } catch (IOException e) { } } } return null; }

Target:
protected String loadStyleSheet() { URL styleSheetURL = JFaceUtilsActivator.getInstance().getBundle().getEntry(styleSheetFileName); if (styleSheetURL != null) { try { InputStreamReader inputStreamReader = new InputStreamReader(styleSheetURL.openStream()); BufferedReader reader = new BufferedReader(inputStreamReader); String ret = reader.lines().collect(Collectors.joining("\n")); reader.close(); inputStreamReader.close(); return ret; } catch (IOException e) { return null; } } return null; }
Source:
public void init() { initMocks(this); pid = PIDs.get(UUID.randomUUID().toString()); collection = new CollectionObject(pid, repository, dataLoader); folderChildPid = PIDs.get(UUID.randomUUID().toString()); when(repository.mintContentPid()).thenReturn(folderChildPid); workChildPid = PIDs.get(UUID.randomUUID().toString()); when(repository.mintContentPid()).thenReturn(workChildPid); folderChildObj = new FolderObject(folderChildPid, repository, dataLoader); when(repository.createFolderObject(any(PID.class), any(Model.class))) .thenReturn(folderChildObj); workChildObj = new WorkObject(workChildPid, repository, dataLoader); when(repository.createWorkObject(any(PID.class), any(Model.class))) .thenReturn(workChildObj); }

Target:
public void init() { initMocks(this); pid = PIDs.get(UUID.randomUUID().toString()); collection = new CollectionObject(pid, repository, dataLoader); folderChildPid = PIDs.get(UUID.randomUUID().toString()); workChildPid = PIDs.get(UUID.randomUUID().toString()); when(repository.mintContentPid()).thenReturn(folderChildPid).thenReturn(workChildPid); folderChildObj = new FolderObject(folderChildPid, repository, dataLoader); when(repository.createFolderObject(any(PID.class), any(Model.class))) .thenReturn(folderChildObj); workChildObj = new WorkObject(workChildPid, repository, dataLoader); when(repository.createWorkObject(any(PID.class), any(Model.class))) .thenReturn(workChildObj); }
Source:
private String getMessage(Multimap<EAttribute, String> wrongTypes) { StringBuilder sb = new StringBuilder(); sb.append(wrongTypes.size()); sb.append(" variables available in interpreted expressions need type correction:"); for (EAttribute attr : wrongTypes.keySet()) { sb.append("\n . "); sb.append(attr.eResource().getURIFragment(attr)); for (String v : wrongTypes.get(attr)) { sb.append("\n . " + v); } } return sb.toString(); }

Target:
private String getMessage(Multimap<EAttribute, String> wrongTypes) { StringBuilder sb = new StringBuilder(); sb.append(wrongTypes.size()); sb.append(" variable(s) available in interpreted expressions need type correction:"); for (EAttribute attr : wrongTypes.keySet()) { sb.append("\n . "); sb.append(attr.eResource().getURIFragment(attr)); for (String v : wrongTypes.get(attr)) { sb.append("\n . " + v); } } return sb.toString(); }
Source:
private void cacheVertex(final SequenceSegment vertex) { int startBucket = (int) Math.floor((double) vertex.getUnifiedStart() / bucketWidth); int endBucket = (int) Math.floor((double) vertex.getUnifiedEnd() / bucketWidth); for (int bucket = startBucket; bucket <= endBucket; bucket++) { buckets.get(bucket).add(vertex); } }

Target:
private void cacheVertex(final SequenceSegment vertex) { int startBucket = bucketPosition(vertex.getUnifiedStart()); int endBucket = 1 + bucketPosition(vertex.getUnifiedEnd()); for (SortedSet<SequenceSegment> bucket : buckets.subList(startBucket, endBucket)) { bucket.add(vertex); } }
Source:
public MetricsManager metricsManager() { return MetricsManagers.createForTests(); }

Target:
public MetricsManager metricsManager() { return MetricsManagers.of(new MetricRegistry(), new DefaultTaggedMetricRegistry()); }
Source:
public static Optional<Integer> getFirmwareVersionFromBuildInfo(final String buildInfoText) { final Iterable<String> strings = Splitter.on("\n").split(buildInfoText); final Map<String, String> buildInfo = Maps.newHashMap(); for (final String line : strings) { if (line.contains(":")) { final String[] parts = line.split(":"); buildInfo.put(parts[0].trim(), parts[1].trim()); } } if (buildInfo.get("version").isEmpty()) { return Optional.absent(); } try { if (buildInfo.get("version").equals(buildInfo.get("travis_build_number"))) { return Optional.of(Integer.parseInt(buildInfo.get("version"), 10)); } else { return Optional.of(Integer.parseInt(buildInfo.get("version"), 16)); } } catch (NumberFormatException nfe) { return Optional.absent(); } }

Target:
static Optional<Integer> getFirmwareVersionFromBuildInfo(final String buildInfoText) { final Iterable<String> strings = Splitter.on("\n").split(buildInfoText); final Map<String, String> buildInfo = Maps.newHashMap(); for (final String line : strings) { if (line.contains(":")) { final String[] parts = line.split(":"); buildInfo.put(parts[0].trim(), parts[1].trim()); } } if (!buildInfo.containsKey("version")) { return Optional.absent(); } if (buildInfo.get("version").isEmpty()) { return Optional.absent(); } try { if (buildInfo.get("version").equals(buildInfo.get("travis_build_number"))) { return Optional.of(Integer.parseInt(buildInfo.get("version"), 10)); } else { return Optional.of(Integer.parseInt(buildInfo.get("version"), 16)); } } catch (NumberFormatException nfe) { return Optional.absent(); } }
Source:
public void executeQuery(AsyncQuery queryObj, User user, String apiVersion) { QueryRunner runner = runners.get(apiVersion); if (runner == null) { throw new InvalidOperationException("Invalid API Version"); } AsyncQueryThread queryWorker = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, apiVersion); Future<AsyncQueryResult> task = executor.submit(queryWorker); try { queryObj.setStatus(QueryStatus.PROCESSING); AsyncQueryResult queryResultObj = task.get(queryObj.getAsyncAfterSeconds(), TimeUnit.SECONDS); queryObj.setResult(queryResultObj); queryObj.setStatus(QueryStatus.COMPLETE); } catch (InterruptedException e) { log.error("InterruptedException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } catch (ExecutionException e) { log.error("ExecutionException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } catch (TimeoutException e) { log.error("TimeoutException: {}", e); if (task.isDone()) { log.info("task is done."); try { queryObj.setResult(task.get()); queryObj.setStatus(QueryStatus.COMPLETE); } catch (InterruptedException e1) { log.error("InterruptedException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } catch (ExecutionException e1) { log.error("ExecutionException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } } else { log.info("task is not done yet."); AsyncQueryUpdateThread queryUpdateWorker = new AsyncQueryUpdateThread(elide, task, queryObj, asyncQueryDao); updater.execute(queryUpdateWorker); } } }

Target:
public void executeQuery(AsyncQuery queryObj, User user, String apiVersion) { QueryRunner runner = runners.get(apiVersion); if (runner == null) { throw new InvalidOperationException("Invalid API Version"); } AsyncQueryThread queryWorker = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, apiVersion); Future<AsyncQueryResult> task = executor.submit(queryWorker); try { queryObj.setStatus(QueryStatus.PROCESSING); AsyncQueryResult queryResultObj = task.get(queryObj.getAsyncAfterSeconds(), TimeUnit.SECONDS); queryObj.setResult(queryResultObj); queryObj.setStatus(QueryStatus.COMPLETE); } catch (InterruptedException e) { log.error("InterruptedException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } catch (ExecutionException e) { log.error("ExecutionException: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } catch (TimeoutException e) { log.error("TimeoutException: {}", e); queryObj.setQueryUpdateWorker(new AsyncQueryUpdateThread(elide, task, queryObj, asyncQueryDao)); } catch (Exception e) { log.error("Exception: {}", e); queryObj.setStatus(QueryStatus.FAILURE); } }
Source:
protected IdeFrameFixture openProject(@NotNull String projectDirName) throws IOException { final File projectPath = setUpProject(projectDirName); WelcomeFrameFixture welcomeFrame = findWelcomeFrame(); welcomeFrame.openProjectButton().click(); FileChooserDialogFixture openProjectDialog = FileChooserDialogFixture.findOpenProjectDialog(myRobot); return openProjectAndWaitUntilOpened(projectPath, openProjectDialog); }

Target:
protected IdeFrameFixture openProject(@NotNull String projectDirName) throws IOException { final File projectPath = setUpProject(projectDirName, true); WelcomeFrameFixture welcomeFrame = findWelcomeFrame(); welcomeFrame.openProjectButton().click(); FileChooserDialogFixture openProjectDialog = FileChooserDialogFixture.findOpenProjectDialog(myRobot); return openProjectAndWaitUntilOpened(projectPath, openProjectDialog); }
Source:
public InputStream lookupResponse(String id) { InputStream result = null; if (null != id) { try (Connection connection = getConnection(); PreparedStatement mySelectSQL = connection.prepareStatement(selectionString)) { mySelectSQL.setString(SELECT_COLUMN_RESPONSE, id); try (ResultSet rs = mySelectSQL.executeQuery()) { if (null == rs || !rs.next()) { LOGGER.warn("No response found for request id " + id); } else { result = rs.getAsciiStream(1); } } } catch (SQLException ex) { LOGGER.error("Could not look up response in database", ex); } if (null != result) { if (id.toLowerCase().contains("output") && !Boolean.parseBoolean(getDatabaseProperties("saveResultsToDB"))) { try { String outputFileLocation = IOUtils.toString(result); LOGGER.debug("ID is output and saved to disk instead of database. Path = " + outputFileLocation); if (Files.exists(Paths.get(outputFileLocation))) { result = new GZIPInputStream(new FileInputStream(outputFileLocation)); } else { LOGGER.warn("Response not found on disk for id " + id + " at " + outputFileLocation); } } catch (FileNotFoundException ex) { LOGGER.warn("Response not found on disk for id " + id, ex); } catch (IOException ex) { LOGGER.warn("Error processing response for id " + id, ex); } } } else { LOGGER.warn("response found but returned null"); } } else { LOGGER.warn("tried to look up response for null id, returned null"); } return result; }

Target:
public InputStream lookupResponse(String id) { InputStream result = null; if (null != id) { try (Connection connection = getConnection(); PreparedStatement selectStatement = connection.prepareStatement(selectionString)) { selectStatement.setString(SELECTION_STRING_REQUEST_ID_PARAM_INDEX, id); try (ResultSet rs = selectStatement.executeQuery()) { if (null == rs || !rs.next()) { LOGGER.warn("No response found for request id " + id); } else { result = rs.getAsciiStream(SELECTION_STRING_RESPONSE_COLUMN_INDEX); } } } catch (SQLException ex) { LOGGER.error("Could not look up response in database", ex); } if (null != result) { if (id.toLowerCase().contains("output") && !Boolean.parseBoolean(getDatabaseProperties("saveResultsToDB"))) { try { String outputFileLocation = IOUtils.toString(result); LOGGER.debug("ID is output and saved to disk instead of database. Path = " + outputFileLocation); if (Files.exists(Paths.get(outputFileLocation))) { result = new GZIPInputStream(new FileInputStream(outputFileLocation)); } else { LOGGER.warn("Response not found on disk for id " + id + " at " + outputFileLocation); } } catch (FileNotFoundException ex) { LOGGER.warn("Response not found on disk for id " + id, ex); } catch (IOException ex) { LOGGER.warn("Error processing response for id " + id, ex); } } } else { LOGGER.warn("response found but returned null"); } } else { LOGGER.warn("tried to look up response for null id, returned null"); } return result; }
Source:
public URI createDepositRecord(URI path, Model model) throws FedoraException { URI depositRecordUri; try (FcrepoResponse response = getClient().put(path) .body(RDFModelUtil.streamModel(model), "text/turtle") .perform()) { depositRecordUri = response.getLocation(); ldpFactory.createDirectContainer(depositRecordUri, Cdr.hasManifest, RepositoryPathConstants.DEPOSIT_MANIFEST_CONTAINER); ldpFactory.createDirectContainer(depositRecordUri, Premis.hasEvent, RepositoryPathConstants.EVENTS_CONTAINER); } catch (IOException e) { throw new FedoraException("Unable to create deposit record at " + path, e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return depositRecordUri; }

Target:
public URI createDepositRecord(URI path, Model model) throws FedoraException { URI depositRecordUri; try (FcrepoResponse response = getClient().put(path) .body(RDFModelUtil.streamModel(model), TURTLE_MIMETYPE) .perform()) { depositRecordUri = response.getLocation(); ldpFactory.createDirectContainer(depositRecordUri, Cdr.hasManifest, RepositoryPathConstants.DEPOSIT_MANIFEST_CONTAINER); ldpFactory.createDirectContainer(depositRecordUri, Premis.hasEvent, RepositoryPathConstants.EVENTS_CONTAINER); } catch (IOException e) { throw new FedoraException("Unable to create deposit record at " + path, e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return depositRecordUri; }
Source:
private RexNode simplifyIs(RexCall call, RexUnknownAs unknownAs) { final SqlKind kind = call.getKind(); final RexNode argument = call.getOperands().get(0); if (kind == SqlKind.IS_TRUE && unknownAs == RexUnknownAs.FALSE) { return simplify(argument, unknownAs); } if (kind == SqlKind.IS_NOT_FALSE && unknownAs == RexUnknownAs.TRUE) { return simplify(argument, unknownAs); } final RexNode a = simplify(call.getOperands().get(0), RexUnknownAs.UNKNOWN); final RexNode pred = simplifyIsPredicate(kind, a); if (pred != null) { return pred; } final RexNode simplified = simplifyIs2(kind, a); if (simplified != null) { return simplified; } return call; }

Target:
private RexNode simplifyIs(RexCall call, RexUnknownAs unknownAs) { final SqlKind kind = call.getKind(); final RexNode a = call.getOperands().get(0); if (kind == SqlKind.IS_TRUE && unknownAs == RexUnknownAs.FALSE) { return simplify(a, unknownAs); } if (kind == SqlKind.IS_FALSE && unknownAs == RexUnknownAs.FALSE) { return simplify(rexBuilder.makeCall(SqlStdOperatorTable.NOT, a), unknownAs); } if (kind == SqlKind.IS_NOT_FALSE && unknownAs == RexUnknownAs.TRUE) { return simplify(a, unknownAs); } if (kind == SqlKind.IS_NOT_TRUE && unknownAs == RexUnknownAs.TRUE) { return simplify(rexBuilder.makeCall(SqlStdOperatorTable.NOT, a), unknownAs); } final RexNode pred = simplifyIsPredicate(kind, a); if (pred != null) { return pred; } final RexNode simplified = simplifyIs2(kind, a, unknownAs); if (simplified != null) { return simplified; } return call; }
Source:
private void setHttpClient(String host, int port) { try { client = HttpClients.custom() .setSSLSocketFactory(new SSLConnectionSocketFactory( SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build())) .build(); } catch (NoSuchAlgorithmException | eyManagementException | KeyStoreException e) { log.error("Exception : ", e); } baseUrl = "https://" + host + ":" + port; userName = "admin"; passWord = "admin"; }

Target:
private void setHttpClient(String host, int port) { try { client = HttpClients.custom() .setSSLSocketFactory(new SSLConnectionSocketFactory( SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build())) .build(); } catch (NoSuchAlgorithmException | keyManagementException | KeyStoreException e) { log.error(Constants.DEFAULT_EX, e); } baseUrl = Constants.URL_SCHEMA + host + ":" + port; }
Source:
public boolean isProjectRegistered(String project) { ProjectPreferenceSetting projectSetting = getProjectSetting( project); return (projectSetting != null && projectSetting.startupQuestionAsked); }

Target:
public boolean isProjectRegistered(String project) { ProjectPreferenceSetting projectSetting = getProjectSetting( project); return projectSetting != null && projectSetting.startupQuestionAsked; }