auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void checkFileConfiguration() throws RuntimeConfigurationError { VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(getFilePath())); if (file == null) { <START> String relativePath = FileUtil.join(getWorkingDirectory(), getFilePath()); <END> file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(relativePath)); if (file == null) throw new RuntimeConfigurationError("Main file is not specified"); } PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); if (psiFile == null || !(psiFile instanceof GoFile)) { throw new RuntimeConfigurationError("Main file is invalid"); } if (!GoRunUtil.isMainGoFile(psiFile)) { throw new RuntimeConfigurationError("Main file has non-main package or doesn't contain main function"); } }</code><technical_language>relativePath, path. Please rename</technical_language>

Target:
protected void checkFileConfiguration() throws RuntimeConfigurationError { VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(getFilePath())); if (file == null) { String path = FileUtil.join(getWorkingDirectory(), getFilePath()); file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(path)); if (file == null) throw new RuntimeConfigurationError("Main file is not specified"); } PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); if (psiFile == null || !(psiFile instanceof GoFile)) { throw new RuntimeConfigurationError("Main file is invalid"); } if (!GoRunUtil.isMainGoFile(psiFile)) { throw new RuntimeConfigurationError("Main file has non-main package or doesn't contain main function"); } }
Source:
<code>protected Serializable doCreate(final Session session) { <START> UUID sessionId = UUID.randomUUID(); <END> assignSessionId(session, sessionId.toString()); jdbcSessionSqlDao.create(new SessionModelDao(session)); return sessionId; }</code><technical_language>Need UUIDs instead, for performance. Nit: final</technical_language>

Target:
protected Serializable doCreate(final Session session) { final UUID sessionId = UUIDs.randomUUID(); assignSessionId(session, sessionId.toString()); jdbcSessionSqlDao.create(new SessionModelDao(session)); return sessionId; }
Source:
<code>protected void setTreeChecked(Object treeElement, boolean state) { if (treeElement.equals(currentTreeSelection)) { listViewer.setAllChecked(state); } if (state) { List listItemsChecked = new ArrayList(); <START> java.util.Collections.addAll(listItemsChecked, listContentProvider.getElements(treeElement)); <END> checkedStateStore.put(treeElement, listItemsChecked); } else { checkedStateStore.remove(treeElement); } setWhiteChecked(treeElement, state); treeViewer.setChecked(treeElement, state); treeViewer.setGrayed(treeElement, false); for (Object child : treeContentProvider.getChildren(treeElement)) { setTreeChecked(child, state); } }</code><technical_language>add contructor here? List listItemsChecked = new ArrayList(Arrays.asList(listContentProvider.getElements(treeElement)));</technical_language>

Target:
protected void setTreeChecked(Object treeElement, boolean state) { if (treeElement.equals(currentTreeSelection)) { listViewer.setAllChecked(state); } if (state) { List listItemsChecked = new ArrayList(Arrays.asList(listContentProvider.getElements(treeElement))); checkedStateStore.put(treeElement, listItemsChecked); } else { checkedStateStore.remove(treeElement); } setWhiteChecked(treeElement, state); treeViewer.setChecked(treeElement, state); treeViewer.setGrayed(treeElement, false); for (Object child : treeContentProvider.getChildren(treeElement)) { setTreeChecked(child, state); } }
Source:
<code>public void testMarkerWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "marker_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("obj2_no_spaces.txt", 1024), new Ds3Object("obj3 has spaces.txt", 1024), new Ds3Object("obj4 also has spaces.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); putJob.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { @Override public SeekableByteChannel buildChannel(String key) throws IOException { final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(120, 1024)); final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(1024); channel.write(randomBuffer); return channel; } }); final Iterable<Contents> objs = helpers.listObjects(bucketName, null, "obj3 has spaces.txt"); boolean foundObj4 = false; <START> for( Contents obj : objs ) { <END> LOG.info("marker with spaces name: " + obj.getKey()); if (obj.getKey().equals("obj4 also has spaces.txt")) foundObj4 = true; LOG.info("marker with spaces size: " + obj.getSize()); } assertTrue(Iterables.size(objs) == 1); assertTrue(foundObj4); } finally { Util.deleteAllContents(client, bucketName); } }</code><technical_language>Missing final</technical_language>

Target:
public void testMarkerWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "marker_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("obj2_no_spaces.txt", 1024), new Ds3Object("obj3 has spaces.txt", 1024), new Ds3Object("obj4 also has spaces.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); final Iterable<Contents> objs = helpers.listObjects(bucketName, null, "obj3 has spaces.txt"); boolean foundObj4 = false; for (final Contents obj : objs) { LOG.info("marker with spaces name: " + obj.getKey()); if (obj.getKey().equals("obj4 also has spaces.txt")) foundObj4 = true; LOG.info("marker with spaces size: " + obj.getSize()); } assertTrue(Iterables.size(objs) == 1); assertTrue(foundObj4); final CancelJobResponse cancelJobResponse = client.cancelJob(new CancelJobRequest(putJob.getJobId())); assertEquals(204, cancelJobResponse.getStatusCode()); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
<code><START> private HashSet determineModelOutputIdsWithoutViews(Set<Integer> rowIds, Set<Integer> viewIds) { <END> HashSet<Integer> result = new HashSet(); for (Integer id : viewIds) { if (rowIds.contains(id)) { log.info("View already exists for model_output_id: " + id); } else { result.add(id); log.info("Will create two views for each model_output_id: " + id); } } log.info("Found: " + result.size()+ " model_output_ids that will require views to be created."); return result; }</code><technical_language>able simplify this method set operations. For example, [Set#removeAll(Collection<?>)](<LINK_0> finds asymmetric set difference</technical_language>

Target:
private HashSet determineModelOutputIdsWithoutViews(Set<Integer> rowIds, Set<Integer> viewIds) { HashSet<Integer> result = new HashSet(); for (Integer id : rowIds) { if (viewIds.contains(id)) { log.info("View already exists for model_output_id: " + id); } else { result.add(id); log.info("Will create two views for each model_output_id: " + id); } } log.info("Found: " + result.size()+ " model_output_ids that will require views to be created."); return result; }
Source:
<code>private void setup(String propName, List<T> defaultValue, Splitter splitter) { this.defaultValues = (defaultValue == null ? null : Collections.unmodifiableList(new ArrayList<T>(defaultValue))); this.splitter = splitter; delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null); load(); Runnable callback = new Runnable() { @Override public void run() { propertyChangedInternal(); } }; delegate.addCallback(callback); <START> callbackList.add(callback); <END> }</code><technical_language>Is necessary maintain another callback list here? If not, delegate.unsubscribe() remove callbacks</technical_language>

