auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDisks() throws IOException { SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hal = si.getHardware(); if (hal.getDisksStores().length > 1) { assertNotNull(hal.getDisksStores()[0].getName()); assertNotNull(hal.getDisksStores()[0].getModel()); assertNotNull(hal.getDisksStores()[0].getSerial()); assertNotNull(hal.getDisksStores()[0].getSize()); assertNotNull(hal.getDisksStores()[0].getReads()); assertNotNull(hal.getDisksStores()[0].getWrites()); } }

Target:
public void testDisks() throws IOException { SystemInfo si = new SystemInfo(); for (HWDiskStore disk : si.getHardware().getDisksStores()) { assertNotNull(disk.getName()); assertNotNull(disk.getModel()); assertNotNull(disk.getSerial()); assertNotNull(disk.getSize()); assertNotNull(disk.getReads()); assertNotNull(disk.getWrites()); } }
Source:
KeyType(String alg, int keySize){ this.alg = alg; this.keySize = keySize; }

Target:
private KeyType(String alg, int keySize){ this.alg = alg; this.keySize = keySize; this.ivSize = keySize; }
Source:
private String getPrivateKeyAlias(final KeyStore keyStore, final String keyStoreAlias) { try { final Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { String currentAlias = aliases.nextElement(); if (keyStoreAlias == null) { return currentAlias; } else if (currentAlias.equals(keyStoreAlias)) { return currentAlias; } } throw new SAMLException("Keystore has no private keys"); } catch (final KeyStoreException e) { throw new SAMLException("Unable to get aliases from keyStore", e); } }

Target:
private String getPrivateKeyAlias(final KeyStore keyStore, final String keyStoreAlias) { try { final Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { String currentAlias = aliases.nextElement(); if (keyStoreAlias == null || currentAlias.equals(keyStoreAlias)) { return currentAlias; } } throw new SAMLException("Keystore has no private keys"); } catch (final KeyStoreException e) { throw new SAMLException("Unable to get aliases from keyStore", e); } }
Source:
public void testLoadConfigurationFromClassPath() { try { final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( "/com/puppycrawl/tools/checkstyle/configs/" + "config_with_ignore.xml", new PropertiesExpander(new Properties()), true); final Configuration[] children = config.getChildren(); assertEquals(0, children[0].getChildren().length); } catch (CheckstyleException ignored) { fail("unexpected exception"); } }

Target:
public void testLoadConfigurationFromClassPath() throws Exception { final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( "/com/puppycrawl/tools/checkstyle/configs/" + "config_with_ignore.xml", new PropertiesExpander(new Properties()), true); final Configuration[] children = config.getChildren(); assertEquals(0, children[0].getChildren().length); }
Source:
private void uploadDirectory(String dirPath, String container) throws FileNotFoundException, InterruptedException, ExecutionException { File dir = new File(dirPath); if (!dir.isDirectory()) { throw new FileNotFoundException(dirPath + " is not a directory."); } System.out.println("Uploading " + dirPath + " to " + container); storage.createContainerInLocation(null, container); List<BlobDetail> blobDetails = Lists.newArrayList(); generateFileList(dir, "", blobDetails); uploadFiles(container, blobDetails); }

Target:
private void uploadDirectory(String dirPath, String container) throws InterruptedException, ExecutionException { File dir = new File(dirPath); checkArgument(dir.isDirectory(), "%s is not a directory", dirPath); System.out.println("Uploading " + dirPath + " to " + container); storage.createContainerInLocation(null, container); List<BlobDetail> blobDetails = Lists.newArrayList(); generateFileList(dir, "", blobDetails); uploadFiles(container, blobDetails); }
Source:
public void onCompleted() { if (!empty) { child.onCompleted(); } else if (!child.isUnsubscribed()) { subscribeToAlternate(); } }

Target:
public void onCompleted() { if (!empty) { child.onCompleted(); } else if (!child.isUnsubscribed()) { unsubscribe(); subscribeToAlternate(); } }
Source:
public boolean productHasSubscriptions(Product prod) { ArrayList<Product> provided = new ArrayList<Product>(); provided.add(prod); return currentSession().createCriteria(Subscription.class) .createAlias("providedProducts", "providedProd", JoinType.LEFT_OUTER_JOIN) .createAlias("derivedProvidedProducts", "derivedProvidedProd", JoinType.LEFT_OUTER_JOIN) .add(Restrictions.or( Restrictions.eq("product", prod), Restrictions.eq("derivedProduct", prod), Restrictions.eq("providedProd.id", prod.getId()), Restrictions.eq("derivedProvidedProd.id", prod.getId()))) .setProjection(Projections.id()) .list().size() > 0; }

Target:
public boolean productHasSubscriptions(Product prod) { return ((Long) currentSession().createCriteria(Subscription.class) .createAlias("providedProducts", "providedProd", JoinType.LEFT_OUTER_JOIN) .createAlias("derivedProvidedProducts", "derivedProvidedProd", JoinType.LEFT_OUTER_JOIN) .add(Restrictions.or( Restrictions.eq("product", prod), Restrictions.eq("derivedProduct", prod), Restrictions.eq("providedProd.id", prod.getId()), Restrictions.eq("derivedProvidedProd.id", prod.getId()))) .setProjection(Projections.count("id")) .uniqueResult()) > 0; }
Source:
private void maybeAddReferenceCount(Node n) { Node refParent = getBaseQualifiedNameNode(n); if (refParent == null) { return; } String qName = refParent.getQualifiedName(); if (qName.startsWith("module.exports.")) { qName = qName.substring(15); } else if (qName.startsWith("exports.")) { qName = qName.substring(8); } else { return; } int assignCount = 1; if (propertyExportRefCount.containsKey(qName)) { assignCount = propertyExportRefCount.get(qName) + 1; propertyExportRefCount.remove(qName); } propertyExportRefCount.put(qName, assignCount); }

