auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { for(Order o : ordersPlaced){ if(o.getStockSymbol().equals(symbol)) throw new StockMarketExpection(); } Stock stock = m.getStockForSymbol(symbol); if( orderType == OrderType.SELL){ int size = -1; for(Order o : position){ if(o.getStockSymbol().equals(symbol)){ size = o.getSize(); } } if(size == -1 || size < volume){ throw new StockMarketExpection(); } SellOrder sellOrder = new SellOrder(symbol, volume, price, this); ordersPlaced.add(sellOrder); m.addOrder(sellOrder); }else{ double totalCost = stock.getPrice() * volume ; if(totalCost <= cashInHand){ BuyOrder buyOrder = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(buyOrder); m.addOrder(buyOrder); }else{ throw new StockMarketExpection("You don't have enough cash"); } } }

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { for(Order order : ordersPlaced){ if(order.getStockSymbol().equals(symbol)) throw new StockMarketExpection(); } Stock stock = m.getStockForSymbol(symbol); if( orderType == OrderType.SELL){ int size = -1; for(Order o : position){ if(o.getStockSymbol().equals(symbol)){ size = o.getSize(); } } if(size == -1 || size < volume){ throw new StockMarketExpection(); } SellOrder sellOrder = new SellOrder(symbol, volume, price, this); ordersPlaced.add(sellOrder); m.addOrder(sellOrder); }else{ double totalCost = stock.getPrice() * volume ; if(totalCost <= cashInHand){ BuyOrder buyOrder = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(buyOrder); m.addOrder(buyOrder); }else{ throw new StockMarketExpection("You don't have enough cash"); } } }
Source:
private long getClinicalId(boolean silent, String clinicalStrAux) throws CatalogDBException { long clinicalId = Long.parseLong(clinicalStrAux); try { clinicalDBAdaptor.checkId(clinicalId); } catch (CatalogException e) { if (silent) { return -1L; } else { throw e; } } return clinicalId; }

Target:
private long getClinicalId(boolean silent, String clinicalStrAux) throws CatalogException { long clinicalId = Long.parseLong(clinicalStrAux); try { clinicalDBAdaptor.checkId(clinicalId); } catch (CatalogException e) { if (silent) { return -1L; } else { throw e; } } return clinicalId; }
Source:
private void publishEvent(String event, SiteNode node) { ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node))); }

Target:
private static void publishEvent(String event, SiteNode node) { ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node))); }
Source:
Client(Map storm_conf, String host, int port) { message_queue = new LinkedBlockingQueue<Object>(); retries = new AtomicInteger(0); channelRef = new AtomicReference<Channel>(null); being_closed = new AtomicBoolean(false); buffer_size = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE)); max_retries = Math.max(30, Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_RETRIES))); base_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS)); max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS)); int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS)); if (maxWorkers > 0) { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers); } else { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); } bootstrap = new ClientBootstrap(factory); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("sendBufferSize", buffer_size); bootstrap.setOption("keepAlive", true); bootstrap.setPipelineFactory(new StormClientPipelineFactory(this)); remote_addr = new InetSocketAddress(host, port); bootstrap.connect(remote_addr); }

Target:
Client(Map storm_conf, String host, int port) { message_queue = new LinkedBlockingQueue<Object>(); retries = new AtomicInteger(0); channelRef = new AtomicReference<Channel>(null); being_closed = new AtomicBoolean(false); buffer_size = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE)); max_retries = Math.min(30, Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_RETRIES))); base_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS)); max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS)); int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS)); if (maxWorkers > 0) { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers); } else { factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); } bootstrap = new ClientBootstrap(factory); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("sendBufferSize", buffer_size); bootstrap.setOption("keepAlive", true); bootstrap.setPipelineFactory(new StormClientPipelineFactory(this)); remote_addr = new InetSocketAddress(host, port); bootstrap.connect(remote_addr); }
Source:
protected boolean isVmNotInPreviewSnapshot() { return getVmId() != null && validate(getSnapshotsValidator().vmNotDuringSnapshot(getVmId())) && validate(getSnapshotsValidator().vmNotInPreview(getVmId())); }

Target:
protected boolean isVmNotInPreviewSnapshot() { final SnapshotsValidator snapshotsValidator = getSnapshotsValidator(); return getVmId() != null && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())); }
Source:
public void testOur404Handler(String wiki, String inputPath, String expectedPath) { String wikiBase = urlBuilder.getUrlForWiki(wiki); String inputUrl = wikiBase + inputPath; String expectedUrl = expectedPath; if (!expectedUrl.startsWith("http://")) { expectedUrl = wikiBase + expectedUrl; } driver.get(inputUrl); String actualUrl = driver.getCurrentUrl(); Assertion.assertEquals(actualUrl, expectedUrl); }

Target:
public void testOur404Handler(String wiki, String inputPath, String expectedPath) { String wikiBase = urlBuilder.getUrlForWiki(wiki); String inputUrl = wikiBase + inputPath; String expectedUrl = wikiBase + expectedPath; if (expectedPath.startsWith("http://")) { expectedUrl = expectedPath; } driver.get(inputUrl); String actualUrl = driver.getCurrentUrl(); Assertion.assertEquals(actualUrl, expectedUrl); }
Source:
private boolean isStringConcat(Node childNode, Node baseNode) { Node currentNode = childNode; for (int i = 0; i < 10 && currentNode != null && currentNode != baseNode; i++) { currentNode = currentNode.jjtGetParent(); if (currentNode instanceof ASTAdditiveExpression) { return true; } } return false; }