Target:
private void setup(String propName, List<T> defaultValue, Splitter splitter) { this.defaultValues = (defaultValue == null ? null : Collections.unmodifiableList(new ArrayList<T>(defaultValue))); this.splitter = splitter; delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null); load(); Runnable callback = new Runnable() { @Override public void run() { propertyChangedInternal(); } }; delegate.addCallback(callback); }
Source:
<code>public static FlowParameters getFlowParameters(List<String> providerIds) { List<IdpConfig> idpConfigs = new ArrayList<>(); for (String providerId : providerIds) { switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.GoogleBuilder().build()); break; case FacebookAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.FacebookBuilder().build()); <START> break; <END> case TwitterAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.TwitterBuilder().build()); break; case EmailAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.EmailBuilder().build()); break; case PhoneAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.PhoneBuilder().build()); break; default: throw new IllegalArgumentException("Unknown provider: " + providerId); } } return new FlowParameters( FIREBASE_APP_NAME, idpConfigs, AuthUI.getDefaultTheme(), AuthUI.NO_LOGO, null, null, true, true); }</code><technical_language>I turn in IntelliJ kills visual ability line length, this is test code I mind removal</technical_language>

Target:
public static FlowParameters getFlowParameters(List<String> providerIds) { List<IdpConfig> idpConfigs = new ArrayList<>(); for (String providerId : providerIds) { switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.GoogleBuilder().build()); break; case FacebookAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.FacebookBuilder().build()); break; case TwitterAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.TwitterBuilder().build()); break; case EmailAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.EmailBuilder().build()); break; case PhoneAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.PhoneBuilder().build()); break; default: throw new IllegalArgumentException("Unknown provider: " + providerId); } } return new FlowParameters( FirebaseApp.DEFAULT_APP_NAME, idpConfigs, AuthUI.getDefaultTheme(), AuthUI.NO_LOGO, null, null, true, true); }
Source:
<code>public static void addConfiguredSecurityProviders(Map<String, ?> configs) { String securityProviderClassesStr = (String) configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (securityProviderClassesStr == null || securityProviderClassesStr.equals("")) { return; } try { String[] securityProviderClasses = securityProviderClassesStr.replaceAll("\\s+", "").split(","); for (int index = 0; index < securityProviderClasses.length; index++) { SecurityProviderCreator securityProviderCreator = (SecurityProviderCreator) Class.forName(securityProviderClasses[index]).newInstance(); securityProviderCreator.configure(configs); Security.insertProviderAt(securityProviderCreator.getProvider(), index + 1); } } catch (ClassCastException e) { <START> LOGGER.error("Generator provided through " + SecurityConfig.SECURITY_PROVIDERS_CONFIG + <END> " are expected to be sub-classes of SecurityProviderCreator"); } catch (ClassNotFoundException cnfe) { LOGGER.error("Unrecognized security provider class", cnfe); } catch (IllegalAccessException | InstantiationException e) { LOGGER.error("Unexpected implementation of security provider class", e); } }</code><technical_language>Change Generator Creator</technical_language>

Target:
public static void addConfiguredSecurityProviders(Map<String, ?> configs) { String securityProviderClassesStr = (String) configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (securityProviderClassesStr == null || securityProviderClassesStr.equals("")) { return; } try { String[] securityProviderClasses = securityProviderClassesStr.replaceAll("\\s+", "").split(","); for (int index = 0; index < securityProviderClasses.length; index++) { SecurityProviderCreator securityProviderCreator = (SecurityProviderCreator) Class.forName(securityProviderClasses[index]).newInstance(); securityProviderCreator.configure(configs); Security.insertProviderAt(securityProviderCreator.getProvider(), index + 1); } } catch (ClassCastException e) { LOGGER.error("Creators provided through " + SecurityConfig.SECURITY_PROVIDERS_CONFIG + " are expected to be sub-classes of SecurityProviderCreator"); } catch (ClassNotFoundException cnfe) { LOGGER.error("Unrecognized security provider creator class", cnfe); } catch (IllegalAccessException | InstantiationException e) { LOGGER.error("Unexpected implementation of security provider creator class", e); } }
Source:
<code>protected void verifyAppStarted(String appFile) throws MojoExecutionException { if (shouldValidateAppStart()) { String appName; if (getAppsDirectory().equals("apps")) { ServerConfigDocument scd = null; File serverXML = new File(serverDirectory, "server.xml"); <START> if (serverXML != null && serverXML.exists()) { <END> try { scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory, bootstrapPropertiesFile, bootstrapProperties, serverEnvFile, false); } catch (Exception e) { log.warn(e.getLocalizedMessage()); log.debug(e); } } appName = scd.findNameForLocation(appFile); } else { appName = appFile.substring(0, appFile.lastIndexOf('.')); } ServerTask serverTask = initializeJava(); if (serverTask.waitForStringInLog(START_APP_MESSAGE_REGEXP + appName, timeout * 1000, new File(new File(outputDirectory, serverName), "logs/messages.log")) == null) { throw new MojoExecutionException(MessageFormat.format(messages.getString("error.deploy.fail"), appName)); } } }</code><technical_language>a running server server.xml file</technical_language>