Target:
private void maybeAddReferenceCount(Node n) { Node refParent = getBaseQualifiedNameNode(n); if (refParent == null) { return; } String qName = refParent.getQualifiedName(); if (qName.startsWith("module.exports.")) { qName = qName.substring("module.exports.".length()); } else if (qName.startsWith("exports.")) { qName = qName.substring("exports.".length()); } else { return; } propertyExportRefCount.add(qName); }
Source:
public void onResume() { if(client != null && reactActivityDelegate != null){ reactActivityDelegate.onReadyCreate(); } super.onResume(); if (passcodeManager.onResume(this)) { try { client = clientManager.peekRestClient(); } catch (ClientManager.AccountInfoNotFoundException e) { client = null; } if (client == null) { onResumeNotLoggedIn(); } else { Log.i(TAG, "onResume - Already logged in"); } } }

Target:
public void onResume() { super.onResume(); if (passcodeManager.onResume(this)) { try { setRestClient(clientManager.peekRestClient()); } catch (ClientManager.AccountInfoNotFoundException e) { setRestClient(client); } if (client == null) { onResumeNotLoggedIn(); } else { Log.i(TAG, "onResume - Already logged in"); } } }
Source:
public boolean isLocal() { for(EnvironmentConfig part : this) { if(part.isLocal()) return false; } return true; }

Target:
public boolean isLocal() { for(EnvironmentConfig part : this) { if(!part.isLocal()) return false; } return true; }
Source:
public Anchor(String href, String text, AnchorTarget target) { setHref(href); setText(text); setTargetEnum(target); }

Target:
public Anchor(String href, String text, AnchorTarget target) { setHref(href); setText(text); setTarget(target); }
Source:
public Iterable<TmfXmlLocation> getLocations() { return Collections.EMPTY_SET; }

Target:
public @Nullable Iterable<TmfXmlLocation> getLocations() { return Collections.EMPTY_SET; }
Source:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.error("Handling error for message type: " + messageType, e); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build()); }

Target:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.error("Handling error for message type: " + messageType, e); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
private Phenotype updatePhenotype( final Integer observationId, final Integer categoricalValueId, final String value, final Boolean draftMode) { final PhenotypeDao phenotypeDao = this.daoFactory.getPhenotypeDAO(); final Phenotype phenotype = phenotypeDao.getById(observationId); if (draftMode) { phenotype.setDraftValue(value); phenotype.setDraftCValueId(categoricalValueId == null || categoricalValueId == 0 ? null : categoricalValueId); } else { phenotype.setValue(value); phenotype.setcValue(categoricalValueId == null || categoricalValueId == 0 ? null : categoricalValueId); } final Integer observableId = phenotype.getObservableId(); this.resolveObservationStatus(observableId, phenotype); phenotype.setChanged(true); phenotypeDao.update(phenotype); return phenotype; }

