auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { _collector = collector; Config conf = new Config(); conf.putAll(stormConf); checkConfiguration(conf); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH); long start = System.currentTimeMillis(); LOG.info("[Fetcher #{}] : starting at {}", taskIndex, sdf.format(start)); this.eventCounter = context.registerMetric("fetcher_counter", new MultiCountMetric(), 10); this.metricGauge = context.registerMetric("fetcher", new MultiCountMetric(), 10); this.averagedMetrics = context.registerMetric("fetcher_reduced", new MultiReducedMetric(new MeanReducer()), 10); protocolFactory = new ProtocolFactory(conf); this.fetchQueues = new FetchItemQueues(conf); this.taskIndex = context.getThisTaskIndex(); int threadCount = ConfUtils.getInt(conf, "fetcher.threads.number", 10); for (int i = 0; i < threadCount; i++) { new FetcherThread(conf).start(); } String urlconfigfile = ConfUtils.getString(conf, "urlfilters.config.file", "urlfilters.json"); if (urlconfigfile != null) try { urlFilters = new URLFilters(conf, urlconfigfile); } catch (IOException e) { LOG.error("Exception caught while loading the URLFilters"); throw new RuntimeException( "Exception caught while loading the URLFilters", e); } allowRedirs = ConfUtils.getBoolean(stormConf, com.digitalpebble.storm.crawler.Constants.AllowRedirParamName, true); metadataTransfer = MetadataTransfer.getInstance(stormConf); }

Target:
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { _collector = collector; Config conf = new Config(); conf.putAll(stormConf); checkConfiguration(conf); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH); long start = System.currentTimeMillis(); LOG.info("[Fetcher #{}] : starting at {}", taskIndex, sdf.format(start)); this.eventCounter = context.registerMetric("fetcher_counter", new MultiCountMetric(), 10); this.metricGauge = context.registerMetric("fetcher", new MultiCountMetric(), 10); this.averagedMetrics = context.registerMetric("fetcher_average", new MultiReducedMetric(new MeanReducer()), 10); protocolFactory = new ProtocolFactory(conf); this.fetchQueues = new FetchItemQueues(conf); this.taskIndex = context.getThisTaskIndex(); int threadCount = ConfUtils.getInt(conf, "fetcher.threads.number", 10); for (int i = 0; i < threadCount; i++) { new FetcherThread(conf).start(); } String urlconfigfile = ConfUtils.getString(conf, "urlfilters.config.file", "urlfilters.json"); if (urlconfigfile != null) try { urlFilters = new URLFilters(conf, urlconfigfile); } catch (IOException e) { LOG.error("Exception caught while loading the URLFilters"); throw new RuntimeException( "Exception caught while loading the URLFilters", e); } allowRedirs = ConfUtils.getBoolean(stormConf, com.digitalpebble.storm.crawler.Constants.AllowRedirParamName, true); metadataTransfer = MetadataTransfer.getInstance(stormConf); }
Source:
private ComponentName getConnectedUi() { InCallServiceInfo connectedUi = mInCallServices.keySet().stream().filter( i -> i.getType() == IN_CALL_SERVICE_TYPE_DIALER_UI || i.getType() == IN_CALL_SERVICE_TYPE_DIALER_UI) .findAny() .orElse(null); if (connectedUi != null) { return connectedUi.mComponentName; } return null; }

Target:
private ComponentName getConnectedUi() { InCallServiceInfo connectedUi = mInCallServices.keySet().stream().filter( i -> i.getType() == IN_CALL_SERVICE_TYPE_DIALER_UI || i.getType() == IN_CALL_SERVICE_TYPE_SYSTEM_UI) .findAny() .orElse(null); if (connectedUi != null) { return connectedUi.mComponentName; } return null; }
Source:
public void parse(CommandSource source, CommandArgs args, CommandContext context) throws ArgumentParseException { if (args.hasNext()) { Object start = args.getState(); try { this.element.parse(source, args, context); } catch (ArgumentParseException ex) { if (!this.considerInvalidFormatEmpty && !args.hasNext()) { throw ex; } args.setState(start); } } if (this.element.getKey() != null && this.value != null) { context.putArg(this.element.getUntranslatedKey(), this.value); } }

Target:
public void parse(CommandSource source, CommandArgs args, CommandContext context) throws ArgumentParseException { if (!args.hasNext()) { Text key = this.element.getKey(); if (key != null && this.value != null) { context.putArg(key.toPlain(), this.value); } return; } Object startState = args.getState(); try { this.element.parse(source, args, context); } catch (ArgumentParseException ex) { if (this.considerInvalidFormatEmpty || args.hasNext()) { args.setState(startState); if (this.element.getKey() != null && this.value != null) { context.putArg(this.element.getUntranslatedKey(), this.value); } } else { throw ex; } } }
Source:
private void copyInputStreamToFile(InputStream in, File file) throws IOException { OutputStream out = new FileOutputStream(file); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } out.close(); in.close(); }

Target:
private void copyInputStreamToFile(InputStream in, File file) throws IOException { OutputStream out = new FileOutputStream(file); IOUtils.copy(in, out); }
Source:
private void handleCommandAsNonCoordinator(final CommandContext ctx) { log.info("Received SYNC request from coordinator"); boolean update = false; if(ctx.getMessage().getProtocolParameters().containsKey("branch") || ctx.getMessage().getProtocolParameters().containsKey("sha")) { update = true; } if(update) { log.info("Taking site down to run sync update!"); maintFilter.start(); final CoordinatedWorkerListener oldListener = worker.getListener(); worker.setListener(new CoordinatedWorkerListener() { @Override public void workDone(Map<String, String> properties) { log.info("Sync done"); fileServlet.switchContent(ctx.getMessage().getRequestTime()); if(processor != null) { processor.makeLive(); } if(manager != null) { try { manager.logEvent(properties.get("BranchName"), properties.get("CurrentRevision"), "SYNC".equals(properties.get("comment")) ? "AUTO" : properties.get("openId"), configProperties.getProperty("com.meltmedia.cadmium.lastUpdated"), properties.get("uuid"), properties.get("comment"), !new Boolean(properties.get("nonRevertible")), true); } catch(Exception e){ log.warn("Failed to update log", e); } } maintFilter.stop(); worker.setListener(oldListener); } @Override public void workFailed(String branch, String sha, String openId, String uuid) { log.info("Sync failed"); worker.setListener(oldListener); } }); ctx.getMessage().getProtocolParameters().put("comment", "SYNC"); this.worker.beginPullUpdates(ctx.getMessage().getProtocolParameters()); } }

