auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setChromeOptions(WebDriverConfiguration configuration, DesiredCapabilities capabilities) { ChromeOptions chromeOptions = new ChromeOptions(); String browser = configuration.getBrowser().toLowerCase(); if (browser.equals("chromeheadless")) { chromeOptions.addArguments("--headless"); chromeOptions.addArguments("--window-size=1200,600"); } CapabilitiesOptionsMapper.mapCapabilities(chromeOptions, capabilities, BROWSER_CAPABILITIES); String binary = (String) capabilities.getCapability("chrome.binary"); if (Validate.nonEmpty(binary)) { chromeOptions.setBinary(binary); } capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); String printChromeOptions = (String) capabilities.getCapability(CHROME_PRINT_OPTIONS); if (Validate.nonEmpty(printChromeOptions) && Boolean.valueOf(printChromeOptions.trim())) { try { StringBuffer chromeOptionsLog = new StringBuffer("\n"); chromeOptionsLog.append("======== Chrome options =========").append("\n"); chromeOptionsLog.append(chromeOptions.toJson().toString()).append("\n"); chromeOptionsLog.append("===== End of Chrome options ====="); log.info(chromeOptionsLog.toString()); } catch (IOException e) { log.warning("Something bad happened during printing chrome options: "); log.warning(e.getMessage()); } } }

Target:
public void setChromeOptions(WebDriverConfiguration configuration, DesiredCapabilities capabilities) { ChromeOptions chromeOptions = new ChromeOptions(); Dimensions dimensions = new Dimensions(configuration); String browser = configuration.getBrowser().toLowerCase(); if (browser.equals("chromeheadless")) { chromeOptions.addArguments("--headless"); if (dimensions.hasFullscreenEnabled()) { log.info( String.format("Chrome Headless does not support fullscreen. Setting default window-size to %dx%d", dimensions.getWidth(), dimensions.getHeight())); } chromeOptions.addArguments( String.format("--window-size=%d,%d", dimensions.getWidth(), dimensions.getHeight())); } CapabilitiesOptionsMapper.mapCapabilities(chromeOptions, capabilities, BROWSER_CAPABILITIES); String binary = (String) capabilities.getCapability("chrome.binary"); if (Validate.nonEmpty(binary)) { chromeOptions.setBinary(binary); } capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); String printChromeOptions = (String) capabilities.getCapability(CHROME_PRINT_OPTIONS); if (Validate.nonEmpty(printChromeOptions) && Boolean.valueOf(printChromeOptions.trim())) { try { StringBuffer chromeOptionsLog = new StringBuffer("\n"); chromeOptionsLog.append("======== Chrome options =========").append("\n"); chromeOptionsLog.append(chromeOptions.toJson().toString()).append("\n"); chromeOptionsLog.append("===== End of Chrome options ====="); log.info(chromeOptionsLog.toString()); } catch (IOException e) { log.warning("Something bad happened during printing chrome options: "); log.warning(e.getMessage()); } } }
Source:
@Override public void run(JsonNode jsonNode) throws Exception { String cacheName = jsonNode.get("cacheName").asText(); int warmup = jsonNode.get("warmup").asInt(); String cell = jsonNode.get("cell").asText(); String attr = jsonNode.get("attr").asText(); markInitialized(); waitForActivation(); IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(cacheName); long[] max = new long[20]; Arrays.fill(max, -1); int key = 10_000_000; int cnt = 0; long initTime = 0; boolean record = false; Affinity<Integer> aff = ignite.affinity(cacheName); while (!terminated()) { key++; Collection<ClusterNode> nodes = aff.mapKeyToPrimaryAndBackups(key); Map<Object, Long> stat = nodes.stream().collect( Collectors.groupingBy(n -> n.attributes().get(attr), Collectors.counting())); if (!stat.containsKey(cell)) continue; cnt++; long start = System.currentTimeMillis(); cache.put(key, key); long finish = System.currentTimeMillis(); long time = finish - start; if (!record && cnt > warmup) { record = true; initTime = System.currentTimeMillis(); log.info("Warmup finished"); } if (record) { for (int i = 0; i < max.length; i++) { if (max[i] <= time) { System.arraycopy(max, i, max, i + 1, max.length - i - 1); max[i] = time; break; } } } if (cnt % 1000 == 0) log.info("Application streamed " + cnt + " transactions [worst_latency=" + Arrays.toString(max) + "]"); } recordResult("WORST_LATENCY", Arrays.toString(max)); recordResult("STREAMED", cnt - warmup); recordResult("MEASURE_DURATION", System.currentTimeMillis() - initTime); markFinished(); }

Target:
@Override public void run(JsonNode jsonNode) throws Exception { String cacheName = jsonNode.get("cacheName").asText(); int warmup = jsonNode.get("warmup").asInt(); String cell = jsonNode.get("cell").asText(); String attr = jsonNode.get("attr").asText(); markInitialized(); waitForActivation(); IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(cacheName); long[] max = new long[20]; Arrays.fill(max, -1); int key = 0; int cnt = 0; long initTime = 0; boolean record = false; Affinity<Integer> aff = ignite.affinity(cacheName); while (!terminated()) { key++; Collection<ClusterNode> nodes = aff.mapKeyToPrimaryAndBackups(key); Map<Object, Long> stat = nodes.stream().collect( Collectors.groupingBy(n -> n.attributes().get(attr), Collectors.counting())); if (!stat.containsKey(cell)) continue; cnt++; long start = System.currentTimeMillis(); cache.put(key, key); long finish = System.currentTimeMillis(); long time = finish - start; if (!record && cnt > warmup) { record = true; initTime = System.currentTimeMillis(); log.info("Warmup finished"); } if (record) { for (int i = 0; i < max.length; i++) { if (max[i] <= time) { System.arraycopy(max, i, max, i + 1, max.length - i - 1); max[i] = time; break; } } } if (cnt % 1000 == 0) log.info("Application streamed " + cnt + " transactions [worst_latency=" + Arrays.toString(max) + "]"); } recordResult("WORST_LATENCY", Arrays.toString(max)); recordResult("STREAMED", cnt - warmup); recordResult("MEASURE_DURATION", System.currentTimeMillis() - initTime); markFinished(); }
Source:
private String extractPragmasFromFilename(String filename, Properties prop) { int parameterDelimiter = filename.indexOf('?'); if (parameterDelimiter == -1) { return filename; } StringBuilder sb = new StringBuilder(); sb.append(filename.substring(0, parameterDelimiter)); String parameters = filename.substring(parameterDelimiter + 1).split("&"); for (int i = 0 ; i < parameters.length; i++) { final String parameter = parameters[i]; final String kvp = parameter.toLowerCase().split("="); final String key = kvp[0].trim(); if (pragmaSet.contains(key)) { final String value = kvp[1].trim(); if (!value.isEmpty()) { prop.setProperty(key, value); } } else { if (i == 0) { sb.append('?'); } else { sb.append('&'); } sb.append(parameter); } } final String newFilename = sb.toString(); return newFilename; }

