auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void offer( long candidate ) { long currentHighest; do { currentHighest = highestId.get(); if ( candidate < currentHighest ) { return; } } while ( !highestId.compareAndSet( currentHighest, candidate ) ); }

Target:
public void offer( long candidate ) { long currentHighest; do { currentHighest = highestId.get(); if ( candidate <= currentHighest ) { return; } } while ( !highestId.compareAndSet( currentHighest, candidate ) ); }
Source:
public List<ReviewFile> listFiles() { try { List<ReviewFile> files = new ArrayList<ReviewFile>(); Map<String, FileInfo> changeFiles = gerritApi.changes() .id(gerritPatchset.getChangeId()).revision(gerritPatchset.getRevisionId()).files(); for (Map.Entry<String, FileInfo> entry : changeFiles.entrySet()) { if (COMMIT_MSG.equals(entry.getKey())) { continue; } FileInfo fileInfo = entry.getValue(); if (fileInfo.status != null && fileInfo.status == 'D') { continue; } files.add(new ReviewFile(entry.getKey())); } return files; } catch (RestApiException e) { throw new GerritException("Error when listing files", e); } }

Target:
public List<ReviewFile> listFiles() { try { List<ReviewFile> files = new ArrayList<ReviewFile>(); Map<String, FileInfo> changeFiles = gerritApi.changes() .id(gerritPatchset.getChangeId()).revision(gerritPatchset.getRevisionId()).files(); for (Map.Entry<String, FileInfo> changeFileEntry : changeFiles.entrySet()) { if (COMMIT_MSG.equals(changeFileEntry.getKey())) { continue; } FileInfo fileInfo = changeFileEntry.getValue(); if (isDeleted(fileInfo)) { continue; } files.add(new ReviewFile(changeFileEntry.getKey())); } return files; } catch (RestApiException e) { throw new GerritException("Error when listing files", e); } }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ENABLE_GLUSTER_HOOK); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_HOOK); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ENABLE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_HOOK); }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); context.record( TransformLineageRecorderUtils.oneToOneIn(TransformLineageRecorderUtils.getFields(outSchema), "decompress", "Use the specified algorithm to decompress specific fields.")); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); parseConfiguration(config.decompressor, context.getFailureCollector()); List<String> inFields = TransformLineageRecorderUtils.getFields(context.getInputSchema()); List<String> outFields = TransformLineageRecorderUtils.getFields(context.getOutputSchema()); List<String> identityFields = outFields.stream() .filter(field -> !deCompMap.containsKey(field) || deCompMap.get(field) == DecompressorType.NONE) .collect(Collectors.toList()); List<String> processedFields = new ArrayList<>(outFields); processedFields.removeAll(identityFields); List<String> droppedFields = new ArrayList<>(inFields); droppedFields.removeAll(outFields); List<FieldOperation> output = new ArrayList<>(); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(processedFields, "decompress", "Used the specified algorithm to decompress the field.")); output.addAll(TransformLineageRecorderUtils.generateDrops(droppedFields)); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(identityFields, "identity", TransformLineageRecorderUtils.IDENTITY_TRANSFORM_DESCRIPTION)); context.record(output); }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { File originalFile = ServletUtils.makeFileFromSanePath(request.getPathInfo(), base); Locale locale = getLocaleFromRequest(request); File file = determineActualFile(request, locale); file = checkForIndex(request, response, file, request.getPathInfo()); if (null == file) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else if (!response.isCommitted()){ Object languagePageShown = request.getSession(true).getAttribute(LANG_PAGE_SHOWN); if (!file.equals(originalFile)) { String redirect = request.getServletPath() + replaceLocaleWithUSLocale(request.getPathInfo(), locale); if ((null == languagePageShown || !Boolean.parseBoolean(languagePageShown.toString()))) { request.getSession(true).setAttribute(LANG_PAGE_SHOWN, true); request.setAttribute(LOCALE, locale); request.setAttribute(ENGLISH_HREF, redirect); RequestDispatcher dispatcher = request.getRequestDispatcher(LANG_JSP); if (dispatcher != null) { dispatcher.include(request, response); } } else { response.sendRedirect(redirect); } } else { ServletUtils.sendFile(request, response, file, type); } } }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { File originalFile = ServletUtils.makeFileFromSanePath(request.getPathInfo(), base); Locale locale = getLocaleFromRequest(request); File file = determineActualFile(request, locale); file = checkForIndex(request, response, file, request.getPathInfo()); if (file == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else if (!response.isCommitted()){ Object languagePageShown = request.getSession(true).getAttribute(LANG_PAGE_SHOWN); if (!file.equals(originalFile)) { String redirect = request.getServletPath() + replaceLocaleWithUSLocale(request.getPathInfo(), locale); if ((languagePageShown == null || !Boolean.parseBoolean(languagePageShown.toString()))) { request.getSession(true).setAttribute(LANG_PAGE_SHOWN, true); request.setAttribute(LOCALE, locale); request.setAttribute(ENGLISH_HREF, redirect); RequestDispatcher dispatcher = request.getRequestDispatcher(LANG_JSP); if (dispatcher != null) { dispatcher.include(request, response); } } else { response.sendRedirect(redirect); } } else { ServletUtils.sendFile(request, response, file, type); } } }
Source:
public int evaluate(IRoutingTile tile, EntityMinecart cart) { if (conditions == null) return 0; EntityMinecart controllingCart = getRoutableCart(cart); if (controllingCart == null) return 0; for (Condition condition : conditions) { int value = condition.evaluate(tile, controllingCart); if (value != 0) return value; } return 0; }

Target:
public int evaluate(IRoutingTile tile, EntityMinecart cart) { if (expressions == null) return NO_POWER; EntityMinecart controllingCart = getRoutableCart(cart); if (controllingCart == null) return NO_POWER; for (Expression expression : expressions) { int value = expression.evaluate(tile, controllingCart); if (value != NO_POWER) return value; } return NO_POWER; }
Source:
private void downloadComponent(ComponentInstallationJob job) { Path tempZipPath = null; try { tempZipPath = Files.createTempFile(job.getComponent(), ""); DigitalExchangeBaseCall call = new DigitalExchangeBaseCall( HttpMethod.GET, "digitalExchange", "components", job.getComponent(), "packages"); try (InputStream in = client.getStreamResponse(job.getDigitalExchange(), call)) { Files.copy(in, tempZipPath, StandardCopyOption.REPLACE_EXISTING); } createComponentsDir(); extractZip(tempZipPath); } catch (ApsSystemException | IOException | UncheckedIOException ex) { logger.error("Error while downloading component", ex); throw new InstallationException("Unable to save component", ex); } finally { if (tempZipPath != null) { tempZipPath.toFile().delete(); } } }

Target:
private void downloadComponent(ComponentInstallationJob job) { Path tempZipPath = null; try { tempZipPath = Files.createTempFile(job.getComponent(), ""); DigitalExchangeBaseCall call = new DigitalExchangeBaseCall( HttpMethod.GET, "digitalExchange", "components", job.getComponent(), "packages"); try (InputStream in = client.getStreamResponse(job.getDigitalExchange(), call)) { Files.copy(in, tempZipPath, StandardCopyOption.REPLACE_EXISTING); } createComponentsDir(); extractZip(tempZipPath); } catch (ApsSystemException | IOException | UncheckedIOException ex) { logger.error("Error while downloading component", ex); throw new InstallationException("Unable to save component", ex); } finally { if (tempZipPath != null) { if (!tempZipPath.toFile().delete()) { logger.warn("Unable to delete temporary zip file {}", tempZipPath.toFile().getAbsolutePath()); } } } }
Source:
public static void writeBigEndianLongToOutputStream(OutputStream out, long value, ByteBuffer helperBuffer) throws IOException { if (helperBuffer.order() != ByteOrder.BIG_ENDIAN) { throw new IllegalArgumentException("Expected big-endian byteBuffer"); } helperBuffer.putLong(0, value); out.write(helperBuffer.array(), 0, 8); }

Target:
public static void writeBigEndianLongToOutputStream(OutputStream out, long value, ByteBuffer helperBuffer) throws IOException { if (helperBuffer.order() != ByteOrder.BIG_ENDIAN || !helperBuffer.hasArray()) { throw new IllegalArgumentException("Expected writable, big-endian, heap byteBuffer"); } helperBuffer.putLong(0, value); out.write(helperBuffer.array(), helperBuffer.arrayOffset(), Longs.BYTES); }
Source:
private boolean dbDelete(ContentType type) throws DotDataException { if (type.defaultType()) { throw new DotDataException("contenttype.delete.cannot.delete.default.type"); } if (type.system()) { throw new DotDataException("contenttype.delete.cannot.delete.system.type"); } new FieldFactoryImpl().deleteByContentType(type); updateFolderFileAssetReferences(type); APILocator.getContainerAPI().deleteContainerStructureByContentType(type); deleteContentletsByType(type); deleteWorkflowSchemeReference(type); APILocator.getPermissionAPI().removePermissions(type); deleteRelationships(type); DotConnect dc = new DotConnect(); dc.setSQL(this.contentTypeSql.DELETE_TYPE_BY_INODE).addParam(type.id()).loadResult(); dc.setSQL(this.contentTypeSql.DELETE_INODE_BY_INODE).addParam(type.id()).loadResult(); return true; }

Target:
private boolean dbDelete(ContentType type) throws DotDataException { if (type.defaultType()) { throw new DotDataException("contenttype.delete.cannot.delete.default.type"); } if (type.system()) { throw new DotDataException("contenttype.delete.cannot.delete.system.type"); } FactoryLocator.getFieldFactory().deleteByContentType(type); updateFolderFileAssetReferences(type); APILocator.getContainerAPI().deleteContainerStructureByContentType(type); deleteContentletsByType(type); deleteWorkflowSchemeReference(type); APILocator.getPermissionAPI().removePermissions(type); deleteRelationships(type); DotConnect dc = new DotConnect(); dc.setSQL(this.contentTypeSql.DELETE_TYPE_BY_INODE).addParam(type.id()).loadResult(); dc.setSQL(this.contentTypeSql.DELETE_INODE_BY_INODE).addParam(type.id()).loadResult(); return true; }
Source:
public int concurrencyKey(EntityMessage entityMessage) { if (entityMessage instanceof ServerStoreOpMessage.GetMessage) { return UNIVERSAL_KEY; } else if (entityMessage instanceof ConcurrentEntityMessage) { ConcurrentEntityMessage concurrentEntityMessage = (ConcurrentEntityMessage) entityMessage; return DATA_CONCURRENCY_KEY_OFFSET + Math.abs(concurrentEntityMessage.concurrencyKey() % bucketCount); } else { return DEFAULT_KEY; } }

Target:
public int concurrencyKey(EntityMessage entityMessage) { if (entityMessage instanceof ServerStoreOpMessage.GetMessage) { return UNIVERSAL_KEY; } else if (entityMessage instanceof ConcurrentEntityMessage) { ConcurrentEntityMessage concurrentEntityMessage = (ConcurrentEntityMessage) entityMessage; return DATA_CONCURRENCY_KEY_OFFSET + mapper.getSegmentForKey(concurrentEntityMessage.concurrencyKey()); } else { return DEFAULT_KEY; } }
Source:
public void canMakeGetRequest() throws IOException { String url = "<LINK_0>"; String expectedResp; if (System.getenv("GOOGLE_CLOUD_PROJECT") != null) { expectedResp = "Id token query succeeded"; } else { expectedResp = "Id token query failed"; } Authentication.makeGetRequest(url); String got = bout.toString(); assertThat(got, containsString(expectedResp)); }

Target:
public void canMakeGetRequest() throws IOException { String url = "<LINK_0>"; Authentication.makeGetRequest(url); String got = bout.toString(); assertThat(got, containsString(expectedResp)); }
Source:
public byte[] getCacheKey() { return new CacheKeyBuilder(DimFilterUtils.SELECTOR_CACHE_ID) .appendCacheablesIgnoringOrder(dimensions) .build(); }

Target:
public byte[] getCacheKey() { return new CacheKeyBuilder(DimFilterUtils.COLUMN_COMPARISON_CACHE_ID) .appendCacheablesIgnoringOrder(dimensions) .build(); }
Source:
private String getSystemPassword() { String password = ""; if (StringUtils.isEmpty(this.hadoopSecurityCredentialPath)) { password = this.systemPassword; } else { try { Configuration configuration = new Configuration(); configuration.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, this.hadoopSecurityCredentialPath); CredentialProvider provider = CredentialProviderFactory.getProviders(configuration).get(0); CredentialProvider.CredentialEntry credEntry = provider.getCredentialEntry( keystorePass); if (credEntry != null) { password = new String(credEntry.getCredential()); } } catch (Exception e) { log.debug("ignored exception: " + e.getMessage()); } } return password; }

