auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void startListening(final Server server) { if(!checkAndAddServer(server)) { return; } else { if(server.getServerType() == WireProtocol.TCP) { acceptScheduler.execute(new AddToSelector(server, acceptSelector, SelectionKey.OP_ACCEPT)); } else if(server.getServerType() == WireProtocol.UDP) { acceptScheduler.execute(new AddToSelector(server, acceptSelector, SelectionKey.OP_READ)); } acceptSelector.wakeup(); } }

Target:
public void startListening(final Server server) { if(!checkServer(server)) { return; } else { if(server.getServerType() == WireProtocol.TCP) { acceptScheduler.execute(new AddToSelector(server, acceptSelector, SelectionKey.OP_ACCEPT)); } else if(server.getServerType() == WireProtocol.UDP) { acceptScheduler.execute(new AddToSelector(server, acceptSelector, SelectionKey.OP_READ)); } else { throw new UnsupportedOperationException("Unknown Server WireProtocol!"+ server.getServerType()); } acceptSelector.wakeup(); } }
Source:
public void processShow(Element transmission) { Element element = transmission .getFirstChildElement("watchable_link") .getFirstChildElement("watchable"); String showLink = element.getFirstChildElement("show_link").getAttributeValue("href"); String id = showLink.split("/")[5]; Brand brand = extractBrand(element, id); EpisodeProcessingNodeFactory nodeFactory = EpisodeProcessingNodeFactory.create( brand, watchableProcessor ); try { String responseBody = httpClient.get(getShowUri(id) + WATCHABLES_URL_SUFFIX).body(); new Builder(nodeFactory).build(new StringReader(responseBody)); } catch(Exception e) { log.error("Exception parsing episodes for brand " + brand.getTitle(), e); return; } if(FILM.equals(brand.getSpecialization()) && nodeFactory.items.size() == 1) { setFilmDescription((Film) Iterables.getOnlyElement(nodeFactory.items), element); } write(brand); watchableProcessor.getSeriesMap() .values() .forEach(this::write); nodeFactory.items .forEach(item -> write(brand, item)); }

Target:
public void processShow(Element transmission) { Element element = transmission .getFirstChildElement("watchable_link") .getFirstChildElement("watchable"); String showLink = element.getFirstChildElement("show_link").getAttributeValue("href"); String id = showLink.split("/")[5]; Brand brand = extractBrand(element, id); EpisodeProcessingNodeFactory nodeFactory = EpisodeProcessingNodeFactory.create( brand, watchableProcessor ); try { String responseBody = httpClient.get(getShowUri(id) + WATCHABLES_URL_SUFFIX).body(); new nu.xom.Builder(nodeFactory).build(new StringReader(responseBody)); } catch(Exception e) { log.error("Exception parsing episodes for brand {}", brand.getTitle(), e); return; } if(FILM.equals(brand.getSpecialization()) && nodeFactory.items.size() == 1) { setFilmDescription((Film) Iterables.getOnlyElement(nodeFactory.items), element); } write(brand); watchableProcessor.getSeriesMap() .values() .forEach(this::write); nodeFactory.items .forEach(item -> write(brand, item)); }
Source:
public static Pair<Integer, byte[][]> serializeUTFs(String... values) { int totalLength = 0; byte[][] bytes = new byte[values.length][]; for (int idx = 0; idx < values.length; idx++) { bytes[idx] = StringUtils.toUtf8(values[idx]); totalLength += bytes[idx].length; } return Pair.of(totalLength, bytes); }

Target:
public static Pair<Integer, byte[][]> serializeUTFs(String... values) { if (values == null) { return Pair.of(0, EMPTY_BYTES_ARRAY); } int totalLength = 0; byte[][] bytes = new byte[values.length][]; for (int idx = 0; idx < values.length; idx++) { bytes[idx] = StringUtils.toUtf8(values[idx]); if (bytes[idx] == null) { bytes[idx] = EMPTY_BYTES; } else { totalLength += bytes[idx].length; } } return Pair.of(totalLength, bytes); }
Source:
public Optional<DefaultValueBridgeExpectations<URI, ?>> getDefaultValueBridgeExpectations() { return Optional.of( new DefaultValueBridgeExpectations<URI, URI>() { @Override public Class<URI> getProjectionType() { return URI.class; } @Override public Class<URI> getIndexFieldJavaType() { return URI.class; } @Override public List<URI> getEntityPropertyValues() { List<URI> uris = Arrays.asList( URI.create( "<LINK_3>" ), URI.create( "<LINK_1>" ), URI.create( "<LINK_4>" ), URI.create( "<LINK_5>" ), URI.create( "<LINK_5>products" ), URI.create( "<LINK_2>" ), URI.create( "<LINK_0>" ) ); return uris; } @Override public List<URI> getDocumentFieldValues() { return getEntityPropertyValues(); } @Override public Class<?> getTypeWithValueBridge1() { return TypeWithValueBridge1.class; } @Override public Object instantiateTypeWithValueBridge1(int identifier, URI propertyValue) { TypeWithValueBridge1 instance = new TypeWithValueBridge1(); instance.id = identifier; instance.myProperty = propertyValue; return instance; } @Override public Class<?> getTypeWithValueBridge2() { return TypeWithValueBridge2.class; } } ); }

Target:
public Optional<DefaultValueBridgeExpectations<URI, ?>> getDefaultValueBridgeExpectations() { return Optional.of( new DefaultValueBridgeExpectations<URI, String>() { @Override public Class<URI> getProjectionType() { return URI.class; } @Override public Class<String> getIndexFieldJavaType() { return String.class; } @Override public List<URI> getEntityPropertyValues() { return Arrays.stream( STRING_URLS ).map( s -> URI.create( s ) ).collect( Collectors.toList() ); } @Override public List<String> getDocumentFieldValues() { return Arrays.asList( STRING_URLS ); } @Override public Class<?> getTypeWithValueBridge1() { return TypeWithValueBridge1.class; } @Override public Object instantiateTypeWithValueBridge1(int identifier, URI propertyValue) { TypeWithValueBridge1 instance = new TypeWithValueBridge1(); instance.id = identifier; instance.myProperty = propertyValue; return instance; } @Override public Class<?> getTypeWithValueBridge2() { return TypeWithValueBridge2.class; } } ); }
Source:
public Resource(int version, String id, Vector<ResourceLocation> locations, String descriptor) { this(version, id, locations, descriptor, "false"); }