Target:
private void handleCommandAsNonCoordinator(final CommandContext ctx) { log.info("Received SYNC request from coordinator"); boolean update = false; if(ctx.getMessage().getProtocolParameters().containsKey("branch") || ctx.getMessage().getProtocolParameters().containsKey("sha")) { update = true; } if(update) { log.info("Taking site down to run sync update!"); maintFilter.start(); final CoordinatedWorkerListener oldListener = worker.getListener(); worker.setListener(new CoordinatedWorkerListener() { @Override public void workDone(Map<String, String> properties) { log.info("Sync done"); fileServlet.switchContent(ctx.getMessage().getRequestTime()); if(processor != null) { processor.makeLive(); } if(manager != null) { try { String branch = properties.get("BranchName"); String rev = properties.get("CurrentRevision"); String lastUpdated = configProperties.getProperty("com.meltmedia.cadmium.lastUpdated"); String uuid = properties.get("uuid"); String comment = properties.get("comment"); boolean revertible = !new Boolean(properties.get("nonRevertible")); manager.logEvent(branch, rev, "AUTO", lastUpdated, uuid, comment, revertible, true); } catch(Exception e){ log.warn("Failed to update log", e); } } maintFilter.stop(); worker.setListener(oldListener); } @Override public void workFailed(String branch, String sha, String openId, String uuid) { log.info("Sync failed"); worker.setListener(oldListener); } }); ctx.getMessage().getProtocolParameters().put("comment", "SYNC"); this.worker.beginPullUpdates(ctx.getMessage().getProtocolParameters()); } }
Source:
void writeData(String messageToBeSent) { try { OutputStream outputStream = clientSocket.getOutputStream(); ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); objectOutputStream.writeObject(messageToBeSent); outputStream.flush(); getLog().info("Artifact data and test cases data send to the synapse agent successfully"); } catch (Exception e) { getLog().error("Error while sending deployable data to the synapse agent ", e); } }

Target:
void writeData(String messageToBeSent) { try { outputStream = clientSocket.getOutputStream(); ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); objectOutputStream.writeObject(messageToBeSent); outputStream.flush(); getLog().info("Artifact data and test cases data send to the synapse agent successfully"); } catch (IOException e) { getLog().error("Error while sending deployable data to the synapse agent ", e); } }
Source:
public void testCoinbaseHeightTestnet() throws Exception { byte[] blockAsBytes = CoinbaseBlockTest.getBytes(getClass().getResourceAsStream("block_testnet21066.dat")); Block block = params.getDefaultSerializer().makeBlock(blockAsBytes); assertNotNull(block); block.verify(21066, EnumSet.of(Block.VerifyFlag.HEIGHT_IN_COINBASE)); }

Target:
public void testCoinbaseHeightTestnet() throws Exception { Block block = TestNet3Params.get().getDefaultSerializer().makeBlock( ByteStreams.toByteArray(getClass().getResourceAsStream("block_testnet21066.dat"))); assertEquals("0000000004053156021d8e42459d284220a7f6e087bf78f30179c3703ca4eefa", block.getHashAsString()); block.verify(21066, EnumSet.of(Block.VerifyFlag.HEIGHT_IN_COINBASE)); block = TestNet3Params.get().getDefaultSerializer().makeBlock( ByteStreams.toByteArray(getClass().getResourceAsStream("block_testnet32768.dat"))); assertEquals("000000007590ba495b58338a5806c2b6f10af921a70dbd814e0da3c6957c0c03", block.getHashAsString()); block.verify(32768, EnumSet.of(Block.VerifyFlag.HEIGHT_IN_COINBASE)); }
Source:
public List<Map<String, Object>> getAllAvailablePortletInfoList() throws SystemException, LanguageException, DotRuntimeException, PortalException { PortletAPI portletAPI = APILocator.getPortletAPI(); UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); List<Map<String, Object>> listOfPortletsInfo = new ArrayList<Map<String,Object>>(); Collection<Portlet> portlets = portletAPI.findAllPortlets(); for(Portlet p: portlets) { if(portletAPI.canAddPortletToLayout(p)) { Map<String, Object> portletMap = new HashMap<String, Object>(); String portletTitle = LanguageUtil.get(uWebAPI.getLoggedInUser(request),"com.dotcms.repackage.javax.portlet.title." + p.getPortletId()); portletMap.put("title", portletTitle); portletMap.put("id", p.getPortletId()); listOfPortletsInfo.add(portletMap); } } Collections.sort(listOfPortletsInfo, new Comparator<Map<String, Object>>() { public int compare(Map<String, Object> o1, Map<String, Object> o2) { return ((String)o1.get("title")).compareTo(((String)o2.get("title"))); } }); return listOfPortletsInfo; }

Target:
public List<Map<String, Object>> getAllAvailablePortletInfoList() throws SystemException, LanguageException, DotRuntimeException, PortalException { PortletAPI portletAPI = APILocator.getPortletAPI(); UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); List<Map<String, Object>> listOfPortletsInfo = new ArrayList<Map<String,Object>>(); final Collection<Portlet> portlets = portletAPI.findAllPortlets(); for(final Portlet portlet: portlets) { if(portletAPI.canAddPortletToLayout(portlet)) { Map<String, Object> portletMap = new HashMap<String, Object>(); String portletTitle = LanguageUtil.get(uWebAPI.getLoggedInUser(request),"com.dotcms.repackage.javax.portlet.title." + portlet.getPortletId()); portletMap.put("title", portletTitle); portletMap.put("id", portlet.getPortletId()); listOfPortletsInfo.add(portletMap); } } Collections.sort(listOfPortletsInfo, new Comparator<Map<String, Object>>() { public int compare(Map<String, Object> o1, Map<String, Object> o2) { return ((String)o1.get("title")).compareTo(((String)o2.get("title"))); } }); return listOfPortletsInfo; }
Source:
public ValueHolder<V> get(final K key) throws StoreAccessException { Chain chain = storeProxy.get(key.hashCode()); Map.Entry<Operation<K>, Chain> entry = resolver.resolve(chain, key); Chain compactedChain = entry.getValue(); storeProxy.replaceAtHead(key.hashCode(), chain, compactedChain); Operation<K> resolvedOperation = entry.getKey(); V value = null; if(resolvedOperation != null && resolvedOperation instanceof KeyValueOperation) { value = ((KeyValueOperation<K, V>)resolvedOperation).getValue(); } return new ClusteredValueHolder<V>(value); }