Target:
private Phenotype updatePhenotype( final Integer observationId, final Integer categoricalValueId, final String value, final Boolean draftMode) { final PhenotypeDao phenotypeDao = this.daoFactory.getPhenotypeDAO(); final Phenotype phenotype = phenotypeDao.getById(observationId); if (draftMode) { phenotype.setDraftValue(value); phenotype.setDraftCValueId(Integer.valueOf(0).equals(categoricalValueId) ? null : categoricalValueId); } else { phenotype.setValue(value); phenotype.setcValue(Integer.valueOf(0).equals(categoricalValueId) ? null : categoricalValueId); } final Integer observableId = phenotype.getObservableId(); this.resolveObservationStatus(observableId, phenotype); phenotype.setChanged(true); phenotypeDao.update(phenotype); return phenotype; }
Source:
public void addContents(@NonNull Container container, @NonNull AbstractItem item) { try { File itemRootDir = item.getRootDir(); Path relativeToRoot = new File(Jenkins.get().getRootDir(), "jobs").toPath() .relativize(itemRootDir.toPath()); list(itemRootDir, new FileVisitor() { @Override public void visitSymlink(File link, String target, String relativePath) { container.add(new PrintedContent("items/{0}/{1}", relativeToRoot.toString(), relativePath) { @Override protected void printTo(PrintWriter out) { out.println("symlink -> " + target); } @Override public boolean shouldBeFiltered() { return true; } }); } @Override public void visit(File file, String s) { container.add(new FileContent("items/{0}/{1}", new String[]{relativeToRoot.toString(), s}, file)); } @Override public boolean understandsSymlink() { return true; } }); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not list files from root directory of " + item.getFullName(), e); } }

Target:
public void addContents(@NonNull Container container, @NonNull AbstractItem item) { try { File itemRootDir = item.getRootDir(); String relativeToRoot = Functions.isWindows() ? new File(Jenkins.get().getRootDir(), "jobs").toPath() .relativize(itemRootDir.toPath()).toString().replace('\\','/') : new File(Jenkins.get().getRootDir(), "jobs").toPath() .relativize(itemRootDir.toPath()).toString(); list(itemRootDir, new FileVisitor() { @Override public void visitSymlink(File link, String target, String relativePath) { container.add(new PrintedContent("items/{0}/{1}", relativeToRoot, Functions.isWindows() ? relativePath.replace('\\','/') : relativePath) { @Override protected void printTo(PrintWriter out) { out.println("symlink -> " + target); } @Override public boolean shouldBeFiltered() { return true; } }); } @Override public void visit(File file, String s) { container.add(new FileContent("items/{0}/{1}", new String[]{relativeToRoot, Functions.isWindows() ? s.replace('\\','/') : s}, file) ); } @Override public boolean understandsSymlink() { return true; } }); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not list files from root directory of " + item.getFullName(), e); } }
Source:
public <T extends LwM2mResponse> T send(final Client destination, final DownlinkRequest<T> request) throws InterruptedException { throw new UnsupportedOperationException( "This is a deprecated message and better not use it for testing purposes"); }

Target:
public <T extends LwM2mResponse> T send(final Client destination, final DownlinkRequest<T> request) throws InterruptedException { throw new UnsupportedOperationException("Server doesn't support synchronous sending of messages"); }
Source:
public boolean isPageview( String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent, String rawXAnalyticsHeader ) { uriHost = uriHost.toLowerCase(); Webrequest wr = Webrequest.getInstance(); if (!wr.getXAnalyticsValue(rawXAnalyticsHeader,"pageview").isEmpty()) return true; if (!wr.getXAnalyticsValue(rawXAnalyticsHeader,"preview").isEmpty()) return false; return ( httpStatusesSet.contains(httpStatus) && ( (contentTypesSet.contains(contentType) && !Utilities.stringContains(uriPath, uriPathAPI)) || isAppPageview(uriPath, uriQuery, contentType, userAgent, rawXAnalyticsHeader) ) && ( Utilities.patternIsFound(uriHostWikimediaDomainPattern, uriHost) || Utilities.patternIsFound(uriHostOtherProjectsPattern, uriHost) || Utilities.patternIsFound(uriHostProjectDomainPattern, uriHost) ) && ( Utilities.patternIsFound(uriPathPattern, uriPath) || Utilities.patternIsFound(uriQueryPattern, uriQuery) ) && !Utilities.patternIsFound(uriPathUnwantedSpecialPagesPattern, uriPath) && !Utilities.patternIsFound(uriQueryUnwantedSpecialPagesPattern, uriQuery) && !Utilities.patternIsFound(uriQueryUnwantedActions, uriQuery) ); }

Target:
public boolean isPageview( String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent, String rawXAnalyticsHeader ) { uriHost = uriHost.toLowerCase(); Webrequest wr = Webrequest.getInstance(); if (wr.getXAnalyticsValue(rawXAnalyticsHeader,"preview").trim().equalsIgnoreCase("1")) return false; if (wr.getXAnalyticsValue(rawXAnalyticsHeader,"pageview").trim().equalsIgnoreCase("1")) return true; return ( httpStatusesSet.contains(httpStatus) && ( (contentTypesSet.contains(contentType) && !Utilities.stringContains(uriPath, uriPathAPI)) || isAppPageview(uriPath, uriQuery, contentType, userAgent, rawXAnalyticsHeader) ) && ( Utilities.patternIsFound(uriHostWikimediaDomainPattern, uriHost) || Utilities.patternIsFound(uriHostOtherProjectsPattern, uriHost) || Utilities.patternIsFound(uriHostProjectDomainPattern, uriHost) ) && ( Utilities.patternIsFound(uriPathPattern, uriPath) || Utilities.patternIsFound(uriQueryPattern, uriQuery) ) && !Utilities.patternIsFound(uriPathUnwantedSpecialPagesPattern, uriPath) && !Utilities.patternIsFound(uriQueryUnwantedSpecialPagesPattern, uriQuery) && !Utilities.patternIsFound(uriQueryUnwantedActions, uriQuery) ); }
Source:
public static Block zipWith( Type leftElementType, Type rightElementType, ArrayType outputArrayType, Object state, Block leftBlock, Block rightBlock, BinaryFunctionInterface function) { checkCondition(leftBlock.getPositionCount() == rightBlock.getPositionCount(), INVALID_FUNCTION_ARGUMENT, "Arrays must have the same length"); Type outputElementType = outputArrayType.getElementType(); PageBuilder pageBuilder = (PageBuilder) state; if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder arrayBlockBuilder = pageBuilder.getBlockBuilder(0); BlockBuilder blockBuilder = arrayBlockBuilder.beginBlockEntry(); for (int position = 0; position < leftBlock.getPositionCount(); position++) { Object left = readNativeValue(leftElementType, leftBlock, position); Object right = readNativeValue(rightElementType, rightBlock, position); Object output; try { output = function.apply(left, right); } catch (Throwable throwable) { throw Throwables.propagate(throwable); } writeNativeValue(outputElementType, blockBuilder, output); } arrayBlockBuilder.closeEntry(); pageBuilder.declarePosition(); return outputArrayType.getObject(arrayBlockBuilder, arrayBlockBuilder.getPositionCount() - 1); }

Target:
public static Block zipWith( Type leftElementType, Type rightElementType, ArrayType outputArrayType, Object state, Block leftBlock, Block rightBlock, BinaryFunctionInterface function) { checkCondition(leftBlock.getPositionCount() == rightBlock.getPositionCount(), INVALID_FUNCTION_ARGUMENT, "Arrays must have the same length"); Type outputElementType = outputArrayType.getElementType(); PageBuilder pageBuilder = (PageBuilder) state; if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder arrayBlockBuilder = pageBuilder.getBlockBuilder(0); BlockBuilder blockBuilder = arrayBlockBuilder.beginBlockEntry(); for (int position = 0; position < leftBlock.getPositionCount(); position++) { Object left = readNativeValue(leftElementType, leftBlock, position); Object right = readNativeValue(rightElementType, rightBlock, position); Object output; try { output = function.apply(left, right); } catch (Throwable throwable) { arrayBlockBuilder.closeEntry(); pageBuilder.declarePosition(); throwIfUnchecked(throwable); throw new RuntimeException(throwable); } writeNativeValue(outputElementType, blockBuilder, output); } arrayBlockBuilder.closeEntry(); pageBuilder.declarePosition(); return outputArrayType.getObject(arrayBlockBuilder, arrayBlockBuilder.getPositionCount() - 1); }
Source:
protected void handleCreateTarget() { final Map<String, String> commands = uiManager.getAddTargetCommands(); final Map<String, Image> images = uiManager.getTargetIcons(); if (!commands.isEmpty()) { ListDialog ld = new ListDialog(getShell()); ld.setTitle("New Launch Target"); ld.setMessage("Select target type to create"); ld.setContentProvider(new ArrayContentProvider()); ld.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return (String)element; } @Override public Image getImage(Object element) { return images.get(element); } }); ld.setInput(commands.keySet().toArray()); switch(ld.open()) { case Window.CANCEL: return; case Window.OK: String command = commands.get((String) (ld.getResult()[0])); Activator.runCommand(command); return; default: } } }

Target:
protected void handleCreateTarget() { final Map<String, String> commands = uiManager.getAddTargetCommands(); final Map<String, Image> images = uiManager.getTargetIcons(); if (!commands.isEmpty()) { ListDialog ld = new ListDialog(getShell()); ld.setTitle("New Launch Target"); ld.setMessage("Select target type to create"); ld.setContentProvider(new ArrayContentProvider()); ld.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return (String)element; } @Override public Image getImage(Object element) { return images.get(element); } }); ld.setInput(commands.keySet().toArray()); if (ld.open() == Window.OK) { String command = commands.get((String) (ld.getResult()[0])); Activator.runCommand(command); } } }
Source:
public boolean addEndpointForTenant(String endpointData, String tenantDomain) throws EndpointAdminException { try { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); boolean status = addEndpoint(endpointData); return status; } finally { PrivilegedCarbonContext.endTenantFlow(); } }