Target:
protected void verifyAppStarted(String appFile) throws MojoExecutionException { if (shouldValidateAppStart()) { String appName = appFile.substring(0, appFile.lastIndexOf('.')); if (getAppsDirectory().equals("apps")) { ServerConfigDocument scd = null; File serverXML = new File(serverDirectory, "server.xml"); try { scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory, bootstrapPropertiesFile, bootstrapProperties, serverEnvFile, false); appName = scd.findNameForLocation(appFile); } catch (Exception e) { log.warn(e.getLocalizedMessage()); log.debug(e); } } ServerTask serverTask = initializeJava(); if (serverTask.waitForStringInLog(START_APP_MESSAGE_REGEXP + appName, timeout * 1000, new File(new File(outputDirectory, serverName), "logs/messages.log")) == null) { throw new MojoExecutionException(MessageFormat.format(messages.getString("error.deploy.fail"), appName)); } } }
Source:
<code>public final CompletionStage<Void> wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner) { if (!isOwner && !isL1Enabled) { return CompletableFutures.completedNull(); } CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { InternalCacheEntry readEntry = getFromContainer(key, segment); CompletionStage<Boolean> expiredStage = null; if (readEntry == null) { if (isOwner) { <START> cacheEntry = NullCacheEntry.getInstance(); <END> } } else if (isOwner || readEntry.isL1Entry()) { cacheEntry = readEntry; expiredStage = handlePossibleExpiredEntry(readEntry, false); } if (cacheEntry != null) { if (expiredStage != null) { if (!CompletionStages.isCompletedSuccessfully(expiredStage)) { CacheEntry finalEntry = cacheEntry; returnedStage = expiredStage.thenApply(expired -> { if (expired == Boolean.FALSE) { addReadEntryToContext(ctx, finalEntry, key); } else if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } return null; }); } else { Boolean expired = CompletionStages.join(expiredStage); if (expired == Boolean.FALSE) { addReadEntryToContext(ctx, cacheEntry, key); } else if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } } } else { addReadEntryToContext(ctx, cacheEntry, key); } } } return returnedStage; }</code><technical_language>nitpick: add NullCacheEntry context return immediately. avoid cacheEntry != null expiredStage != null checks</technical_language>

Target:
public final CompletionStage<Void> wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner) { if (!isOwner && !isL1Enabled) { return CompletableFutures.completedNull(); } CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { InternalCacheEntry readEntry = getFromContainer(key, segment); if (readEntry == null) { if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } } else if (isOwner || readEntry.isL1Entry()) { CompletionStage<Boolean> expiredStage = handlePossibleExpiredEntry(readEntry, false); if (expiredStage != null) { if (CompletionStages.isCompletedSuccessfully(expiredStage)) { Boolean expired = CompletionStages.join(expiredStage); handleExpiredEntryContextAddition(expired, ctx, readEntry, key, isOwner); } else { returnedStage = expiredStage.thenApply(expired -> { handleExpiredEntryContextAddition(expired, ctx, readEntry, key, isOwner); return null; }); } } else { addReadEntryToContext(ctx, readEntry, key); } } } return returnedStage; }
Source:
<code>private BuildConfig configAtSha(String name, String sha, GitInfo gitInfo) throws IOException { LOG.info("Trying to fetch current config at sha: {}", sha); GitHub gitHub = gitHubFor(gitInfo); GHRepository repository = gitHub.getRepository(gitInfo.getFullRepositoryName()); <START> GHContent configContent = repository.getFileContent(".blazar.yaml", gitInfo.getBranch()); <END> LOG.info("Found config at hubspot.build/%s ".format(name)); return objectMapper.readValue(yamlFactory.createParser(configContent.getContent()), BuildConfig.class); }</code><technical_language>this sha instead of gitInfo.getBranch()</technical_language>

Target:
private BuildConfig configAtSha(String name, String sha, GitInfo gitInfo) throws IOException { LOG.info("Trying to fetch current config at sha: in repo: {}", sha, gitInfo.getFullRepositoryName()); GitHub gitHub = gitHubFor(gitInfo); GHRepository repository = gitHub.getRepository(gitInfo.getFullRepositoryName()); String configPath = ".blazar.yaml"; try { GHContent configContent = repository.getFileContent(configPath, sha); LOG.info("Found config at {}", configPath); return objectMapper.readValue(yamlFactory.createParser(configContent.getContent()), BuildConfig.class); } catch (FileNotFoundException e) { LOG.info("No blazar config file found for project using default values", name); return BuildConfig.makeDefaultBuildConfig(); } }
Source:
<code>protected String[] stringTagsAt(int pos) { <START> pos -= leftWindow(); END> if ((pos < 0) || (pos >= size)) { return naTagArr; } if (originalTags != null) { final String orig = originalTags.get(pos); if (orig != null) { return new String[] { orig }; } } String[] arr1; String word = sent.get(pos - leftWindow()); int count = maxentTagger.dict.sum(word); if (count == 0 || count < minWordsLockTags) { arr1 = maxentTagger.tags.getOpenTagsArray(); } else { arr1 = maxentTagger.dict.getTags(word); } return maxentTagger.tags.deterministicallyExpandTags(arr1); }</code><technical_language>typo (everything)</technical_language>