Target:
public ValueHolder<V> get(final K key) throws StoreAccessException { Chain chain = storeProxy.get(key.hashCode()); ResolvedChain<K> resolvedChain = resolver.resolve(chain, key); Chain compactedChain = resolvedChain.getCompactedChain(); storeProxy.replaceAtHead(key.hashCode(), chain, compactedChain); Operation<K> resolvedOperation = resolvedChain.getResolvedOperation(key); V value = null; if(resolvedOperation != null && resolvedOperation instanceof KeyValueOperation) { value = ((KeyValueOperation<K, V>)resolvedOperation).getValue(); } return new ClusteredValueHolder<V>(value); }
Source:
public String getBorderStyle() { JavascriptExecutor js = (JavascriptExecutor)driver; WebElement selectedComponent = component.get(0); wait.forElementVisible(selectedComponent); selectedComponent.click(); String script = "return window.getComputedStyle(" + "document.querySelector('.active'),':before').getPropertyValue('Border')"; return js.executeScript(script).toString(); }

Target:
public String getBorderStyle() { JavascriptExecutor js = (JavascriptExecutor)driver; WebElement selectedComponent = component.get(0); wait.forElementClickable(selectedComponent); selectedComponent.click(); String script = "return window.getComputedStyle(" + "document.querySelector('.active'),':before').getPropertyValue('Border')"; return js.executeScript(script).toString(); }
Source:
protected void apply(RelOptRuleCall call, Project project, TableScan scan) { final RelOptTable table = scan.getTable(); assert table.unwrap(ProjectableFilterableTable.class) != null; final List<Integer> selectedColumns = new ArrayList<>(); project.getProjects().forEach(proj -> { proj.accept(new RexVisitorImpl<Void>(true) { public Void visitInputRef(RexInputRef inputRef) { if (!selectedColumns.contains(inputRef.getIndex())) { selectedColumns.add(inputRef.getIndex()); } return null; } }); }); final List<RexNode> filtersPushDown; final List<Integer> projectsPushDown; if (scan instanceof Bindables.BindableTableScan) { final Bindables.BindableTableScan bindableScan = (Bindables.BindableTableScan) scan; filtersPushDown = bindableScan.filters; projectsPushDown = selectedColumns.stream() .map(col -> bindableScan.projects.get(col)).collect(Collectors.toList()); } else { filtersPushDown = ImmutableList.of(); projectsPushDown = selectedColumns; } Bindables.BindableTableScan newScan = Bindables.BindableTableScan.create( scan.getCluster(), scan.getTable(), filtersPushDown, projectsPushDown); final List<RexNode> newProjectRexNodes = new RexShuttle() { @Override public RexNode visitInputRef(RexInputRef inputRef) { int newIdx = selectedColumns.indexOf(inputRef.getIndex()); assert newIdx != -1; return new RexInputRef(newIdx, inputRef.getType()); } }.apply(project.getProjects()); if (RexUtil.isIdentity(newProjectRexNodes, newScan.getRowType())) { call.transformTo(newScan); } else { call.transformTo( call.builder().push(newScan).project(newProjectRexNodes).build()); } }

Target:
protected void apply(RelOptRuleCall call, Project project, TableScan scan) { final RelOptTable table = scan.getTable(); assert table.unwrap(ProjectableFilterableTable.class) != null; final List<Integer> selectedColumns = new ArrayList<>(); project.getProjects().forEach(proj -> { proj.accept(new RexVisitorImpl<Void>(true) { public Void visitInputRef(RexInputRef inputRef) { if (!selectedColumns.contains(inputRef.getIndex())) { selectedColumns.add(inputRef.getIndex()); } return null; } }); }); final List<RexNode> filtersPushDown; final List<Integer> projectsPushDown; if (scan instanceof Bindables.BindableTableScan) { final Bindables.BindableTableScan bindableScan = (Bindables.BindableTableScan) scan; filtersPushDown = bindableScan.filters; projectsPushDown = selectedColumns.stream() .map(col -> bindableScan.projects.get(col)) .collect(Collectors.toList()); } else { filtersPushDown = ImmutableList.of(); projectsPushDown = selectedColumns; } Bindables.BindableTableScan newScan = Bindables.BindableTableScan.create( scan.getCluster(), scan.getTable(), filtersPushDown, projectsPushDown); Mapping mapping = Mappings.target(selectedColumns, scan.getRowType().getFieldCount()); final List<RexNode> newProjectRexNodes = ImmutableList.copyOf(RexUtil.apply(mapping, project.getProjects())); if (RexUtil.isIdentity(newProjectRexNodes, newScan.getRowType())) { call.transformTo(newScan); } else { call.transformTo( call.builder() .push(newScan) .project(newProjectRexNodes) .build()); } }
Source:
public static List<String> sanitizeColumnName(List<String> columnNames) throws DDFException { Preconditions.checkArgument(columnNames.size() > 0); List<String> ret = new ArrayList<>(); for (String name : columnNames) { Preconditions.checkArgument(name.length() > 0); String dashName = name.trim().replaceAll("![0-9a-zA-Z]|\\s", "_"); int i; for (i = 0; i < dashName.length(); ++i) { char c = name.charAt(i); boolean isAlpha = ((c >= 'a' && c <= 'z') || (c >= 'A' && c <='Z')); if (isAlpha) { ret.add(dashName.substring(i)); break; } } if (i == dashName.length()) { throw new DDFException(String.format("Not valid column name: %s", name)); } } HashSet<String> nameSet = new HashSet<>(); for (int i = 0; i < ret.size(); ++i) { String validName = ret.get(i); String attemptName = new String(validName); int j = 0; while (true) { if (!nameSet.contains(attemptName)) { nameSet.add(attemptName); ret.set(i, attemptName); break; } else { attemptName = String.format("%s%s%s", validName, "_", String.valueOf(j)); ++j; } } } return ret; }