Target:
private String getSystemPassword() { String password = ""; if (StringUtils.isEmpty(this.hadoopSecurityCredentialPath)) { password = this.systemPassword; } else { try { Configuration configuration = new Configuration(); configuration.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, this.hadoopSecurityCredentialPath); CredentialProvider provider = CredentialProviderFactory.getProviders(configuration).get(0); CredentialProvider.CredentialEntry credEntry = provider.getCredentialEntry( keystorePass); if (credEntry != null) { password = new String(credEntry.getCredential()); } } catch (Exception e) { log.debug("ignored error from getting credential entry from keystore", e); } } return password; }
Source:
public static void downloadStormYaml(StormMaster.Client client, String storm_yaml_output) { String conf_str = "Not Avaialble"; try { conf_str = client.getStormConf(); } catch (TTransportException ex) { LOG.warn("Exception in downloading storm.yaml:"+ex.toString()); } catch (TException e) { LOG.warn("Exception in downloading storm.yaml:"+e.toString()); } try { Object json = JSONValue.parse(conf_str); Map<?, ?> conf = (Map<?, ?>)json; Yaml yaml = new Yaml(); if (storm_yaml_output == null) { LOG.info("storm.yaml downloaded:"); System.out.println(yaml.dump(conf)); } else { FileWriter out = new FileWriter(storm_yaml_output); yaml.dump(conf, out); out.flush(); out.close(); LOG.info("storm.yaml downloaded into "+storm_yaml_output); } } catch (Exception ex) { LOG.error("Exception in storing storm.yaml. "+ ex.toString()); } }