Target:
protected String[] stringTagsAt(int pos) { pos -= leftWindow(); if ((pos < 0) || (pos >= size)) { return naTagArr; } if (originalTags != null) { final String orig = originalTags.get(pos); if (orig != null) { return new String[] { orig }; } } String[] arr1; String word = sent.get(pos); int count = maxentTagger.dict.sum(word); if (count == 0 || count < minWordsLockTags) { arr1 = maxentTagger.tags.getOpenTagsArray(); } else { arr1 = maxentTagger.dict.getTags(word); } return maxentTagger.tags.deterministicallyExpandTags(arr1); }
Source:
<code>public void init() throws APIManagerIntegrationTestException { infraProperties = getDeploymentProperties(); String publisherURL = infraProperties.getProperty(PUBLISHER_URL); String storeURL = infraProperties.getProperty(STORE_URL); String warFileName = "jaxrs_basic"; String warFileLocation = System.getProperty("user.dir") + File.separator+ "src/test/resources" + File.separator + warFileName + ".war"; String serviceEndpoint = "https://localhost:9443/services/"; <START> if (publisherURL == null) { <END> publisherURL = "https://localhost:9443/publisher"; } if (storeURL == null) { storeURL = "https://localhost:9443/store"; } setKeyStoreProperties(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(admin, admin); apiStore = new APIStoreRestClient(storeURL); apiStore.login(admin, admin); try { WebAppDeployUtils.deployWebApp(serviceEndpoint, admin, admin, warFileLocation, warFileName); log.info("WebApp deployed successfully"); } catch (RemoteException | MalformedURLException e) { e.printStackTrace(); } }</code><technical_language>do need do in test class now. Parent class this. remove</technical_language>

Target:
public void init() throws APIManagerIntegrationTestException { String warFileName = "jaxrs_basic"; String warFileLocation = System.getProperty("user.dir") + File.separator+ "src/test/resources" + File.separator + warFileName + ".war"; String serviceEndpoint = "https://localhost:9443/services/"; createUsers(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(apiProvider, "wso2123$"); apiStore = new APIStoreRestClient(storeURL); apiStore.login("APIConsumer", "wso2123$"); try { WebAppDeployUtils.deployWebApp(serviceEndpoint, admin, admin, warFileLocation, warFileName); log.info("WebApp deployed successfully"); } catch (RemoteException | MalformedURLException e) { e.printStackTrace(); } }
Source:
<code>private String publish(KeenProject project, String eventCollection, Map<String, Object> event) throws IOException, URISyntaxException { <START> eventCollection = new URI(null, null, eventCollection,null).getRawPath(); <END> String urlString = String.format(Locale.US, "%s/%s/projects/%s/events/%s", getBaseUrl(), KeenConstants.API_VERSION, project.getProjectId(), eventCollection); URL url = new URL(urlString); return publishObject(project, url, event); }</code><technical_language>URISyntaxException is handled in places this method is called</technical_language>

Target:
private String publish(KeenProject project, String eventCollection, Map<String, Object> event) throws IOException { URL url = createURL(project, eventCollection); if (url == null) { throw new IllegalStateException("URL address is empty"); } return publishObject(project, url, event); }
Source:
<code><START> public void shouldAlertIfOkObtained() throws Exception { <END> nano.addHandler(new ForbiddenResponse(PROTECTED_PATH)); nano.addHandler(new OkResponse("/." + PROTECTED_PATH)); HttpMessage msg = this.getHttpMessage(PROTECTED_PATH); rule.init(msg, this.parent); rule.scan(); assertThat(alertsRaised, hasSize(1)); Alert alert = alertsRaised.get(0); assertEquals("Bypassing 403", alert.getName()); assertEquals(Alert.RISK_MEDIUM, alert.getRisk()); assertEquals(Alert.CONFIDENCE_MEDIUM, alert.getConfidence()); }</code><technical_language>assert attack is empty for tests expected one</technical_language>

Target:
public void shouldAlertIfOkObtained() throws Exception { nano.addHandler(new ForbiddenResponse(PROTECTED_PATH)); nano.addHandler(new OkResponse("/." + PROTECTED_PATH)); HttpMessage msg = this.getHttpMessage(PROTECTED_PATH); rule.init(msg, this.parent); rule.scan(); assertThat(alertsRaised, hasSize(1)); Alert alert = alertsRaised.get(0); assertEquals("/%2e" + PROTECTED_PATH, alert.getAttack()); assertAlert(alert); }
Source:
<code>protected Dialect getDialect(RolapSchema schema) { Dialect dialect = null; <START> try { <END> if (schema != null && schema.getDialect() != null) { dialect = schema.getDialect(); } else { dialect = createDialect(); } } catch (Exception ignored) { } return dialect; }</code><technical_language>@stanislau-strelchanka - is this wrapped in a try/catch</technical_language>

Target:
protected Dialect getDialect(RolapSchema schema) { Dialect dialect = null; if (schema != null && schema.getDialect() != null) { dialect = schema.getDialect(); } else { dialect = createDialect(); } return dialect; }
Source:
<code>public NewCourseOutlineAdapter(final Context context, Fragment fragment, final EnrolledCoursesResponse courseData, final IEdxEnvironment environment, DownloadListener listener, boolean isVideoMode, boolean isOnCourseOutline) { this.context = context; this.parentFragment = fragment; this.environment = environment; this.config = environment.getConfig(); this.dbStore = environment.getDatabase(); this.storage = environment.getStorage(); this.courseData = courseData; this.downloadListener = listener; this.isVideoMode = isVideoMode; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); adapterData = new ArrayList(); if (isOnCourseOutline) { if (!isVideoMode) { adapterData.add(new SectionRow(SectionRow.COURSE_CARD, null)); if (courseData.isCertificateEarned() && environment.getConfig().areCertificateLinksEnabled()) { adapterData.add(new SectionRow(SectionRow.COURSE_CERTIFICATE, null, new View.OnClickListener() { @Override public void onClick(View v) { environment.getRouter().showCertificate(context, courseData); } })); } } else { adapterData.add(new SectionRow(SectionRow.BULK_DOWNLOAD, null)); } } <START> getItem(getNonCourseWareItemPlace(SectionRow.BULK_DOWNLOAD)); <END> }</code><technical_language>is of this function call</technical_language>

Target:
public NewCourseOutlineAdapter(final Context context, Fragment fragment, final EnrolledCoursesResponse courseData, final IEdxEnvironment environment, DownloadListener listener, boolean isVideoMode, boolean isOnCourseOutline) { this.context = context; this.parentFragment = fragment; this.environment = environment; this.config = environment.getConfig(); this.dbStore = environment.getDatabase(); this.storage = environment.getStorage(); this.courseData = courseData; this.downloadListener = listener; this.isVideoMode = isVideoMode; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); adapterData = new ArrayList(); if (isOnCourseOutline) { if (isVideoMode) { adapterData.add(new SectionRow(SectionRow.BULK_DOWNLOAD, null)); } else { adapterData.add(new SectionRow(SectionRow.COURSE_CARD, null)); if (courseData.isCertificateEarned() && environment.getConfig().areCertificateLinksEnabled()) { adapterData.add(new SectionRow(SectionRow.COURSE_CERTIFICATE, null, new View.OnClickListener() { @Override public void onClick(View v) { environment.getRouter().showCertificate(context, courseData); } })); } } } }
Source:
<code>public void set(long index, Block value) { Block currentValue = array.get(index); if (currentValue != null) { <START> long headerSize = currentValue.getRetainedSizeInBytesBreakdown(decrementVisitor); <END> sizeOfBlocks -= headerSize; } if (value != null) { long headerSize = value.getRetainedSizeInBytesBreakdown(incrementVisitor); sizeOfBlocks += headerSize; } array.set(index, value); }</code><technical_language>header I guess object header. consistent other parts of code instance size object overhead I object header else</technical_language>