Target:
public static List<String> sanitizeColumnName(List<String> columnNames) throws DDFException { Preconditions.checkArgument(columnNames.size() > 0); List<String> ret = new ArrayList<>(); for (String name : columnNames) { Preconditions.checkArgument(name.length() > 0); String dashName = name.trim().replaceAll("![0-9a-zA-Z]|\\s", "_"); int i; for (i = 0; i < dashName.length(); ++i) { char c = name.charAt(i); boolean isAlpha = ((c >= 'a' && c <= 'z') || (c >= 'A' && c <='Z')); if (isAlpha) { ret.add(dashName.substring(i)); break; } } if (i == dashName.length()) { throw new DDFException(String.format("Not valid column name: %s", name)); } } HashSet<String> nameSet = new HashSet<>(); for (int i = 0; i < ret.size(); ++i) { String validName = ret.get(i); String attemptName = new String(validName); int j = 0; while (true) { if (!nameSet.contains(attemptName.toLowerCase())) { nameSet.add(attemptName.toLowerCase()); ret.set(i, attemptName); break; } else { attemptName = String.format("%s%s%s", validName, "_", String.valueOf(j)); ++j; } } } return ret; }
Source:
public void testOutputSourceMapContainsSourcesContent() { String inputString = "[{\"src\": \"\", \"path\": \"base.js\"}," + "{\"src\": \"alert('foo');\", \"path\":\"foo.js\"}]"; args.add("--json_streams=BOTH"); args.add("--chunk=m1:1"); args.add("--chunk=m2:1:m1"); args.add("--source_map_include_content"); CommandLineRunner runner = new CommandLineRunner( args.toArray(new String[] {}), new ByteArrayInputStream(inputString.getBytes(UTF_8)), new PrintStream(outReader), new PrintStream(errReader)); lastCompiler = runner.getCompiler(); try { runner.doRun(); } catch (IOException e) { e.printStackTrace(); assertWithMessage("Unexpected exception " + e).fail(); } String output = new String(outReader.toByteArray(), UTF_8); assertThat(output).contains("\\\"sourcesContent\\\":"); }

Target:
public void testOutputSourceMapContainsSourcesContent() { String inputString = "[{\"src\": \"\", \"path\": \"base.js\"}," + "{\"src\": \"alert('foo');\", \"path\":\"foo.js\"}]"; args.add("--json_streams=BOTH"); args.add("--chunk=m1:1"); args.add("--chunk=m2:1:m1"); args.add("--source_map_include_content"); CommandLineRunner runner = new CommandLineRunner( args.toArray(new String[] {}), new ByteArrayInputStream(inputString.getBytes(UTF_8)), new PrintStream(outReader), new PrintStream(errReader)); lastCompiler = runner.getCompiler(); try { runner.doRun(); } catch (IOException e) { e.printStackTrace(); assertWithMessage("Unexpected exception " + e).fail(); } String output = new String(outReader.toByteArray(), UTF_8); assertThat(output) .isEqualTo( "[{\"src\":\"\\n\",\"path\":\"./m1.js\",\"source_map\":\"{\\n\\\"version\\\":3," + "\\n\\\"file\\\":\\\"./m1.js\\\",\\n\\\"lineCount\\\":1,\\n\\\"mappings\\\":\\\";\\\"" + ",\\n\\\"sources\\\":[],\\n\\\"names\\\":[]\\n}\\n\"},{\"src\":\"alert(\\\"foo\\\");" + "\\n\",\"path\":\"./m2.js\",\"source_map\":\"{\\n\\\"version\\\":3,\\n\\\"file\\\":" + "\\\"./m2.js\\\",\\n\\\"lineCount\\\":1,\\n\\\"mappings\\\":\\\"AAAAA,KAAA,CAAM,KAAN;" + "\\\",\\n\\\"sources\\\":[\\\"foo.js\\\"],\\n\\\"sourcesContent\\\":[\\\"" + "alert('foo');\\\"],\\n\\\"names\\\":[\\\"alert\\\"]\\n}\\n\"}," + "{\"src\":\"\\n\",\"path\":\"./$weak$.js\",\"source_map\":\"{\\n\\\"version\\\":3,\\n" + "\\\"file\\\":\\\"./$weak$.js\\\",\\n\\\"lineCount\\\":1,\\n\\\"mappings\\\":\\\";" + "\\\",\\n\\\"sources\\\":[],\\n\\\"names\\\":[]\\n}\\n\"}]"); }
Source:
public void shouldThrowExcepionBecauseObservableEmittedUnexpectedItemAfterExpectedSequence() { final Queue<String> expectedValues = new LinkedList<String>(); expectedValues.add("1"); expectedValues.add("2"); expectedValues.add("3"); final PublishSubject<String> publishSubject = PublishSubject.create(); final AbstractEmissionChecker<String> emissionChecker = new AbstractEmissionChecker<String>(expectedValues) { @NonNull @Override public Subscription subscribe() { return publishSubject .subscribe(new Action1<String>() { @Override public void call(String s) { onNextObtained(s); } }); } }; final Subscription subscription = emissionChecker.subscribe(); publishSubject.onNext("1"); publishSubject.onNext("2"); publishSubject.onNext("3"); emissionChecker.awaitNextExpectedValue(); emissionChecker.awaitNextExpectedValue(); emissionChecker.awaitNextExpectedValue(); emissionChecker.assertThatNoExpectedValuesLeft(); try { publishSubject.onNext("4"); failBecauseExceptionWasNotThrown(OnErrorNotImplementedException.class); } catch (OnErrorNotImplementedException expected) { assertThat(expected.getCause()) .hasMessageStartingWith("Received emission, but no more emissions were expected: obtained "); } finally { subscription.unsubscribe(); } }