Target:
private String extractPragmasFromFilename(String filename, Properties prop) throws SQLException { int parameterDelimiter = filename.indexOf('?'); if (parameterDelimiter == -1) { return filename; } StringBuilder sb = new StringBuilder(); sb.append(filename.substring(0, parameterDelimiter)); int nonPragmaCount = 0; String parameters = filename.substring(parameterDelimiter + 1).split("&"); for (int i = 0; i < parameters.length; i++) { String parameter = parameters[parameters.length - 1 - i].trim(); if (parameter.isEmpty()) { continue; } String kvp = parameter.toLowerCase().split("="); String key = kvp[0].trim(); if (pragmaSet.contains(key)) { if (kvp.length == 1) { throw new SQLException(String.format("Please specify a value for PRAGMA %s in URL %s", key, url)); } String value = kvp[1].trim(); if (!value.isEmpty()) { if (prop.containsKey(key)) { } else { prop.setProperty(key, value); } } } else { sb.append(nonPragmaCount == 0 ? '?' : '&'); sb.append(parameter); nonPragmaCount++; } } final String newFilename = sb.toString(); return newFilename; }
Source:
public void setFirstPaymentDate() { nextPayment = nextPayment.plusDays(1); int temp; switch (schedule) { case Finances.SCHEDULE_BIWEEKLY: temp = 8 - nextPayment.getDayOfWeek().getValue(); if (temp != 7) { nextPayment = nextPayment.plusDays(temp); } nextPayment = nextPayment.plusWeeks(2); break; case Finances.SCHEDULE_MONTHLY: temp = nextPayment.getDayOfMonth(); if (temp != 1) { nextPayment = nextPayment.plusDays(nextPayment.lengthOfMonth() - temp); } nextPayment = nextPayment.plusMonths(1); break; case Finances.SCHEDULE_QUARTERLY: temp = nextPayment.getDayOfMonth(); if (temp != 1) { nextPayment = nextPayment.plusDays(nextPayment.lengthOfMonth() - temp); } nextPayment = nextPayment.plusMonths(3); break; case Finances.SCHEDULE_YEARLY: temp = nextPayment.getDayOfYear(); if (temp != 1) { nextPayment = nextPayment.plusDays(nextPayment.lengthOfYear() - temp); } nextPayment = nextPayment.plusYears(1); break; } }

Target:
public void setFirstPaymentDate() { nextPayment = nextPayment.plusDays(1); switch (schedule) { case Finances.SCHEDULE_BIWEEKLY: nextPayment = nextPayment.with(TemporalAdjusters.nextOrSame(DayOfWeek.MONDAY)).plusWeeks(2); break; case Finances.SCHEDULE_MONTHLY: if (nextPayment.getDayOfMonth() != 1) { nextPayment = nextPayment.with(TemporalAdjusters.firstDayOfNextMonth()); } nextPayment = nextPayment.plusMonths(1); break; case Finances.SCHEDULE_QUARTERLY: if (nextPayment.getDayOfMonth() != 1) { nextPayment = nextPayment.with(TemporalAdjusters.firstDayOfNextMonth()); } nextPayment = nextPayment.plusMonths(3); break; case Finances.SCHEDULE_YEARLY: if (nextPayment.getDayOfYear() != 1) { nextPayment = nextPayment.with(TemporalAdjusters.firstDayOfNextYear()); } nextPayment = nextPayment.plusYears(1); break; } }
Source:
public <T> T getMandatoryParameter(String parameterName, Class<T> type) { if ( !parameters.containsKey( parameterName ) ) { throw LOG.getUnableToFindAnnotationParameterException( parameterName, null ); } Object parameter = parameters.get( parameterName ); if ( !type.isAssignableFrom( parameter.getClass() ) ) { throw LOG.getWrongParameterTypeException( type, parameter.getClass() ); } return (T) parameter; }

Target:
public <T> T getMandatoryParameter(String parameterName, Class<T> type) { Object parameter = parameters.get( parameterName ); if ( parameter == null ) { throw LOG.getUnableToFindAnnotationParameterException( parameterName, null ); } if ( !type.isAssignableFrom( parameter.getClass() ) ) { throw LOG.getWrongParameterTypeException( type, parameter.getClass() ); } return (T) parameter; }
Source:
public void setTransform( AffineTransform transform ) { AWTSWTImageUtils.checkAccess(); double[] matrix=new double[6]; transform.getMatrix(matrix); if( swtTransform==null ){ swtTransform=new Transform(display, (float)matrix[0], (float)matrix[2], (float)matrix[1], (float)matrix[3], (float)matrix[4], (float)matrix[5] ); }else{ swtTransform.setElements( (float)matrix[0], (float)matrix[2], (float)matrix[1], (float)matrix[3], (float)matrix[4], (float)matrix[5] ); } gc.setTransform(swtTransform); }

Target:
public void setTransform( AffineTransform transform ) { AWTSWTImageUtils.checkAccess(); double[] matrix=new double[6]; transform.getMatrix(matrix); swtTransform.setElements( (float)matrix[0], (float)matrix[2], (float)matrix[1], (float)matrix[3], (float)matrix[4], (float)matrix[5] ); gc.setTransform(swtTransform); }
Source:
public Set<Job> getAllActiveJobsOnHost(@NotBlank final String hostName) { log.debug("Called with hostname {}", hostName); final CriteriaBuilder cb = this.entityManager.getCriteriaBuilder(); final CriteriaQuery<JobEntity> query = cb.createQuery(JobEntity.class); final Root<JobEntity> root = query.from(JobEntity.class); final Join<JobEntity, JobExecutionEntity> executions = root.join(JobEntity_.execution); final Set<Predicate> statusPredicates = JobStatus .getActiveStatuses() .stream() .map(status -> cb.equal(root.get(JobEntity_.status), status)) .collect(Collectors.toSet()); final Predicate statusPredicate = cb.or(statusPredicates.toArray(new Predicate[statusPredicates.size()])); final Predicate hostPredicate = cb.equal(executions.get(JobExecutionEntity_.hostName), hostName); query .distinct(true) .where(cb.and(statusPredicate, hostPredicate)); return this.entityManager .createQuery(query) .getResultList() .stream() .map(JobEntity::getDTO) .collect(Collectors.toSet()); }