Target:
public Resource(int version, String id, Vector<ResourceLocation> locations, String descriptor) { this(version, id, locations, descriptor, LAZY_VAL_FALSE); }
Source:
public void setInSlot(Object slot, Widget content) { if (slot == ApplicationPresenter.TYPE_SetMainContent && content == null) { main.clear(); } else if (slot == ApplicationPresenter.TYPE_SetMainContent) { main.clear(); main.add(content); } else { super.setInSlot(slot, content); } }

Target:
public void setInSlot(Object slot, Widget content) { if (slot == ApplicationPresenter.TYPE_SetMainContent) { main.setWidget(content); } else { super.setInSlot(slot, content); } }
Source:
protected void invokeFinishBundle() throws Exception { ((AsyncPythonFunctionRunner) pythonFunctionRunner).flush(); elementCount = 0; while ((resultTuple = pythonFunctionRunner.receive()) != null) { emitResult(); } lastFinishBundleTime = getProcessingTimeService().getCurrentProcessingTime(); if (bundleFinishedCallback != null) { bundleFinishedCallback.run(); bundleFinishedCallback = null; } }

Target:
protected void invokeFinishBundle() throws Exception { if (elementCount > 0) { pythonFunctionRunner.flush(); elementCount = 0; emitResults(); lastFinishBundleTime = getProcessingTimeService().getCurrentProcessingTime(); if (bundleFinishedCallback != null) { bundleFinishedCallback.run(); bundleFinishedCallback = null; } } }
Source:
protected void render0(FunctionRenderContext context) { Object[] jsonPathElements = new Object[context.getArgumentsSize() - 1]; for (int i = 1; i < context.getArgumentsSize(); i++) { try { jsonPathElements[i - 1] = Integer.parseInt(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i))); } catch (NumberFormatException e) { jsonPathElements[i - 1] = JpqlFunctionUtil.unquoteDoubleQuotes(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i))); } } String jsonPath = AbstractJsonGetFunction.toJsonPath(jsonPathElements, jsonPathElements.length, true); context.addChunk("coalesce(json_value("); context.addArgument(0); context.addChunk(",'"); context.addChunk(jsonPath); context.addChunk("'),json_query("); context.addArgument(0); context.addChunk(",'"); context.addChunk(jsonPath); context.addChunk("'))"); }

Target:
protected void render0(FunctionRenderContext context) { List<Object> jsonPathElements = AbstractJsonGetFunction.retrieveJsonPathElements(context, 1); String jsonPath = AbstractJsonGetFunction.toJsonPath(jsonPathElements, jsonPathElements.size(), true); context.addChunk("coalesce(json_value("); context.addArgument(0); context.addChunk(",'"); context.addChunk(jsonPath); context.addChunk("'),json_query("); context.addArgument(0); context.addChunk(",'"); context.addChunk(jsonPath); context.addChunk("'))"); }
Source:
private <T> List<T> getAnnotatedMembers(Map<Class<? extends Annotation>, List<T>> map, Class<? extends Annotation> type, boolean fillIfAbsent) { if (!map.containsKey(type) && fillIfAbsent) { map.put(type, new ArrayList<T>()); } List<T> members = map.get(type); return members == null ? Collections.<T>emptyList() : members; }

Target:
private static <T> List<T> getAnnotatedMembers(Map<Class<? extends Annotation>, List<T>> map, Class<? extends Annotation> type, boolean fillIfAbsent) { if (!map.containsKey(type) && fillIfAbsent) { map.put(type, new ArrayList<T>()); } List<T> members = map.get(type); return members == null ? Collections.<T>emptyList() : members; }
Source:
private void parseLevelDBCacheStoreCompression(XMLExtendedStreamReader reader, LevelDBStoreConfigurationBuilder builder) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { builder.implementationType(LevelDBStoreConfiguration.ImplementationType.valueOf(value)); break; } default: throw ParseUtils.unexpectedAttribute(reader, i); } } ParseUtils.requireNoContent(reader); }

Target:
private void parseLevelDBCacheStoreCompression(XMLExtendedStreamReader reader, LevelDBStoreConfigurationBuilder builder) throws XMLStreamException { for (int i = 0; i < reader.getAttributeCount(); i++) { String value = reader.getAttributeValue(i); Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { builder.compressionType(CompressionType.valueOf(value)); break; } default: throw ParseUtils.unexpectedAttribute(reader, i); } } ParseUtils.requireNoContent(reader); }
Source:
public static ObjectMapper buildObjectMapperForDeserialization() { Thread.currentThread().setContextClassLoader(InventoryAbstractMessage.class.getClassLoader()); final ObjectMapper mapper = new ObjectMapper(); InventoryJacksonConfig.configure(mapper); mapper.addMixIn(CanonicalPath.class, CanonicalPathMixin.class); return mapper; }

Target:
public static ObjectMapper buildObjectMapperForDeserialization() { final ObjectMapper mapper = new ObjectMapper(); InventoryJacksonConfig.configure(mapper); mapper.addMixIn(CanonicalPath.class, CanonicalPathMixin.class); return mapper; }
Source:
<K, V, M> MessageStream<M> getOutputStream(String streamId, Function<M, K> keyExtractor, Function<M, V> msgExtractor) { return outStreams.computeIfAbsent(runner.getStream(streamId), streamSpec -> new OutputStreamImpl<>(this, streamSpec, keyExtractor, msgExtractor)); }

Target:
public <K, V, M> OutputStream<K, V, M> getOutputStream(String streamId, Function<M, K> keyExtractor, Function<M, V> msgExtractor) { return outStreams.computeIfAbsent(runner.getStreamSpec(streamId), streamSpec -> new OutputStreamInternalImpl<>(this, streamSpec, keyExtractor, msgExtractor)); }
Source:
public DataSet next() { if (minibatchCount < terminationPoint) { minibatchCount++; return underlyingIterator.next(); } else { throw new RuntimeException("Calls to next have exceeded termination point."); } }