Target:
public static void downloadStormYaml(StormMaster.Client client, String storm_yaml_output) { String conf_str = "Not Avaialble"; try { conf_str = client.getStormConf(); } catch (TTransportException ex) { LOG.error("Exception in downloading storm.yaml", ex); } catch (TException ex) { LOG.error("Exception in downloading storm.yaml", ex); } try { Object json = JSONValue.parse(conf_str); Map<?, ?> conf = (Map<?, ?>)json; Yaml yaml = new Yaml(); if (storm_yaml_output == null) { LOG.info("storm.yaml downloaded:"); System.out.println(yaml.dump(conf)); } else { FileWriter out = new FileWriter(storm_yaml_output); yaml.dump(conf, out); out.flush(); out.close(); LOG.info("storm.yaml downloaded into "+storm_yaml_output); } } catch (Exception ex) { LOG.error("Exception in storing storm.yaml. ", ex); } }
Source:
private boolean isRedeployAfterRemoval(ModelNode operation) { return operation.hasDefined(REMOVE) && operation.get(REMOVE).asBoolean(); }

Target:
private boolean isRedeployAfterRemoval(ModelNode operation) { return operation.hasDefined(DEPLOYMENT_OVERLAY_LINK_REMOVAL) && operation.get(DEPLOYMENT_OVERLAY_LINK_REMOVAL).asBoolean(); }
Source:
public void initializeContinueButton(GameContainer container) { mouseOverContinueButton = new MouseOverArea(container, null, container.getWidth() - margin - typeFontPlayer.getWidth(gameContinueText), container.getHeight() - margin - typeFontPlayer.getHeight(), typeFontPlayer.getWidth(gameContinueText), typeFontPlayer.getHeight()); }

Target:
private void initializeContinueButton(GameContainer container) { mouseOverContinueButton = new MouseOverArea(container, null, container.getWidth() - margin - typeFontPlayer.getWidth(gameContinueText), container.getHeight() - margin - typeFontPlayer.getHeight(), typeFontPlayer.getWidth(gameContinueText), typeFontPlayer.getHeight()); }
Source:
public void initialize(PerunSession sess) { if (!this.initialized.compareAndSet(false, true)) return; ExtSourceGoogle.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceVOOT.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceUnity.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceCSV.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceISMU.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceLdap.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceSql.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourcePerun.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceREMS.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceTCS.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceSqlComplex.setPerunBlImpl((PerunBlImpl) perunBl); ExtSourceXML.setPerunBlImpl((PerunBlImpl) perunBl); this.extSourcesManagerImpl.initialize(sess); cacheExtSourcesInMemory(sess); }

Target:
public void initialize(PerunSession sess) { if (!this.initialized.compareAndSet(false, true)) return; this.extSourcesManagerImpl.initialize(sess, perunBl); cacheExtSourcesInMemory(sess); }
Source:
private static void checkCanceled(IProgressMonitor pm) { if (pm.isCanceled()) throw new OperationCanceledException(); }

Target:
private static void checkCanceled(IProgressMonitor pm) { if (pm.isCanceled()) { throw new OperationCanceledException(); } }
Source:
public List<Comment> getAllComments(PaginationRequest request,String uuid) throws CommentManagementException, SQLException { PaginationResult paginationResult = new PaginationResult(); List<Comment> comments; request = Util.validateCommentListPageSize(request); if (log.isDebugEnabled()) { log.debug("get all comments of the application release"+uuid); } try { ConnectionManagerUtil.openDBConnection(); comments=commentDAO.getAllComments(uuid,request); int count=commentDAO.getCommentCount(request,uuid); paginationResult.setData(comments); paginationResult.setRecordsFiltered(count); paginationResult.setRecordsTotal(count); return comments; } catch (DBConnectionException e) { log.error("DB Connection Exception occurs.", e); } finally { ConnectionManagerUtil.closeDBConnection(); } return null; }