Target:
public Set<Job> getAllActiveJobsOnHost(@NotBlank final String hostName) { log.debug("Called with hostname {}", hostName); final CriteriaBuilder cb = this.entityManager.getCriteriaBuilder(); final CriteriaQuery<JobEntity> query = cb.createQuery(JobEntity.class); final Root<JobEntity> root = query.from(JobEntity.class); final Join<JobEntity, JobExecutionEntity> executions = root.join(JobEntity_.execution); final Expression<Boolean> statusExpression = root.get(JobEntity_.status).in(JobStatus.getActiveStatuses()); final Predicate hostPredicate = cb.equal(executions.get(JobExecutionEntity_.hostName), hostName); query.where(cb.and(statusExpression, hostPredicate)); return this.entityManager .createQuery(query) .getResultList() .stream() .map(JobEntity::getDTO) .collect(Collectors.toSet()); }
Source:
public Map<String, String> getClaimsMap() { if (claimsMap == null) { return Collections.emptyMap(); } return claimsMap; }

Target:
public Map<String, String> getClaimsMap() { return claimsMap; }
Source:
public void infer_stream_types_on_chained_map() { Result result = Result.createFor("InferLambdaType"); JavaSymbol stringToBoolean = result.symbol("stringToBoolean"); assertThat(stringToBoolean.usages()).hasSize(2); assertThat(result.reference(63, 17)).isEqualTo(stringToBoolean); assertThat(result.reference(67, 17)).isEqualTo(stringToBoolean); IdentifierTree map = result.referenceTree(63, 8); MethodJavaType methodJavaType = (MethodJavaType) map.symbolType(); assertThat(methodJavaType.resultType.isTagged(JavaType.DEFERRED)).isFalse(); JavaSymbol booleanToInt = result.symbol("booleanToInt"); assertThat(booleanToInt.usages()).hasSize(1); assertThat(result.reference(68, 17)).isEqualTo(booleanToInt); JavaSymbol intToInt = result.symbol("intToInt"); assertThat(intToInt.usages()).hasSize(1); assertThat(result.reference(72, 20)).isEqualTo(intToInt); }

Target:
public void infer_stream_types_on_chained_map() { Result result = Result.createFor("InferLambdaType"); JavaSymbol stringToBoolean = result.symbol("stringToBoolean"); assertThat(stringToBoolean.usages()).hasSize(2); assertThat(result.reference(63, 17)).isEqualTo(stringToBoolean); assertThat(result.reference(67, 17)).isEqualTo(stringToBoolean); IdentifierTree map = result.referenceTree(63, 8); JavaType mapResultType = ((MethodJavaType) map.symbolType()).resultType; assertThat(mapResultType.isTagged(JavaType.DEFERRED)).isFalse(); assertThat(mapResultType.is("java.util.stream.Stream")).isTrue(); assertThat(mapResultType.isParameterized()).isTrue(); JavaType substitutionType = ((ParametrizedTypeJavaType) mapResultType).typeSubstitution.substitutedTypes().get(0); assertThat(substitutionType.is("java.lang.Boolean")).isTrue(); JavaSymbol booleanToInt = result.symbol("booleanToInt"); assertThat(booleanToInt.usages()).hasSize(1); assertThat(result.reference(68, 17)).isEqualTo(booleanToInt); JavaSymbol intToInt = result.symbol("intToInt"); assertThat(intToInt.usages()).hasSize(1); assertThat(result.reference(72, 20)).isEqualTo(intToInt); }
Source:
public static void main(final String[] args) throws IOException { Banner.banner(); String namespace = null; int i = 0; while (i < args.length) { final String arg = args[i]; if (arg.startsWith("-")) { switch (arg) { case "-namespace": namespace = args[++i]; break; default: log.debug("Unknown argument: " + arg); usage(); break; } } else { break; } i++; } if (i >= args.length) { System.err.println("Not enough arguments."); usage(); } final String propertyFileName = args[i]; try { final Properties properties = processProperties(propertyFileName); File journal = new File(properties.getProperty(Options.FILE)); long startTime = System.currentTimeMillis(); if (journal.isFile()) { Journal jnl = new Journal(properties); AtomicLong duplicates = new AtomicLong(); try { log.info("Processing the journal: " + jnl.getFile()); if (namespace == null) { List<String> namespaces = jnl.getGlobalRowStore().getNamespaces(jnl.getLastCommitTime()); for (String nm : namespaces) { checkNamespace(jnl, nm, duplicates); } } else { checkNamespace(jnl, namespace, duplicates); } } finally { jnl.commit(); jnl.close(); log.info("Completed in " + (System.currentTimeMillis()-startTime) + ". Found " + duplicates.get() + " duplicates"); } } else { log.debug("Journal " + journal + " does not exist"); } } catch (Throwable e) { log.error("Error", e); } }