Target:
public boolean addEndpointForTenant(String endpointData, String tenantDomain) throws EndpointAdminException { try { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); return addEndpoint(endpointData); } finally { PrivilegedCarbonContext.endTenantFlow(); } }
Source:
public List<PlanFragment> getSourceFragments(RemoteSourceNode node) { return node.getSourceFragmentIds().stream() .map(id -> { verify(fragmentMap.containsKey(id), "fragment id not in map"); return fragmentMap.get(id); }) .collect(toImmutableList()); }

Target:
public List<PlanFragment> getSourceFragments(RemoteSourceNode node) { return node.getSourceFragmentIds().stream() .map(id -> { verify(fragments.containsKey(id), "fragment id not in map: %s", id); return fragments.get(id); }) .collect(toImmutableList()); }
Source:
public void showIssue(String repoId, int id, boolean isPullRequest, boolean isForceRefresh) { if (isPullRequest) { logger.info("Showing pull request #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForPullRequest(repoId, id), isForceRefresh)); runBrowserOperation(() -> driver.scrollToBottom()); } else { logger.info("Showing issue #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForIssue(repoId, id), isForceRefresh)); runBrowserOperation(() -> driver.scrollToBottom()); } }

Target:
public void showIssue(String repoId, int id, boolean isPullRequest, boolean isForceRefresh) { if (isPullRequest) { logger.info("Showing pull request #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForPullRequest(repoId, id), isForceRefresh)); } else { logger.info("Showing issue #" + id); runBrowserOperation(() -> driver.get(GitHubURL.getPathForIssue(repoId, id), isForceRefresh)); } runBrowserOperation(() -> scrollToBottom()); }
Source:
public ElasticsearchQueryBuilder(List<ElasticsearchColumnHandle> columnHandles, ElasticsearchConnectorConfig config, ElasticsearchSplit split) { columns = requireNonNull(columnHandles, "columnHandles is null"); requireNonNull(config, "config is null"); requireNonNull(split, "split is null"); ElasticsearchTableDescription table = split.getTable(); tupleDomain = split.getTupleDomain(); index = split.getIndex(); type = table.getType(); shard = split.getShard(); try { Settings settings = Settings.builder().put("client.transport.ignore_cluster_name", true).build(); client = new PreBuiltTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(split.getSearchNode()), split.getPort())); } catch (IOException e) { throw new PrestoException(ELASTIC_SEARCH_CONNECTION_ERROR, "Error connecting to Elasticsearch SearchNode: " + split.getSearchNode() + " with port: " + split.getPort(), e); } scrollTimeout = config.getScrollTimeout(); scrollSize = config.getScrollSize(); }

Target:
public ElasticsearchQueryBuilder(List<ElasticsearchColumnHandle> columnHandles, ElasticsearchConnectorConfig config, ElasticsearchSplit split) { requireNonNull(columnHandles, "columnHandles is null"); requireNonNull(config, "config is null"); requireNonNull(split, "split is null"); ElasticsearchTableDescription table = split.getTable(); columns = columnHandles; tupleDomain = split.getTupleDomain(); index = split.getIndex(); type = table.getType(); shard = split.getShard(); try { Settings settings = Settings.builder() .put("client.transport.ignore_cluster_name", true) .build(); InetAddress address = InetAddress.getByName(split.getSearchNode()); client = new PreBuiltTransportClient(settings) .addTransportAddress(new TransportAddress(address, split.getPort())); } catch (UnknownHostException e) { throw new PrestoException(ELASTICSEARCH_CONNECTION_ERROR, format("Error connecting to search node (%s:%d)", split.getSearchNode(), split.getPort()), e); } scrollTimeout = config.getScrollTimeout(); scrollSize = config.getScrollSize(); }
Source:
public PlaylistFragment(){ for(SongMetadata s : metadataList){ s.setTitle("This is a really really really looooooooooooooooooooooooooooooooooooooooooooooong Title"); s.setAlbum("Album is super freaking long too"); s.setArtist("Artist is too, but not as much"); } metadataList.get(0).setUsername("Reid"); metadataList.get(1).setUsername("Lizziemom"); metadataList.get(2).setUsername("Greenie"); }

Target:
public PlaylistFragment(){ for(SongMetadata s : metadataList){ s.setTitle("This is a really really really loooooooooooooooooooooo" + "ooooooooooooooooooooooooong Title"); s.setAlbum("Album is super freaking long too"); s.setArtist("Artist is too, but not as much"); } metadataList.get(0).setUsername("Reid"); metadataList.get(1).setUsername("Lizziemom"); metadataList.get(2).setUsername("Greenie"); }
Source:
private DatastreamDocument getXMLDatastreamIfExists(PID pid, String datastreamName) throws FedoraException { log.debug("Attempting to get datastream " + datastreamName + " for object " + pid); try { while (true) { edu.unc.lib.dl.fedora.types.Datastream datastream = managementClient.getDatastream(pid, datastreamName); if (datastream == null) { return null; } log.debug("Got datastream, attempting to get dissemination version with create date " + managementClient.getDatastream(pid, datastreamName).getCreateDate()); try { MIMETypedStream mts = accessClient.getDatastreamDissemination(pid, datastreamName, datastream.getCreateDate()); try (ByteArrayInputStream bais = new ByteArrayInputStream(mts.getStream())) { Document dsDoc = new SAXBuilder().build(bais); return new DatastreamDocument(dsDoc, datastream.getCreateDate()); } catch (JDOMException | IOException e) { throw new ServiceException("Failed to parse datastream " + datastreamName + " for object " + pid, e); } } catch (NotFoundException e) { log.debug("No dissemination version for create date " + datastream.getCreateDate() + " found, retrying"); } } } catch (NotFoundException e) { return null; } }

Target:
private DatastreamDocument getXMLDatastreamIfExists(PID pid, String datastreamName) throws FedoraException { log.debug("Attempting to get datastream " + datastreamName + " for object " + pid); try { while (true) { edu.unc.lib.dl.fedora.types.Datastream datastream = managementClient.getDatastream(pid, datastreamName); if (datastream == null) { return null; } log.debug("Got datastream, attempting to get dissemination version with create date " + datastream.getCreateDate()); try { MIMETypedStream mts = accessClient.getDatastreamDissemination(pid, datastreamName, datastream.getCreateDate()); try (ByteArrayInputStream bais = new ByteArrayInputStream(mts.getStream())) { Document dsDoc = new SAXBuilder().build(bais); return new DatastreamDocument(dsDoc, datastream.getCreateDate()); } catch (JDOMException | IOException e) { throw new ServiceException("Failed to parse datastream " + datastreamName + " for object " + pid, e); } } catch (NotFoundException e) { log.debug("No dissemination version for create date " + datastream.getCreateDate() + " found, retrying"); } } } catch (NotFoundException e) { return null; } }
Source:
public static Neo4jBoltClient getInstance(Neo4jConfiguration neo4jConfiguration) { if ( INSTANCE_MAP != null && INSTANCE_MAP.size() > 0 && INSTANCE_MAP.containsKey(neo4jConfiguration) ) return INSTANCE_MAP.get(neo4jConfiguration); else { Neo4jBoltClient instance = new Neo4jBoltClient(neo4jConfiguration); if( instance != null && instance.client != null ) { INSTANCE_MAP.put(neo4jConfiguration, instance); return instance; } else { return null; } } }

Target:
public static Neo4jBoltClient getInstance(Neo4jConfiguration neo4jConfiguration) { if ( INSTANCE_MAP != null && INSTANCE_MAP.size() > 0 && INSTANCE_MAP.containsKey(neo4jConfiguration)) { return INSTANCE_MAP.get(neo4jConfiguration); } else { Neo4jBoltClient instance = new Neo4jBoltClient(neo4jConfiguration); if( instance != null && instance.client != null ) { INSTANCE_MAP.put(neo4jConfiguration, instance); return instance; } else { return null; } } }
Source:
public void testRemoveValueNoStoreEntryCacheAccessExceptionEqualCacheWriterEntry() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); final MockCacheWriter realCache = new MockCacheWriter(Collections.singletonMap("key", "value")); this.cacheWriter = spy(realCache); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verify(this.spiedResilienceStrategy) .removeFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(false)); assertThat(realCache.getEntries().containsKey("key"), is(true)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }

Target:
public void testRemoveValueNoStoreEntryCacheAccessExceptionEqualCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.singletonMap("key", "value")); this.cacheWriter = spy(fakeWriter); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); ehcache.remove("key", "value"); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verify(this.spiedResilienceStrategy) .removeFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(false)); assertThat(fakeWriter.getEntryMap().containsKey("key"), is(true)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }
Source:
public String format(String projectName, String revision, ConfigSection globalCfg, InputStream raw) throws IOException { html.startDocument() .openHead() .closeHead() .openBody() .openTable() .appendCellHeader("name") .appendCellHeader("size") .appendCellHeader("last modified"); try (ZipInputStream zip = new ZipInputStream(raw)) { ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { html.openRow() .appendCell(entry.getName()); if (!entry.isDirectory()) { if (entry.getSize() != -1) { html.appendCell(FileUtils.byteCountToDisplaySize(entry.getSize())); } else { html.appendCell("n/a"); } } else { html.appendCell(); } html.appendDateCell(entry.getTime()) .closeRow(); } } html.closeTable() .closeBody() .endDocument(); return util.applyCss(html.toString(), NAME, projectName); }