Target:
public List<Comment> getAllComments(PaginationRequest request, String uuid) throws CommentManagementException { PaginationResult paginationResult = new PaginationResult(); List<Comment> comments; request = Util.validateCommentListPageSize(request); if (log.isDebugEnabled()) { log.debug("get all comments of the application release" + uuid); } try { ConnectionManagerUtil.openDBConnection(); comments = commentDAO.getAllComments(uuid, request); int count = commentDAO.getCommentCount(request, uuid); paginationResult.setData(comments); paginationResult.setRecordsFiltered(count); paginationResult.setRecordsTotal(count); return comments; } catch (DBConnectionException e) { throw new CommentManagementException( "DB Connection error occurs ,Comments of application with UUID " + uuid + "cannot get.", e); } catch (SQLException e) { throw new CommentManagementException( "SQL Exception occurs,Comments of application with UUID " + uuid + "cannot get.", e); } finally { ConnectionManagerUtil.closeDBConnection(); } }
Source:
public BoundingBox(final List<Point> points) { if (points == null) { this.points = null; } else { this.points = Collections.unmodifiableList(new ArrayList<>(points)); } }

Target:
public BoundingBox(final List<Point> points) { if (points == null) { this.points = null; } else { this.points = Collections.unmodifiableList(points); } }
Source:
public SearchResultsWrapper select(String query) { HttpURLConnection connection = null; try { URL serverAddress = new URL(solrUrl+"select?"+query); connection = (HttpURLConnection)serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.connect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return new SearchResultsWrapper(connection); }

Target:
public SearchResultsWrapper select(String query) { HttpURLConnection connection = null; try { URL serverAddress = new URL(solrUrl+"select?"+query); connection = (HttpURLConnection)serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setConnectTimeout(5000); connection.setReadTimeout(5000); connection.connect(); } catch (MalformedURLException e) { log.error(e.getLocalizedMessage()); } catch (IOException e) { log.error(e.getLocalizedMessage()); } return new SearchResultsWrapper(connection); }
Source:
public void intercept(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { if (!COMMON_STRATEGY.equals(pvcStrategy) || isEphemeral(k8sEnv.getAttributes())) { return; } String namespace = identity.getInfrastructureNamespace(); String workspaceId = identity.getWorkspaceId(); RollableScalableResource<Deployment, DoneableDeployment> asyncStoragePodResource = getAsyncStoragePodResource(namespace, workspaceId); if (asyncStoragePodResource.get() == null) { return; } try { deleteAsyncStoragePod(asyncStoragePodResource) .get(DELETE_POD_TIMEOUT_IN_MIN, TimeUnit.MINUTES); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new InfrastructureException( format( "Interrupted while waiting for pod '%s' removal. " + ex.getMessage(), ASYNC_STORAGE), ex); } catch (ExecutionException ex) { throw new InfrastructureException( format( "Error occurred while waiting for pod '%s' removal. " + ex.getMessage(), ASYNC_STORAGE), ex); } catch (TimeoutException ex) { throw new InfrastructureException( format("Pod '%s' removal timeout reached " + ex.getMessage(), ASYNC_STORAGE), ex); } }

Target:
public void intercept(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { if (!COMMON_STRATEGY.equals(pvcStrategy) || isEphemeral(k8sEnv.getAttributes())) { return; } removeAsyncStoragePodWithoutDeployment(identity); String namespace = identity.getInfrastructureNamespace(); String workspaceId = identity.getWorkspaceId(); RollableScalableResource<Deployment, DoneableDeployment> asyncStorageDeploymentResource = getAsyncStorageDeploymentResource(namespace, workspaceId); if (asyncStorageDeploymentResource.get() == null) { return; } try { deleteAsyncStorageDeployment(asyncStorageDeploymentResource) .get(DELETE_DEPLOYMENT_TIMEOUT_IN_MIN, TimeUnit.MINUTES); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new InfrastructureException( format( "Interrupted while waiting for deployment '%s' removal. " + ex.getMessage(), ASYNC_STORAGE), ex); } catch (ExecutionException ex) { throw new InfrastructureException( format( "Error occurred while waiting for deployment '%s' removal. " + ex.getMessage(), ASYNC_STORAGE), ex); } catch (TimeoutException ex) { throw new InfrastructureException( format("Pod '%s' removal timeout reached " + ex.getMessage(), ASYNC_STORAGE), ex); } }
Source:
private MustacheFactory createNewMustacheFactory(Class<? extends View> key) { return (fileRoot != null) ? new DefaultMustacheFactory(new FileSystemResolver(fileRoot)) : new DefaultMustacheFactory(new PerClassMustacheResolver(key)); }

Target:
private MustacheFactory createNewMustacheFactory(Class<? extends View> key) { return new DefaultMustacheFactory( fileRoot.isPresent() ? new FileSystemResolver(fileRoot.get()) : new PerClassMustacheResolver(key)); }
Source:
public void reset() { serviceProvider = null; federatedIdentityProviders = null; federatedIdentityProvidersMap.clear(); localAuthenticatorConfigs = null; requestPathAuthenticators = null; roleMap = null; claimMap = null; requestedClaims = new HashMap<String, String>(); samlIssuer = null; kerberosServiceName = null; oauthAppName = null; wstrustEp = null; passivests = null; passiveSTSWReply = null; openid = null; oauthConsumerSecret = null; attrConsumServiceIndex = null; enabledFederatedIdentityProviders = null; customInbountAuthenticatorConfigs = null; }

Target:
public void reset() { serviceProvider = null; federatedIdentityProviders = null; federatedIdentityProvidersMap.clear(); localAuthenticatorConfigs = null; requestPathAuthenticators = null; roleMap = null; claimMap = null; requestedClaims = new HashMap<String, String>(); samlIssuer = null; kerberosServiceName = null; oauthAppName = null; wstrustEp = null; passivests = null; passiveSTSWReply = null; openid = null; oauthConsumerSecret = null; attrConsumServiceIndex = null; enabledFederatedIdentityProviders = null; inboundAuthenticationRequestConfigs = Collections.EMPTY_LIST; }
Source:
public Tab(@JsonProperty("identifier") String identifier, @JsonProperty("title") String title) { this.identifier = identifier; this.title = title; }

Target:
private Tab(@JsonProperty("identifier") String identifier, @JsonProperty("title") String title) { this.identifier = identifier; this.title = title; }
Source:
public<K> void runTopics() throws IOException { TopicReader<K> tr; SortedMap<K, Map<String, String>> topics = new TreeMap<>(); for (String singleTopicsFile : args.topics) { Path topicsFilePath = Paths.get(singleTopicsFile); if (!Files.exists(topicsFilePath) || !Files.isRegularFile(topicsFilePath) || !Files.isReadable(topicsFilePath)) { throw new IllegalArgumentException("Topics file : " + topicsFilePath + " does not exist or is not a (readable) file."); } try { tr = (TopicReader<K>) Class.forName("io.anserini.search.topicreader." + args.topicReader + "TopicReader") .getConstructor(Path.class).newInstance(topicsFilePath); topics.putAll(tr.read()); } catch (Exception e) { throw new IllegalArgumentException("Unable to load topic reader: " + args.topicReader); } } final String runTag = args.runtag == null ? "Solrini" : args.runtag; final ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(args.threads); executor.execute(new SolrSearcherThread<K>(topics, args.output, runTag)); executor.shutdown(); try { while (!executor.awaitTermination(1, TimeUnit.MINUTES)) } catch (InterruptedException ie) { executor.shutdownNow(); Thread.currentThread().interrupt(); } }

Target:
public<K> void runTopics() throws IOException { TopicReader<K> tr; SortedMap<K, Map<String, String>> topics = new TreeMap<>(); for (String singleTopicsFile : args.topics) { Path topicsFilePath = Paths.get(singleTopicsFile); if (!Files.exists(topicsFilePath) || !Files.isRegularFile(topicsFilePath) || !Files.isReadable(topicsFilePath)) { throw new IllegalArgumentException("Topics file : " + topicsFilePath + " does not exist or is not a (readable) file."); } try { tr = (TopicReader<K>) Class.forName("io.anserini.search.topicreader." + args.topicReader + "TopicReader") .getConstructor(Path.class).newInstance(topicsFilePath); topics.putAll(tr.read()); } catch (Exception e) { throw new IllegalArgumentException("Unable to load topic reader: " + args.topicReader); } } final String runTag = args.runtag == null ? "Solrini" : args.runtag; SolrSearcherThread<K> solrThread = new SolrSearcherThread<K>(topics, args.output, runTag); solrThread.run(); }
Source:
protected AbstractDeployer(ZooKeeperConnection zkConnection, PagingAndSortingRepository<D, String> repository, XDParser parser, ParsingContext parsingContext) { Assert.notNull(zkConnection, "ZooKeeper connection cannot be null"); Assert.notNull(repository, "Repository cannot be null"); Assert.notNull(parsingContext, "Entity type kind cannot be null"); this.zkConnection = zkConnection; this.repository = repository; this.definitionKind = parsingContext; this.parser = parser; composedJobParser = new JobParser(); }

Target:
protected AbstractDeployer(ZooKeeperConnection zkConnection, PagingAndSortingRepository<D, String> repository, XDParser parser, ParsingContext parsingContext) { Assert.notNull(zkConnection, "ZooKeeper connection cannot be null"); Assert.notNull(repository, "Repository cannot be null"); Assert.notNull(parsingContext, "Entity type kind cannot be null"); this.zkConnection = zkConnection; this.repository = repository; this.definitionKind = parsingContext; this.parser = parser; this.composedJobParser = new JobParser(); }
Source:
void setupContainerComponent() { final SimplePanel container = getContainer(); final Style style = container.getElement().getStyle(); style.setPaddingLeft(5, PX); style.setPaddingRight(5, PX); style.setPaddingTop(5, PX); style.setPaddingBottom(5, PX); container.setWidget(widget); }

Target:
void setupContainerComponent() { final SimplePanel container = getContainer(); final Style style = container.getElement().getStyle(); style.setPadding(5, PX); container.setWidget(widget); }
Source:
public void untilSuccessful() { final ConstructModel tryModel = coreExtensionModel.getConstructModel("untilSuccessful").get(); List<ParameterModel> allParameterModels = tryModel.getAllParameterModels(); assertThat(allParameterModels, hasSize(2)); ParameterModel action = allParameterModels.get(0); assertThat(action.getName(), is("maxRetries")); assertThat(action.getType(), is(instanceOf(DefaultStringType.class))); assertThat(action.getExpressionSupport(), is(SUPPORTED)); assertThat(action.getDefaultValue(), is("5")); assertThat(action.isRequired(), is(false)); ParameterModel type = allParameterModels.get(1); assertThat(type.getName(), is("millisBetweenRetries")); assertThat(type.getType(), is(instanceOf(DefaultStringType.class))); assertThat(type.getExpressionSupport(), is(SUPPORTED)); assertThat(type.getDefaultValue(), is("60000")); assertThat(type.isRequired(), is(false)); }

Target:
public void untilSuccessful() { final ConstructModel tryModel = coreExtensionModel.getConstructModel("untilSuccessful").get(); List<ParameterModel> allParameterModels = tryModel.getAllParameterModels(); assertThat(allParameterModels, hasSize(2)); ParameterModel action = allParameterModels.get(0); assertThat(action.getName(), is("maxRetries")); assertThat(action.getType(), is(instanceOf(DefaultNumberType.class))); assertThat(action.getExpressionSupport(), is(SUPPORTED)); assertThat(action.getDefaultValue(), is(5)); assertThat(action.isRequired(), is(false)); ParameterModel type = allParameterModels.get(1); assertThat(type.getName(), is("millisBetweenRetries")); assertThat(type.getType(), is(instanceOf(DefaultNumberType.class))); assertThat(type.getExpressionSupport(), is(SUPPORTED)); assertThat(type.getDefaultValue(), is(60000)); assertThat(type.isRequired(), is(false)); }
Source:
private DoubleArray resolveSteps(List<SchedulePeriod> periods, RollConvention rollConv) { int size = periods.size(); double[] result = new double[size]; List<ValueStep> resolvedSteps = getStepSequence().map(seq -> seq.resolve(steps, rollConv)).orElse(steps); ValueAdjustment[] expandedSteps = new ValueAdjustment[size]; for (ValueStep step : resolvedSteps) { int index = step.findIndex(periods); if (expandedSteps[index] != null && !expandedSteps[index].equals(step.getValue())) { throw new IllegalArgumentException("Two ValueStep instances resolve to the same schedule period"); } expandedSteps[index] = step.getValue(); } double value = initialValue; for (int i = 0; i < size; i++) { if (expandedSteps[i] != null) { value = expandedSteps[i].adjust(value); } result[i] = value; } return DoubleArray.ofUnsafe(result); }

Target:
private DoubleArray resolveSteps(List<SchedulePeriod> periods, RollConvention rollConv) { int size = periods.size(); double[] result = new double[size]; List<ValueStep> resolvedSteps = getStepSequence().map(seq -> seq.resolve(steps, rollConv)).orElse(steps); ValueAdjustment[] expandedSteps = new ValueAdjustment[size]; for (ValueStep step : resolvedSteps) { int index = step.findIndex(periods); if (expandedSteps[index] != null && !expandedSteps[index].equals(step.getValue())) { throw new IllegalArgumentException(Messages.format( "Invalid ValueSchedule, two steps resolved to the same schedule period starting on {}, schedule defined as {}", periods.get(index).getUnadjustedStartDate(), this)); } expandedSteps[index] = step.getValue(); } double value = initialValue; for (int i = 0; i < size; i++) { if (expandedSteps[i] != null) { value = expandedSteps[i].adjust(value); } result[i] = value; } return DoubleArray.ofUnsafe(result); }
Source:
public DescriptorValue calculate(IAtomContainer mol) { try { mol = mol.clone(); } catch (CloneNotSupportedException ex) { } int nC = 0; int nCSP3 = 0; DoubleResult result; try { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); for (IAtom atom: mol.atoms()) { if (atom.getAtomicNumber() == 6) { nC++; if (atom.getHybridization() == Hybridization.SP3) nCSP3++; } } result = new DoubleResult(nC == 0 ? 0 : (double)nCSP3 / nC); } catch (CDKException e) { result = new DoubleResult(Double.NaN); } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result, getDescriptorNames()); }

Target:
public DescriptorValue calculate(IAtomContainer mol) { DoubleResult result; try { int nC = 0; int nCSP3 = 0; CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(mol.getBuilder()); for (IAtom atom : mol.atoms()) { if (atom.getAtomicNumber() == 6) { nC++; IAtomType matched = matcher.findMatchingAtomType(mol, atom); if (matched != null && matched.getHybridization() == IAtomType.Hybridization.SP3) { nCSP3++; } } } result = new DoubleResult(nC == 0 ? 0 : (double)nCSP3 / nC); } catch (CDKException e) { result = new DoubleResult(Double.NaN); } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result, getDescriptorNames()); }
Source:
public void dispose() { trace = GitTraceLocation.HISTORYVIEW.isActive(); if (trace) GitTraceLocation.getTrace().traceEntry( GitTraceLocation.HISTORYVIEW.getLocation()); if (myRefsChangedHandle != null) { myRefsChangedHandle.remove(); myRefsChangedHandle = null; } for (ActionFactory.IWorkbenchAction action : actionsToDispose) action.dispose(); actionsToDispose.clear(); cancelRefreshJob(); if (popupMgr != null) { for (final IContributionItem i : popupMgr.getItems()) { if (i instanceof ActionFactory.IWorkbenchAction) ((ActionFactory.IWorkbenchAction) i).dispose(); } for (final IContributionItem i : getSite().getActionBars() .getMenuManager().getItems()) { if (i instanceof ActionFactory.IWorkbenchAction) ((ActionFactory.IWorkbenchAction) i).dispose(); } } super.dispose(); }