Target:
public void shouldThrowExcepionBecauseObservableEmittedUnexpectedItemAfterExpectedSequence() { final Queue<String> expectedValues = new LinkedList<String>(); expectedValues.add("1"); expectedValues.add("2"); expectedValues.add("3"); final PublishSubject<String> publishSubject = PublishSubject.create(); final AbstractEmissionChecker<String> emissionChecker = new AbstractEmissionChecker<String>(expectedValues) { @NonNull @Override public Subscription subscribe() { return publishSubject .subscribe(new Action1<String>() { @Override public void call(String s) { onNextObtained(s); } }); } }; final Subscription subscription = emissionChecker.subscribe(); publishSubject.onNext("1"); publishSubject.onNext("2"); publishSubject.onNext("3"); emissionChecker.awaitNextExpectedValue(); emissionChecker.awaitNextExpectedValue(); emissionChecker.awaitNextExpectedValue(); emissionChecker.assertThatNoExpectedValuesLeft(); try { publishSubject.onNext("4"); failBecauseExceptionWasNotThrown(OnErrorNotImplementedException.class); } catch (OnErrorNotImplementedException expected) { assertThat(expected.getCause()) .hasMessage("Received emission, but no more emissions were expected: obtained 4, expectedValues = [], obtainedValues = []"); } finally { subscription.unsubscribe(); } }
Source:
private Edge savePreparedEdge(final EdgeBuilderBase edgeBuilder, final String outVertexId, final String inVertexId, Long timestamp, Authorizations authorizations) { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); for (int i = 0; i < 10; i++) { IncreasingTime.currentTimeMillis(); } } long incrementingTimestamp = timestamp; InMemoryTableElement edgeTableElement = this.edges.getTableElement(edgeBuilder.getEdgeId()); boolean isNew = false; if (edgeTableElement == null) { isNew = true; edges.append( edgeBuilder.getEdgeId(), new AlterVisibilityMutation(incrementingTimestamp++, edgeBuilder.getVisibility()), new ElementTimestampMutation(incrementingTimestamp++), new AlterEdgeLabelMutation(incrementingTimestamp++, edgeBuilder.getLabel()), new EdgeSetupMutation(incrementingTimestamp++, outVertexId, inVertexId) ); } else { edges.append(edgeBuilder.getEdgeId(), new ElementTimestampMutation(incrementingTimestamp++)); } if (edgeBuilder.getNewEdgeLabel() != null) { edges.append(edgeBuilder.getEdgeId(), new AlterEdgeLabelMutation(incrementingTimestamp, edgeBuilder.getNewEdgeLabel())); } InMemoryEdge edge = this.edges.get(InMemoryGraph.this, edgeBuilder.getEdgeId(), authorizations); if (isNew && hasEventListeners()) { fireGraphEvent(new AddEdgeEvent(InMemoryGraph.this, edge)); } edge.updatePropertiesInternal(edgeBuilder); if (edgeBuilder.getIndexHint() != IndexHint.DO_NOT_INDEX) { getSearchIndex().addElement(InMemoryGraph.this, edge, authorizations); } return edge; }

Target:
private Edge savePreparedEdge(final EdgeBuilderBase edgeBuilder, final String outVertexId, final String inVertexId, Long timestamp, Authorizations authorizations) { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); IncreasingTime.advanceTime(10); } long incrementingTimestamp = timestamp; InMemoryTableElement edgeTableElement = this.edges.getTableElement(edgeBuilder.getEdgeId()); boolean isNew = false; if (edgeTableElement == null) { isNew = true; edges.append( edgeBuilder.getEdgeId(), new AlterVisibilityMutation(incrementingTimestamp++, edgeBuilder.getVisibility()), new ElementTimestampMutation(incrementingTimestamp++), new AlterEdgeLabelMutation(incrementingTimestamp++, edgeBuilder.getLabel()), new EdgeSetupMutation(incrementingTimestamp++, outVertexId, inVertexId) ); } else { edges.append(edgeBuilder.getEdgeId(), new ElementTimestampMutation(incrementingTimestamp++)); } if (edgeBuilder.getNewEdgeLabel() != null) { edges.append(edgeBuilder.getEdgeId(), new AlterEdgeLabelMutation(incrementingTimestamp, edgeBuilder.getNewEdgeLabel())); } InMemoryEdge edge = this.edges.get(InMemoryGraph.this, edgeBuilder.getEdgeId(), authorizations); if (isNew && hasEventListeners()) { fireGraphEvent(new AddEdgeEvent(InMemoryGraph.this, edge)); } edge.updatePropertiesInternal(edgeBuilder); if (edgeBuilder.getIndexHint() != IndexHint.DO_NOT_INDEX) { getSearchIndex().addElement(InMemoryGraph.this, edge, authorizations); } return edge; }
Source:
private void verifyDirectories(URIish u) { if (directory == null && gitDir == null) { directory = new File(u.getHumanishName() + (bare ? Constants.DOT_GIT : "")); } directoryExistsInitially = directory != null && directory.exists(); gitDirExistsInitially = gitDir != null && gitDir.exists(); validateDirs(directory, gitDir, bare); if (isNonEmptyDirectory(directory)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } if (isNonEmptyDirectory(gitDir)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, gitDir.getName())); } }

Target:
void verifyDirectories(URIish u) { if (directory == null && gitDir == null) { directory = new File(u.getHumanishName() + (bare ? Constants.DOT_GIT : "")); } directoryExistsInitially = directory != null && directory.exists(); gitDirExistsInitially = gitDir != null && gitDir.exists(); validateDirs(directory, gitDir, bare); if (isNonEmptyDirectory(directory)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, directory.getName())); } if (isNonEmptyDirectory(gitDir)) { throw new JGitInternalException(MessageFormat.format( JGitText.get().cloneNonEmptyDirectory, gitDir.getName())); } }
Source:
public GitHubSCMSource() { pullRequestMetadataCache = new ConcurrentHashMap<>(); pullRequestContributorCache = new ConcurrentHashMap<>(); this.traits = new ArrayList<>(); this.repoOwner = ""; this.repository = ""; this.repositoryUrl = null; this.apiUri = GITHUB_URL; }

Target:
public GitHubSCMSource() { pullRequestMetadataCache = new ConcurrentHashMap<>(); pullRequestContributorCache = new ConcurrentHashMap<>(); traits = new ArrayList<>(); repoOwner = ""; repository = ""; repositoryUrl = null; apiUri = GITHUB_URL; }
Source:
private void verifyActionResult(int[][] expectedLogs, String... params) { AdminActivityLogPageAction action = getAction(params); ShowPageResult result = getShowPageResult(action); AdminActivityLogPageData page = (AdminActivityLogPageData) result.data; List<ActivityLogEntry> actualLogs = page.getLogs(); verifyLogs(expectedLogs, actualLogs); }

Target:
private void verifyActionResult(int[][] expectedLogs, String... params) { AdminActivityLogPageAction action = getAction(params); ShowPageResult result = getShowPageResult(action); AdminActivityLogPageData pageData = (AdminActivityLogPageData) result.data; List<ActivityLogEntry> actualLogs = pageData.getLogs(); verifyLogs(expectedLogs, actualLogs); }
Source:
public void init(final Context context) { final ImmutableSet.Builder<IncrementalResultExporter> exportersBuilder = ImmutableSet.builder(); for(final IncrementalResultExporterFactory builder : factories) { try { System.out.println("QueryResultObserver.init(): for each exportersBuilder=" + builder); final Optional<IncrementalResultExporter> exporter = builder.build(context); if(exporter.isPresent()) { exportersBuilder.add(exporter.get()); } } catch (final IncrementalExporterFactoryException e) { log.error("Could not initialize a result exporter.", e); } } exporters = exportersBuilder.build(); }