Target:
public void set(long index, Block value) { Block currentValue = array.get(index); if (currentValue != null) { currentValue.retainedBytesForEachPart((object, size) -> { if (currentValue == object) { sizeOfBlocks -= size; return; } if (trackedObjects.decrementReference(object) == 0) { sizeOfBlocks -= size; } }); } if (value != null) { value.retainedBytesForEachPart((object, size) -> { if (value == object) { sizeOfBlocks += size; return; } if (trackedObjects.incrementReference(object) == 1) { sizeOfBlocks += size; } }); } array.set(index, value); }
Source:
<code>public void setupTopologyConfigId(long topologyConfigId) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataKey.KeyType.TOPOLOGY_CONFIG_ID); if (topologyConfigId <= persistedTopologyConfigId) { log.warn("Skip setupTopologyConfigId. the current topologyConfigId " + topologyConfigId + " is not larger than the persistedTopologyConfigID " + persistedTopologyConfigId); } TxBuilder txBuilder = corfuStore.tx(namespace); for (LogReplicationMetadataKey.KeyType type : LogReplicationMetadataKey.KeyType.values()) { long val = Address.NON_ADDRESS; if (type == LogReplicationMetadataKey.KeyType.TOPOLOGY_CONFIG_ID) { val = topologyConfigId; } if (type != LogReplicationMetadataKey.KeyType.UNRECOGNIZED) { appendUpdate(txBuilder, type, val); } <START> } <END> txBuilder.commit(timestamp); log.info("Update topologyConfigId, new metadata {}", this); }</code><technical_language>curious, if update topologyConfigId, do need reset other values? a new standby is added.. is this needed</technical_language>

Target:
public void setupTopologyConfigId(long topologyConfigId) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); if (topologyConfigId <= persistedTopologyConfigId) { log.warn("Skip setupTopologyConfigId. the current topologyConfigId is not larger than the persistedTopologyConfigID {}", topologyConfigId, persistedTopologyConfigId); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); for (LogReplicationMetadataType type : LogReplicationMetadataType.values()) { long val = Address.NON_ADDRESS; if (type == LogReplicationMetadataType.TOPOLOGY_CONFIG_ID) { val = topologyConfigId; } appendUpdate(txBuilder, type, val); } txBuilder.commit(timestamp); log.info("Update topologyConfigId, new metadata {}", this); }
Source:
<code>public String enableStatistics(String proxyName) throws ProxyAdminException { final Lock lock = getLock(); try { lock.lock(); ProxyService proxy = getSynapseConfiguration().getProxyService(proxyName); if (proxy != null) { if (proxy.getAspectConfiguration() == null) { AspectConfiguration config = new AspectConfiguration(proxyName); config.enableStatistics(); proxy.configure(config); } else { proxy.getAspectConfiguration().enableStatistics(); } CAppArtifactDataService cAppArtifactDataService = ConfigHolder.getInstance(). getcAppArtifactDataService(); <START> if (!cAppArtifactDataService.isArtifactDeployedFromCApp(getTenantId(), ServiceBusConstants.PROXY_SERVICE_TYPE + File.separator + proxyName)) { <END> persistProxyService(proxy); } } else { log.error("Couldn't find the proxy service with name " + proxyName + " to enable statistics"); return FAILED; } if(log.isDebugEnabled()) { log.debug("Enabled statistics on proxy service : " + proxyName); } return SUCCESSFUL; } catch (Exception e) { handleException(log, "Unable to enable statistics for proxy service " + proxyName, e); } finally { lock.unlock(); } return FAILED; }</code><technical_language>ServiceBusConstants.PROXY_SERVICE_TYPE + File.separator + proxyName in places. variable</technical_language>