Target:
public void dispose() { trace = GitTraceLocation.HISTORYVIEW.isActive(); if (trace) GitTraceLocation.getTrace().traceEntry( GitTraceLocation.HISTORYVIEW.getLocation()); if (myRefsChangedHandle != null) { myRefsChangedHandle.remove(); myRefsChangedHandle = null; } for (IWorkbenchAction action : actionsToDispose) action.dispose(); actionsToDispose.clear(); cancelRefreshJob(); if (popupMgr != null) { for (final IContributionItem i : popupMgr.getItems()) { if (i instanceof IWorkbenchAction) ((IWorkbenchAction) i).dispose(); } for (final IContributionItem i : getSite().getActionBars() .getMenuManager().getItems()) { if (i instanceof IWorkbenchAction) ((IWorkbenchAction) i).dispose(); } } super.dispose(); }
Source:
public double[] findMinMax(double[] rawData) { double xMin = Double.MAX_VALUE; double xMax = 0; for (int i = 1; i <= rawData.length; i++) { double value = rawData[i - 1]; if (value < xMin) { xMin = value; } if (value > xMax) { xMax = value; } } double[] minMaxVal = new double[2]; minMaxVal[0] = xMin; minMaxVal[1] = xMax; return minMaxVal; }

Target:
public List<Double> findMinMax(double[] rawData) { double xMin = Double.MAX_VALUE; double xMax = 0; for (int i = 1; i <= rawData.length; i++) { double value = rawData[i - 1]; xMin = Math.min(xMin, value); xMax = Math.max(xMax, value); } List<Double> minMaxVal = new ArrayList<Double>(); minMaxVal.add(xMin); minMaxVal.add(xMax); return minMaxVal; }
Source:
private boolean isOneToOneAndSet(ReferenceChange diff, boolean mergeRightToLeft) { if (diff.getReference().getEOpposite() == null) { return false; } return !diff.getReference().isMany() && !diff.getReference().getEOpposite().isMany() && isSet(diff, mergeRightToLeft); }