Target:
private boolean isStringConcat(Node childNode, Node baseNode) { Node currentNode = childNode; while (currentNode != baseNode) { currentNode = currentNode.jjtGetParent(); if (currentNode instanceof ASTAdditiveExpression) { return true; } } return false; }
Source:
private synchronized void startSplit(PrioritizedSplitRunner split) { allSplits.add(split); waitingSplits.offer(split); log.debug("%s is started", split.toString()); }

Target:
private synchronized void startSplit(PrioritizedSplitRunner split) { allSplits.add(split); waitingSplits.offer(split); log.debug("Started %s", split); }
Source:
private static String getProperty(String propertyName) { return AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(propertyName)); }

Target:
private String getProperty(String propertyName) { return propertyCache.computeIfAbsent( propertyName, p -> AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty(p))); }
Source:
private boolean readState() { IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); boolean terminate = true; if (preferences != null) { terminate = preferences.getBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true); } return terminate; }

Target:
private boolean readState() { return Platform.getPreferencesService().getBoolean(GdbPlugin.PLUGIN_ID, IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true, null); }
Source:
public void sharedPoolsConfigured() { if (managementRegistry != null) { LOGGER.trace("sharedPoolsConfigured()"); CompletableFuture.allOf(ehcacheStateService.getSharedResourcePools() .entrySet() .stream() .map(e -> managementRegistry.register(new PoolBinding(e.getKey(), e.getValue(), PoolBinding.AllocationType.SHARED))) .collect(Collectors.toList()) .toArray(new CompletableFuture<?>[0])) .thenRun(() -> { managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(PoolBinding.ALL_SHARED, EHCACHE_RESOURCE_POOLS_CONFIGURED.name()); }); } }

Target:
public void sharedPoolsConfigured() { if (managementRegistry != null) { LOGGER.trace("sharedPoolsConfigured()"); CompletableFuture.allOf(ehcacheStateService.getSharedResourcePools() .entrySet() .stream() .map(e -> managementRegistry.register(new PoolBinding(e.getKey(), e.getValue(), PoolBinding.AllocationType.SHARED))) .toArray(CompletableFuture<?>[]::new)) .thenRun(() -> { managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(PoolBinding.ALL_SHARED, EHCACHE_RESOURCE_POOLS_CONFIGURED.name()); }); } }
Source:
public static int runBackupToolFromOtherJvmToGetExitCode( File neo4jHome, String... args ) throws Exception { List<String> allArgs = new ArrayList<>( Arrays.asList( ProcessUtil.getJavaExecutable().toString(), "-cp", ProcessUtil.getClassPath(), AdminTool.class.getName() ) ); allArgs.add( "backup" ); allArgs.addAll( Arrays.asList( args ) ); Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ), new String[] {"NEO4J_HOME=" + neo4jHome.getAbsolutePath()} ); return new ProcessStreamHandler( process, false ).waitForResult(); }

Target:
public static int runBackupToolFromOtherJvmToGetExitCode( File neo4jHome, String... args ) throws Exception { List<String> allArgs = new ArrayList<>( Arrays.asList( ProcessUtil.getJavaExecutable().toString(), "-cp", ProcessUtil.getClassPath(), AdminTool.class.getName() ) ); allArgs.add( "backup" ); allArgs.addAll( Arrays.asList( args ) ); Process process = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ), new String[] {"NEO4J_HOME=" + neo4jHome.getAbsolutePath()} ); return new ProcessStreamHandler( process, true ).waitForResult(); }
Source:
public void setColorFilter(ColorFilter cf) { bitmapPaint.setColorFilter(cf); }

Target:
@Override public void setColorFilter(ColorFilter cf) { throw new UnsupportedOperationException("Custom ColorFilters not supported"); }
Source:
public void testFilterOnTimeExtract() throws Exception { testQuery( "SELECT COUNT(*) FROM druid.foo\n" + "WHERE EXTRACT(YEAR FROM __time) = 2000\n" + "AND EXTRACT(MONTH FROM __time) = 1", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Intervals.of("-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"))) .granularity(Granularities.ALL) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .filters( AND( EXPRESSION_FILTER("(timestamp_extract(\"__time\",'YEAR','UTC') == 2000)"), EXPRESSION_FILTER("(timestamp_extract(\"__time\",'MONTH','UTC') == 1)") ) ) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{3L} ) ); }

Target:
public void testFilterOnTimeExtract() throws Exception { testQuery( "SELECT COUNT(*) FROM druid.foo\n" + "WHERE EXTRACT(YEAR FROM __time) = 2000\n" + "AND EXTRACT(MONTH FROM __time) = 1", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(QSS(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(AGGS(new CountAggregatorFactory("a0"))) .filters( AND( EXPRESSION_FILTER("(timestamp_extract(\"__time\",'YEAR','UTC') == 2000)"), EXPRESSION_FILTER("(timestamp_extract(\"__time\",'MONTH','UTC') == 1)") ) ) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{3L} ) ); }
Source:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; } valuesBytes[index] = StringUtils.toUtf8(StringUtils.nullToEmptyNonDruidDataString(value)); valuesBytesSize += valuesBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); ByteBuffer filterCacheKey = ByteBuffer.allocate(5 + dimensionBytes.length + valuesBytesSize + extractionFnBytes.length) .put(DimFilterUtils.IN_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(hasNull ? (byte) 1 : (byte) 0) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; } valuesBytes[index] = StringUtils.toUtf8(Strings.nullToEmpty(value)); valuesBytesSize += valuesBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); ByteBuffer filterCacheKey = ByteBuffer.allocate(5 + dimensionBytes.length + valuesBytesSize + extractionFnBytes.length) .put(DimFilterUtils.IN_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(hasNull ? NullHandling.IS_NULL_BYTE : NullHandling.IS_NOT_NULL_BYTE) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }
Source:
public FormValidation doReRegister() { if (!manageHook) { return FormValidation.error("Works only when jenkins manages hooks"); } int triggered = 0; for (AbstractProject<?,?> job : Jenkins.getInstance().getAllItems(AbstractProject.class)) { GitHubPushTrigger trigger = job.getTrigger(GitHubPushTrigger.class); if (trigger!=null) { LOGGER.log(Level.FINE, "Calling registerHooks() for {0}", job.getFullName()); trigger.registerHooks(); triggered++; } } LOGGER.log(Level.INFO, "Called registerHooks() for {0} jobs", triggered); return FormValidation.ok("Called registerHooks() for " + triggered + " jobs"); }