Target:
public String enableStatistics(String proxyName) throws ProxyAdminException { final Lock lock = getLock(); try { lock.lock(); ProxyService proxy = getSynapseConfiguration().getProxyService(proxyName); if (proxy != null) { if (proxy.getAspectConfiguration() == null) { AspectConfiguration config = new AspectConfiguration(proxyName); config.enableStatistics(); proxy.configure(config); } else { proxy.getAspectConfiguration().enableStatistics(); } CAppArtifactDataService cAppArtifactDataService = ConfigHolder.getInstance(). getcAppArtifactDataService(); if (!cAppArtifactDataService.isArtifactDeployedFromCApp(getTenantId(),getArtifactName(artifactType, proxyName))) { persistProxyService(proxy); } } else { log.error("Couldn't find the proxy service with name " + proxyName + " to enable statistics"); return FAILED; } if(log.isDebugEnabled()) { log.debug("Enabled statistics on proxy service : " + proxyName); } return SUCCESSFUL; } catch (Exception e) { handleException(log, "Unable to enable statistics for proxy service " + proxyName, e); } finally { lock.unlock(); } return FAILED; }
Source:
<code>@Test public void testJsonInsert() { String query = "select json_insert(\"product_name\", '$', 10) from \"product\""; final String expected = "SELECT JSON_INSERT(\"product_name\", '$', 10)\n" <START> + "FROM \"foodmart\".\"product\""; <END> sql(query).ok(expected); }</code><technical_language>1. Do test 'null' "\n" in query 2. put query expected pair instead of putting queries together</technical_language>

Target:
@Test public void testJsonInsert() { String query0 = "select json_insert(\"product_name\", '$', 10) from \"product\""; String query1 = "select json_insert(cast(null as varchar), '$', 10, '$', null, '$'," + " '\n\t\n') from \"product\""; final String expected0 = "SELECT JSON_INSERT(\"product_name\", '$', 10)\n" + "FROM \"foodmart\".\"product\""; final String expected1 = "SELECT JSON_INSERT(NULL, '$', 10, '$', NULL, '$', " + "u&'\\000a\\0009\\000a')\nFROM \"foodmart\".\"product\""; sql(query0).ok(expected0); sql(query1).ok(expected1); }
Source:
<code>public static String printLine() { <START> String result = "\n"; <END> for (int i = 0; i < LINE_LENGTH; i++) { result += "-"; } return result + "\n"; }</code><technical_language>StringBuilder</technical_language>

Target:
public static String printLine() { StringBuilder result = new StringBuilder().append("\n"); for (int i = 0; i < LINE_LENGTH; i++) { result.append("-"); } result.append("\n"); return result.toString(); }
Source:
<code>public void waitForPanelsToCollapse() { List<WebElement> panelBodies = browser.driver.findElements(By.cssSelector("div[id^='panelBodyCollapse-']")); waitForElementsVisibility(panelBodies); <START> ThreadHelper.waitFor(1000); <END> }</code><technical_language>idea this wait is for</technical_language>

Target:
public void waitForPanelsToCollapse() { By panelCollapseSelector = By.cssSelector("div[id^='panelBodyCollapse-']"); waitForElementToDisappear(panelCollapseSelector); }
Source:
<code>public synchronized void notifyTaskFailure(long jobId, long taskId, Throwable t) { Pair<Long, Long> id = new Pair<>(jobId, taskId); TaskInfo taskInfo = mUnfinishedTasks.get(id); taskInfo.setStatus(Status.FAILED); String errorMessage; if (ServerConfiguration.getBoolean(PropertyKey.DEBUG)) { errorMessage = Throwables.getStackTraceAsString(t); } else { errorMessage = t.getMessage(); } taskInfo.setErrorType(ErrorUtils.getErrorType(t)); if (errorMessage != null) { taskInfo.setErrorMessage(errorMessage); } finishTask(id); LOG.info("Task for job failed: {}", taskId, jobId, errorMessage); <START> SAMPLING_LOGGER.info(Throwables.getStackTraceAsString(t)); <END> }</code><technical_language>I this message taskId jobId, stack is for? like: java SAMPLING_LOGGER.info("Stack trace for taskId: jobId: : {}", taskId, jobId, Throwables.getStackTraceAsString(t));</technical_language>

Target:
public synchronized void notifyTaskFailure(long jobId, long taskId, Throwable t) { Pair<Long, Long> id = new Pair<>(jobId, taskId); TaskInfo taskInfo = mUnfinishedTasks.get(id); taskInfo.setStatus(Status.FAILED); String errorMessage; if (ServerConfiguration.getBoolean(PropertyKey.DEBUG)) { errorMessage = Throwables.getStackTraceAsString(t); } else { errorMessage = t.getMessage(); } taskInfo.setErrorType(ErrorUtils.getErrorType(t)); if (errorMessage != null) { taskInfo.setErrorMessage(errorMessage); } finishTask(id); LOG.info("Task for job failed: {}", taskId, jobId, errorMessage); SAMPLING_LOGGER.info("Stack trace for taskId: jobId: : {}", taskId, jobId, Throwables.getStackTraceAsString(t)); }
Source:
<code><START> protected void mergeOneCommit(final CodeReviewCommit n) throws MergeException { <END> final ThreeWayMerger m; if (destProject.isUseContentMerge()) { m = MergeStrategy.RESOLVE.newMerger(db, true); } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger(db); } try { if (m.merge(new AnyObjectId[] {mergeTip, n})) { writeMergeCommit(m, n); } else { failed(n, CommitMergeStatus.PATH_CONFLICT); } } catch (IOException e) { if (e.getMessage().startsWith("Multiple merge bases for")) { try { failed(n, CommitMergeStatus.CRISS_CROSS_MERGE); } catch (IOException e2) { throw new MergeException("Cannot merge " + n.name(), e); } } else { throw new MergeException("Cannot merge " + n.name(), e); } } }</code><technical_language>subclasses allowed override this method</technical_language>