Target:
private boolean isOneToOneAndSet(ReferenceChange diff, boolean mergeRightToLeft) { final boolean hasOpposite = diff.getReference().getEOpposite() != null; final boolean isOneToOne = hasOpposite && !diff.getReference().isMany() && !diff.getReference().getEOpposite().isMany(); return isOneToOne && isSet(diff, mergeRightToLeft); }
Source:
public void checkResultSetSelectAll(ResultSet rs) throws SQLException { ArrayList<String> results = getArrayListResult(rs); Assert.assertEquals( values2.size(), results.size() ); for( int i = 0; i < results.size(); i++ ) { Assert.assertEquals( values2.get(i), results.get(i) ); } }

Target:
public void checkResultSetSelectAll(ResultSet rs) throws SQLException { List<String> results = getListResult(rs); Assert.assertEquals( values2.size(), results.size() ); for( int i = 0; i < results.size(); i++ ) { Assert.assertEquals( values2.get(i), results.get(i) ); } }
Source:
private void timeToExpireSession() { if (CommCareApplication._().isConsumerApp()) { return; } long currentTime = new Date().getTime(); if (logoutStartedAt != -1 && currentTime > (logoutStartedAt + LOGOUT_TIMEOUT)) { if (!CommCareSessionService.sessionAliveLock.tryLock()) { return; } try { CommCareApplication._().expireUserSession(); } finally { CommCareSessionService.sessionAliveLock.unlock(); } } else if (isActive() && logoutStartedAt == -1 && (currentTime > sessionExpireDate.getTime() || (sessionExpireDate.getTime() - currentTime > sessionLength))) { if (!CommCareSessionService.sessionAliveLock.tryLock()) { return; } try { saveFormAndCloseSession(); } finally { CommCareSessionService.sessionAliveLock.unlock(); } showLoggedOutNotification(); } }