Target:
public FormValidation doReRegister() { if (!manageHook) { return FormValidation.error("Works only when Jenkins manages hooks"); } int triggered = 0; for (AbstractProject<?,?> job : getJenkinsInstance().getAllItems(AbstractProject.class)) { if (!job.isBuildable()) { continue; } GitHubPushTrigger trigger = job.getTrigger(GitHubPushTrigger.class); if (trigger!=null) { LOGGER.log(Level.FINE, "Calling registerHooks() for {0}", job.getFullName()); trigger.registerHooks(); triggered++; } } LOGGER.log(Level.INFO, "Called registerHooks() for {0} jobs", triggered); return FormValidation.ok("Called re-register hooks for " + triggered + " jobs"); }
Source:
public static void deleteFile(@Nonnull File f) throws IOException { if (!f.delete()) { if(!f.exists()) return; makeWritable(f); makeWritable(f.getParentFile()); if(!f.delete() && f.exists()) { Files.delete(f.toPath()); File[] files = f.listFiles(); if(files!=null && files.length>0) throw new IOException("Unable to delete " + f.getPath()+" - files in dir: "+Arrays.asList(files)); throw new IOException("Unable to delete " + f.getPath()); } } }

Target:
public static void deleteFile(@Nonnull File f) throws IOException { if (!f.delete()) { if(!f.exists()) return; makeWritable(f); makeWritable(f.getParentFile()); if(!f.delete() && f.exists()) { Files.deleteIfExists(f.toPath()); File[] files = f.listFiles(); if(files!=null && files.length>0) throw new IOException("Unable to delete " + f.getPath()+" - files in dir: "+Arrays.asList(files)); throw new IOException("Unable to delete " + f.getPath()); } } }
Source:
public void addDynamicRTPPayloadType( byte rtpPayloadType, MediaFormat format) { @SuppressWarnings("unchecked") MediaFormatImpl<? extends Format> mediaFormatImpl = (MediaFormatImpl<? extends Format>) format; synchronized (dynamicRTPPayloadTypes) { dynamicRTPPayloadTypes.put(Byte.valueOf(rtpPayloadType), format); } String encoding = format.getEncoding(); if (Constants.RED.equals(encoding)) { REDTransformEngine redTransformEngine = getRedTransformEngine(); if (redTransformEngine != null) { redTransformEngine.setIncomingPT(rtpPayloadType); redTransformEngine.setOutgoingPT(rtpPayloadType); } } else if (Constants.ULPFEC.equals(encoding)) { FECTransformEngine fecTransformEngine = getFecTransformEngine(); if (fecTransformEngine != null) { fecTransformEngine.setIncomingPT(rtpPayloadType); fecTransformEngine.setOutgoingPT(rtpPayloadType); } } else if (Constants.FLEXFEC_03.equals(encoding)) { logger.info("Creating FlexFEC transform engine"); FECTransformEngine flexFecTransformEngine = new FECTransformEngine(FECTransformEngine.FecType.FLEXFEC_03, rtpPayloadType, rtpPayloadType, this); setFecTransformEngine(flexFecTransformEngine); } if (rtpManager != null) { rtpManager.addFormat( mediaFormatImpl.getFormat(), rtpPayloadType); } this.onDynamicPayloadTypesChanged(); }