Target:
public DataSet next() { if (minibatchCount < terminationPoint) { minibatchCount++; return underlyingIterator.next(); } else { throw new RuntimeException("Calls to next have exceeded the allotted number of minibatches."); } }
Source:
public boolean isPulseOnce(GlowBlock block) { return false; }

Target:
public boolean isPulseOnce(GlowBlock block) { return true; }
Source:
public Map<String, Object> toMap() { Map<String, Object> dict = new HashMap<>(); for (String name : rs.getColumnNames().keySet()) { dict.put(name, getObject(indexForColumnName(name))); } return dict; }

Target:
public Map<String, Object> toMap() { List<Object> values = toList(); Map<String, Object> dict = new HashMap<>(); for (String name : rs.getColumnNames().keySet()) { int index = indexForColumnName(name); dict.put(name, values.get(index)); } return dict; }
Source:
public void releaseUserCodeClassLoader_willRunReleaseHooks() throws Exception { final BlobLibraryCacheManager libraryCacheManager = new TestingBlobLibraryCacheManagerBuilder().build(); final LibraryCacheManager.ClassLoaderLease classLoaderLease = libraryCacheManager.registerClassLoaderLease(new JobID()); final UserCodeClassLoader userCodeClassLoader = classLoaderLease.getOrResolveClassLoader(Collections.emptyList(), Collections.emptyList()); final OneShotLatch releaseHookLatch = new OneShotLatch(); userCodeClassLoader.registerReleaseHookIfAbsent("test", releaseHookLatch::trigger); classLoaderLease.release(); releaseHookLatch.await(); }

Target:
public void releaseUserCodeClassLoader_willRunReleaseHooks() throws IOException, InterruptedException { final BlobLibraryCacheManager libraryCacheManager = new TestingBlobLibraryCacheManagerBuilder().build(); final LibraryCacheManager.ClassLoaderLease classLoaderLease = libraryCacheManager.registerClassLoaderLease(new JobID()); final UserCodeClassLoader userCodeClassLoader = classLoaderLease.getOrResolveClassLoader(Collections.emptyList(), Collections.emptyList()); final OneShotLatch releaseHookLatch = new OneShotLatch(); userCodeClassLoader.registerReleaseHookIfAbsent("test", releaseHookLatch::trigger); classLoaderLease.release(); releaseHookLatch.await(); }
Source:
public boolean canHandleToken(ReceivedToken validateTarget, String realm) { Object token = validateTarget.getToken(); if ((token instanceof BinarySecurityTokenType) && (X509_PKI_PATH.equals(((BinarySecurityTokenType) token).getValueType()) || X509TokenValidator.X509_V3_TYPE.equals( ((BinarySecurityTokenType) token).getValueType()))) { return true; } if (token instanceof Element && WSConstants.SIG_NS.equals(((Element) token).getNamespaceURI()) && WSConstants.X509_DATA_LN.equals(((Element) token).getLocalName())) { return true; } return false; }