Target:
private void timeToExpireSession() { long currentTime = new Date().getTime(); if (logoutStartedAt != -1 && currentTime > (logoutStartedAt + LOGOUT_TIMEOUT)) { if (!CommCareSessionService.sessionAliveLock.tryLock()) { return; } try { CommCareApplication._().expireUserSession(); } finally { CommCareSessionService.sessionAliveLock.unlock(); } } else if (isActive() && logoutStartedAt == -1 && (currentTime > sessionExpireDate.getTime() || (sessionExpireDate.getTime() - currentTime > sessionLength))) { if (!CommCareSessionService.sessionAliveLock.tryLock()) { return; } try { saveFormAndCloseSession(); } finally { CommCareSessionService.sessionAliveLock.unlock(); } showLoggedOutNotification(); } }
Source:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { MetaData metaData; try { FileSystem fs = FileSystem.get(new Path(context.location).toUri(), context.hiveConf); metaData = EximUtil.readMetaData(fs, new Path(context.location, EximUtil.METADATA_NAME)); } catch (IOException e) { throw new SemanticException(ErrorMsg.INVALID_PATH.getMsg(), e); } Database db = metaData.getDatabase(); String destinationDBName = context.dbName == null ? db.getName() : context.dbName; CreateDatabaseDesc createDatabaseDesc = new CreateDatabaseDesc(destinationDBName, db.getDescription(), db.getLocationUri(), true); createDatabaseDesc.setDatabaseProperties(db.getParameters()); Task<DDLWork> createDBTask = TaskFactory.get( new DDLWork(new HashSet<>(), new HashSet<>(), createDatabaseDesc), context.hiveConf); if (StringUtils.isNotEmpty(db.getOwnerName())) { AlterDatabaseDesc alterDbDesc = new AlterDatabaseDesc(db.getName(), new PrincipalDesc(db.getOwnerName(), db.getOwnerType()), context.eventOnlyReplicationSpec()); Task<DDLWork> alterDbTask = TaskFactory .get(new DDLWork(new HashSet<>(), new HashSet<>(), alterDbDesc), context.hiveConf); createDBTask.addDependentTask(alterDbTask); } return Collections.singletonList(createDBTask); }

Target:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { MetaData metaData; try { FileSystem fs = FileSystem.get(new Path(context.location).toUri(), context.hiveConf); metaData = EximUtil.readMetaData(fs, new Path(context.location, EximUtil.METADATA_NAME)); } catch (IOException e) { throw new SemanticException(ErrorMsg.INVALID_PATH.getMsg(), e); } Database db = metaData.getDatabase(); String destinationDBName = context.dbName == null ? db.getName() : context.dbName; CreateDatabaseDesc createDatabaseDesc = new CreateDatabaseDesc(destinationDBName, db.getDescription(), null, true); createDatabaseDesc.setDatabaseProperties(db.getParameters()); Task<DDLWork> createDBTask = TaskFactory.get( new DDLWork(new HashSet<>(), new HashSet<>(), createDatabaseDesc), context.hiveConf); if (!db.getParameters().isEmpty()) { AlterDatabaseDesc alterDbDesc = new AlterDatabaseDesc(destinationDBName, db.getParameters(), context.eventOnlyReplicationSpec()); Task<DDLWork> alterDbProperties = TaskFactory .get(new DDLWork(new HashSet<>(), new HashSet<>(), alterDbDesc), context.hiveConf); createDBTask.addDependentTask(alterDbProperties); } if (StringUtils.isNotEmpty(db.getOwnerName())) { AlterDatabaseDesc alterDbOwner = new AlterDatabaseDesc(destinationDBName, new PrincipalDesc(db.getOwnerName(), db.getOwnerType()), context.eventOnlyReplicationSpec()); Task<DDLWork> alterDbTask = TaskFactory .get(new DDLWork(new HashSet<>(), new HashSet<>(), alterDbOwner), context.hiveConf); createDBTask.addDependentTask(alterDbTask); } updatedMetadata .set(context.dmd.getEventTo().toString(), destinationDBName, null, null); return Collections.singletonList(createDBTask); }
Source:
protected void endWithFailure() { if (commandCoordinatorUtil.getCommandExecutionStatus(getCommandId()) != CommandExecutionStatus.EXECUTED) { changeStorageDomainStatusInTransaction(loadStoragePoolIsoMap(), StorageDomainStatus.Unknown); auditLogDirector.log(this, AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE); } else { changeStorageDomainStatusInTransaction(loadStoragePoolIsoMap(), StorageDomainStatus.Active); } setSucceeded(true); }

Target:
protected void endWithFailure() { if (commandCoordinatorUtil.getCommandExecutionStatus(getCommandId()) != CommandExecutionStatus.EXECUTED) { changeStorageDomainStatusInTransaction(loadStoragePoolIsoMap(), StorageDomainStatus.Unknown); auditLogDirector.log(this, AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE); } else { changeStorageDomainStatusInTransaction(loadStoragePoolIsoMap(), StorageDomainStatus.Unknown); } setSucceeded(true); }
Source:
public void testListenerFailExecution() throws Exception { when( component.execute() ).thenReturn( false ); PentahoAsyncReportExecution exec = createMockCallable(); exec.notifyTaskQueued( UUID.randomUUID(), null ); assertEquals( AsyncExecutionStatus.QUEUED, exec.getState().getStatus() ); IFixedSizeStreamingContent returnStream = exec.call(); assertEquals( AsyncExecutionStatus.FAILED, exec.getState().getStatus() ); assertFalse( returnStream.equals( input ) ); verify( handler, times( 0 ) ).getStagingContent(); }