Target:
public String format(String projectName, String revision, ConfigSection globalCfg, InputStream raw) throws IOException { html.startDocument() .openHead() .closeHead() .openBody() .openTable() .appendCellHeader("name") .appendCellHeader("size") .appendCellHeader("last modified"); try (ZipInputStream zip = new ZipInputStream(raw)) { for (ZipEntry entry; (entry = zip.getNextEntry()) != null;) { html.openRow() .appendCell(entry.getName()); if (!entry.isDirectory()) { if (entry.getSize() != -1) { html.appendCell(FileUtils.byteCountToDisplaySize(entry.getSize())); } else { html.appendCell("n/a"); } } else { html.appendCell(); } html.appendDateCell(entry.getTime()) .closeRow(); } } html.closeTable() .closeBody() .endDocument(); return util.applyCss(html.toString(), NAME, projectName); }
Source:
protected void refreshVisuals() { Connector connector = (Connector) getNotationView(); NamedStyle namedStyle = connector.getNamedStyle(NotationPackage.Literals.INT_VALUE_STYLE, "delta"); if (namedStyle instanceof IntValueStyle) { int delta = ((IntValueStyle) namedStyle).getIntValue(); ((DurationLinkFigure) getFigure()).setArrowPositionDelta(delta); } super.refreshVisuals(); }