Target:
public static void main(final String[] args) { Banner.banner(); String namespace = null; int i = 0; while (i < args.length) { final String arg = args[i]; if (arg.startsWith("-")) { switch (arg) { case "-namespace": namespace = args[++i]; break; default: log.debug("Unknown argument: " + arg); usage(); break; } } else { break; } i++; } if (i >= args.length) { System.err.println("Not enough arguments."); usage(); } final String propertyFileName = args[i]; try { final Properties properties = processProperties(propertyFileName); File journal = new File(properties.getProperty(Options.FILE)); long startTime = System.currentTimeMillis(); if (journal.isFile()) { Journal jnl = new Journal(properties); AtomicLong duplicates = new AtomicLong(); try { log.info("Processing the journal: " + jnl.getFile()); if (namespace == null) { List<String> namespaces = jnl.getGlobalRowStore().getNamespaces(jnl.getLastCommitTime()); for (String nm : namespaces) { checkNamespace(jnl, nm, duplicates); } } else { checkNamespace(jnl, namespace, duplicates); } } finally { jnl.commit(); jnl.close(); log.info("Completed in " + (System.currentTimeMillis()-startTime) + ". Found " + duplicates.get() + " duplicates"); } } else { log.debug("Journal " + journal + " does not exist"); } } catch (Throwable e) { log.error("Error", e); } }
Source:
private Collection<EventClass> getEventClasses(Collection<Event> events) { return transform(events, new Function<Event, EventClass>() { @Override public @Nullable EventClass apply(@Nullable Event record) { if (record == null) { return null; } Message eventMessage = unpack(record.getMessage()); return EventClass.of(eventMessage); } }); }

Target:
private Collection<EventClass> getEventClasses(Collection<Event> events) { List<EventClass> result = events.stream() .map(EventClass::of) .collect(toList()); return result; }
Source:
public InputRow nextRow() throws IOException { if (!hasMore()) { throw new NoSuchElementException(); } if (!parsedInputRows.isEmpty()) { return parsedInputRows.remove(0); } return getNextRow(); }

Target:
public InputRow nextRow() throws IOException { if (!hasMore()) { throw new NoSuchElementException(); } if (parsedInputRows.hasNext()) { return parsedInputRows.next(); } return getNextRow(); }
Source:
public void initialContentShouldEndUpInThirdBackupFileAfterThreeBackupRuns() throws IOException { final int kNumberOfBackups = 3; String contentOne = "Test One."; Process process = new Process(); process.setId(2); process.setProcessBaseUri(URI.create("2")); URI correctURI = URI .create(processService.getProcessDataDirectory(process).toString() + "/" + BACKUP_FILE_NAME); writeFile(correctURI, contentOne); runBackup(kNumberOfBackups, process); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(kNumberOfBackups, process); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(kNumberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".3", contentOne); }

Target:
public void initialContentShouldEndUpInThirdBackupFileAfterThreeBackupRuns() throws IOException { final int numberOfBackups = 3; String contentOne = "Test One."; Process process = new Process(); process.setId(2); process.setProcessBaseUri(URI.create("2")); URI correctURI = URI .create(processService.getProcessDataDirectory(process).toString() + "/" + BACKUP_FILE_NAME); writeFile(correctURI, contentOne); runBackup(numberOfBackups, process); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(numberOfBackups, process); fileService.createResource(processService.getProcessDataDirectory(process), BACKUP_FILE_NAME); runBackup(numberOfBackups, process); assertFileHasContent(processService.getProcessDataDirectory(process) + "/" + BACKUP_FILE_NAME + ".3", contentOne); }
Source:
private void stopBeingLeader() { synchronized (lock) { try { leaderCounter++; log.info("I am no longer the leader..."); for (String server : loadManagementPeons.keySet()) { LoadQueuePeon peon = loadManagementPeons.remove(server); peon.stop(); } loadManagementPeons.clear(); serviceAnnouncer.unannounce(self); metadataRuleManager.stop(); metadataSegmentManager.stop(); lookupCoordinatorManager.stop(); } catch (Exception e) { log.makeAlert(e, "Unable to stopBeingLeader").emit(); } finally { leader = false; } } }

Target:
private void stopBeingLeader() { synchronized (lock) { try { leaderCounter++; log.info("I am no longer the leader..."); for (String server : loadManagementPeons.keySet()) { LoadQueuePeon peon = loadManagementPeons.remove(server); peon.stop(); } loadManagementPeons.clear(); serviceAnnouncer.unannounce(self); metadataRuleManager.stop(); metadataSegmentManager.stop(); lookupCoordinatorManager.stop(); leader = false; } catch (Exception e) { log.makeAlert(e, "Unable to stopBeingLeader").emit(); } } }
Source:
protected EventsValue(final Builder builder) { this.eventId = builder.eventId; this.timestamp = new SecondTimeStamp(builder.timestamp); this.endTimestamp = new SecondTimeStamp(builder.endTimestamp); this.source = builder.source; this.title = builder.title; this.message = builder.message; this.priority = builder.priority; this.userId = builder.userId; this.ongoing = builder.ongoing; this.parentId = builder.parentIds; this.childId = builder.childIds; this.additionalProps = builder.additionalProps; this.namespace = builder.namespace; }

Target:
protected EventsValue(final Builder builder) { this.eventId = builder.eventId; this.timestamp = new SecondTimeStamp(builder.timestamp); this.endTimestamp = new SecondTimeStamp(builder.endTimestamp); this.source = builder.source; this.title = builder.title; this.message = builder.message; this.priority = builder.priority; this.userId = builder.userId; this.ongoing = builder.ongoing; this.parentIds = builder.parentIds; this.childIds = builder.childIds; this.additionalProps = builder.additionalProps; this.namespace = builder.namespace; }
Source:
protected void notifySelect() { notify(SWT.MouseEnter); notify(SWT.Activate); notify(SWT.FocusIn); notify(SWT.MouseMove); notify(SWT.MouseDown); notify(SWT.Selection); notify(SWT.MouseUp); notify(SWT.MouseHover); notify(SWT.MouseMove); notify(SWT.MouseExit); notify(SWT.Deactivate); notify(SWT.FocusOut); }

Target:
protected void notifySelect() { notifySelect(true); }
Source:
public ModuleDefinitionResource save(@RequestParam("name") String name, @RequestParam("definition") String definition) { List<ModuleDeploymentRequest> modules = this.parser.parse(name, definition); ModuleType type = this.determineType(modules); ModuleDefinition moduleDefinition = new ModuleDefinition(name, type); moduleDefinition.setDefinition(definition); ModuleDefinitionResource resource = new ModuleDefinitionResourceAssembler().toResource(moduleDefinition); this.repository.save(moduleDefinition); return resource; }

Target:
public ModuleDefinitionResource save(@RequestParam("name") String name, @RequestParam("definition") String definition) { List<ModuleDeploymentRequest> modules = this.parser.parse(name, definition); ModuleType type = this.determineType(modules); ModuleDefinition moduleDefinition = new ModuleDefinition(name, type); moduleDefinition.setDefinition(definition); ModuleDefinitionResource resource = moduleDefinitionResourceAssembler.toResource(moduleDefinition); this.repository.save(moduleDefinition); return resource; }
Source:
public int addFileAttachment(String path) { if (immutable) { throw new UnsupportedOperationException("Attachments can't be muted"); } paths.add(path); return paths.size() - 1; }