Target:
public void testListenerFailExecution() throws Exception { when( component.execute() ).thenReturn( false ); PentahoAsyncReportExecution exec = createMockCallable(); exec.notifyTaskQueued( UUID.randomUUID(), Collections.<ReportProgressListener>emptyList() ); assertEquals( AsyncExecutionStatus.QUEUED, exec.getState().getStatus() ); IFixedSizeStreamingContent returnStream = exec.call(); assertEquals( AsyncExecutionStatus.FAILED, exec.getState().getStatus() ); assertFalse( returnStream.equals( input ) ); verify( handler, times( 0 ) ).getStagingContent(); }
Source:
@Override public final <P extends Job<P, B>, B extends Run<P, B>> JobDecorator<P, B> jobDecorator(Class<P> clazz) { if (!isApplicable(clazz)) { return null; } return new JobDecorator<P, B>() { @NonNull @Override public List<JobProperty<? super P>> jobProperties( @NonNull List<JobProperty<? super P>> jobProperties) { List<JobProperty<? super P>> result = asArrayList(jobProperties); for (Iterator<JobProperty<? super P>> iterator = result.iterator(); iterator.hasNext(); ) { JobProperty<? super P> p = iterator.next(); if (p instanceof ParametersDefinitionProperty) { iterator.remove(); } } if (parameterDefinitions != null && !parameterDefinitions.isEmpty()) { result.add(new ParametersDefinitionProperty(parameterDefinitions)); } return result; } }; }

Target:
public final <P extends Job<P, B>, B extends Run<P, B>> JobDecorator<P, B> jobDecorator(Class<P> clazz) { if (!isApplicable(clazz)) { return null; } return new JobDecorator<P, B>() { @NonNull @Override public List<JobProperty<? super P>> jobProperties( @NonNull List<JobProperty<? super P>> jobProperties) { List<JobProperty<? super P>> result = asArrayList(jobProperties); for (Iterator<JobProperty<? super P>> iterator = result.iterator(); iterator.hasNext(); ) { JobProperty<? super P> p = iterator.next(); if (p instanceof ParametersDefinitionProperty) { iterator.remove(); } } if (parameterDefinitions != null && !parameterDefinitions.isEmpty()) { result.add(new ParametersDefinitionProperty(parameterDefinitions)); } return result; } }; }
Source:
private void checkForInvalidPath() { if ( ((this.fullId.contains(FCR_ACL) || this.fullId.contains(FCR_TOMBSTONE)) && (this.fullId.contains(FCR_METADATA) || this.fullId.contains(FCR_VERSIONS))) || (this.fullId.contains(FCR_TOMBSTONE) && this.fullId.contains(FCR_ACL)) ) { throw new InvalidResourceIdentifierException(String.format("Path is invalid: %s", pathOnly)); } for (final String extension : extensions) { if (this.fullId.contains(extension)) { final Pattern extPattern = Pattern.compile(extension); if (extPattern.matcher(this.fullId).results().count() > 1) { throw new InvalidResourceIdentifierException(String.format("Path is invalid: %s", pathOnly)); } } } }

Target:
private void checkForInvalidPath() { if ( ((this.fullId.contains(FCR_ACL) || this.fullId.contains(FCR_TOMBSTONE)) && (this.fullId.contains(FCR_METADATA) || this.fullId.contains(FCR_VERSIONS))) || (this.fullId.contains(FCR_TOMBSTONE) && this.fullId.contains(FCR_ACL)) ) { throw new InvalidResourceIdentifierException(String.format("Path is invalid: %s", pathOnly)); } for (final Pattern extension : extensions) { if (extension.matcher(this.fullId).results().count() > 1) { throw new InvalidResourceIdentifierException(String.format("Path is invalid: %s", pathOnly)); } } }
Source:
public String getFileName() { if (fileName==null) setFileName(1); return fileName; }

Target:
public String getFileName() { if (fileName==null) { setFileName(1); } return fileName; }
Source:
public void testLookupDataSet() throws Exception { DataSetLookup lookup = new DataSetLookup(); lookup.setDataSetUUID(PROCESS_DEFINITION_DATASET); DataSetLookup consoleDataSetLookup = ConsoleDataSetLookup.fromInstance(lookup, "servereTemplateId"); CoreFunctionFilter coreFunctionFilter = new CoreFunctionFilter("ProcessDefName", CoreFunctionType.LIKE_TO, "name"); DataSetFilter dataSetFilter = new DataSetFilter(); dataSetFilter.addFilterColumn(coreFunctionFilter); consoleDataSetLookup.addOperation(dataSetFilter); DataSet dataSet = processDefinitionDataSetProvider.lookupDataSet(dataSetdef, consoleDataSetLookup); assertEquals(PROCESS_DEFINITION_DATASET, dataSet.getUUID()); assertThat(dataSet.getColumns()).hasSize(5).extracting(dataColumn -> { return dataColumn.getId(); }).contains(COL_ID_PROCESSVERSION, COL_ID_PROCESSVERSION, COL_ID_PROJECT, COL_ID_PROCESSDEF, COL_DYNAMIC); }

Target:
public void testLookupDataSet() throws Exception { DataSetLookup lookup = new DataSetLookup(); lookup.setDataSetUUID(PROCESS_DEFINITION_DATASET); DataSetLookup consoleDataSetLookup = ConsoleDataSetLookup.fromInstance(lookup, SERVER_TEMPLATE_ID); CoreFunctionFilter coreFunctionFilter = new CoreFunctionFilter(SORT_COLUMN_NAME, CoreFunctionType.LIKE_TO, TEXT_SEARCH); DataSetFilter dataSetFilter = new DataSetFilter(); dataSetFilter.addFilterColumn(coreFunctionFilter); consoleDataSetLookup.addOperation(dataSetFilter); DataSet dataSet = processDefinitionDataSetProvider.lookupDataSet(dataSetdef, consoleDataSetLookup); assertEquals(PROCESS_DEFINITION_DATASET, dataSet.getUUID()); assertEquals(1, dataSet.getRowCount()); assertThat(dataSet.getColumns()).hasSize(5).extracting(dataColumn -> dataColumn.getId()).contains(COL_ID_PROCESSVERSION, COL_ID_PROCESSVERSION, COL_ID_PROJECT, COL_ID_PROCESSDEF, COL_DYNAMIC); }