Target:
public void addDynamicRTPPayloadType( byte rtpPayloadType, MediaFormat format) { @SuppressWarnings("unchecked") MediaFormatImpl<? extends Format> mediaFormatImpl = (MediaFormatImpl<? extends Format>) format; synchronized (dynamicRTPPayloadTypes) { dynamicRTPPayloadTypes.put(Byte.valueOf(rtpPayloadType), format); } String encoding = format.getEncoding(); if (Constants.RED.equals(encoding)) { REDTransformEngine redTransformEngine = getRedTransformEngine(); if (redTransformEngine != null) { redTransformEngine.setIncomingPT(rtpPayloadType); redTransformEngine.setOutgoingPT(rtpPayloadType); } } else if (Constants.ULPFEC.equals(encoding)) { TransformEngineWrapper<FECTransformEngine> fecTransformEngineWrapper = getFecTransformEngine(); if (fecTransformEngineWrapper.getWrapped() != null) { FECTransformEngine fecTransformEngine = fecTransformEngineWrapper.getWrapped(); fecTransformEngine.setIncomingPT(rtpPayloadType); fecTransformEngine.setOutgoingPT(rtpPayloadType); } } else if (Constants.FLEXFEC_03.equals(encoding)) { TransformEngineWrapper<FECTransformEngine> fecTransformEngineWrapper = getFecTransformEngine(); if (fecTransformEngineWrapper.getWrapped() != null) { logger.info("Updating existing FlexFEC-03 transform engine with payload type " + rtpPayloadType); fecTransformEngineWrapper.getWrapped().setIncomingPT(rtpPayloadType); fecTransformEngineWrapper.getWrapped().setOutgoingPT(rtpPayloadType); } else { logger.info("Creating FlexFEC-03 transform engine with payload type " + rtpPayloadType); FECTransformEngine flexFecTransformEngine = new FECTransformEngine(FECTransformEngine.FecType.FLEXFEC_03, rtpPayloadType, rtpPayloadType, this); setFecTransformEngine(flexFecTransformEngine); } } if (rtpManager != null) { rtpManager.addFormat( mediaFormatImpl.getFormat(), rtpPayloadType); } this.onDynamicPayloadTypesChanged(); }
Source:
public DepthObjectWalk(ObjectReader or, int depth, final RevFlag shallow, final Collection<? extends ObjectId> clientShallows) { super(or); this.depth = depth; SHALLOW = shallow == null ? newFlag("SHALLOW") : shallow; this.clientShallows = clientShallows; BOUNDARY = newFlag("BOUNDARY"); }

Target:
DepthObjectWalk(ObjectReader or, int depth, final RevFlag shallow, final Collection<? extends ObjectId> clientShallows) { super(or); this.depth = depth; SHALLOW = shallow == null ? newFlag("SHALLOW") : shallow; this.clientShallows = clientShallows; BOUNDARY = newFlag("BOUNDARY"); }
Source:
public void setBufferSize(final int bufferSize) { this.bufferSize = 1; }

Target:
public void setBufferSize(final int bufferSize) { if (bufferSize != 1) { LOGGER.debug("Noop. SimpleEmitter buffer size must always be 1."); } }
Source:
public synchronized void addListener(File file, String path, ResourceListener listener) { if( watcher == null ){ Disposer disposer = GeoServerExtensions.bean(Disposer.class); watcher = new FileSystemWatcher(); if(disposer!=null) { disposer.register(watcher); } else { LOGGER.warning("Disposer not available to register for disposal. FileSystemWatcher may not be closed at application shutdown."); } } watcher.addListener( file, path, listener ); }

Target:
public synchronized void addListener(File file, String path, ResourceListener listener) { if( watcher == null ){ watcher = new FileSystemWatcher(); } watcher.addListener( file, path, listener ); }
Source:
public void objectFreq() { jedis.set(key, "test1"); jedis.configSet("maxmemory-policy", "allkeys-lfu"); jedis.get(key); Long count = jedis.objectFreq(key); assertTrue(count > 0); count = jedis.objectFreq(binaryKey); assertTrue(count > 0); jedis.configSet("maxmemory-policy", "noeviction"); }

Target:
public void objectFreq() { lfuJedis.set(key, "test1"); lfuJedis.get(key); Long count = lfuJedis.objectFreq(key); assertTrue(count > 0); count = lfuJedis.objectFreq(binaryKey); assertTrue(count > 0); assertNull(lfuJedis.objectFreq("no_such_key")); try { jedis.set(key, "test2"); jedis.objectFreq(key); fail("Freq is only allowed with LFU policy"); }catch(JedisDataException e) }
Source:
public HeaderConverter newHeaderConverter(AbstractConfig config, String classPropertyName, ClassLoaderUsage classLoaderUsage) { Class<? extends HeaderConverter> klass = null; switch (classLoaderUsage) { case CURRENT_CLASSLOADER: if (!config.originals().containsKey(classPropertyName)) { return null; } klass = pluginClassFromConfig(config, classPropertyName, HeaderConverter.class); break; case PLUGINS: String converterClassOrAlias = config.getClass(classPropertyName).getName(); try { klass = pluginClass( delegatingLoader, converterClassOrAlias, HeaderConverter.class ); } catch (ClassNotFoundException e) { throw new ConnectException( "Failed to find any class that implements HeaderConverter and which name matches " + converterClassOrAlias + ", available header converters are: " + pluginNames(delegatingLoader.headerConverters()) ); } } if (klass == null) { throw new ConnectException("Unable to initialize the HeaderConverter specified in '" + classPropertyName + "'"); } String configPrefix = classPropertyName + "."; Map<String, Object> converterConfig = config.originalsWithPrefix(configPrefix); converterConfig.put(ConverterConfig.TYPE_CONFIG, ConverterType.HEADER.getName()); log.debug("Configuring the header converter with configuration keys:{}{}", System.lineSeparator(), converterConfig.keySet()); HeaderConverter plugin; ClassLoader savedLoader = compareAndSwapLoaders(klass.getClassLoader()); try { plugin = newPlugin(klass); plugin.configure(converterConfig); } finally { compareAndSwapLoaders(savedLoader); } return plugin; }