Target:
public int addFileAttachment(String path) { if (immutable) { throw new UnsupportedOperationException("Attachments can't be mutated"); } paths.add(path); return paths.size() - 1; }
Source:
public static String metadataFieldNameToDisplayName(String metadataFieldName) { if (metadataFieldName.startsWith("characteristic")) { return characteristicFieldNameToDisplayName(metadataFieldName); } else { return factorFieldNameToDisplayName(metadataFieldName); } }

Target:
public static String metadataFieldNameToDisplayName(String metadataFieldName) { if (metadataFieldName.startsWith("characteristic")) { return metadataFieldNameToDisplayName(metadataFieldName, "characteristic_"); } else { return metadataFieldNameToDisplayName(metadataFieldName, "factor_"); } }
Source:
public void auditLoggingOnForInboundX12BatchResponseTest() { AdapterCORE_X12DSGenericBatchResponseProxyObjectFactory mockFactory = mock(AdapterCORE_X12DSGenericBatchResponseProxyObjectFactory.class); PassthroughInboundCORE_X12DSGenericBatchResponse inboundResp = new PassthroughInboundCORE_X12DSGenericBatchResponse(mockFactory, getAuditLogger(true)); AdapterCORE_X12DGenericBatchResponseProxy mockResponseProxy = mock(AdapterCORE_X12DGenericBatchResponseProxy.class); COREEnvelopeBatchSubmission request = new COREEnvelopeBatchSubmission(); COREEnvelopeBatchSubmissionResponse expectedResponse = new COREEnvelopeBatchSubmissionResponse(); AssertionType assertion = new AssertionType(); Properties webContextProperties = new Properties(); when(mockFactory.getAdapterCORE_X12DocSubmissionProxy()).thenReturn(mockResponseProxy); when(mockResponseProxy.batchSubmitTransaction(eq(request), eq(assertion))).thenReturn(expectedResponse); COREEnvelopeBatchSubmissionResponse actualResponse = inboundResp.batchSubmitTransaction(request, assertion, webContextProperties); assertEquals("Actual and Expected response differ", actualResponse, expectedResponse); verify(mockEJBLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.CORE_X12DS_GENERICBATCH_RESPONSE_SERVICE_NAME), any(COREX12BatchSubmissionAuditTransforms.class)); }

Target:
public void auditLoggingOnForInboundX12BatchResponseTest() { PassthroughInboundCORE_X12DSGenericBatchResponse inboundResp = new PassthroughInboundCORE_X12DSGenericBatchResponse(mockFactory, getAuditLogger(true)); COREEnvelopeBatchSubmissionResponse expectedResponse = new COREEnvelopeBatchSubmissionResponse(); when(mockFactory.getAdapterCORE_X12DocSubmissionProxy()).thenReturn(mockResponseProxy); when(mockResponseProxy.batchSubmitTransaction(eq(request), eq(assertion))).thenReturn(expectedResponse); COREEnvelopeBatchSubmissionResponse actualResponse = inboundResp.batchSubmitTransaction(request, assertion, webContextProperties); assertEquals("Actual and Expected response differ", actualResponse, expectedResponse); verify(mockEJBLogger).auditResponseMessage(eq(request), eq(actualResponse), eq(assertion), isNull(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.FALSE), eq(webContextProperties), eq(NhincConstants.CORE_X12DS_GENERICBATCH_RESPONSE_SERVICE_NAME), any(COREX12BatchSubmissionAuditTransforms.class)); }
Source:
protected DistStageAck run() { if (queries.isEmpty()) { log.info("No queries have been specified"); return successfulResponse(); } MulticastSocket socket = null; try { socket = new MulticastSocket(); socket.setSoTimeout((int) timeout); InetAddress targetAddress = InetAddress.getByName(address); byte[] payload = getQuery().getBytes(); DatagramPacket packet = new DatagramPacket(payload, 0, payload.length, targetAddress, port); socket.send(packet); if (expectedResponseCount == -1) { return successfulResponse(); } long start = System.currentTimeMillis(); int received = 0; while (received < expectedResponseCount) { if (start + timeout < System.currentTimeMillis()) { String errorMessage = "Timed out waiting for query responses"; log.error(errorMessage); return errorResponse(errorMessage); } byte[] buffer = new byte[1024 * 64]; DatagramPacket result = new DatagramPacket(buffer, buffer.length); socket.receive(result); received++; if (printResultsAsInfo) { log.infof("Received response %s from %s:%d", new String(result.getData(), 0, result.getLength()), result.getAddress(), result.getPort()); } else { log.tracef("Received response %s from %s:%d", new String(result.getData(), 0, result.getLength()), result.getAddress(), result.getPort()); } } } catch (IOException e) { String errorMessage = "Exception while performing multicast socket operation. Make sure 'enable_diagnostics' property of TP is enabled " + "and correct diagnostics port is specified"; log.error(errorMessage, e); return errorResponse(errorMessage, e); } finally { if (socket != null) { socket.close(); } } return successfulResponse(); }

Target:
protected String[] run() throws IOException { String[] datagramPacketsResponse = null; if (!queries.isEmpty() && expectedResponseCount > 0) { datagramPacketsResponse = new String[expectedResponseCount]; MulticastSocket socket = null; try { socket = new MulticastSocket(); socket.setSoTimeout((int) timeout); InetAddress targetAddress = InetAddress.getByName(address); byte[] payload = getQuery().getBytes(); DatagramPacket packet = new DatagramPacket(payload, 0, payload.length, targetAddress, port); socket.send(packet); long start = TimeService.currentTimeMillis(); int received = 0; while (received < expectedResponseCount) { if (start + timeout < TimeService.currentTimeMillis()) { String errorMessage = "Timed out waiting for query responses"; throw new IOException(errorMessage); } byte[] buffer = new byte[1024 * 64]; DatagramPacket result = new DatagramPacket(buffer, buffer.length); socket.receive(result); datagramPacketsResponse[received++] = String.format("Received response %s from %s:%d", new String(result.getData(), 0, result.getLength()), result.getAddress(), result.getPort()); } } catch (IOException e) { String errorMessage = "Exception while performing multicast socket operation. Make sure 'enable_diagnostics' property of TP is enabled " + "and correct diagnostics port is specified"; throw new IOException(errorMessage, e); } finally { if (socket != null) { socket.close(); } } } return datagramPacketsResponse != null ? datagramPacketsResponse : EMPTY_RESPONSE; }
Source:
public void testGetNotificationTypesForAdminUser() { final int expectedCount = 8; SecurityContextHolder.getContext().setAuthentication(adminUser); Set<NotificationType> results = searchMenuManager.getNotificationTypes(); assertNotNull(results); assertEquals(expectedCount, results.size()); for (NotificationType nt : results) { assertNotNull(nt.getId()); assertNotNull(nt.getName()); assertNotNull(nt.getDescription()); assertNotNull(nt.getRequiresAcb()); } }