Target:
public void init(final Context context) { final ImmutableSet.Builder<IncrementalResultExporter> exportersBuilder = ImmutableSet.builder(); for(final IncrementalResultExporterFactory builder : factories) { try { log.debug("QueryResultObserver.init(): for each exportersBuilder=" + builder); final Optional<IncrementalResultExporter> exporter = builder.build(context); if(exporter.isPresent()) { exportersBuilder.add(exporter.get()); } } catch (final IncrementalExporterFactoryException e) { log.error("Could not initialize a result exporter.", e); } } exporters = exportersBuilder.build(); }
Source:
public FeedbackSessionResultsBundle (FeedbackSessionAttributes feedbackSession, List<FeedbackResponseAttributes> responses, Map<String, FeedbackQuestionAttributes> questions, Map<String, String> emailNameTable, Map<String, String> emailLastNameTable, Map<String, String> emailTeamNameTable, Map<String, boolean[]> visibilityTable, FeedbackSessionResponseStatus responseStatus, CourseRoster roster, Map<String, List<FeedbackResponseCommentAttributes>> responseComments, boolean isComplete) { this.feedbackSession = feedbackSession; this.questions = questions; this.responses = responses; this.emailNameTable = emailNameTable; this.emailLastNameTable = emailLastNameTable; this.emailTeamNameTable = emailTeamNameTable; this.visibilityTable = visibilityTable; this.responseStatus = responseStatus; this.roster = roster; this.responseComments = responseComments; this.actualResponses = new ArrayList<FeedbackResponseAttributes>(); for (FeedbackResponseAttributes response : responses) { if (questions.get(response.feedbackQuestionId).giverType == FeedbackParticipantType.TEAMS){ response.giverEmail += Const.TEAM_OF_EMAIL_OWNER; } FeedbackResponseAttributes fraCopy = new FeedbackResponseAttributes(response); actualResponses.add(fraCopy); } this.isComplete = isComplete; hideResponsesGiverRecipient(responses, questions, emailNameTable, emailTeamNameTable, visibilityTable); this.rosterTeamNameEmailTable = getTeamNameToStudentsTableFromRoster(roster); this.rosterSectionTeamNameTable = getSectionToTeamNamesFromRoster(roster); }

Target:
public FeedbackSessionResultsBundle (FeedbackSessionAttributes feedbackSession, List<FeedbackResponseAttributes> responses, Map<String, FeedbackQuestionAttributes> questions, Map<String, String> emailNameTable, Map<String, String> emailLastNameTable, Map<String, String> emailTeamNameTable, Map<String, boolean[]> visibilityTable, FeedbackSessionResponseStatus responseStatus, CourseRoster roster, Map<String, List<FeedbackResponseCommentAttributes>> responseComments, boolean isComplete) { this.feedbackSession = feedbackSession; this.questions = questions; this.responses = responses; this.emailNameTable = emailNameTable; this.emailLastNameTable = emailLastNameTable; this.emailTeamNameTable = emailTeamNameTable; this.visibilityTable = visibilityTable; this.responseStatus = responseStatus; this.roster = roster; this.responseComments = responseComments; this.actualResponses = new ArrayList<FeedbackResponseAttributes>(); for (FeedbackResponseAttributes response : responses) { if (questions.get(response.feedbackQuestionId).giverType == FeedbackParticipantType.TEAMS){ response.giverEmail += Const.TEAM_OF_EMAIL_OWNER; } FeedbackResponseAttributes fraCopy = new FeedbackResponseAttributes(response); actualResponses.add(fraCopy); } this.isComplete = isComplete; hideResponsesGiverRecipient(); this.rosterTeamNameMembersTable = getTeamNameToEmailsTableFromRoster(roster); this.rosterSectionTeamNameTable = getSectionToTeamNamesFromRoster(roster); }
Source:
private void restoreCollectionPreferences() { try { mShowNextReviewTime = getCol().getConf().getBoolean("estTimes"); mShowRemainingCardCount = getCol().getConf().getBoolean("dueCounts"); } catch (JSONException e) { throw new RuntimeException(); } catch (NullPointerException npe) { Intent deckPicker = new IntentTop(this, DeckPicker.class); deckPicker.putExtra("collectionLoadError", true); deckPicker.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivityWithAnimation(deckPicker, ActivityTransitionAnimation.LEFT); } }

Target:
private void restoreCollectionPreferences() { try { mShowNextReviewTime = getCol().getConf().getBoolean("estTimes"); mShowRemainingCardCount = getCol().getConf().getBoolean("dueCounts"); } catch (JSONException e) { throw new RuntimeException(); } catch (NullPointerException npe) { Intent deckPicker = new IntentTopNewTask(this, DeckPicker.class); deckPicker.putExtra("collectionLoadError", true); startActivityWithAnimation(deckPicker, ActivityTransitionAnimation.LEFT); } }
Source:
public void initialize(TransformContext context) throws Exception { super.initialize(context); outSchema = config.getOutputSchema(); validateXpathAndSchema(); mapErrorProcessing.put("Ignore error and continue", 1); mapErrorProcessing.put("Exit on error", 2); mapErrorProcessing.put("Write to error dataset", 3); }

Target:
public void initialize(TransformContext context) throws Exception { super.initialize(context); outSchema = config.getOutputSchema(); xPathMapping = getXPathMapping(); }
Source:
public void close() throws IOException { baseMap.clear(); byteCountingLRUMap.clear(); }