Target:
protected void refreshVisuals() { Connector connector = (Connector) getNotationView(); NamedStyle namedStyle = connector.getNamedStyle(NotationPackage.Literals.INT_VALUE_STYLE, "delta"); if (namedStyle instanceof IntValueStyle) { refreshArrowDelta((IntValueStyle) namedStyle); } super.refreshVisuals(); }
Source:
public synchronized void clearCache(HelixConstants.ChangeType changeType) { switch (changeType) { case LIVE_INSTANCE: case INSTANCE_CONFIG: LOG.warn("clearCache is deprecated for changeType: " + changeType); break; case EXTERNAL_VIEW: _externalViewCache.clear(); break; default: break; } }

Target:
public synchronized void clearCache(HelixConstants.ChangeType changeType) { switch (changeType) { case LIVE_INSTANCE: case INSTANCE_CONFIG: LOG.warn("clearCache is deprecated for changeType: {}.", changeType); break; case EXTERNAL_VIEW: _externalViewCache.clear(); break; default: break; } }
Source:
public static Geometry unifyWindingOrder(Geometry geometry, boolean counterClockWise) { if (geometry == null) { return null; } if (geometry instanceof MultiPolygon) { return unifyWindingOrderForMultiPolygon((MultiPolygon) geometry, counterClockWise); } else if (geometry instanceof Polygon) { return unifyWindingOrderForPolyGon((Polygon) geometry, counterClockWise); } else if (geometry instanceof LinearRing) { return unifyWindingOrderForLinearRing((LinearRing) geometry, counterClockWise); } else if (geometry instanceof GeometryCollection && geometry.getClass() == GeometryCollection.class) { return unifyWindingOrderForGeometryCollection((GeometryCollection) geometry, counterClockWise); } else return geometry; }

Target:
public static Geometry unifyWindingOrder(Geometry geometry, boolean counterClockWise) { if (geometry == null) { return null; } if (geometry instanceof MultiPolygon) { return unifyWindingOrderForMultiPolygon((MultiPolygon) geometry, counterClockWise); } else if (geometry instanceof Polygon) { return unifyWindingOrderForPolyGon((Polygon) geometry, counterClockWise); } else if (geometry instanceof LinearRing) { return unifyWindingOrderForLinearRing((LinearRing) geometry, counterClockWise); } else if (GeometryCollection.class.equals(geometry.getClass())) { return unifyWindingOrderForGeometryCollection((GeometryCollection) geometry, counterClockWise); } else return geometry; }
Source:
private void dumpLibraryProperties(@CheckForNull ZipOutputStream zos) { Properties libraryProperties = new Properties(); libraryProperties.put(KEY_LIB_EMITTER, "jill " + version); libraryProperties.put(KEY_LIB_MAJOR_VERSION, "0"); libraryProperties.put(KEY_LIB_MINOR_VERSION, "0"); libraryProperties.put(KEY_JAYCE, String.valueOf(true)); libraryProperties.put(KEY_JAYCE_MAJOR_VERSION, "2"); libraryProperties.put(KEY_JAYCE_MINOR_VERSION, "14"); if (zos != null) { dumpPropertiesToZip(zos, libraryProperties); } else { dumpPropertiesToFile(new File(options.getOutputDir(), LIBRARY_PROPERTIES), libraryProperties); } }

Target:
private void dumpLibraryProperties(@CheckForNull ZipOutputStream zos) { Properties libraryProperties = new Properties(); libraryProperties.put(KEY_LIB_EMITTER, "jill " + version); libraryProperties.put(KEY_LIB_MAJOR_VERSION, LIB_MAJOR_VERSION); libraryProperties.put(KEY_LIB_MINOR_VERSION, LIB_MINOR_VERSION); libraryProperties.put(KEY_JAYCE, String.valueOf(true)); libraryProperties.put(KEY_JAYCE_MAJOR_VERSION, JAYCE_MAJOR_VERSION); libraryProperties.put(KEY_JAYCE_MINOR_VERSION, JAYCE_MINOR_VERSION); if (zos != null) { dumpPropertiesToZip(zos, libraryProperties); } else { dumpPropertiesToFile(new File(options.getOutputDir(), LIBRARY_PROPERTIES), libraryProperties); } }
Source:
public SerializableProtobuf(T object, ProtobufCodec<T> codec) { buf = new byte[codec.sizeof(object)]; codec.encode(object, buf); this.object = object; this.codec = codec; hash = object.hashCode(); }