Target:
protected final void mergeOneCommit(final CodeReviewCommit n) throws MergeException { final ThreeWayMerger m; if (destProject.isUseContentMerge()) { m = MergeStrategy.RESOLVE.newMerger(db, true); } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger(db); } try { if (m.merge(new AnyObjectId[] {mergeTip, n})) { writeMergeCommit(m, n); } else { failed(n, CommitMergeStatus.PATH_CONFLICT); } } catch (IOException e) { if (e.getMessage().startsWith("Multiple merge bases for")) { try { failed(n, CommitMergeStatus.CRISS_CROSS_MERGE); } catch (IOException e2) { throw new MergeException("Cannot merge " + n.name(), e); } } else { throw new MergeException("Cannot merge " + n.name(), e); } } }
Source:
<code>public static DistributedQueryRunner createElasticsearchQueryRunner(EmbeddedElasticsearchNode embeddedElasticsearch, Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { <START> queryRunner = new DistributedQueryRunner(createSession(), 2); <END> queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); embeddedElasticsearch.start(); Map<SchemaTableName, ElasticsearchTableDescription> tableDescriptions = createTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables); installElasticsearchPlugin(queryRunner, tables, tableDescriptions); TestingPrestoClient prestoClient = queryRunner.getClient(); LOG.info("Loading data..."); long startTime = System.nanoTime(); for (TpchTable<?> table : tables) { loadTpchTopic(embeddedElasticsearch, prestoClient, table); } LOG.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS)); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner, embeddedElasticsearch); throw e; } }</code><technical_language>Please DistributedQueryRunner.Builder this method is deprecated</technical_language>

Target:
public static DistributedQueryRunner createElasticsearchQueryRunner(EmbeddedElasticsearchNode embeddedElasticsearch, Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = DistributedQueryRunner.builder(createSession()) .setNodeCount(NODE_COUNT) .build(); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); embeddedElasticsearch.start(); ElasticsearchTableDescriptionProvider tableDescriptions = createTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables); ElasticsearchConnectorTestFactory testFactory = new ElasticsearchConnectorTestFactory(tableDescriptions); installElasticsearchPlugin(queryRunner, tables, testFactory); TestingPrestoClient prestoClient = queryRunner.getClient(); LOG.info("Loading data..."); long startTime = System.nanoTime(); for (TpchTable<?> table : tables) { loadTpchTopic(embeddedElasticsearch, prestoClient, table); } LOG.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS)); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner, embeddedElasticsearch); throw e; } }
Source:
<code>public List<String> getRuleChainVisits() { if (xPathRuleQueryNeedsInitialization()) { initXPathRuleQuery(); <START> for (final String nodeName : xpathRuleQuery.getRuleChainVisits()) { <END> super.addRuleChainVisit(nodeName); } } return super.getRuleChainVisits(); }</code><technical_language>Unwanted final</technical_language>

Target:
public List<String> getRuleChainVisits() { if (xPathRuleQueryNeedsInitialization()) { initXPathRuleQuery(); for (String nodeName : xpathRuleQuery.getRuleChainVisits()) { super.addRuleChainVisit(nodeName); } } return super.getRuleChainVisits(); }
Source:
<code><START> public String refreshToken() throws Exception { <END> token = flow.getToken(); return token; }</code><technical_language>Is throw a more specific exception</technical_language>

Target:
public String refreshToken() throws OAuthSystemException, OAuthProblemException { if (flow == null) { throw new OAuthSystemException("Oauth flow is null"); } token = flow.getToken(); return token; }
Source:
<code>public DesignDocument get(String id) { final URI uri = buildUri(dbUri).path(id).build(); <START> return client.get(uri, DesignDocument.class); <END> }</code><technical_language>methods in need client.couchDbClient.get(...) break merges master of #133</technical_language>

Target:
public DesignDocument get(String id) { assertNotEmpty(id, "id"); id = CouchDbUtil.ensureDesignPrefix(id); return db.find(DesignDocument.class, id); }
Source:
<code>public List<Node> getChildren() { <START> return ImmutableList.copyOf(properties); <END> }</code><technical_language>need copy (the class store immutable list)</technical_language>

Target:
public List<Property> getChildren() { return properties; }
Source:
<code>public static WorkProcessor<Page> mergeSortedPages( List<WorkProcessor<Page>> pageProducers, PageWithPositionComparator comparator, List<Integer> outputChannels, List<Type> outputTypes, BiPredicate<PageBuilder, PageWithPosition> pageBreakPredicate, boolean updateMemoryAfterEveryPosition, AggregatedMemoryContext aggregatedMemoryContext, DriverYieldSignal yieldSignal) { <START> return buildPage(mergeSorted( <END> pageProducers.stream() .map(pageProducer -> pageWithPositions(pageProducer, aggregatedMemoryContext.newLocalMemoryContext())) .collect(toImmutableList()), (firstPageWithPosition, secondPageWithPosition) -> comparator.compareTo( firstPageWithPosition.getPage(), firstPageWithPosition.getPosition(), secondPageWithPosition.getPage(), secondPageWithPosition.getPosition())), outputChannels, outputTypes, pageBreakPredicate, updateMemoryAfterEveryPosition, aggregatedMemoryContext.newLocalMemoryContext(), yieldSignal); }</code><technical_language>extract variables: List<WorkProcessor<PageWithPosition>> pageWithPositionProducers = pageProducers.stream() .map(pageProducer -> pageWithPositions(pageProducer, aggregatedMemoryContext.newLocalMemoryContext())) .collect(toImmutableList()); WorkProcessor<PageWithPosition> pageWithPositions = mergeSorted( pageWithPositionProducers, (firstPageWithPosition, secondPageWithPosition) -> comparator.compareTo( firstPageWithPosition.getPage(), firstPageWithPosition.getPosition(), secondPageWithPosition.getPage(), secondPageWithPosition.getPosition()));</technical_language>