Target:
public HeaderConverter newHeaderConverter(AbstractConfig config, String classPropertyName, ClassLoaderUsage classLoaderUsage) { Class<? extends HeaderConverter> klass = null; switch (classLoaderUsage) { case CURRENT_CLASSLOADER: if (!config.originals().containsKey(classPropertyName)) { return null; } klass = pluginClassFromConfig(config, classPropertyName, HeaderConverter.class, delegatingLoader.headerConverters()); break; case PLUGINS: String converterClassOrAlias = config.getClass(classPropertyName).getName(); try { klass = pluginClass( delegatingLoader, converterClassOrAlias, HeaderConverter.class ); } catch (ClassNotFoundException e) { throw new ConnectException( "Failed to find any class that implements HeaderConverter and which name matches " + converterClassOrAlias + ", available header converters are: " + pluginNames(delegatingLoader.headerConverters()) ); } } if (klass == null) { throw new ConnectException("Unable to initialize the HeaderConverter specified in '" + classPropertyName + "'"); } String configPrefix = classPropertyName + "."; Map<String, Object> converterConfig = config.originalsWithPrefix(configPrefix); converterConfig.put(ConverterConfig.TYPE_CONFIG, ConverterType.HEADER.getName()); log.debug("Configuring the header converter with configuration keys:{}{}", System.lineSeparator(), converterConfig.keySet()); HeaderConverter plugin; ClassLoader savedLoader = compareAndSwapLoaders(klass.getClassLoader()); try { plugin = newPlugin(klass); plugin.configure(converterConfig); } finally { compareAndSwapLoaders(savedLoader); } return plugin; }
Source:
protected Object doReceive() { AbstractFileInfo<F> file = poll(); if (file != null) { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { AbstractIntegrationMessageBuilder<InputStream> builder = getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()); if (getObjectMapper() != null) { try { builder.setHeader(FileHeaders.REMOTE_FILE_INFO, getObjectMapper().toJson(file)); } catch (Exception e) { logger.info("Failed to transform file info to json: " + file, e); } } return builder.build(); } catch (IOException e) { throw new MessagingException("IOException when retrieving " + remotePath, e); } } return null; }

Target:
protected Object doReceive() { AbstractFileInfo<F> file = poll(); if (file != null) { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? (file.toJson()) : file) .build(); } catch (IOException e) { throw new MessagingException("IOException when retrieving " + remotePath, e); } } return null; }
Source:
public Response startAttempt(RestSessionAttemptRequest request) throws ResourceNotFoundException, ResourceConflictException { ProjectStore rs = rm.getProjectStore(getSiteId()); StoredWorkflowDefinitionWithProject def = rs.getWorkflowDefinitionById(request.getWorkflowId()); Optional<Long> resumingAttemptId = request.getResume() .transform(r -> r.getAttemptId()); List<Long> resumingTasks = request.getResume() .transform(r -> collectResumingTasks(r)) .or(ImmutableList.of()); AttemptRequest ar = attemptBuilder.buildFromStoredWorkflow( def, request.getParams(), ScheduleTime.runNow(request.getSessionTime()), request.getRetryAttemptName(), resumingAttemptId, resumingTasks); try { StoredSessionAttemptWithSession attempt = executor.submitWorkflow(getSiteId(), ar, def); RestSessionAttempt res = RestModels.attempt(attempt, def.getProject().getName()); return Response.ok(res).build(); } catch (LimitExceededException ex) { return Response.status(Response.Status.FORBIDDEN).entity(ex.getMessage()).build(); } catch (SessionAttemptConflictException ex) { StoredSessionAttemptWithSession conflicted = ex.getConflictedSession(); RestSessionAttempt res = RestModels.attempt(conflicted, def.getProject().getName()); return Response.status(Response.Status.CONFLICT).entity(res).build(); } }

Target:
public Response startAttempt(RestSessionAttemptRequest request) throws ResourceNotFoundException, ResourceConflictException { ProjectStore rs = rm.getProjectStore(getSiteId()); StoredWorkflowDefinitionWithProject def = rs.getWorkflowDefinitionById(request.getWorkflowId()); Optional<Long> resumingAttemptId = request.getResume() .transform(r -> r.getAttemptId()); List<Long> resumingTasks = request.getResume() .transform(r -> collectResumingTasks(r)) .or(ImmutableList.of()); AttemptRequest ar = attemptBuilder.buildFromStoredWorkflow( def, request.getParams(), ScheduleTime.runNow(request.getSessionTime()), request.getRetryAttemptName(), resumingAttemptId, resumingTasks); try { StoredSessionAttemptWithSession attempt = executor.submitWorkflow(getSiteId(), ar, def); RestSessionAttempt res = RestModels.attempt(attempt, def.getProject().getName()); return Response.ok(res).build(); } catch (SessionAttemptConflictException ex) { StoredSessionAttemptWithSession conflicted = ex.getConflictedSession(); RestSessionAttempt res = RestModels.attempt(conflicted, def.getProject().getName()); return Response.status(Response.Status.CONFLICT).entity(res).build(); } }
Source:
public String transform(String regExpression, String source) throws TransformationException { if (regExpression == null || source == null) { throw new TransformationException("the given parameters 'regex' and 'source' must not be null"); } logger.debug("about to transform '{}' by the function '{}'", source, regExpression); String result = ""; Matcher substMatcher = SUBSTR_PATTERN.matcher(regExpression); if (substMatcher.matches()) { logger.debug("Using substitution form of regex transformation"); String regex = substMatcher.group(1); String substitution = substMatcher.group(2); String options = substMatcher.group(3); if (options.equals("g")) { result = source.trim().replaceAll(regex, substitution); } else { result = source.trim().replaceFirst(regex, substitution); } if (result != null) { return result; } } Matcher matcher = Pattern.compile("^" + regExpression + "$", Pattern.DOTALL).matcher(source.trim()); if (!matcher.matches()) { logger.debug( "the given regex '^{}$' doesn't match the given content '{}' -> couldn't compute transformation", regExpression, source); return UnDefType.NULL.toFullString(); } matcher.reset(); while (matcher.find()) { if (matcher.groupCount() == 0) { logger.info( "the given regular expression '^{}$' doesn't contain a group. No content will be extracted and returned!", regExpression); continue; } result = matcher.group(1); if (matcher.groupCount() > 1) { logger.debug( "the given regular expression '^{}$' contains more than one group. Only the first group will be returned!", regExpression); } } if (result != null) { return result; } else { return UnDefType.NULL.toFullString(); } }