Target:
public boolean canHandleToken(ReceivedToken validateTarget, String realm) { Object token = validateTarget.getToken(); if ((token instanceof BinarySecurityTokenType) && (X509_PKI_PATH.equals(((BinarySecurityTokenType) token).getValueType()) || X509TokenValidator.X509_V3_TYPE.equals( ((BinarySecurityTokenType) token).getValueType()))) { return true; } return (token instanceof Element && WSConstants.SIG_NS.equals(((Element) token).getNamespaceURI()) && WSConstants.X509_DATA_LN.equals(((Element) token).getLocalName())); }
Source:
public void destroyObjectsInSameTreeTest() { initializeJob(objsToDestroy); objsToDestroy.remove(3); job.run(); PID fileObjPid = objsToDestroy.get(2); PID workObjPid = objsToDestroy.get(1); PID folderObjPid = objsToDestroy.get(0); verify(spyProxyService).destroyProxy(folderObjPid); Tombstone stoneFile = repoObjLoader.getTombstone(fileObjPid); Tombstone stoneWork = repoObjLoader.getTombstone(workObjPid); Tombstone stoneFolder = repoObjLoader.getTombstone(folderObjPid); assertTrue(stoneFile.getModel().contains(stoneFile.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(stoneFile.getModel().contains(stoneFile.getResource(), RDF.type, Cdr.FileObject)); assertTrue(stoneWork.getModel().contains(stoneWork.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(stoneWork.getModel().contains(stoneWork.getResource(), RDF.type, Cdr.Work)); assertTrue(stoneFolder.getModel().contains(stoneFolder.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(stoneFolder.getModel().contains(stoneFolder.getResource(), RDF.type, Cdr.Folder)); PremisEventObject event = repoObjLoader.getPremisEventObject(stoneFolder.getPremisLog().listEvents().get(0)); assertTrue(event.getResource().hasProperty(Premis.hasEventType, Premis.Deletion)); assertTrue(event.getResource().hasProperty(Premis.hasEventDetail, "Item deleted from repository and replaced by tombstone")); }

Target:
public void destroyObjectsInSameTreeTest() { initializeJob(objsToDestroy); objsToDestroy.remove(3); job.run(); PID fileObjPid = objsToDestroy.get(2); PID workObjPid = objsToDestroy.get(1); PID folderObjPid = objsToDestroy.get(0); verify(spyProxyService).destroyProxy(folderObjPid); Tombstone stoneFile = repoObjLoader.getTombstone(fileObjPid); Tombstone stoneWork = repoObjLoader.getTombstone(workObjPid); Tombstone stoneFolder = repoObjLoader.getTombstone(folderObjPid); assertTrue(stoneFile.getResource().hasProperty(RDF.type, Cdr.Tombstone)); assertTrue(stoneFile.getResource().hasProperty(RDF.type, Cdr.FileObject)); assertTrue(stoneWork.getResource().hasProperty(RDF.type, Cdr.Tombstone)); assertTrue(stoneWork.getResource().hasProperty(RDF.type, Cdr.Work)); assertTrue(stoneFolder.getResource().hasProperty(RDF.type, Cdr.Tombstone)); assertTrue(stoneFolder.getResource().hasProperty(RDF.type, Cdr.Folder)); PremisEventObject event = repoObjLoader.getPremisEventObject(stoneFolder.getPremisLog().listEvents().get(0)); assertTrue(event.getResource().hasProperty(Premis.hasEventType, Premis.Deletion)); assertTrue(event.getResource().hasProperty(Premis.hasEventDetail, "Item deleted from repository and replaced by tombstone")); }
Source:
public static ParcelFileDescriptor fromSocket(Socket socket) { FileDescriptor fd = socket.getFileDescriptor$(); try { return fd != null ? ParcelFileDescriptor.dup(fd) : null; } catch (IOException ex) { throw new UncheckedIOException(ex); } }

Target:
public static ParcelFileDescriptor fromSocket(Socket socket) { FileDescriptor fd = socket.getFileDescriptor$(); try { return fd != null ? ParcelFileDescriptor.dup(fd) : null; } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { try { exceptionsTrustManager.checkServerTrusted(chain, authType); } catch (CertificateException ex) { checkDateValidity(chain); if (chain.length > 1) { try { validatePath(chain); } catch (NoSuchAlgorithmException | KeyStoreException | InvalidAlgorithmParameterException | CertPathValidatorException | CertPathBuilderException e) { Log.error("Validating path failed", e); throw new CertificateException("Certificate path validation failed", e); } } else if (chain.length == 1 && !acceptSelfSigned) { throw new CertificateException("Self Signed certificate"); } else if (chain.length == 1 && acceptSelfSigned) { List<X509Certificate> certList = new ArrayList<>(Arrays.asList(getAcceptedIssuers())); if (!certList.contains(chain[0])) { throw new CertificateException("Certificate not in the TrustStore"); } try { loadCRL(chain); for (X509CRL crl : crlCollection) { if (crl.isRevoked(chain[0])) { throw new CertificateException("Certificate is revoked"); } } } catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException | CertStoreException | CRLException | IOException e) { Log.warning("Couldn't load CRL"); } }else { throw new CertificateException("Certificate chain cannot be trusted"); } } }

Target:
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { try { exceptionsTrustManager.checkServerTrusted(chain, authType); } catch (CertificateException ex) { checkDateValidity(chain); if (isSelfSigned(chain) == false) { try { validatePath(chain); } catch (NoSuchAlgorithmException | KeyStoreException | InvalidAlgorithmParameterException | CertPathValidatorException | CertPathBuilderException e) { Log.error("Validating path failed", e); throw new CertificateException("Certificate path validation failed", e); } } else if (isSelfSigned(chain) && !acceptSelfSigned) { throw new CertificateException("Self Signed certificate"); } else if (isSelfSigned(chain) && acceptSelfSigned) { List<X509Certificate> certList = new ArrayList<>(Arrays.asList(getAcceptedIssuers())); if (!certList.contains(chain[0])) { throw new CertificateException("Certificate not in the TrustStore"); } try { loadCRL(chain); for (X509CRL crl : crlCollection) { if (crl.isRevoked(chain[0])) { throw new CertificateException("Certificate is revoked"); } } } catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException | CertStoreException | CRLException | IOException e) { Log.warning("Couldn't load CRL"); } }else { throw new CertificateException("Certificate chain cannot be trusted"); } } }
Source:
private void testWorkflowVersionMetadata(Workflow workflow) { final String partialReadmeDescription = "AMPA-NF is a pipeline for assessing the antimicrobial domains of proteins,"; final String descriptorDescription = "Fast automated prediction of protein antimicrobial regions"; Assert.assertEquals(descriptorDescription, workflow.getDescription()); Assert.assertEquals(descriptorDescription, workflow.getDescription()); workflow.getWorkflowVersions().forEach(workflowVersion -> { if (workflowVersion.getName().equals("v1.0")) { Assert.assertTrue(workflowVersion.getDescription().contains(partialReadmeDescription)); Assert.assertNull(workflowVersion.getAuthor()); Assert.assertNull(workflowVersion.getEmail()); } else { Assert.assertNotNull(descriptorDescription, workflowVersion.getDescription()); Assert.assertEquals("test.user@test.com", workflowVersion.getAuthor()); Assert.assertNull(workflowVersion.getEmail()); } }); }

Target:
private void testWorkflowVersionMetadata(Workflow workflow) { final String partialReadmeDescription = "AMPA-NF is a pipeline for assessing the antimicrobial domains of proteins,"; final String descriptorDescription = "Fast automated prediction of protein antimicrobial regions"; final String versionWithReadmeDescription = "v1.0"; Assert.assertEquals(descriptorDescription, workflow.getDescription()); Assert.assertTrue(workflow.getWorkflowVersions().stream().anyMatch(workflowVersion -> workflowVersion.getName().equals(versionWithReadmeDescription))); workflow.getWorkflowVersions().forEach(workflowVersion -> { if (workflowVersion.getName().equals(versionWithReadmeDescription)) { Assert.assertTrue(workflowVersion.getDescription().contains(partialReadmeDescription)); Assert.assertNull(workflowVersion.getAuthor()); Assert.assertNull(workflowVersion.getEmail()); } else { Assert.assertNotNull(descriptorDescription, workflowVersion.getDescription()); Assert.assertEquals("test.user@test.com", workflowVersion.getAuthor()); Assert.assertNull(workflowVersion.getEmail()); } }); }
Source:
private List<String> getPublicIpAddresses(Container container) { String dockerIpAddress; if (container.node() != null && container.node().isPresent()) { dockerIpAddress = container.node().get().ip(); } else { dockerIpAddress = URI.create(providerMetadata.getEndpoint()).getHost(); } return ImmutableList.of(dockerIpAddress); }

Target:
private List<String> getPublicIpAddresses(Container container) { String dockerIpAddress; if (container.node().isPresent()) { dockerIpAddress = container.node().get().ip(); } else { dockerIpAddress = URI.create(providerMetadata.getEndpoint()).getHost(); } return ImmutableList.of(dockerIpAddress); }
Source:
public static String getNimbusHost(Map mesosStormConf) throws UnknownHostException { Optional<String> nimbusHostFromConfig = Optional.fromNullable((String) mesosStormConf.get(Config.NIMBUS_HOST)); Optional<String> nimbusHostFromEnv = Optional.fromNullable(System.getenv("MESOS_NIMBUS_HOST")); return nimbusHostFromConfig.or(nimbusHostFromEnv).or(nimbusHostFromConfig).or(InetAddress.getLocalHost().getCanonicalHostName()); }

Target:
public static String getNimbusHost(Map mesosStormConf) throws UnknownHostException { Optional<String> nimbusHostFromConfig = Optional.fromNullable((String) mesosStormConf.get(Config.NIMBUS_HOST)); Optional<String> nimbusHostFromEnv = Optional.fromNullable(System.getenv("MESOS_NIMBUS_HOST")); return nimbusHostFromConfig.or(nimbusHostFromEnv).or(InetAddress.getLocalHost().getCanonicalHostName()); }
Source:
private void initDragDrop() { DropSupport drop = DropSupport.addIfSupported(this); if (drop != null) { drop.setListener(new DropSupport.Listener() { @Override public boolean onDrop(DropEvent event) { event.preventDefault(); event.stopPropagation(); PackagesPanelUi.this.packagesDropzone.removeStyleName(DROPZONE_ACTIVE_STYLE_NAME); final List<File> droppedFiles = event.getFiles(); if (!droppedFiles.isEmpty()) { final File first = droppedFiles.get(0); if (first.getName().endsWith(".dp")) { PackagesPanelUi.this.confirmDialog.show(MSGS.packagesConfirmMessage(), () -> installDp(first)); } else { PackagesPanelUi.this.uploadErrorText.setText(MSGS.packagesMarketplaceInstallDpNotValid()); PackagesPanelUi.this.uploadErrorModal.show(); } } else { final String url = event.getAsText(); if (isEclipseMarketplaceUrl(url)) { PackagesPanelUi.this.confirmDialog.show(MSGS.packagesMarketplaceInstallConfirmMessage(), () -> eclipseMarketplaceInstall(url)); } else { PackagesPanelUi.this.uploadErrorText.setText(MSGS.packagesMarketplaceInstallDpNotValid()); PackagesPanelUi.this.uploadErrorModal.show(); } } return true; } @Override public boolean onDragOver(DropEvent event) { PackagesPanelUi.this.packagesDropzone.addStyleName(DROPZONE_ACTIVE_STYLE_NAME); return true; } @Override public void onDragExit(DropEvent event) { PackagesPanelUi.this.packagesDropzone.removeStyleName(DROPZONE_ACTIVE_STYLE_NAME); } }); } else { this.marketplaceInstallWell.setVisible(false); } }

Target:
private void initDragDrop() { DropSupport drop = DropSupport.addIfSupported(this); if (drop != null) { drop.setListener(new DropSupport.Listener() { @Override public boolean onDrop(DropEvent event) { event.preventDefault(); event.stopPropagation(); PackagesPanelUi.this.packagesDropzone.removeStyleName(DROPZONE_ACTIVE_STYLE_NAME); final List<File> droppedFiles = event.getFiles(); if (!droppedFiles.isEmpty()) { installFromFile(droppedFiles); } else { installFromUrl(event); } return true; } @Override public boolean onDragOver(DropEvent event) { PackagesPanelUi.this.packagesDropzone.addStyleName(DROPZONE_ACTIVE_STYLE_NAME); return true; } @Override public void onDragExit(DropEvent event) { PackagesPanelUi.this.packagesDropzone.removeStyleName(DROPZONE_ACTIVE_STYLE_NAME); } }); } else { this.marketplaceInstallWell.setVisible(false); } }
Source:
public DelimitedInputFormat( @JsonProperty("columns") @Nullable List<String> columns, @JsonProperty("listDelimiter") @Nullable String listDelimiter, @JsonProperty("delimiter") @Nullable String delimiter, @Deprecated @JsonProperty("hasHeaderRow") @Nullable Boolean hasHeaderRow, @JsonProperty("findColumnsFromHeader") @Nullable Boolean findColumnsFromHeader, @JsonProperty("skipHeaderRows") int skipHeaderRows ) { this.listDelimiter = listDelimiter; this.columns = columns == null ? Collections.emptyList() : columns; this.findColumnsFromHeader = Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("hasHeaderRow", hasHeaderRow), new Property<>("findColumnsFromHeader", findColumnsFromHeader) ) ).getValue(); this.skipHeaderRows = skipHeaderRows; this.format = getFormat(delimiter); Preconditions.checkArgument( delimiter == null || delimiter.length() == 1, "The delimiter should be a single character" ); if (!this.columns.isEmpty()) { for (String column : this.columns) { Preconditions.checkArgument( !column.contains(format.getDelimiterAsString()), "Column[%s] has a " + format.getLiteral() + ", it cannot", column ); } } else { Preconditions.checkArgument( this.findColumnsFromHeader, "If columns field is not set, the first row of your data must have your header" + " and hasHeaderRow must be set to true." ); } }

Target:
public DelimitedInputFormat( @JsonProperty("columns") @Nullable List<String> columns, @JsonProperty("listDelimiter") @Nullable String listDelimiter, @JsonProperty("delimiter") @Nullable String delimiter, @Deprecated @JsonProperty("hasHeaderRow") @Nullable Boolean hasHeaderRow, @JsonProperty("findColumnsFromHeader") @Nullable Boolean findColumnsFromHeader, @JsonProperty("skipHeaderRows") int skipHeaderRows ) { this.listDelimiter = listDelimiter; this.columns = columns == null ? Collections.emptyList() : columns; this.findColumnsFromHeader = Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("hasHeaderRow", hasHeaderRow), new Property<>("findColumnsFromHeader", findColumnsFromHeader) ) ).getValue(); this.skipHeaderRows = skipHeaderRows; this.delimiter = delimiter == null ? "\t" : delimiter; this.format = getFormat(this.delimiter); Preconditions.checkArgument( this.delimiter.length() == 1, "The delimiter should be a single character" ); Preconditions.checkArgument( !this.delimiter.equals(listDelimiter), "Cannot have same delimiter and list delimiter of [%s]", this.delimiter ); if (!this.columns.isEmpty()) { for (String column : this.columns) { Preconditions.checkArgument( !column.contains(format.getDelimiterAsString()), "Column[%s] has a " + format.getLiteral() + ", it cannot", column ); } } else { Preconditions.checkArgument( this.findColumnsFromHeader, "If columns field is not set, the first row of your data must have your header" + " and hasHeaderRow must be set to true." ); } }
Source:
private void didClickAddDirectory(ActionEvent event) { final DirectoryChooser dirChooser = new DirectoryChooser(); final File file = dirChooser.showDialog(stage); addDirectory(file); }

Target:
private void didClickAddDirectory(ActionEvent event) { final DirectoryChooser dirChooser = new DirectoryChooser(); final File file = dirChooser.showDialog(stage); addDirectory(file.toPath()); }
Source:
private Collection<CheService> toServices(Collection<CheFeature> features) throws InfrastructureException { Collection<CheService> services = getServices(features); Map<String, List<String>> parameters = getServicesParameters(features); for (CheService service : services) { String serviceName = service.getMetadata().getName(); String serviceVersion = service.getSpec().getVersion(); String serviceKey = serviceName + '/' + serviceVersion; service.getSpec() .getContainers() .forEach(container -> container.getEnv() .forEach(envVar -> { if (isParameter(envVar)) { String envVarValue = envVar.getValue(); String parameterKey = serviceKey + '/' + envVarValue; List<String> remove = parameters.remove(parameterKey); if (remove != null) { envVar.setValue(String.join(",", remove)); } } })); if (!parameters.isEmpty()) { throw new InfrastructureException( "Parameters not supported by services found: " + parameters); } } return services; }

Target:
private Collection<CheService> toServices(Collection<CheFeature> features) throws InfrastructureException { Collection<CheService> services = getServices(features); Map<String, List<String>> parameters = getServicesParameters(features); for (CheService service : services) { String serviceName = service.getMetadata().getName(); String serviceVersion = service.getSpec().getVersion(); String serviceKey = serviceName + '/' + serviceVersion; service .getSpec() .getContainers() .stream() .flatMap(container -> container.getEnv().stream()) .filter(this::isParameter) .forEach( envVar -> { String parameterKey = serviceKey + '/' + envVar.getValue(); List<String> remove = parameters.remove(parameterKey); String envVarValue; if (remove != null) { envVarValue = String.join(",", remove); } else { envVarValue = ""; } envVar.setValue(envVarValue); }); } if (!parameters.isEmpty()) { throw new InfrastructureException( "Parameters not supported by services found: " + parameters.keySet()); } return services; }
Source:
protected void executeCommand() { updateClusterCpuName(getMaxServerCpu().getCpuName(), getMaxServerCpu().getArchitecture()); if (maxServerFound() && !architecturesMatch() ) { addCustomValue("VdsArchitecture", getMaxServerCpu().getArchitecture().name()); addCustomValue("ClusterArchitecture", getCluster().getArchitecture().name()); SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { List<String> missingFlags = getCpuFlagsManagerHandler().missingServerCpuFlags( getCluster().getCpuName(), getVds().getCpuFlags(), getCluster().getCompatibilityVersion()); if (vdsContainsFlags() && !cpuFlagsMatch(missingFlags)) { if (missingFlags != null) { addCustomValue("CpuFlags", StringUtils.join(missingFlags, ", ")); if (missingFlags.contains("nx")) { auditLogDirector.log(this, AuditLogType.CPU_FLAGS_NX_IS_MISSING); } } SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.CPU_TYPE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { setCommandShouldBeLogged(false); } } setSucceeded(true); }

Target:
protected void executeCommand() { setMaxServerCPU(getCpuFlagsManagerHandler().findMaxServerCpuByFlags( getVds().getCpuFlags(), getVds().getClusterCompatibilityVersion())); if (getMaxServerCpu() != null) { updateClusterCpuName(getMaxServerCpu().getCpuName(), getMaxServerCpu().getArchitecture()); } else { log.error("Could not find server cpu for server '{}' ({}), flags: '{}'", getVds().getName(), getVdsId(), getVds().getCpuFlags()); } if (maxServerFound() && !architecturesMatch() ) { addCustomValue("VdsArchitecture", getMaxServerCpu().getArchitecture().name()); addCustomValue("ClusterArchitecture", getCluster().getArchitecture().name()); SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { List<String> missingFlags = getCpuFlagsManagerHandler().missingServerCpuFlags( getCluster().getCpuName(), getVds().getCpuFlags(), getCluster().getCompatibilityVersion()); if (vdsContainsFlags() && !cpuFlagsMatch(missingFlags)) { if (missingFlags != null) { addCustomValue("CpuFlags", StringUtils.join(missingFlags, ", ")); if (missingFlags.contains("nx")) { auditLogDirector.log(this, AuditLogType.CPU_FLAGS_NX_IS_MISSING); } } SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.CPU_TYPE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { setCommandShouldBeLogged(false); } } setSucceeded(true); }
Source:
private void convertTasksToWorkflowCoordinates(StringBuilder diagram, List<Task> tasks) { int xAxe = 498; for (Task task : tasks) { diagram.append(XmlGenerator.generateTaskShape(task.getOrdering(), xAxe)); xAxe = xAxe + 150; } XmlGenerator.generateBpmnEndEvent(diagram, xAxe); }

Target:
private void convertTasksToWorkflowCoordinates(StringBuilder diagram, List<Task> tasks) { int diagramStart = 498; for (Task task : tasks) { diagram.append(XmlGenerator.generateTaskShape(task.getOrdering(), diagramStart)); diagramStart = diagramStart + BOX_DISTANCE; } XmlGenerator.generateBpmnEndEvent(diagram, diagramStart); }
Source:
public AccessDeniedException(String file, String other, String reason) { super(file + ", other " + other + ", reason " + reason); }

Target:
public AccessDeniedException(String file, String other, String reason) { super(MessageFormat.format(JGitText.get().accessFileDenied, file, other, reason)); }
Source:
private static String getResultJobFilePath(final JavaSparkContext sparkContext, final SparkJobContext sparkJobContext) { String resultPath = sparkJobContext.getResultPath(); if (resultPath == null) { final Configuration hadoopConfiguration = sparkContext.hadoopConfiguration(); final String fileSystemPrefix = hadoopConfiguration.get("fs.defaultFS"); resultPath = fileSystemPrefix + DEFAULT_RESULT_PATH; } final String analysisJobXmlName = sparkJobContext.getAnalysisJobName(); final Date date = new Date(); if (!resultPath.endsWith("/")) { resultPath = resultPath + "/"; } final String filePath = resultPath + analysisJobXmlName + "-" + date.getTime() + ".analysis.result.dat"; return filePath; }

Target:
private static String getResultJobFilePath(final JavaSparkContext sparkContext, final SparkJobContext sparkJobContext) { String resultPath = sparkJobContext.getResultPath(); final Configuration hadoopConfiguration = sparkContext.hadoopConfiguration(); final String fileSystemPrefix = hadoopConfiguration.get("fs.defaultFS"); if (resultPath == null) { resultPath = fileSystemPrefix + DEFAULT_RESULT_PATH; } else { final URI uri = URI.create(resultPath); if (!uri.isAbsolute()){ resultPath = fileSystemPrefix + resultPath; } } final String analysisJobXmlName = sparkJobContext.getAnalysisJobName(); final Date date = new Date(); if (!resultPath.endsWith("/")) { resultPath = resultPath + "/"; } final String filePath = resultPath + analysisJobXmlName + "-" + date.getTime() + ".analysis.result.dat"; return filePath; }
Source:
public void setJvm( String jvm ) throws Exception { Field toolchainField = AbstractSurefireMojo.class.getDeclaredField( "jvm" ); toolchainField.setAccessible( true ); toolchainField.set( this, jvm ); }

Target:
public void setJvm( String jvm ) throws Exception { setInternalState( this, "jvm", jvm ); }
Source:
private void changeOreonAttributes(Actor oreon, TaskComponent taskComponent) { OreonAttributeComponent oreonAttributeComponent = oreon.getComponent(OreonAttributeComponent.class); String assignedTaskType = taskComponent.assignedTaskType; switch(assignedTaskType) { case AssignedTaskType.Eat: logger.info("eating task complete hunger to zero ", oreonAttributeComponent.hunger); oreonAttributeComponent.hunger = 0; break; case AssignedTaskType.Train_Strength: oreonAttributeComponent.strength += 10; oreonAttributeComponent.strength = oreonAttributeComponent.strength > oreonAttributeComponent.maxStrength ? oreonAttributeComponent.maxStrength : oreonAttributeComponent.strength; logger.info("Strength training complete, strength is now : {}", oreonAttributeComponent.strength); break; case AssignedTaskType.Train_Intelligence: oreonAttributeComponent.intelligence += 10; oreonAttributeComponent.intelligence = oreonAttributeComponent.intelligence > oreonAttributeComponent.maxIntelligence ? oreonAttributeComponent.maxIntelligence : oreonAttributeComponent.intelligence; logger.info("Intelligence training complete, intelligence is now : {}", oreonAttributeComponent.intelligence); break; case AssignedTaskType.Sleep: oreonAttributeComponent.health = 100; break; default: oreonAttributeComponent.hunger += 30; } oreon.save(oreonAttributeComponent); }

Target:
private void changeOreonAttributes(Actor oreon, TaskComponent taskComponent) { OreonAttributeComponent oreonAttributeComponent = oreon.getComponent(OreonAttributeComponent.class); String assignedTaskType = taskComponent.assignedTaskType; switch(assignedTaskType) { case AssignedTaskType.Eat: logger.info("eating task complete hunger to zero ", oreonAttributeComponent.hunger); oreonAttributeComponent.hunger = 0; break; case AssignedTaskType.Train_Strength: oreonAttributeComponent.strength += 10; if (oreonAttributeComponent.strength > oreonAttributeComponent.maxStrength) { oreonAttributeComponent.strength = oreonAttributeComponent.maxStrength; } logger.info("Strength training complete, strength is now : {}", oreonAttributeComponent.strength); break; case AssignedTaskType.Train_Intelligence: oreonAttributeComponent.intelligence += 10; if (oreonAttributeComponent.intelligence > oreonAttributeComponent.maxIntelligence) { oreonAttributeComponent.intelligence = oreonAttributeComponent.maxIntelligence; } logger.info("Intelligence training complete, intelligence is now : {}", oreonAttributeComponent.intelligence); break; case AssignedTaskType.Sleep: oreonAttributeComponent.health = 100; break; default: oreonAttributeComponent.hunger += 30; } oreon.save(oreonAttributeComponent); }
Source:
protected Void convert(List<RiakKvPB.TsDelResp> responses) { int numResponses = responses.size(); checkIfMoreThanOneResponse(responses); return null; }

Target:
protected Void convert(List<RiakKvPB.TsDelResp> responses) { checkAndGetSingleResponse(responses); return null; }
Source:
public boolean isPythonLoggingSupported() { return getControlService().isVersionSupported("2.7.0"); }

Target:
public boolean isPythonLoggingSupported() { return ((TargetNodeComponent) getParent()).isPythonLoggingSupported(); }
Source:
protected int renameLdapSynchCollisionBehaviorValue() throws SQLException { int numberOfRecordsRenamed = 0; if (dbAccessor.tableExists(AMBARI_CONFIGURATION_TABLE)) { LOG.debug(String.format("Executing: %s", RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL)); numberOfRecordsRenamed = dbAccessor.executeUpdate(RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); LOG.info(String.format("Renamed %d %s with incorrect LDAP configuration property name", numberOfRecordsRenamed, 1 >= numberOfRecordsRenamed ? "record" : "records")); } else { LOG.info(String.format("%s table does not exists; nothing to update", AMBARI_CONFIGURATION_TABLE)); } return numberOfRecordsRenamed; }

Target:
protected int renameLdapSynchCollisionBehaviorValue() throws SQLException { int numberOfRecordsRenamed = 0; if (dbAccessor.tableExists(AMBARI_CONFIGURATION_TABLE)) { LOG.debug("Executing: {}", RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); numberOfRecordsRenamed = dbAccessor.executeUpdate(RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); LOG.info("Renamed with incorrect LDAP configuration property name", numberOfRecordsRenamed, 1 >= numberOfRecordsRenamed ? "record" : "records"); } else { LOG.info("{} table does not exists; nothing to update", AMBARI_CONFIGURATION_TABLE); } return numberOfRecordsRenamed; }
Source:
public boolean matches(String address) { String addressAndMask = preprocessAddressAndMask(address); String ipAddr = addressAndMask[0]; int maskBits = Integer.parseInt(addressAndMask[1]); InetAddress remoteAddress = parseAddress(ipAddr); Assert.isTrue(remoteAddress.getAddress().length * 8 >= maskBits, String.format("Mask bits too long for this address %s", address)); if (!requiredAddress.getClass().equals(remoteAddress.getClass())) { return false; } if (nMaskBits < 0) { return remoteAddress.equals(requiredAddress); } byte[] remAddr = remoteAddress.getAddress(); byte[] reqAddr = requiredAddress.getAddress(); int nMaskFullBytes = nMaskBits / 8; byte finalByte = (byte) (0xFF00 >> (nMaskBits & 0x07)); for (int i = 0; i < nMaskFullBytes; i++) { if (remAddr[i] != reqAddr[i]) { return false; } } if (finalByte != 0) { return (remAddr[nMaskFullBytes] & finalByte) == (reqAddr[nMaskFullBytes] & finalByte); } return true; }

Target:
public boolean matches(String address) { InetAddress remoteAddress = parseAddress(address); if (!requiredAddress.getClass().equals(remoteAddress.getClass())) { return false; } if (nMaskBits < 0) { return remoteAddress.equals(requiredAddress); } byte[] remAddr = remoteAddress.getAddress(); byte[] reqAddr = requiredAddress.getAddress(); int nMaskFullBytes = nMaskBits / 8; byte finalByte = (byte) (0xFF00 >> (nMaskBits & 0x07)); for (int i = 0; i < nMaskFullBytes; i++) { if (remAddr[i] != reqAddr[i]) { return false; } } if (finalByte != 0) { return (remAddr[nMaskFullBytes] & finalByte) == (reqAddr[nMaskFullBytes] & finalByte); } return true; }
Source:
public AlertFilterAPI(ExtensionAlertFilters extension) { super(); this.extension = extension; ApiView alertFilterList = new ApiView(VIEW_ALERT_FILTER_LIST, new String[] {PARAM_CONTEXT_ID}); alertFilterList.setDescriptionTag("alertFilters.api.view.alertFilterList"); this.addApiView(alertFilterList); ApiAction addAlertFilter = new ApiAction( ACTION_ADD_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, PARAM_ENABLED, }); addAlertFilter.setDescriptionTag("alertFilters.api.action.addAlertFilter"); this.addApiAction(addAlertFilter); ApiAction removeAlertFilter = new ApiAction( ACTION_REMOVE_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, PARAM_ENABLED, }); removeAlertFilter.setDescriptionTag("alertFilters.api.action.removeAlertFilter"); this.addApiAction(removeAlertFilter); }

Target:
public AlertFilterAPI(ExtensionAlertFilters extension) { super(); this.extension = extension; ApiView alertFilterList = new ApiView(VIEW_ALERT_FILTER_LIST, new String[] {PARAM_CONTEXT_ID}); alertFilterList.setDescriptionTag("alertFilters.api.view.alertFilterList"); this.addApiView(alertFilterList); ApiAction addAlertFilter = new ApiAction( ACTION_ADD_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_ENABLED, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, }); addAlertFilter.setDescriptionTag("alertFilters.api.action.addAlertFilter"); this.addApiAction(addAlertFilter); ApiAction removeAlertFilter = new ApiAction( ACTION_REMOVE_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_ENABLED, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, }); removeAlertFilter.setDescriptionTag("alertFilters.api.action.removeAlertFilter"); this.addApiAction(removeAlertFilter); }
Source:
private boolean checkContent(FileSystem fileSystem, UUID shardUuid, BitSet rowsToDelete) { OrcStorageManager manager = createOrcStorageManager(); Optional<BitSet> rows = manager.getRowsFromUuid(fileSystem, Optional.of(shardUuid)); if (rows.isPresent()) { return rows.get().equals(rowsToDelete); } return false; }

Target:
private boolean checkContent(FileSystem fileSystem, UUID shardUuid, BitSet rowsToDelete) { OrcStorageManager manager = createOrcStorageManager(); Optional<BitSet> rows = manager.getRowsFromUuid(fileSystem, Optional.of(shardUuid)); return rows.map(r -> r.equals(rowsToDelete)).orElse(false); }
Source:
public ByteBuffer serialize(String object) throws IOException { LOG.info("serializing {}", object); ByteBuffer byteBuffer = ByteBuffer.allocate(object.length()); byteBuffer.put(object.getBytes(CHARSET)); byteBuffer.flip(); return byteBuffer; }

Target:
public ByteBuffer serialize(String object) throws IOException { ByteBuffer byteBuffer = ByteBuffer.allocate(object.length()); byteBuffer.put(object.getBytes(CHARSET)); byteBuffer.flip(); return byteBuffer; }
Source:
public void testWrongSyslogFormat() { udpOperation.get(ElytronDescriptionConstants.SYSLOG_FORMAT).set(BAD_RFC_STRING); ModelNode response = services.executeOperation(udpOperation); assertCorrectError(response, "No enum constant org.jboss.logmanager.handlers.SyslogHandler.SyslogType.RFC1"); assertFailed(response); }

Target:
public void testWrongSyslogFormat() { udpOperation.get(ElytronDescriptionConstants.SYSLOG_FORMAT).set(BAD_RFC_STRING); ModelNode response = services.executeOperation(udpOperation); assertCorrectError(response, new String[] {"WFLYCTL0158", "RFC1"}); assertFailed(response); }