Target:
public void close() throws IOException { baseMap.clear(); byteCountingLRUMap.clear(); namespaceId.clear(); }
Source:
protected String getJVMArguments() { String args = super.getJVMArguments(); String typeUserGlobalJVMArgs = getJobProps().getString("jobtype.global.jvm.args", null); if (typeUserGlobalJVMArgs != null) { args += " " + typeUserGlobalJVMArgs; } String typeSysGlobalJVMArgs = getSysProps().getString("jobtype.global.jvm.args", null); if (typeSysGlobalJVMArgs != null) { args += " " + typeSysGlobalJVMArgs; } String typeUserJVMArgs = getJobProps().getString("jobtype.jvm.args", null); if (typeUserJVMArgs != null) { args += " " + typeUserJVMArgs; } String typeSysJVMArgs = getSysProps().getString("jobtype.jvm.args", null); if (typeSysJVMArgs != null) { args += " " + typeSysJVMArgs; } String typeUserJVMArgs2 = getJobProps().getString("jvm.args", null); if (typeUserJVMArgs != null) { args += " " + typeUserJVMArgs2; } String typeSysJVMArgs2 = getSysProps().getString("jvm.args", null); if (typeSysJVMArgs != null) { args += " " + typeSysJVMArgs2; } if (shouldProxy) { info("Setting up secure proxy info for child process"); String secure; secure = " -D" + HadoopSecurityManager.USER_TO_PROXY + "=" + getJobProps().getString(HadoopSecurityManager.USER_TO_PROXY); String extraToken = getSysProps().getString(HadoopSecurityManager.OBTAIN_BINARY_TOKEN, "false"); if (extraToken != null) { secure += " -D" + HadoopSecurityManager.OBTAIN_BINARY_TOKEN + "=" + extraToken; } info("Secure settings = " + secure); args += secure; } else { info("Not setting up secure proxy info for child process"); } return args; }

Target:
protected String getJVMArguments() { String args = super.getJVMArguments(); String typeUserGlobalJVMArgs = getJobProps().getString(HadoopJobUtils.JOBTYPE_GLOBAL_JVM_ARGS, null); if (typeUserGlobalJVMArgs != null) { args += " " + typeUserGlobalJVMArgs; } String typeSysGlobalJVMArgs = getSysProps().getString(HadoopJobUtils.JOBTYPE_GLOBAL_JVM_ARGS, null); if (typeSysGlobalJVMArgs != null) { args += " " + typeSysGlobalJVMArgs; } String typeUserJVMArgs = getJobProps().getString(HadoopJobUtils.JOBTYPE_JVM_ARGS, null); if (typeUserJVMArgs != null) { args += " " + typeUserJVMArgs; } String typeSysJVMArgs = getSysProps().getString(HadoopJobUtils.JOBTYPE_JVM_ARGS, null); if (typeSysJVMArgs != null) { args += " " + typeSysJVMArgs; } String typeUserJVMArgs2 = getJobProps().getString(HadoopJobUtils.JVM_ARGS, null); if (typeUserJVMArgs != null) { args += " " + typeUserJVMArgs2; } String typeSysJVMArgs2 = getSysProps().getString(HadoopJobUtils.JVM_ARGS, null); if (typeSysJVMArgs != null) { args += " " + typeSysJVMArgs2; } if (shouldProxy) { info("Setting up secure proxy info for child process"); String secure; secure = " -D" + HadoopSecurityManager.USER_TO_PROXY + "=" + getJobProps().getString(HadoopSecurityManager.USER_TO_PROXY); String extraToken = getSysProps().getString(HadoopSecurityManager.OBTAIN_BINARY_TOKEN, "false"); if (extraToken != null) { secure += " -D" + HadoopSecurityManager.OBTAIN_BINARY_TOKEN + "=" + extraToken; } info("Secure settings = " + secure); args += secure; } else { info("Not setting up secure proxy info for child process"); } return args; }
Source:
public void testPhiroIfBrickDelete() { onScriptList().atPosition(brickPosition).onChildView(withText(R.string.brick_phiro_sensor_begin)).perform(click()); onView(withText(R.string.brick_context_dialog_delete_brick)) .perform(click()); onView(withText(R.string.yes)) .perform(click()); onView(withId(R.string.brick_phiro_sensor_begin)).check(doesNotExist()); onView(withId(R.string.brick_if_else)).check(doesNotExist()); onView(withId(R.string.brick_if_end)).check(doesNotExist()); }

Target:
public void testPhiroIfBrickDelete() { Script currentScript = ProjectManager.getInstance().getCurrentScript(); Assert.assertEquals(currentScript.getBrickList().size(), 3); Assert.assertEquals(currentScript.containsBrickOfType(PhiroIfLogicBeginBrick.class), true); Assert.assertEquals(currentScript.containsBrickOfType(IfLogicElseBrick.class), true); Assert.assertEquals(currentScript.containsBrickOfType(IfLogicEndBrick.class), true); onScriptList().atPosition(brickPosition).onChildView(withText(R.string.brick_phiro_sensor_begin)) .perform(click()); onView(withText(R.string.brick_context_dialog_delete_brick)) .perform(click()); onView(withText(R.string.yes)) .perform(click()); currentScript = ProjectManager.getInstance().getCurrentScript(); Assert.assertEquals(currentScript.getBrickList().size(), 0); Assert.assertEquals(currentScript.containsBrickOfType(PhiroIfLogicBeginBrick.class), false); Assert.assertEquals(currentScript.containsBrickOfType(IfLogicElseBrick.class), false); Assert.assertEquals(currentScript.containsBrickOfType(IfLogicEndBrick.class), false); }
Source:
public static boolean matches(String arg) { if (arg.startsWith("bigdoor@")) { return true; } return valueOf(arg) != null; }

Target:
public static boolean matches(String arg) { if (arg.startsWith("bigdoor@")) { return true; } return valueOf(arg, CoreUtilities.noDebugContext) != null; }
Source:
public void filter(ContainerRequestContext context) throws IOException { String path = ui.getPath(); if (path.endsWith("books/checkN")) { URI requestURI = URI.create(path.replace("N", "2")); context.setRequestUri(requestURI); String body = IOUtils.readStringFromStream(context.getEntityStream()); if (!"s".equals(body)) { throw new RuntimeException(); } replaceStream(context); } else if (path.endsWith("books/check2")) { replaceStream(context); } else if (path.endsWith("books/checkNQuery")) { URI requestURI = URI.create(path.replace("NQuery", "2")); context.setRequestUri(requestURI); replaceStream(context); } }