Target:
SerializableProtobuf(T object, ProtobufCodec<T> codec) { this.object = object; this.codec = codec; this.hash = object.hashCode(); }
Source:
private void initTemplates(List<VmTemplate> templates) { List<VmTemplate> rootTemplates = keepBaseTemplates(templates); List<VmTemplate> templatesList = new ArrayList<>(); DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); StoragePool selectedDataCenter = dataCenterWithCluster.getDataCenter(); Guid selectedDataCenterId = selectedDataCenter.getId(); if (selectedDataCenterId == null) { return; } for (VmTemplate template : rootTemplates) { Guid datacenterId = template.getStoragePoolId() == null ? Guid.Empty : template.getStoragePoolId(); if (!template.isBlank() && selectedDataCenterId.equals(datacenterId) && template.getStatus() == VmTemplateStatus.OK) { templatesList.add(template); } } Collections.sort(templatesList, new NameableComparator()); List<VmTemplate> filteredTemplates = AsyncDataProvider.getInstance().filterTemplatesByArchitecture(templatesList, dataCenterWithCluster.getCluster().getArchitecture()); if (filteredTemplates.isEmpty()) { getModel().getIsSubTemplate().setEntity(false); getModel().getIsSubTemplate().setIsChangeable(false, constants.someNonDefaultTemplateHasToExistFirst()); return; } getModel().getIsSubTemplate().setEntity(false); getModel().getIsSubTemplate().setIsChangeable(true); VmTemplate currentTemplate = Linq.firstOrDefault(templates, new Linq.TemplatePredicate(getVm().getVmtGuid())); getModel().getBaseTemplate().setItems(filteredTemplates); getModel().getBaseTemplate().setSelectedItem(Linq.firstOrDefault(filteredTemplates, new Linq.TemplatePredicate(currentTemplate.getBaseTemplateId()))); }

Target:
private void initTemplates(List<VmTemplate> templates) { List<VmTemplate> rootTemplates = keepBaseTemplates(templates); List<VmTemplate> templatesList = new ArrayList<>(); DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); StoragePool selectedDataCenter = dataCenterWithCluster.getDataCenter(); Guid selectedDataCenterId = selectedDataCenter.getId(); if (selectedDataCenterId == null) { return; } for (VmTemplate template : rootTemplates) { Guid datacenterId = template.getStoragePoolId() == null ? Guid.Empty : template.getStoragePoolId(); if (!template.isBlank() && selectedDataCenterId.equals(datacenterId) && template.getStatus() == VmTemplateStatus.OK) { templatesList.add(template); } } Collections.sort(templatesList, new NameableComparator()); List<VmTemplate> filteredTemplates = AsyncDataProvider.getInstance().filterTemplatesByArchitecture(templatesList, dataCenterWithCluster.getCluster().getArchitecture()); getModel().getIsSubTemplate().setEntity(false); if (filteredTemplates.isEmpty()) { getModel().getIsSubTemplate().setIsChangeable(false, constants.someNonDefaultTemplateHasToExistFirst()); return; } getModel().getIsSubTemplate().setIsChangeable(true); VmTemplate currentTemplate = Linq.firstOrDefault(templates, new Linq.TemplatePredicate(getVm().getVmtGuid())); getModel().getBaseTemplate().setItems(filteredTemplates); getModel().getBaseTemplate().setSelectedItem(Linq.firstOrDefault(filteredTemplates, new Linq.TemplatePredicate(currentTemplate.getBaseTemplateId()))); }
Source:
public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.P_STANDARD, ""); store.setDefault(PreferenceConstants.P_CLASSIFICATION, ""); store.setDefault(PreferenceConstants.P_APPLICATION_DOMAIN, ""); store.setDefault(PreferenceConstants.P_FUNCTION, ""); store.setDefault(PreferenceConstants.P_TYPE, ""); store.setDefault(PreferenceConstants.P_DESCRIPTION, ""); store.setDefault(PreferenceConstants.P_VERSION, ""); store.setDefault(PreferenceConstants.P_ORGANIZATION, ""); store.setDefault(PreferenceConstants.P_AUTHOR, ""); store.setDefault(PreferenceConstants.P_DATE, ""); store.setDefault(PreferenceConstants.P_REMARKS, ""); }

Target:
public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.P_STANDARD, ""); store.setDefault(PreferenceConstants.P_CLASSIFICATION, ""); store.setDefault(PreferenceConstants.P_APPLICATION_DOMAIN, ""); store.setDefault(PreferenceConstants.P_FUNCTION, ""); store.setDefault(PreferenceConstants.P_TYPE, ""); store.setDefault(PreferenceConstants.P_DESCRIPTION, ""); store.setDefault(PreferenceConstants.P_VERSION, "1.0"); store.setDefault(PreferenceConstants.P_ORGANIZATION, ""); store.setDefault(PreferenceConstants.P_AUTHOR, System.getProperty("user.name")); store.setDefault(PreferenceConstants.P_REMARKS, ""); }
Source:
public String toString() { StringBuffer sb = new StringBuffer(); String[] paths = getNativePaths(); for (int i = 0; i < paths.length; i++) { if (i > 0) { sb.append("; "); } sb.append(paths[i]); } String[] procs = getProcessors(); for (String proc : procs) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_PROCESSOR); sb.append('='); sb.append(proc); } String[] oses = getOSNames(); for (String ose : oses) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_OSNAME); sb.append('='); sb.append(ose); } VersionRange[] osRanges = getOSVersions(); for (VersionRange osRange : osRanges) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_OSVERSION); sb.append("=\""); sb.append(osRange.toString()); sb.append('"'); } String[] langs = getLanguages(); for (String lang : langs) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_LANGUAGE); sb.append('='); sb.append(lang); } Filter f = getFilter(); if (f != null) { sb.append("; "); sb.append(Constants.SELECTION_FILTER_ATTRIBUTE); sb.append("=\""); sb.append(f.toString()); sb.append('"'); } return (sb.toString()); }