Target:
public @Nullable String transform(String regExpression, String source) throws TransformationException { if (regExpression == null || source == null) { throw new TransformationException("the given parameters 'regex' and 'source' must not be null"); } logger.debug("about to transform '{}' by the function '{}'", source, regExpression); String result = ""; Matcher substMatcher = SUBSTR_PATTERN.matcher(regExpression); if (substMatcher.matches()) { logger.debug("Using substitution form of regex transformation"); String regex = substMatcher.group(1); String substitution = substMatcher.group(2); String options = substMatcher.group(3); if (options.equals("g")) { result = source.trim().replaceAll(regex, substitution); } else { result = source.trim().replaceFirst(regex, substitution); } if (result != null) { return result; } } Matcher matcher = Pattern.compile("^" + regExpression + "$", Pattern.DOTALL).matcher(source.trim()); if (!matcher.matches()) { logger.debug( "the given regex '^{}$' doesn't match the given content '{}' -> couldn't compute transformation", regExpression, source); return null; } matcher.reset(); while (matcher.find()) { if (matcher.groupCount() == 0) { logger.info( "the given regular expression '^{}$' doesn't contain a group. No content will be extracted and returned!", regExpression); continue; } result = matcher.group(1); if (matcher.groupCount() > 1) { logger.debug( "the given regular expression '^{}$' contains more than one group. Only the first group will be returned!", regExpression); } } return result; }
Source:
public State terminate(AkkaRpcActor<?> akkaRpcActor) { akkaRpcActor.mainThreadValidator.enterMainThread(); CompletableFuture<Void> terminationFuture; try { terminationFuture = akkaRpcActor.rpcEndpoint.internalCallOnStop(); } catch (Throwable t) { String errorMsg = String.format("Failure while stopping RpcEndpoint %s.", akkaRpcActor.rpcEndpoint.getEndpointId()); LoggerFactory.getLogger(akkaRpcActor.rpcEndpoint.getClass()).error(errorMsg, t); terminationFuture = FutureUtils.completedExceptionally(new AkkaRpcException(errorMsg, t)); akkaRpcActor.rpcEndpoint.getTerminationFuture().completeExceptionally(t); } finally { akkaRpcActor.mainThreadValidator.exitMainThread(); } terminationFuture.whenComplete((ignored, throwable) -> akkaRpcActor.stop(RpcEndpointTerminationResult.of(throwable))); return TerminatingState.TERMINATING; }

Target:
default State terminate(AkkaRpcActor<?> akkaRpcActor) { throw new AkkaRpcInvalidStateException(invalidStateTransitionMessage(TerminatingState.TERMINATING)); }
Source:
public Object visit(ASTAttachmentDecl node, Object data) { String connector = node.getConnector(); HashSet<String> ports = node.getAllPorts(); if (!connectors.containsKey(connector)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "connector", connector); } if (attachments.putIfAbsent(connector, ports) != null) { ToolError.reportError(ErrorMessage.DUPLICATE_CONNECTOR_USE, node.getLocation(), connector); } for (String portFull : ports) { String[] portParts = portFull.split("\\.", 2); String component = portParts[0]; String port = portParts[1]; String type = components.get(component).getType(); if (type == null) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "component", component); } ASTComponentTypeDecl typeDecl = componentTypes .get(type); if (!typeDecl.getReqs().containsKey(port) && !typeDecl.getProvs().containsKey(port)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "port", port); } } return super.visit(node, data); }

Target:
public Object visit(ASTAttachmentDecl node, Object data) { String connector = node.getConnector(); HashSet<String> ports = node.getAllPorts(); if (attachments.putIfAbsent(connector, ports) != null) { ToolError.reportError(ErrorMessage.DUPLICATE_CONNECTOR_USE, node.getLocation(), connector); } for (String portFull : ports) { String[] portParts = portFull.split("\\.", 2); String component = portParts[0]; String port = portParts[1]; ASTComponentDecl comp = components.get(component); if (comp == null) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "component", component); } ASTComponentTypeDecl typeDecl = componentTypes .get(comp.getType()); if (!typeDecl.getReqs().containsKey(port) && !typeDecl.getProvs().containsKey(port)) { ToolError.reportError(ErrorMessage.MEMBER_NOT_DECLARED, node.getLocation(), "port", port); } } return super.visit(node, data); }
Source:
void putReserved(final ThriftTransportKey key, final CachedConnection connection) { executeWithinLock(key, () -> getOrCreateCachedConnections(key).reserved.put(connection.transport, connection)); }