Target:
public static WorkProcessor<Page> mergeSortedPages( List<WorkProcessor<Page>> pageProducers, PageWithPositionComparator comparator, List<Integer> outputChannels, List<Type> outputTypes, BiPredicate<PageBuilder, PageWithPosition> pageBreakPredicate, boolean updateMemoryAfterEveryPosition, AggregatedMemoryContext aggregatedMemoryContext, DriverYieldSignal yieldSignal) { List<WorkProcessor<PageWithPosition>> pageWithPositionProducers = pageProducers.stream() .map(pageProducer -> pageWithPositions(pageProducer, aggregatedMemoryContext.newLocalMemoryContext())) .collect(toImmutableList()); Comparator<PageWithPosition> pageWithPositionComparator = (firstPageWithPosition, secondPageWithPosition) -> comparator.compareTo( firstPageWithPosition.getPage(), firstPageWithPosition.getPosition(), secondPageWithPosition.getPage(), secondPageWithPosition.getPosition()); return buildPage( mergeSorted(pageWithPositionProducers, pageWithPositionComparator), outputChannels, outputTypes, pageBreakPredicate, updateMemoryAfterEveryPosition, aggregatedMemoryContext.newLocalMemoryContext(), yieldSignal); }
Source:
<code>public Boolean getDayNightRenderer() { if (dayNightMode.isDay()) { return Boolean.TRUE; } else if (dayNightMode.isNight()) { return Boolean.FALSE; } else if (dayNightMode.isAuto()) { long currentTime = System.currentTimeMillis(); if (currentTime - lastAutoCall > 60000) { lastAutoCall = System.currentTimeMillis(); try { Location lastKnownLocation = getLocation(); if (lastKnownLocation == null) { return null; } double longitude = lastKnownLocation.getLongitude(); Date actualTime = new Date(); SunriseSunset daynightSwitch = new SunriseSunset(lastKnownLocation.getLatitude(), longitude < 0 ? 360 - longitude : longitude, actualTime, <START> (-1.0 * TimeZone.getDefault().getOffset(actualTime.getTime())) / 3600000); <END> boolean daytime = daynightSwitch.isDaytime(); log.debug("Sunrise/sunset setting to day: " + daytime); lastAutoValue = Boolean.valueOf(daytime); return lastAutoValue; } catch (IllegalArgumentException e) { log.warn("Network location provider not available"); } catch (SecurityException e) { log.warn("Missing permitions to get actual location!"); } return null; } else { return lastAutoValue; } } else if (dayNightMode.isSensor()) { log.debug("lux value:" + lux + " setting to day: " + (lux > SensorManager.LIGHT_CLOUDY)); return lux > SensorManager.LIGHT_CLOUDY ? Boolean.TRUE : Boolean.FALSE; } return null; }</code><technical_language>Change SunriseSunset class minutes instead of hours get rid of double. Thanx</technical_language>

Target:
public Boolean getDayNightRenderer() { if (dayNightMode.isDay()) { return Boolean.TRUE; } else if (dayNightMode.isNight()) { return Boolean.FALSE; } else if (dayNightMode.isAuto()) { long currentTime = System.currentTimeMillis(); if (currentTime - lastAutoCall > 60000) { lastAutoCall = System.currentTimeMillis(); try { Location lastKnownLocation = getLocation(); if (lastKnownLocation == null) { return null; } double longitude = lastKnownLocation.getLongitude(); Date actualTime = new Date(); SunriseSunset daynightSwitch = new SunriseSunset(lastKnownLocation.getLatitude(), longitude < 0 ? 360 - longitude : longitude, actualTime, TimeZone.getDefault()); boolean daytime = daynightSwitch.isDaytime(); log.debug("Sunrise/sunset setting to day: " + daytime); lastAutoValue = Boolean.valueOf(daytime); return lastAutoValue; } catch (IllegalArgumentException e) { log.warn("Network location provider not available"); } catch (SecurityException e) { log.warn("Missing permitions to get actual location!"); } return null; } else { return lastAutoValue; } } else if (dayNightMode.isSensor()) { log.debug("lux value:" + lux + " setting to day: " + (lux > SensorManager.LIGHT_CLOUDY)); return lux > SensorManager.LIGHT_CLOUDY ? Boolean.TRUE : Boolean.FALSE; } return null; }
Source:
<code>public static TruthState getVar(final int allele0idx, final int allele1idx) { if (allele0idx == 0 && allele1idx == 1) return HET_REF_VAR1; if (allele0idx == 1 && allele1idx == 0) return HET_REF_VAR1; if (allele0idx == 1 && allele1idx == 2) return HET_VAR1_VAR2; if (allele0idx == 2 && allele1idx == 1) return HET_VAR1_VAR2; <START> ValidationUtils.validateArg(false,"Shouldn't be here."); <END> return null; }</code><technical_language>throw if here</technical_language>

Target:
public static TruthState getVar(final int allele0idx, final int allele1idx) { if (allele0idx == 0 && allele1idx == 1) return HET_REF_VAR1; if (allele0idx == 1 && allele1idx == 0) return HET_REF_VAR1; if (allele0idx == 1 && allele1idx == 2) return HET_VAR1_VAR2; if (allele0idx == 2 && allele1idx == 1) return HET_VAR1_VAR2; throw new IllegalStateException("Shouldn't be here."); }
Source:
<code>public void onRuntimeModelRemoved(@Observes RemovedRuntimeModelEvent event) { <START> String externalComponentsDir = loader.getExternalComponentsDir(); String runtimeModelId = event.getRuntimeModelId(); <END> if (options.isComponentPartition()) { File runtimeModelComponentsFile = Paths.get(externalComponentsDir, runtimeModelId).toFile(); FileUtils.deleteQuietly(runtimeModelComponentsFile); } }</code><technical_language>Consider moving 2 lines if block below. need if options.isComponentPartition() == false</technical_language>

Target:
public void onRuntimeModelRemoved(@Observes RemovedRuntimeModelEvent event) { if (options.isComponentPartition()) { String componentsDir = loader.getExternalComponentsDir(); String runtimeModelId = event.getRuntimeModelId(); if (componentsDir != null && runtimeModelId != null) { File runtimeModelComponentsFile = Paths.get(componentsDir, runtimeModelId).toFile(); FileUtils.deleteQuietly(runtimeModelComponentsFile); } } }