Target:
public String toString() { StringBuffer sb = new StringBuffer(); String[] paths = getNativePaths(); for (int i = 0; i < paths.length; i++) { if (i > 0) { sb.append("; "); } sb.append(paths[i]); } String[] procs = getProcessors(); for (String proc : procs) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_PROCESSOR); sb.append('='); sb.append(proc); } String[] oses = getOSNames(); for (String os : oses) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_OSNAME); sb.append('='); sb.append(os); } VersionRange[] osRanges = getOSVersions(); for (VersionRange osRange : osRanges) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_OSVERSION); sb.append("=\""); sb.append(osRange.toString()); sb.append('"'); } String[] langs = getLanguages(); for (String lang : langs) { sb.append("; "); sb.append(Constants.BUNDLE_NATIVECODE_LANGUAGE); sb.append('='); sb.append(lang); } Filter f = getFilter(); if (f != null) { sb.append("; "); sb.append(Constants.SELECTION_FILTER_ATTRIBUTE); sb.append("=\""); sb.append(f.toString()); sb.append('"'); } return (sb.toString()); }
Source:
private void pushJetpackProtectAndSsoSettings() { final Map<String, Object> params = serializeJetpackProtectAndSsoParams(); if (params.isEmpty()) { return; } WordPress.getRestClientUtilsV1_1().setJetpackSettings(mSite.getSiteId(), params, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Jetpack settings updated"); mRemoteJpSettings.monitorActive = mJpSettings.monitorActive; mRemoteJpSettings.jetpackProtectEnabled = mJpSettings.jetpackProtectEnabled; mRemoteJpSettings.jetpackProtectWhitelist.clear(); mRemoteJpSettings.jetpackProtectWhitelist.addAll(mJpSettings.jetpackProtectWhitelist); mRemoteJpSettings.ssoActive = mJpSettings.ssoActive; mRemoteJpSettings.ssoMatchEmail = mJpSettings.ssoMatchEmail; mRemoteJpSettings.ssoRequireTwoFactor = mJpSettings.ssoRequireTwoFactor; notifySavedOnUiThread(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error updating Jetpack settings: " + error); notifySavedOnUiThread(error); } }); }

Target:
private void pushJetpackProtectAndSsoSettings() { final Map<String, Object> params = serializeJetpackProtectAndSsoParams(); if (params.isEmpty()) { AppLog.v(AppLog.T.API, "No Jetpack settings changes detected. Skipping network POST call."); return; } final JetpackSettingsModel sentJpData = new JetpackSettingsModel(mJpSettings); WordPress.getRestClientUtilsV1_1().setJetpackSettings(mSite.getSiteId(), params, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.d(AppLog.T.API, "Jetpack settings updated"); mRemoteJpSettings.monitorActive = sentJpData.monitorActive; mRemoteJpSettings.jetpackProtectEnabled = sentJpData.jetpackProtectEnabled; mRemoteJpSettings.jetpackProtectWhitelist.clear(); mRemoteJpSettings.jetpackProtectWhitelist.addAll(sentJpData.jetpackProtectWhitelist); mRemoteJpSettings.ssoActive = sentJpData.ssoActive; mRemoteJpSettings.ssoMatchEmail = sentJpData.ssoMatchEmail; mRemoteJpSettings.ssoRequireTwoFactor = sentJpData.ssoRequireTwoFactor; notifySavedOnUiThread(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error updating Jetpack settings: " + error); notifySavedOnUiThread(error); } }); }
Source:
private String getFullArtifactName( DependencyNode node, boolean usePremanaged ) { Artifact artifact = node.getArtifact(); String version = node.getPremanagedVersion(); if ( !usePremanaged || version == null ) { version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } String result = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version; if ( artifact.getScope() != null ) { result += " [" + artifact.getScope() + ']'; if ( "compile".equals( artifact.getScope() ) ) { result = MessageUtils.buffer().strong( result ).toString(); } } return result; }

Target:
private String getFullArtifactName( DependencyNode node, boolean usePremanaged ) { Artifact artifact = node.getArtifact(); String version = node.getPremanagedVersion(); if ( !usePremanaged || version == null ) { version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion(); } String result = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version; if ( "compile".equals( artifact.getScope() ) ) { return MessageUtils.buffer().strong( result ).toString(); } if ( artifact.getScope() != null ) { return result + " [" + artifact.getScope() + ']'; } return result; }
Source:
private static String getPersistenceXml() { return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<persistence xmlns=\"<LINK_3>\" xmlns:orm=\"<LINK_2>\" xmlns:xsi=\"<LINK_1>\" version=\"2.0\" xsi:schemaLocation=\"<LINK_3> <LINK_0> <LINK_2> <LINK_2>_2_0.xsd\">\n" + " <persistence-unit name=\"org.jbpm.test:test-module:1.0.0-SNAPSHOT\" transaction-type=\"JTA\">\n" + " <provider>org.hibernate.ejb.HibernatePersistence</provider>\n" + " <jta-data-source>java:jdbc/testDS1</jta-data-source>\n" + " <class>example.CaseDetail</class>\n" + " <class>org.drools.persistence.jpa.marshaller.MappedVariable</class>\n" + " <class>org.drools.persistence.jpa.marshaller.VariableEntity</class>\n" + " <exclude-unlisted-classes>true</exclude-unlisted-classes>\n" + " <properties>\n" + " <property name=\"hibernate.dialect\" value=\"org.hibernate.dialect.PostgreSQLDialect\"/>\n" + " <property name=\"hibernate.max_fetch_depth\" value=\"3\"/>\n" + " <property name=\"hibernate.hbm2ddl.auto\" value=\"update\"/>\n" + " <property name=\"hibernate.show_sql\" value=\"false\"/>\n" + " <property name=\"hibernate.id.new_generator_mappings\" value=\"false\"/>\n" + " <property name=\"hibernate.transaction.jta.platform\" value=\"org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform\"/>\n" + " </properties>\n" + " </persistence-unit>\n" + "</persistence>"; }

Target:
private static String getPersistenceXml() { File entityTestPersistence = new File("src/test/resources/entity/entity-test-persistence.xml"); assertTrue(entityTestPersistence.exists()); return IoUtils.readFileAsString(entityTestPersistence); }