Target:
void putReserved(final ThriftTransportKey key, final CachedConnection connection) { var connections = getOrCreateCachedConnections(key); executeWithinLock(key, () -> connections.reserved.put(connection.transport, connection)); }
Source:
public static byte[] get(PresignedUrl url) throws IOException { try { HttpURLConnection conn = (HttpURLConnection) new URI(url.base).toURL().openConnection(); conn.setRequestMethod("GET"); for (Map.Entry<String, String> e : url.fields.entrySet()) { conn.setRequestProperty(e.getKey(), e.getValue()); } try { InputStream in = conn.getInputStream(); ByteArrayOutputStream resp = new ByteArrayOutputStream(); byte[] buf = new byte[4096]; int r; while ((r = in.read(buf)) >= 0) resp.write(buf, 0, r); return resp.toByteArray(); } catch (IOException e) { InputStream err = conn.getErrorStream(); ByteArrayOutputStream resp = new ByteArrayOutputStream(); byte[] buf = new byte[4096]; int r; while ((r = err.read(buf)) >= 0) resp.write(buf, 0, r); throw new IOException(new String(resp.toByteArray()), e); } } catch (URISyntaxException e) { throw new RuntimeException(e); } }

Target:
public static byte[] get(PresignedUrl url) throws IOException { try { HttpURLConnection conn = (HttpURLConnection) new URI(url.base).toURL().openConnection(); conn.setConnectTimeout(10_000); conn.setReadTimeout(60_000); conn.setRequestMethod("GET"); for (Map.Entry<String, String> e : url.fields.entrySet()) { conn.setRequestProperty(e.getKey(), e.getValue()); } try { InputStream in = conn.getInputStream(); return Serialize.readFully(in); } catch (IOException e) { InputStream err = conn.getErrorStream(); byte[] errBody = Serialize.readFully(err); throw new IOException(new String(errBody), e); } } catch (URISyntaxException e) { throw new RuntimeException(e); } }
Source:
public Set<Feature> getFeatures(Constituent c) throws EdisonException { String classifier = "ChunkWindowThreeBefore"; TextAnnotation ta = c.getTextAnnotation(); TOKENS = ta.getView(ViewNames.TOKENS); SHALLOW_PARSE = ta.getView(ViewNames.SHALLOW_PARSE); int startspan = c.getStartSpan(); int endspan = c.getEndSpan(); int k = -2; List<Constituent> wordstwobefore = getwordskfrom(TOKENS, startspan, endspan, k); String[] labels = new String[2]; Set<Feature> result = new LinkedHashSet<Feature>(); int i = 0; if (wordstwobefore.size() == 0) { return result; } for (Constituent token : wordstwobefore) { List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); if (Chunk_label.size() != 1) { logger.info("Error token has more than one POS tag or Chunk Label."); } labels[i] = Chunk_label.get(0); String __value = "(" + labels[i] + ")"; String __id = classifier + ":" + (i++); result.add(new DiscreteFeature(__id + __value)); } return result; }

Target:
public Set<Feature> getFeatures(Constituent c) throws EdisonException { String classifier = "ChunkWindowThreeBefore"; TextAnnotation ta = c.getTextAnnotation(); TOKENS = ta.getView(ViewNames.TOKENS); SHALLOW_PARSE = ta.getView(ViewNames.SHALLOW_PARSE); int startspan = c.getStartSpan(); int endspan = c.getEndSpan(); int k = -2; List<Constituent> wordstwobefore = getwordskfrom(TOKENS, startspan, endspan, k); String[] labels = new String[2]; Set<Feature> result = new LinkedHashSet<Feature>(); int i = 0; if (wordstwobefore.size() == 0) { return result; } for (Constituent token : wordstwobefore) { List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); if (Chunk_label.size() != 1) { logger.warn("Error token has more than one POS tag or Chunk Label."); } labels[i] = Chunk_label.get(0); String __value = "(" + labels[i] + ")"; String __id = classifier + ":" + (i++); result.add(new DiscreteFeature(__id + __value)); } return result; }
Source:
private static II getLivingSubjectId(PRPAMT201306UV02LivingSubjectId id) { II oII = null; if (id != null && id.getValue() != null) { oII = id.getValue().get(0); } return oII; }

Target:
private static II getLivingSubjectId(PRPAMT201306UV02LivingSubjectId id) { II oII = null; if (id != null && id.getValue() != null && !id.getValue().isEmpty()) { oII = id.getValue().get(0); } return oII; }
Source:
public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Monitor consumers latency for this LOG, must be a computation Record, " + "can be a comma separated list of log names or ALL") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption(Option.builder() .longOpt("api-key") .desc("Datadog API KEY") .required() .hasArg() .argName("API_KEY") .build()); options.addOption(Option.builder() .longOpt("tags") .desc("A comma separated list of Datadog tags, for instance: project:foo,staging:bar") .hasArg() .argName("TAGS") .build()); options.addOption(Option.builder().longOpt("partition").desc("Report metrics for each partition").build()); options.addOption(Option.builder("i") .longOpt("interval") .desc("send latency spaced at the specified interval in seconds") .hasArg() .argName("INTERVAL") .build()); options.addOption(Option.builder("c") .longOpt("count") .desc("number of time to send the latency information") .hasArg() .argName("COUNT") .build()); options.addOption(Option.builder() .longOpt("prefix") .desc("The metric prefix to use if not server_<hostname>_nuxeo_streams.") .hasArg() .argName("PREFIX") .build()); options.addOption(Option.builder() .longOpt("codec") .desc("Codec used to read record, can be: java, avro, avroBinary, avroJson") .hasArg() .argName("CODEC") .build()); options.addOption(Option.builder().longOpt("verbose").build()); }