Target:
public void testGetNotificationTypesForAdminUser() { final int expectedCount = 1; SecurityContextHolder.getContext().setAuthentication(adminUser); Set<NotificationType> results = searchMenuManager.getNotificationTypes(); assertNotNull(results); assertEquals(expectedCount, results.size()); for (NotificationType nt : results) { assertNotNull(nt.getId()); assertNotNull(nt.getName()); assertNotNull(nt.getDescription()); assertNotNull(nt.getRequiresAcb()); } }
Source:
private static XmlElement findFpmlRoot(XmlElement root) { XmlElement fpmlRoot = isFpmlRoot(root); if (fpmlRoot != null) { return fpmlRoot; } for (XmlElement el : root.getChildren()) { fpmlRoot = isFpmlRoot(el); if (fpmlRoot != null) { return fpmlRoot; } } for (XmlElement el1 : root.getChildren()) { for (XmlElement el2 : el1.getChildren()) { fpmlRoot = isFpmlRoot(el2); if (fpmlRoot != null) { return fpmlRoot; } } } throw new FpmlParseException("Unable to find FpML root element"); }

Target:
private static XmlElement findFpmlRoot(XmlElement root) { XmlElement fpmlRoot = getFpmlRoot(root); if (fpmlRoot != null) { return fpmlRoot; } for (XmlElement el : root.getChildren()) { fpmlRoot = getFpmlRoot(el); if (fpmlRoot != null) { return fpmlRoot; } } for (XmlElement el1 : root.getChildren()) { for (XmlElement el2 : el1.getChildren()) { fpmlRoot = getFpmlRoot(el2); if (fpmlRoot != null) { return fpmlRoot; } } } throw new FpmlParseException("Unable to find FpML root element"); }
Source:
public String getPartitionField() { return partitionField; }

Target:
public String getPartitionField() { return Strings.isNullOrEmpty(partitionField) ? null : partitionField; }
Source:
public void testMassIndexing() throws Exception { boolean indexEnabled = getConfigBuilder().build().indexing().isEnabled(); RestServerHelper helper = restServers.get(0); int port = helper.getPort(); String clearIndexURL = String.format("http://localhost:%d/rest/v2/caches/%s/search/indexes?action=clear", port, CACHE_NAME); String massIndexURL = String.format("http://localhost:%d/rest/v2/caches/%s/search/indexes?action=mass-index", port, CACHE_NAME); Request massIndexRequest = client.newRequest(massIndexURL); Request clearIndexRequest = client.newRequest(clearIndexURL); ContentResponse clearResponse = clearIndexRequest.send(); assertEquals(clearResponse.getStatus(), indexEnabled ? OK_200 : BAD_REQUEST_400); if (indexEnabled) eventually(() -> getCount() == 0); ContentResponse massIndexResponse = massIndexRequest.send(); assertEquals(massIndexResponse.getStatus(), indexEnabled ? OK_200 : BAD_REQUEST_400); eventually(() -> getCount() == ENTRIES); }

Target:
public void testMassIndexing() throws Exception { boolean indexEnabled = getConfigBuilder().indexing().enabled(); RestServerHelper helper = restServers.get(0); int port = helper.getPort(); String clearIndexURL = String.format("http://localhost:%d/rest/v2/caches/%s/search/indexes?action=clear", port, CACHE_NAME); String massIndexURL = String.format("http://localhost:%d/rest/v2/caches/%s/search/indexes?action=mass-index", port, CACHE_NAME); Request massIndexRequest = client.newRequest(massIndexURL); Request clearIndexRequest = client.newRequest(clearIndexURL); ContentResponse clearResponse = clearIndexRequest.send(); assertEquals(clearResponse.getStatus(), indexEnabled ? OK_200 : BAD_REQUEST_400); if (indexEnabled) eventually(() -> getCount() == 0); ContentResponse massIndexResponse = massIndexRequest.send(); assertEquals(massIndexResponse.getStatus(), indexEnabled ? OK_200 : BAD_REQUEST_400); eventually(() -> getCount() == ENTRIES); }
Source:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("SELECT id FROM quality_gates WHERE name = ?") .setString(1, SONARQUBE_WAY_QUALITY_GATE); massUpdate.rowPluralName("quality_gates"); massUpdate.update("UPDATE quality_gates SET name=?, is_built_in=?, updated_at=? WHERE id=?"); massUpdate.execute((row, update) -> { update.setString(1, findNewQualityGateName(context)); update.setBoolean(2, false); update.setDate(3, new Date(system2.now())); update.setLong(4, row.getLong(1)); return true; }); }

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("SELECT id FROM quality_gates WHERE name = ?") .setString(1, SONARQUBE_WAY_QUALITY_GATE); massUpdate.rowPluralName("quality gates"); massUpdate.update("UPDATE quality_gates SET name=?, is_built_in=?, updated_at=? WHERE id=?"); massUpdate.execute((row, update) -> { update.setString(1, findNewQualityGateName(context)); update.setBoolean(2, false); update.setDate(3, new Date(system2.now())); update.setLong(4, row.getLong(1)); return true; }); }
Source:
public void addPlayer(EntityPlayerMP player) { if (player.world != this.getWorldServer()) { CubicChunks.bigWarning("Player world not the same ad PlayerCubeMap world! Adding anyway. This is very likely to cause issues! Player " + "world dimension ID: %d, PlayerCubeMap dimension ID: %d", player.world.provider.getDimension(), getWorldServer().provider.getDimension()); } else if (!player.world.playerEntities.contains(player)) { CubicChunks.LOGGER.debug("PlayerCubeMap (dimension {}): Adding player to pending to add list", getWorldServer().provider.getDimension()); pendingPlayerAdd.add(player); return; } PlayerWrapper playerWrapper = new PlayerWrapper(player); playerWrapper.updateManagedPos(); if (!vanillaNetworkHandler.hasCubicChunks(player)) { vanillaNetworkHandler.updatePlayerPosition(this, player, playerWrapper.getManagedCubePos(), -1); } CubePos playerCubePos = CubePos.fromEntity(player); this.cubeSelector.forAllVisibleFrom(playerCubePos, horizontalViewDistance, verticalViewDistance, (currentPos) -> { ColumnWatcher chunkWatcher = getOrCreateColumnWatcher(currentPos.chunkPos()); if (!chunkWatcher.containsPlayer(player)) { chunkWatcher.addPlayer(player); } CubeWatcher cubeWatcher = getOrCreateCubeWatcher(currentPos); cubeWatcher.addPlayer(player); }); this.players.put(player.getEntityId(), playerWrapper); this.setNeedSort(); }