Target:
public void filter(ContainerRequestContext context) throws IOException { String path = ui.getPath(); if (path.endsWith("books/checkN")) { URI requestURI = URI.create(path.replace("N", "2")); context.setRequestUri(requestURI); String body = IOUtils.readStringFromStream(context.getEntityStream()); if (!"s".equals(body)) { throw new RuntimeException(); } replaceStream(context); } else if (path.endsWith("books/check2")) { replaceStream(context); } else if (path.endsWith("books/checkNQuery")) { URI requestURI = URI.create(path.replace("NQuery", "2?a=b")); context.setRequestUri(requestURI); replaceStream(context); } }
Source:
public Map<Long, LogData> FetchGarbageEntries(Iterable<Long> addresses) { Map<Long, LogData> result = new HashMap<>(); Iterable<List<Long>> batches = Iterables.partition(addresses, runtime.getParameters().getBulkReadSize()); for (List<Long> batch : batches) { Map<Long, LogData> batchResult = layoutHelper(e -> FetchGarbageEntryBatch(batch, e)); result.putAll(batchResult); } return result; }

Target:
public Map<Long, LogData> FetchGarbageEntries(Iterable<Long> addresses) { Iterable<List<Long>> batches = Iterables.partition(addresses, runtime.getParameters().getBulkReadSize()); return layoutHelper(e -> { Map<Long, LogData> garbageEntries = new TreeMap<>(); for (List<Long> batch : batches) { Map<Long, LogData> batchResult = FetchGarbageEntryBatch(batch, e); garbageEntries.putAll(batchResult); } return garbageEntries; }); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { logger.debug("HEATMISER updated() method is called!"); if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } String localAddress = (String) config.get("address"); if (StringUtils.isNotBlank(localAddress)) { ipAddress = localAddress; } String portConfig = (String) config.get("port"); if (StringUtils.isNotBlank(portConfig)) { ipPort = Integer.parseInt(portConfig); } else { ipPort = 1024; } listen(); setProperlyConfigured(true); } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { logger.debug("HEATMISER updated() method is called!"); if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } String localAddress = (String) config.get("address"); if (StringUtils.isNotBlank(localAddress)) { ipAddress = localAddress; } String portConfig = (String) config.get("port"); if (StringUtils.isNotBlank(portConfig)) { ipPort = Integer.parseInt(portConfig); } else { ipPort = DefaultPort; } listen(); setProperlyConfigured(true); } }
Source:
private void setSupportedResolution(Camera camera) { Camera.Parameters parameters = camera.getParameters(); List<Camera.Size> previewSizes = parameters.getSupportedVideoSizes(); for (Camera.Size size : previewSizes) { if (size.width == VIDEO_WIDTH && size.height == VIDEO_HEIGHT) { mVideoWidth = VIDEO_WIDTH; mVideoHeight = VIDEO_HEIGHT; return; } } mVideoWidth = previewSizes.get(0).width; mVideoHeight = previewSizes.get(0).height; }

Target:
private void setSupportedResolution(Camera camera) { Camera.Parameters parameters = camera.getParameters(); List<Camera.Size> videoSizes = parameters.getSupportedVideoSizes(); for (Camera.Size size : videoSizes) { if (size.width == VIDEO_WIDTH && size.height == VIDEO_HEIGHT) { mVideoWidth = VIDEO_WIDTH; mVideoHeight = VIDEO_HEIGHT; return; } } mVideoWidth = videoSizes.get(0).width; mVideoHeight = videoSizes.get(0).height; }
Source:
public static Optional<FileType> getFileType(String descriptorType) { for (DescriptorLanguage lang : values()) { if ((StringUtils.containsIgnoreCase(descriptorType, lang.toString()))) { return Optional.of(lang.getFileType()); } } return Optional.empty(); }

Target:
public static Optional<FileType> getFileType(String descriptorType) { return Arrays.stream(DescriptorLanguage.values()) .filter(lang -> StringUtils.containsIgnoreCase(descriptorType, lang.toString())).findFirst().map(DescriptorLanguage::getFileType); }
Source:
public Ds3ResponseCode toDs3ResponseCode() { Ds3ResponseCode ds3ResponseCode = new Ds3ResponseCode(code, toDs3ResponseTypes()); return ds3ResponseCode; }

Target:
public Ds3ResponseCode toDs3ResponseCode() { final Ds3ResponseCode ds3ResponseCode = new Ds3ResponseCode(code, toDs3ResponseTypes()); return ds3ResponseCode; }
Source:
public static com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter map(StopwordsTokenFilter obj) { if (obj == null) { return null; } com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter stopwordsTokenFilter = new com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter(); String name = obj.getName(); stopwordsTokenFilter.setName(name); Boolean removeTrailingStopWords = obj.isTrailingStopWordsRemoved(); stopwordsTokenFilter.setRemoveTrailingStopWords(removeTrailingStopWords); Boolean ignoreCase = obj.isCaseIgnored(); stopwordsTokenFilter.setIgnoreCase(ignoreCase); if (obj.getStopwords() != null) { List<String> stopwords = new ArrayList<>(obj.getStopwords()); stopwordsTokenFilter.setStopwords(stopwords); } if (obj.getStopwordsList() != null) { com.azure.search.documents.indexes.implementation.models.StopwordsList stopwordsList = StopwordsListConverter.map(obj.getStopwordsList()); stopwordsTokenFilter.setStopwordsList(stopwordsList); } return stopwordsTokenFilter; }

Target:
public static com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter map(StopwordsTokenFilter obj) { if (obj == null) { return null; } com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter stopwordsTokenFilter = new com.azure.search.documents.indexes.implementation.models.StopwordsTokenFilter(); String name = obj.getName(); stopwordsTokenFilter.setName(name); Boolean removeTrailingStopWords = obj.areTrailingStopWordsRemoved(); stopwordsTokenFilter.setRemoveTrailingStopWords(removeTrailingStopWords); Boolean ignoreCase = obj.isCaseIgnored(); stopwordsTokenFilter.setIgnoreCase(ignoreCase); if (obj.getStopwords() != null) { List<String> stopwords = new ArrayList<>(obj.getStopwords()); stopwordsTokenFilter.setStopwords(stopwords); } if (obj.getStopwordsList() != null) { com.azure.search.documents.indexes.implementation.models.StopwordsList stopwordsList = StopwordsListConverter.map(obj.getStopwordsList()); stopwordsTokenFilter.setStopwordsList(stopwordsList); } return stopwordsTokenFilter; }
Source:
public void processAdminDistribution(EDXLDistribution body, AssertionType assertion) { GenericDBUtils.logInfoServiceProcess(this.getClass()); sendToAdapter(body, assertion, adminUtils, adapterFactory); }

Target:
public void processAdminDistribution(EDXLDistribution body, AssertionType assertion) { logInfoServiceProcess(this.getClass()); sendToAdapter(body, assertion, adminUtils, adapterFactory); }