Target:
public void updateOptions(Options options) { options.addOption(Option.builder("l") .longOpt("log-name") .desc("Monitor consumers latency for this LOG, must be a computation Record, " + "can be a comma separated list of log names or ALL") .required() .hasArg() .argName("LOG_NAME") .build()); options.addOption(Option.builder() .longOpt("api-key") .desc("Datadog API KEY") .required() .hasArg() .argName("API_KEY") .build()); options.addOption(Option.builder() .longOpt("tags") .desc("A comma separated list of Datadog tags, for instance: project:foo,staging:bar") .hasArg() .argName("TAGS") .build()); options.addOption(Option.builder().longOpt("partition").desc("Report metrics for each partition").build()); options.addOption(Option.builder("i") .longOpt("interval") .desc("send latency spaced at the specified interval in seconds") .hasArg() .argName("INTERVAL") .build()); options.addOption(Option.builder("c") .longOpt("count") .desc("number of times the latency information is sent") .hasArg() .argName("COUNT") .build()); options.addOption(Option.builder() .longOpt("prefix") .desc("The metric prefix to use if not nuxeo.streams.") .hasArg() .argName("PREFIX") .build()); options.addOption(Option.builder() .longOpt("codec") .desc("Codec used to read record, can be: java, avro, avroBinary, avroJson") .hasArg() .argName("CODEC") .build()); options.addOption(Option.builder().longOpt("verbose").build()); }
Source:
public CsvTupleWriter(final char separator, final OutputStream out) { final CsvPreference sepratorPreference = new CsvPreference.Builder(Character.toChars(CsvPreference.STANDARD_PREFERENCE.getQuoteChar())[0], separator, CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).build(); csvWriter = new CsvListWriter(new BufferedWriter(new OutputStreamWriter(out)), sepratorPreference); }

Target:
public CsvTupleWriter(final char separator, final OutputStream out) { final CsvPreference separatorPreference = new CsvPreference.Builder(Character.toChars(CsvPreference.STANDARD_PREFERENCE.getQuoteChar())[0], separator, CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).build(); csvWriter = new CsvListWriter(new BufferedWriter(new OutputStreamWriter(out)), separatorPreference); }
Source:
public QueryDetail() { modelName = "No Name"; queryText = new ArrayList<String>(); queryText.add("Default Select Statement"); }

Target:
public QueryDetail() { modelName = ""; queryText = new ArrayList<String>(); queryText.add(""); }
Source:
public String getId() { return "org.eclipse.debug.ui.toolbar.openNewView"; }

Target:
public String getId() { return "org.eclipse.cdt.debug.ui.toolbar.openNewView"; }
Source:
public void typeToSearchInput(String value) { seleniumWebDriverHelper.waitVisibility(searchStackField).clear(); searchStackField.sendKeys(value); WaitUtils.sleepQuietly(1); }

Target:
public void typeToSearchInput(String value) { seleniumWebDriverHelper.setValue(searchStackField, value); }
Source:
public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound) { if (useFastRewriting) { this.theFastMatcher = new FastRuleMatcher(constrainedTerm.termContext(), allRuleBits.length(), 90); } stopwatch.start(); KRunState finalState = null; int step = 1; while (step <= bound || bound < 0) { List<ConstrainedTerm> results; if (useFastRewriting) { results = fastComputeRewriteStep(constrainedTerm, true); } else { results = computeRewriteStep(constrainedTerm, step, true); } if (!results.isEmpty()) { constrainedTerm = results.get(0); if (step == bound) { finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step)); } } else { finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step - 1)); break; } step++; } stopwatch.stop(); System.err.println("[" + step + ", " + stopwatch + " ]"); return finalState; }

Target:
public KRunState rewrite(ConstrainedTerm constrainedTerm, int bound) { if (useFastRewriting) { this.theFastMatcher = new FastRuleMatcher(constrainedTerm.termContext(), allRuleBits.length(), 90); } stopwatch.start(); int step = 0; List<ConstrainedTerm> results; while (step != bound && !(results = computeRewriteStep(constrainedTerm, step, true)).isEmpty()) { constrainedTerm = results.get(0); step++; } KRunState finalState = new JavaKRunState(constrainedTerm, counter, Optional.of(step)); stopwatch.stop(); if (constrainedTerm.termContext().global().krunOptions.experimental.statistics) { System.err.println("[" + step + ", " + stopwatch + " ]"); } return finalState; }
Source:
public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchSearchGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), getConfig().getNameSubstitutionStrategy(), authorizations); }

Target:
public SimilarToGraphQuery querySimilarTo(Graph graph, String[] similarToFields, String similarToText, Authorizations authorizations) { return new ElasticSearchSearchGraphQuery( getClient(), getConfig().getIndicesToQuery(), graph, similarToFields, similarToText, getAllPropertyDefinitions(), getConfig().getScoringStrategy(), this.nameSubstitutionStrategy, authorizations); }
Source:
protected void parseObjectStoreEnvironmentElementAndEnrichOperation(final XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case RELATIVE_TO: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.parseAndSetParameter(value, operation, reader); relativeToEncountered = true; break; case PATH: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.parseAndSetParameter(value, operation, reader); if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) { relativeToEncountered = true; } break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }

Target:
protected void parseObjectStoreEnvironmentElementAndEnrichOperation(final XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case RELATIVE_TO: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.parseAndSetParameter(value, operation, reader); needsDefaultRelativeTo = false; break; case PATH: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.parseAndSetParameter(value, operation, reader); if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) { needsDefaultRelativeTo = false; } break; default: throw unexpectedAttribute(reader, i); } } requireNoContent(reader); }