Target:
public void addPlayer(EntityPlayerMP player) { if (player.world != this.getWorldServer()) { CubicChunks.bigWarning("Player world not the same ad PlayerCubeMap world! Adding anyway. This is very likely to cause issues! Player " + "world dimension ID: %d, PlayerCubeMap dimension ID: %d", player.world.provider.getDimension(), getWorldServer().provider.getDimension()); } else if (!player.world.playerEntities.contains(player)) { CubicChunks.LOGGER.debug("PlayerCubeMap (dimension {}): Adding player to pending to add list", getWorldServer().provider.getDimension()); pendingPlayerAdd.add(player); return; } PlayerWrapper playerWrapper = new PlayerWrapper(player); playerWrapper.updateManagedPos(); if (!vanillaNetworkHandler.hasCubicChunks(player)) { vanillaNetworkHandler.updatePlayerPosition(this, player, playerWrapper.getManagedCubePos()); } CubePos playerCubePos = CubePos.fromEntity(player); this.cubeSelector.forAllVisibleFrom(playerCubePos, horizontalViewDistance, verticalViewDistance, (currentPos) -> { ColumnWatcher chunkWatcher = getOrCreateColumnWatcher(currentPos.chunkPos()); if (!chunkWatcher.containsPlayer(player)) { chunkWatcher.addPlayer(player); } CubeWatcher cubeWatcher = getOrCreateCubeWatcher(currentPos); cubeWatcher.addPlayer(player); }); this.players.put(player.getEntityId(), playerWrapper); this.setNeedSort(); }
Source:
public void testCompareTo() { Guid guid1 = new Guid("5b411bc1-c220-4421-9abd-cfa484aecb6e"); Guid guid2 = new Guid("5b411bc1-c220-4421-9abd-cfa484aecb6f"); assertTrue(guid1.compareTo(guid2) < 0); Assert.assertEquals(0, guid1.compareTo(guid1)); assertTrue(guid2.compareTo(guid1) > 0); }

Target:
public void testCompareTo() { Guid guid1 = new Guid("5b411bc1-c220-4421-9abd-cfa484aecb6e"); Guid guid2 = new Guid("5b411bc1-c220-4421-9abd-cfa484aecb6f"); assertTrue(guid1.compareTo(guid2) < 0); assertEquals(0, guid1.compareTo(guid1)); assertTrue(guid2.compareTo(guid1) > 0); }
Source:
public void testOnlyGraphClient() { this.contextRunner .withUserConfiguration(AADResourceServerOboConfiguration.class) .withPropertyValues(AAD_PROPERTY_PREFIX + "authorization.graph.scopes=User.read") .run(context -> { final InMemoryClientRegistrationRepository oboRepo = context.getBean( InMemoryClientRegistrationRepository.class); final OAuth2AuthorizedClientRepository aadOboRepo = context.getBean( AADOAuth2OboAuthorizedClientRepository.class); ClientRegistration graph = oboRepo.findByRegistrationId("graph"); Set<String> graphScopes = graph.getScopes(); assertThat(aadOboRepo).isNotNull(); assertThat(oboRepo).isExactlyInstanceOf(InMemoryClientRegistrationRepository.class); assertThat(graph).isNotNull(); assertThat(graphScopes).hasSize(1); }); }

Target:
public void testOnlyGraphClient() { this.contextRunner .withUserConfiguration(AADResourceServerOboConfiguration.class) .withPropertyValues("azure.activedirectory.authorization.graph.scopes=<LINK_1>" + ".Read") .run(context -> { final InMemoryClientRegistrationRepository oboRepo = context.getBean( InMemoryClientRegistrationRepository.class); final OAuth2AuthorizedClientRepository aadOboRepo = context.getBean( AADOAuth2OboAuthorizedClientRepository.class); ClientRegistration graph = oboRepo.findByRegistrationId("graph"); Set<String> graphScopes = graph.getScopes(); assertThat(aadOboRepo).isNotNull(); assertThat(oboRepo).isExactlyInstanceOf(InMemoryClientRegistrationRepository.class); assertThat(graph).isNotNull(); assertThat(graphScopes).containsOnly("<LINK_0>"); }); }
Source:
public boolean equals(Object other, boolean deepCompare) { if (other == this) { return true; } if (other == null || other.getClass() != getClass()) { return false; } SystemTreeItemModel otherModel = (SystemTreeItemModel) other; if (getChildren().size() > 0 && deepCompare) { if (otherModel.getChildren().size() == getChildren().size()) { boolean result = true; for (int i = 0; i < getChildren().size(); i++) { result = getChildren().get(i).equals(otherModel.getChildren().get(i), deepCompare); if (!result) { break; } } return result; } else { return false; } } else { if (otherModel.getEntity() != null && otherModel.getEntity().equals(getEntity()) && otherModel.getTitle().equals(getTitle())) { return true; } return false; } }

Target:
public boolean equals(Object other, boolean deepCompare) { if (other == this) { return true; } if (other == null || other.getClass() != getClass()) { return false; } boolean result = true; SystemTreeItemModel otherModel = (SystemTreeItemModel) other; if (getChildren().size() > 0 && deepCompare) { if (otherModel.getChildren().size() == getChildren().size()) { for (int i = 0; i < getChildren().size(); i++) { result = getChildren().get(i).equals(otherModel.getChildren().get(i), deepCompare); if (!result) { break; } } } else { result = false; } } if (result) { if ((otherModel.getEntity() == null && getEntity() == null) || (otherModel.getEntity() != null && otherModel.getEntity().equals(getEntity()) && otherModel.getTitle().equals(getTitle()))) { result = true; } else { result = false; } } return result; }
Source:
private String buildJson() { try { return JsonWriter.string() .object() .value("user_action", getUserActionString(errorInfo.userAction)) .value("request", errorInfo.request) .value("content_language", getContentLanguageString()) .value("content_country", getContentLanguageString()) .value("service", errorInfo.serviceName) .value("package", getPackageName()) .value("version", BuildConfig.VERSION_NAME) .value("os", getOsString()) .value("time", currentTimeStamp) .array("exceptions", Arrays.asList(errorList)) .value("user_comment", userCommentBox.getText().toString()) .end() .done(); } catch (Throwable e) { Log.e(TAG, "Error while erroring: Could not build json"); e.printStackTrace(); } return ""; }

Target:
private String buildJson() { try { return JsonWriter.string() .object() .value("user_action", getUserActionString(errorInfo.userAction)) .value("request", errorInfo.request) .value("content_language", getContentLanguageString()) .value("content_country", getContentCountryString()) .value("app_language", getAppLanguage()) .value("service", errorInfo.serviceName) .value("package", getPackageName()) .value("version", BuildConfig.VERSION_NAME) .value("os", getOsString()) .value("time", currentTimeStamp) .array("exceptions", Arrays.asList(errorList)) .value("user_comment", userCommentBox.getText().toString()) .end() .done(); } catch (Throwable e) { Log.e(TAG, "Error while erroring: Could not build json"); e.printStackTrace(); } return ""; }
Source:
public void testFcrepoService() throws Exception { final String webPort = System.getProperty("fcrepo.dynamic.test.port", "8080"); final String baseUrl = "http://localhost:" + webPort + "/fcrepo/rest"; final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(null, headers); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(null, headers); resultEndpoint.expectedMessageCount(2); assertMockEndpointsSatisfied(); }

Target:
public void testFcrepoService() throws Exception { final String webPort = System.getProperty("fcrepo.dynamic.test.port", "8080"); final String baseUrl = "http://localhost:" + webPort + "/fcrepo/rest"; final String url1 = post(baseUrl).replace(baseUrl, ""); final String url2 = post(baseUrl).replace(baseUrl, ""); final Map<String, Object> headers = new HashMap<>(); headers.put(FCREPO_BASE_URL, baseUrl); headers.put(FCREPO_IDENTIFIER, url1); template.sendBodyAndHeaders(null, headers); headers.put(FCREPO_IDENTIFIER, url2); template.sendBodyAndHeaders(null, headers); resultEndpoint.expectedMessageCount(2); assertMockEndpointsSatisfied(); }
Source:
public static boolean isLowerCamelCase(String word) { return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isLowerCase(word.charAt(0)); }

Target:
public static boolean isLowerCamelCase(String word) { return !word.isEmpty() && Character.isLowerCase(word.charAt(0)) && word.matches(ALPHANUMERIC_REGEX); }
Source:
public ValueHolder<V> replace(final K key, final V value) throws StoreAccessException { replaceObserver.begin(); ReplaceOperation<K, V> operation = new ReplaceOperation<K, V>(key, value); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key); Result<V> result = resolvedChain.getResolvedResult(key); if(result == null) { replaceObserver.end(StoreOperationOutcomes.ReplaceOutcome.REPLACED); return null; } else { replaceObserver.end(StoreOperationOutcomes.ReplaceOutcome.MISS); return new ClusteredValueHolder<V>(result.getValue()); } }

Target:
public ValueHolder<V> replace(final K key, final V value) throws StoreAccessException { replaceObserver.begin(); ReplaceOperation<K, V> operation = new ReplaceOperation<K, V>(key, value); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key); Result<V> result = resolvedChain.getResolvedResult(key); if(result == null) { replaceObserver.end(StoreOperationOutcomes.ReplaceOutcome.MISS); return null; } else { replaceObserver.end(StoreOperationOutcomes.ReplaceOutcome.REPLACED); return new ClusteredValueHolder<V>(result.getValue()); } }
Source:
private BlackboardAttribute.Type getKeyAttribute() throws TskCoreException { if (shellBagKeyAttributeType == null) { try { shellBagKeyAttributeType = tskCase.getBlackboard().getOrAddAttributeType(SHELLBAG_ATTRIBUTE_KEY, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING, Bundle.Shellbag_Key_Attribute_Display_Name()); } catch (BlackboardException ex) { throw new TskCoreException(String.format("Failed to get key attriubte %s", SHELLBAG_ATTRIBUTE_KEY), ex); } } return shellBagKeyAttributeType; }

Target:
private BlackboardAttribute.Type getKeyAttribute() throws TskCoreException { if (shellBagKeyAttributeType == null) { try { shellBagKeyAttributeType = tskCase.getBlackboard().getOrAddAttributeType(SHELLBAG_ATTRIBUTE_KEY, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING, Bundle.Shellbag_Key_Attribute_Display_Name()); } catch (BlackboardException ex) { throw new TskCoreException(String.format("Failed to get key attribute %s", SHELLBAG_ATTRIBUTE_KEY), ex); } } return shellBagKeyAttributeType; }
Source:
public boolean equals(final Object obj) { if (!(obj instanceof Ds3Object)) { return false; } final Ds3Object ds3Obj = (Ds3Object) obj; return ds3Obj.getName().equals(this.getName()) && ds3Obj.getSize() == this.getSize() && Objects.equals(ds3Obj.versionId, this.getVersionId()); }

Target:
public boolean equals(final Object obj) { if (!(obj instanceof Ds3Object)) { return false; } final Ds3Object ds3Obj = (Ds3Object) obj; return Objects.equals(ds3Obj.getName(), this.getName()) && ds3Obj.getSize() == this.getSize() && Objects.equals(ds3Obj.versionId, this.getVersionId()); }