auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ServiceReference getTransformerServiceReference(String transformerId) throws CatalogTransformerException { return metacardTransformers .stream() .filter(serviceRef -> serviceRef.getProperty("id") != null) .filter(serviceRef -> serviceRef.getProperty("id").toString().equals(transformerId)) .findFirst() .orElseThrow( () -> new CatalogTransformerException( "The metacard transformer with ID " + transformerId + " could not be found.")); }

Target:
private ServiceReference getTransformerServiceReference(String transformerId) throws CatalogTransformerException { return metacardTransformers .stream() .filter(serviceRef -> transformerId.equals(serviceRef.getProperty("id"))) .findFirst() .orElseThrow( () -> new CatalogTransformerException( "The metacard transformer with ID " + transformerId + " could not be found.")); }
Source:
public synchronized void close() throws IOException { if (!deleted) { Files.delete(filePath); deleted = true; } }

Target:
public synchronized void close() { if (deleted) { return; } deleted = true; try { Files.delete(filePath); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public GuestIdDTO clone() { GuestIdDTO copy = super.clone(); Map<String, String> attributes = this.getAttributes(); if (attributes != null) { copy.setAttributes(new HashMap<String, String>(attributes)); } return copy; }

Target:
public GuestIdDTO clone() { GuestIdDTO copy = super.clone(); copy.setAttributes(this.getAttributes()); return copy; }
Source:
public static VMImage decodeFieldsFromUniqueId(final String id) { VMImage vmImage; String[] fields = checkNotNull(id, "id").split("/"); boolean custom = fields.length == 5; if (custom) { vmImage = VMImage.customImage().location(fields[0]).group(fields[1]).storage(fields[2]).vhd1(fields[3]) .offer(fields[4]).build(); } else { vmImage = VMImage.azureImage().location(fields[0]).publisher(fields[1]).offer(fields[2]).sku(fields[3]) .build(); } return vmImage; }

Target:
public static VMImage decodeFieldsFromUniqueId(final String id) { VMImage vmImage; String[] fields = checkNotNull(id, "id").split("/"); if (isCustom(id)) { vmImage = VMImage.customImage().location(fields[0]).group(fields[1]).storage(fields[2]).vhd1(fields[3]) .offer(fields[4]).build(); } else { vmImage = VMImage.azureImage().location(fields[0]).publisher(fields[1]).offer(fields[2]).sku(fields[3]) .build(); } return vmImage; }
Source:
private List<IBinding> filterClassScopeBindings(ICPPClassType classType, IBinding[] bindings, final boolean isDeclaration) { List<IBinding> filtered = new ArrayList<IBinding>(); final boolean canBeFieldAccess = canBeFieldAccess(classType); final IBinding templateInstance = (classType instanceof ICPPTemplateInstance) ? ((ICPPTemplateInstance) classType).getTemplateDefinition() : null; for (final IBinding binding : bindings) { if (binding instanceof IField) { IField field = (IField) binding; if (!canBeFieldAccess && !field.isStatic()) continue; } else if (binding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) binding; if (method.isImplicit()) continue; if (!isDeclaration) { if (method.isDestructor() || method instanceof ICPPConstructor || (!canBeFieldAccess && !method.isStatic())) continue; } } else if (binding instanceof IEnumerator || binding instanceof IEnumeration) { if (isDeclaration) continue; } else if (templateInstance == binding) { continue; } else if (binding instanceof IType) { if (classType.isSameType((IType) binding)) continue; } filtered.add(binding); } return filtered; }

Target:
private List<IBinding> filterClassScopeBindings(ICPPClassType classType, IBinding[] bindings, final boolean isDeclaration) { List<IBinding> filtered = new ArrayList<IBinding>(); final boolean canBeFieldAccess = canBeFieldAccess(classType); final IBinding templateDefinition = (classType instanceof ICPPTemplateInstance) ? ((ICPPTemplateInstance) classType).getTemplateDefinition() : null; for (final IBinding binding : bindings) { if (binding instanceof IField) { IField field = (IField) binding; if (!canBeFieldAccess && !field.isStatic()) continue; } else if (binding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) binding; if (method.isImplicit()) continue; if (!isDeclaration) { if (method.isDestructor() || method instanceof ICPPConstructor || (!canBeFieldAccess && !method.isStatic())) continue; } } else if (binding instanceof IEnumerator || binding instanceof IEnumeration) { if (isDeclaration) continue; } else if (templateDefinition == binding) { continue; } else if (binding instanceof IType) { if (classType.isSameType((IType) binding)) continue; } filtered.add(binding); } return filtered; }
Source:
public List<Resource> getAssignedResources(PerunSession sess, Service service) throws InternalErrorException, PrivilegeException, ServiceNotExistsException { Utils.checkPerunSession(sess); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN) && !AuthzResolver.isAuthorized(sess, Role.ENGINE) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException(sess, "getAssignedResources"); } getServicesManagerBl().checkServiceExists(sess, service); return getServicesManagerBl().getAssignedResources(sess, service); }

Target:
public List<Resource> getAssignedResources(PerunSession sess, Service service) throws InternalErrorException, PrivilegeException, ServiceNotExistsException { Utils.checkPerunSession(sess); getServicesManagerBl().checkServiceExists(sess, service); List<Resource> resources = getServicesManagerBl().getAssignedResources(sess, service); if (AuthzResolver.isAuthorized(sess, Role.ENGINE) || AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { return resources; } if (AuthzResolver.isAuthorized(sess, Role.VOADMIN) || AuthzResolver.isAuthorized(sess, Role.VOOBSERVER)) { Iterator<Resource> iterator = resources.iterator(); while (iterator.hasNext()) { Resource resource = iterator.next(); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resource) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, resource)) { iterator.remove(); } } } else { throw new PrivilegeException(sess, "getAssignedResources"); } return resources; }
Source:
public void testModuleGroups() throws Exception { Map<String, String> results = new HashMap<>(); results.put(QuboleConstant.BIGDATALAUNCHER_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.PIG_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.S3_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.PIG_PARQUET_MODULE_GROUP.getModuleName(), "(LOAD=='PARQUETLOADER') OR (STORE=='PARQUETSTORER')"); results.put(QuboleConstant.PIG_AVRO_MODULE_GROUP.getModuleName(), "(LOAD=='AVROSTORAGE') OR (STORE=='AVROSTORAGE')"); results.put(QuboleConstant.PIG_SEQUENCEFILE_MODULE_GROUP.getModuleName(), "(LOAD=='SEQUENCEFILELOADER') OR (STORE=='SEQUENCEFILESTORAGE')"); results.put(QuboleConstant.PIG_RCFILE_MODULE_GROUP.getModuleName(), "(LOAD=='RCFILEPIGSTORAGE') OR (STORE=='RCFILEPIGSTORAGE')"); Set<DistributionModuleGroup> moduleGroups = QubolePigModuleGroup.getModuleGroups(); assertEquals(7, moduleGroups.size()); for (DistributionModuleGroup module : moduleGroups) { assertTrue("Should contain module " + module.getModuleName(), results.containsKey(module.getModuleName())); if (results.get(module.getModuleName()) == null) { assertTrue("The condition of the module " + module.getModuleName() + " is not null.", results.get(module.getModuleName()) == null); } else { assertTrue("The condition of the module " + module.getModuleName() + " is null, but it should be " + results.get(module.getModuleName()) + ".", results.get(module.getModuleName()) != null); assertEquals(results.get(module.getModuleName()), module.getRequiredIf().getConditionString()); } } }

Target:
public void testModuleGroups() throws Exception { Map<String, String> results = new HashMap<>(); results.put(QuboleConstant.BIGDATALAUNCHER_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.PIG_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.S3_MODULE_GROUP.getModuleName(), null); results.put(QuboleConstant.PIG_PARQUET_MODULE_GROUP.getModuleName(), "(LOAD=='PARQUETLOADER') OR (STORE=='PARQUETSTORER')"); results.put(QuboleConstant.PIG_AVRO_MODULE_GROUP.getModuleName(), "(LOAD=='AVROSTORAGE') OR (STORE=='AVROSTORAGE')"); results.put(QuboleConstant.PIG_SEQUENCEFILE_MODULE_GROUP.getModuleName(), "(LOAD=='SEQUENCEFILELOADER') OR (STORE=='SEQUENCEFILESTORAGE')"); results.put(QuboleConstant.PIG_RCFILE_MODULE_GROUP.getModuleName(), "(LOAD=='RCFILEPIGSTORAGE') OR (STORE=='RCFILEPIGSTORAGE')"); Set<DistributionModuleGroup> moduleGroups = QubolePigModuleGroup.getModuleGroups(); assertEquals(7, moduleGroups.size()); for (DistributionModuleGroup group : moduleGroups) { assertEquals(results.get(group.getModuleName()), group.getRequiredIf() == null ? null : group.getRequiredIf().getConditionString()); } }
Source:
public static byte[] encode(PasswordSpec passwordSpec) throws NoSuchAlgorithmException, InvalidKeySpecException { if (ClearPasswordSpec.class.isInstance(passwordSpec)) { return encodeClearPasswordSpec((ClearPasswordSpec) passwordSpec); } else if (DigestPasswordSpec.class.isInstance(passwordSpec)) { return encodeDigestPasswordSpec((DigestPasswordSpec) passwordSpec); } else if (SaltedHashPasswordSpec.class.isInstance(passwordSpec)) { return encodeSaltedHashPasswordSpec((SaltedHashPasswordSpec) passwordSpec); } else if (IteratedSaltedHashPasswordSpec.class.isInstance(passwordSpec)) { return encodeIteratedSaltedHashSpec((IteratedSaltedHashPasswordSpec) passwordSpec); } else if (HashPasswordSpec.class.isInstance(passwordSpec)) { return encodeHashPasswordSpec((HashPasswordSpec) passwordSpec); } return null; }

Target:
public static byte[] encode(PasswordSpec passwordSpec) throws NoSuchAlgorithmException, InvalidKeySpecException { if (passwordSpec instanceof ClearPasswordSpec) { return encodeClearPasswordSpec((ClearPasswordSpec) passwordSpec); } else if (passwordSpec instanceof DigestPasswordSpec) { return encodeDigestPasswordSpec((DigestPasswordSpec) passwordSpec); } else if (passwordSpec instanceof SaltedHashPasswordSpec) { return encodeSaltedHashPasswordSpec((SaltedHashPasswordSpec) passwordSpec); } else if (passwordSpec instanceof IteratedSaltedHashPasswordSpec) { return encodeIteratedSaltedHashSpec((IteratedSaltedHashPasswordSpec) passwordSpec); } else if (passwordSpec instanceof HashPasswordSpec) { return encodeHashPasswordSpec((HashPasswordSpec) passwordSpec); } return null; }
Source:
private PGPSecretKey attemptParseSecretKey(Path keyFile, PGPDigestCalculatorProvider calculatorProvider, PBEProtectionRemoverFactory passphraseProvider, PGPPublicKey publicKey) { try (InputStream in = newInputStream(keyFile)) { return new SExprParser(calculatorProvider).parseSecretKey( new BufferedInputStream(in), passphraseProvider, publicKey); } catch (IOException | PGPException | ClassCastException e) { return null; } }

Target:
private PGPSecretKey attemptParseSecretKey(Path keyFile, PGPDigestCalculatorProvider calculatorProvider, PBEProtectionRemoverFactory passphraseProvider, PGPPublicKey publicKey) { try (InputStream in = newInputStream(keyFile)) { return new SExprParser(calculatorProvider).parseSecretKey( new BufferedInputStream(in), passphraseProvider, publicKey); } catch (IOException | PGPException | ClassCastException e) { if (log.isDebugEnabled()) log.debug("Ignoring unreadable file '{}': {}", keyFile, e.getMessage(), e); return null; } }
Source:
public int countOfComponents() { return pcxi[0].length; }

Target:
public int countOfComponents() { return size() != 0 ? pcxi[0].length : 0; }
Source:
protected Plan getTestJob() { Plan plan = getPlan(1 , textPath, resultPath); try { plan.registerCachedFile(cachePath, "cache_test"); } catch (IOException ex) { ex.printStackTrace(); } return plan; }

Target:
protected Plan getTestJob() { Plan plan = getPlan(1 , textPath, resultPath); try { plan.registerCachedFile(cachePath, "cache_test"); } catch (IOException ex) { throw new RuntimeException(ex); } return plan; }
Source:
public void clickingCancel_shouldDismissTheDialog() { dialogFragment.show(fragmentManager, "tag"); AlertDialog dialog = (AlertDialog) ShadowDialog.getLatestDialog(); assertTrue(dialog.isShowing()); dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick(); assertFalse(dialog.isShowing()); assertTrue(shadowOf(dialog).hasBeenDismissed()); }

Target:
public void clickingCancel_shouldDismissTheDialog() { dialogFragment.show(fragmentManager, "tag"); AlertDialog dialog = (AlertDialog) ShadowDialog.getLatestDialog(); assertTrue(dialog.isShowing()); dialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick(); assertFalse(dialog.isShowing()); assertTrue(shadowOf(dialog).hasBeenDismissed()); }
Source:
private void assertUpdated( String expected, String namespace, String key, ConcurrentMap<String, Function<String, String>> lookup ) throws InterruptedException { final Function<String, String> extractionFn = lookup.get(namespace); int count = 0; if (expected == null) { while (extractionFn.apply(key) != null) { Thread.sleep(100); if (++count > 10) { throw new ISE("Update did not occur!"); } } } else { while (!expected.equals(extractionFn.apply(key))) { Thread.sleep(100); if (++count > 10) { throw new ISE("Update did not occur!"); } } } Assert.assertEquals("update check", expected, extractionFn.apply(key)); }

Target:
private void assertUpdated( String expected, String namespace, String key, ConcurrentMap<String, Function<String, String>> lookup ) throws InterruptedException { final Function<String, String> extractionFn = lookup.get(namespace); if (expected == null) { while (extractionFn.apply(key) != null) { Thread.sleep(100); } } else { while (!expected.equals(extractionFn.apply(key))) { Thread.sleep(100); } } Assert.assertEquals("update check", expected, extractionFn.apply(key)); }
Source:
protected void isThreadSuspended(IExecutionDMContext ctx, final DataRequestMonitor<Boolean> rm) { try { getSession().getExecutor().execute(new DsfRunnable() { @Override public void run() { IRunControl runControl = getServicesTracker().getService(IRunControl.class); rm.setData(runControl.isSuspended(ctx) || runControl.isStepping(ctx)); rm.done(); }}); } catch (RejectedExecutionException e) { rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Session shut down", null)); rm.done(); } }

Target:
protected void isThreadSuspended(IExecutionDMContext ctx, final DataRequestMonitor<Boolean> rm) { try { getSession().getExecutor().execute(new DsfRunnable() { @Override public void run() { IRunControl runControl = getServicesTracker().getService(IRunControl.class); rm.setData(runControl.isSuspended(ctx) || runControl.isStepping(ctx)); rm.done(); }}); } catch (RejectedExecutionException e) { rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Session shut down", e)); rm.done(); } }
Source:
public static void tearDown() { System.setProperty("org.uberfire.nio.git.daemon.port", String.valueOf(gitDaemonPort)); if (tmpRoot != null) { TestUtil.rm(tmpRoot.toFile()); } }

Target:
public static void tearDown() { System.clearProperty("org.uberfire.nio.git.daemon.port"); if (tmpRoot != null) { TestUtil.rm(tmpRoot.toFile()); } }
Source:
private int setWifiTethering(final boolean enable) { int rval = TETHER_ERROR_MASTER_ERROR; final long ident = Binder.clearCallingIdentity(); try { synchronized (mPublicSync) { mWifiTetherRequested = enable; final WifiManager mgr = getWifiManager(); if (mgr == null) { mLog.e("setWifiTethering: failed to get WifiManager!"); rval = TETHER_ERROR_SERVICE_UNAVAIL; } else if ((enable && mgr.startSoftAp(null )) || (!enable && mgr.stopSoftAp())) { rval = TETHER_ERROR_NO_ERROR; } } } finally { Binder.restoreCallingIdentity(ident); } if (rval != TETHER_ERROR_NO_ERROR) { mWifiTetherRequested = false; } return rval; }

Target:
private int setWifiTethering(final boolean enable) { int rval = TETHER_ERROR_MASTER_ERROR; final long ident = Binder.clearCallingIdentity(); try { synchronized (mPublicSync) { final WifiManager mgr = getWifiManager(); if (mgr == null) { mLog.e("setWifiTethering: failed to get WifiManager!"); return TETHER_ERROR_SERVICE_UNAVAIL; } if ((enable && mgr.startSoftAp(null )) || (!enable && mgr.stopSoftAp())) { mWifiTetherRequested = enable; return TETHER_ERROR_NO_ERROR; } return TETHER_ERROR_MASTER_ERRROR; } } finally { Binder.restoreCallingIdentity(ident); } if (rval != TETHER_ERROR_NO_ERROR) { mWifiTetherRequested = false; } return rval; }
Source:
protected void lineAdded(String string) { String current = myTextArea1.getText(); if (current == null) { current = ""; } myTextArea1.setText(current + string); if (string.contains("Nothing was installed") || string.contains("Failed") || string.contains("The package filter removed all packages")) { myBackgroundSuccess = false; } else if (string.contains("Done") && !string.contains("othing")) { myBackgroundSuccess = true; } }

Target:
protected void lineAdded(String string) { String current = mySdkManagerOutput.getText(); if (current == null) { current = ""; } mySdkManagerOutput.setText(current + string); if (string.contains("Nothing was installed") || string.contains("Failed") || string.contains("The package filter removed all packages")) { myBackgroundSuccess = false; } else if (string.contains("Done") && !string.contains("othing")) { myBackgroundSuccess = true; } }
Source:
public Reader(Configuration conf, Option... opts) throws IOException { FileOption fileOpt = Options.getOption(FileOption.class, opts); InputStreamOption streamOpt = Options.getOption(InputStreamOption.class, opts); StartOption startOpt = Options.getOption(StartOption.class, opts); LengthOption lenOpt = Options.getOption(LengthOption.class, opts); BufferSizeOption bufOpt = Options.getOption(BufferSizeOption.class, opts); OnlyHeaderOption headerOnly = Options.getOption(OnlyHeaderOption.class, opts); if ((fileOpt == null) == (streamOpt == null)) { throw new IllegalArgumentException("File or stream option must be specified"); } if (fileOpt == null && bufOpt != null) { throw new IllegalArgumentException("buffer size can only be set when" + " a file is specified."); } Path filename = null; FSDataInputStream file; final long len; FileSystem fs = null; try { if (fileOpt != null) { filename = fileOpt.getValue(); fs = filename.getFileSystem(conf); int bufSize = bufOpt == null ? getBufferSize(conf) : bufOpt.getValue(); len = null == lenOpt ? fs.getFileStatus(filename).getLen() : lenOpt.getValue(); file = openFile(fs, filename, bufSize, len); } else { len = null == lenOpt ? Long.MAX_VALUE : lenOpt.getValue(); file = streamOpt.getValue(); } long start = startOpt == null ? 0 : startOpt.getValue(); initialize(filename, file, start, len, conf, headerOnly != null); } catch (RemoteException re) { log.error("Failed creating a WAL Reader: " + re.getMessage()); if (re.getClassName().equals(leaseException)) { if (fs != null) { fs.close(); } } throw re; } }

Target:
public Reader(Configuration conf, Option... opts) throws IOException { FileOption fileOpt = Options.getOption(FileOption.class, opts); InputStreamOption streamOpt = Options.getOption(InputStreamOption.class, opts); LengthOption lenOpt = Options.getOption(LengthOption.class, opts); BufferSizeOption bufOpt = Options.getOption(BufferSizeOption.class, opts); if ((fileOpt == null) == (streamOpt == null)) { throw new IllegalArgumentException("File or stream option must be specified"); } if (fileOpt == null && bufOpt != null) { throw new IllegalArgumentException("buffer size can only be set when a file is specified."); } Path filename = null; FSDataInputStream file; final long len; FileSystem fs = null; try { if (fileOpt != null) { filename = fileOpt.getValue(); fs = filename.getFileSystem(conf); int bufSize = bufOpt == null ? getBufferSize(conf) : bufOpt.getValue(); len = null == lenOpt ? fs.getFileStatus(filename).getLen() : lenOpt.getValue(); file = openFile(fs, filename, bufSize, len); } else { len = null == lenOpt ? Long.MAX_VALUE : lenOpt.getValue(); file = streamOpt.getValue(); } StartOption startOpt = Options.getOption(StartOption.class, opts); long start = startOpt == null ? 0 : startOpt.getValue(); OnlyHeaderOption headerOnly = Options.getOption(OnlyHeaderOption.class, opts); initialize(filename, file, start, len, conf, headerOnly != null); } catch (RemoteException re) { log.error("Failed creating a WAL Reader: " + re.getMessage()); if (re.getClassName().equals(WALConstants.LEASE_EXCEPTION_CLASS_NAME)) { if (fs != null) { fs.close(); } } throw re; } }
Source:
Mono<DigitalTwinsResponse<String>> getComponentWithResponse(String digitalTwinId, String componentPath, Context context) { return protocolLayer.getDigitalTwins().getComponentWithResponseAsync(digitalTwinId, componentPath, context) .flatMap(response -> { try { String jsonResponse = mapper.writeValueAsString(response.getValue()); DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.just(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), jsonResponse, twinHeaders)); } catch (JsonProcessingException e) { return Mono.error(e); } }); }

Target:
Mono<DigitalTwinsResponse<String>> getComponentWithResponse(String digitalTwinId, String componentPath, Context context) { return protocolLayer.getDigitalTwins().getComponentWithResponseAsync(digitalTwinId, componentPath, context) .flatMap(response -> { try { String jsonResponse = mapper.writeValueAsString(response.getValue()); DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.just(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), jsonResponse, twinHeaders)); } catch (JsonProcessingException e) { logger.error("Failed to deserialize the returned component object into a string", e); return Mono.error(e); } }); }
Source:
public void processStartTimestampUpdateOnMultipleBatches() { eventCache.processStartTransactionsUpdate(TIMESTAMPS, SNAPSHOT); verifyStage(); Set<Long> secondTimestamps = ImmutableSet.of(5L, 123L); eventCache.processStartTransactionsUpdate(secondTimestamps, SUCCESS); verifyStage(); }

Target:
public void processStartTimestampUpdateOnMultipleBatches() { setupInitialState(); verifyStage(); Set<Long> secondTimestamps = ImmutableSet.of(5L, 123L); eventCache.processStartTransactionsUpdate(secondTimestamps, SUCCESS); verifyStage(); Set<Long> thirdTimestamps = ImmutableSet.of(6677L, 8888L); eventCache.processStartTransactionsUpdate(thirdTimestamps, SUCCESS_2); verifyStage(); }
Source:
public void addAttribute(String key, Object value) { fProperties.put(key, value); if (key.equals(NAME)) { fName = (String) value; } if (key.equals(FREQ)) { fIsScaled = !Objects.equals(getProperty(FREQ), ONE_BILLION_L); fClockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue(); fClockAntiScale = 1.0 / fClockScale; } if (key.equals(OFFSET)) { fClockOffset = (Long) getProperty(OFFSET); } if (key.equals(OFFSET_S)) { BigDecimal offsetNs = BigDecimal.valueOf(((Long) getProperty(OFFSET_S))).multiply(BigDecimal.valueOf(ONE_BILLION_L)); fClockOffsetNanoSeconds = offsetNs.compareTo(BigDecimal.valueOf(Long.MAX_VALUE)) > 0 ? 0 : offsetNs.longValue(); } }

Target:
public void addAttribute(String key, Object value) { fProperties.put(key, value); if (key.equals(NAME)) { fName = (String) value; } if (key.equals(FREQ)) { fIsScaled = !Objects.equals(getProperty(FREQ), ONE_BILLION_L); fClockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue(); fClockAntiScale = 1.0 / fClockScale; } if (key.equals(OFFSET)) { fClockOffset = (Long) getProperty(OFFSET); } if (key.equals(OFFSET_S)) { fClockOffsetS = (Long) getProperty(OFFSET_S); } }
Source:
public FilterHandler(String unparsedFilters) { String[] rawFilters = unparsedFilters.split(","); filters = new Filter[rawFilters.length]; for (int i = 0; i < rawFilters.length; i++) { String currentFilter = rawFilters[i]; int period = currentFilter.lastIndexOf('.'); if (period < 0) { filters[i] = new Filter(currentFilter); continue; } filters[i] = new Filter(currentFilter.substring(0, period), currentFilter.substring(period + 1)); } Arrays.sort(filters); }

Target:
public FilterHandler(String unparsedFilters) { String[] rawFilters = unparsedFilters.split(","); filters = new Filter[rawFilters.length]; for (int i = 0; i < rawFilters.length; i++) { String currentFilter = rawFilters[i]; int period = currentFilter.lastIndexOf('.'); if (period < 0) { filters[i] = new Filter("", currentFilter); continue; } filters[i] = new Filter(currentFilter.substring(0, period), currentFilter.substring(period + 1)); } Arrays.sort(filters); }
Source:
public void testTrace() { CTFTrace trace = null; CTFTraceReader reader = null; try { trace = new CTFTrace(fTracePath); reader = new CTFTraceReader(trace); reader.getCurrentEventDef(); while (reader.advance()) { reader.getCurrentEventDef(); reader.advance(); } if (!fExpectSuccess) { fail("Trace was expected to fail parsing: " + fTracePath); } } catch (CTFReaderException e) { if (fExpectSuccess) { fail("Trace was expected to succeed, but failed parsing: " + fTracePath); } } finally { if (reader != null) { reader.dispose(); } if (trace != null) { trace.dispose(); } } }

Target:
public void testTrace() { CTFTrace trace = null; CTFTraceReader reader = null; try { trace = new CTFTrace(fTracePath); reader = new CTFTraceReader(trace); reader.getCurrentEventDef(); while (reader.advance()) { assertNotNull(reader.getCurrentEventDef()); } if (!fExpectSuccess) { fail("Trace was expected to fail parsing: " + fTracePath); } } catch (CTFReaderException e) { if (fExpectSuccess) { fail("Trace was expected to succeed, but failed parsing: " + fTracePath); } } finally { if (reader != null) { reader.dispose(); } if (trace != null) { trace.dispose(); } } }
Source:
public void confirmTransactionShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.confirmTransaction("foo", "bar", new RetrofitPromise<Transaction>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards/%s/transactions/%s/commit", MOCK_URL, "foo", "bar")); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); }

Target:
public void confirmTransactionShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.confirmTransaction("foo", "bar", new RetrofitPromise<Transaction>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards/%s/transactions/%s/commit", MOCK_URL, "foo", "bar")); }
Source:
public void testTooManyContexts() throws InterruptedException { final int lwcCount = 101; double increment = (end - begin) / lwcCount; final ArrayList<Long> vals = new ArrayList<>(); final ArrayList<Thread> threads = new ArrayList<>(); final ArrayList<CtfTmfContext> tooManyContexts = new ArrayList<>(); for (double i = begin; i < end; i += increment) { SeekerThread thread = new SeekerThread() { @Override public void run() { CtfTmfContext lwc = new CtfTmfContext(trace); lwc.seek(val); trace.getNext(lwc); synchronized(trace){ if (lwc.getCurrentEvent() != null) { vals.add(lwc.getCurrentEvent().getTimestamp().getValue()); } tooManyContexts.add(lwc); } lwc.dispose(); } }; thread.setVal((long)i); threads.add(thread); thread.start(); } for (Thread t: threads){ t.join(); } for (long val : vals){ assertTrue(val >= begin); assertTrue(val <= end); } }

Target:
public void testTooManyContexts() throws InterruptedException { final int lwcCount = 101; double increment = (end - begin) / lwcCount; final ArrayList<Long> vals = new ArrayList<>(); final ArrayList<Thread> threads = new ArrayList<>(); final ArrayList<CtfTmfContext> tooManyContexts = new ArrayList<>(); for (double i = begin; i < end; i += increment) { SeekerThread thread = new SeekerThread() { @Override public void run() { CtfTmfContext lwc = new CtfTmfContext(trace); lwc.seek(val); trace.getNext(lwc); synchronized (trace) { if (lwc.getCurrentEvent() != null) { vals.add(lwc.getCurrentEvent().getTimestamp().getValue()); } tooManyContexts.add(lwc); } } }; thread.setVal((long) i); threads.add(thread); thread.start(); } for (Thread t : threads) { t.join(); } assertEquals("seeks done ", lwcCount + 1, vals.size()); for (long val : vals) { assertTrue("val >= begin, " + val + " " + begin, val >= begin); assertTrue("val >= end, " + val + " " + end, val <= end); } }
Source:
public String getInstallDir() { if (installDir != null) return installDir; Maybe<Object> minstallDir = getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR, true); if (!minstallDir.isPresent() || minstallDir.get()==null) { String installBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.install"); if (installBasedir != null) { log.warn("Using legacy 'brooklyn.dirs.install' setting for "+entity+"; may be removed in future versions."); installDir = installBasedir+"/"+getEntityVersionLabel()+"_"+entity.getId(); installDir = ResourceUtils.tidyFilePath(installDir); getEntity().setAttribute(SoftwareProcess.INSTALL_DIR, installDir); return installDir; } } installDir = ResourceUtils.tidyFilePath(ConfigToAttributes.apply(getEntity(), SoftwareProcess.INSTALL_DIR)); entity.setAttribute(SoftwareProcess.INSTALL_DIR, installDir); return installDir; }

Target:
public String getInstallDir() { if (installDir != null) return installDir; Maybe<Object> minstallDir = getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR, true); if (!minstallDir.isPresent() || minstallDir.get()==null) { String installBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.install"); if (installBasedir != null) { log.warn("Using legacy 'brooklyn.dirs.install' setting for "+entity+"; may be removed in future versions."); installDir = Os.mergePathsUnix(installBasedir, getEntityVersionLabel()+"_"+entity.getId()); installDir = ResourceUtils.tidyFilePath(installDir); getEntity().setAttribute(SoftwareProcess.INSTALL_DIR, installDir); return installDir; } } installDir = ResourceUtils.tidyFilePath(ConfigToAttributes.apply(getEntity(), SoftwareProcess.INSTALL_DIR)); entity.setAttribute(SoftwareProcess.INSTALL_DIR, installDir); return installDir; }
Source:
public void validate(JobParameters parameters) throws JobParametersInvalidException { ParametersValidatorUtil.checkIsNotNullOrEmptyString( parameters.getString(JobParametersNames.INPUT_VCF_AGGREGATION), JobParametersNames.INPUT_VCF_AGGREGATION); }

Target:
public void validate(JobParameters parameters) throws JobParametersInvalidException { ParametersValidatorUtil.checkIsNotNullOrEmptyString( parameters.getString(JobParametersNames.INPUT_VCF_AGGREGATION), JobParametersNames.INPUT_VCF_AGGREGATION); try { VariantSource.Aggregation.valueOf(parameters.getString(JobParametersNames.INPUT_VCF_AGGREGATION)); } catch (IllegalArgumentException e) { throw new JobParametersInvalidException(e.getMessage()); } }
Source:
public LayoutBuilder assignResponsiveSequencerAsPrimary(@NonNull Set<String> excludedNodes) { List<String> modifiedSequencers = new LinkedList<>(layout.getSequencers()); String primarySequencer = null; Set<String> logTails = layout.getLastSegment().getStripes().stream() .map(LayoutStripe::getTailEndpoint) .collect(Collectors.toSet()); for (String sequencer : modifiedSequencers) { if (excludedNodes.contains(sequencer) || layout.getUnresponsiveServers().contains(sequencer)) { continue; } if (primarySequencer == null) { primarySequencer = sequencer; } if (!logTails.contains(sequencer)) { primarySequencer = sequencer; break; } } if (primarySequencer == null) { log.warn("Failover to a responsive sequencer server failed. Each of the layout " + "sequencers:{} is either a failed endpoint or an unresponsive server", modifiedSequencers.toString()); throw new LayoutModificationException("All sequencers failed."); } modifiedSequencers.remove(primarySequencer); modifiedSequencers.add(0, primarySequencer); layout.setSequencers(modifiedSequencers); return this; }

Target:
public LayoutBuilder assignResponsiveSequencerAsPrimary(@NonNull Set<String> excludedNodes) { LinkedList<String> modifiedSequencers = new LinkedList<>(layout.getSequencers()); Optional<String> primarySequencer = Optional.empty(); Set<String> logTails = layout.getLastSegment().getStripes().stream() .map(LayoutStripe::getTailEndpoint) .collect(Collectors.toSet()); for (String sequencer : modifiedSequencers) { if (excludedNodes.contains(sequencer) || layout.getUnresponsiveServers().contains(sequencer)) { continue; } primarySequencer = Optional.of(sequencer); if (!logTails.contains(sequencer)) { break; } } if (primarySequencer.isPresent()) { modifiedSequencers.remove(primarySequencer.get()); modifiedSequencers.addFirst(primarySequencer.get()); layout.setSequencers(modifiedSequencers); return this; } log.warn("Failover to a responsive sequencer server failed. Each of the layout " + "sequencers:{} is either a failed endpoint or an unresponsive server", modifiedSequencers.toString()); throw new LayoutModificationException("All sequencers failed."); }
Source:
public void tearDown() { realm.close(); }

Target:
public void tearDown() { if (realm != null) { realm.close(); } }
Source:
protected void addHideLabelByDefaultPropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_HideLabelCapabilityStyleDescription_hideLabelByDefault_feature"), getString("_UI_PropertyDescriptor_description", "_UI_HideLabelCapabilityStyleDescription_hideLabelByDefault_feature", "_UI_HideLabelCapabilityStyleDescription_type"), StylePackage.Literals.HIDE_LABEL_CAPABILITY_STYLE_DESCRIPTION__HIDE_LABEL_BY_DEFAULT, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); }

Target:
protected void addHideLabelByDefaultPropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_HideLabelCapabilityStyleDescription_hideLabelByDefault_feature"), getString("_UI_HideLabelCapabilityStyleDescription_hideLabelByDefault_description"), StylePackage.Literals.HIDE_LABEL_CAPABILITY_STYLE_DESCRIPTION__HIDE_LABEL_BY_DEFAULT, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, getString("_UI_LabelPropertyCategory"), null)); }
Source:
public synchronized boolean launchModeAvailable(String mode) { if (fActiveModes == null) { ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); ILaunchMode[] modes = getLaunchModes(); fActiveModes = new HashSet<>(3); for (ILaunchConfigurationType type : types) { for (ILaunchMode mode2 : modes) { if (type.supportsMode(mode2.getIdentifier())) { fActiveModes.add(mode2.getIdentifier()); } } } } return fActiveModes.contains(mode); }

Target:
public synchronized boolean launchModeAvailable(String mode) { if (fActiveModes == null) { fActiveModes = new HashSet<>(3); for (ILaunchConfigurationType type : getLaunchConfigurationTypes()) { for (ILaunchMode launchMode : getLaunchModes()) { if (type.supportsMode(launchMode.getIdentifier())) { fActiveModes.add(launchMode.getIdentifier()); } } } } return fActiveModes.contains(mode); }
Source:
public void testProcessSingleComponentNoProducers() { Trace trace = new Trace(); trace.setId("traceId"); trace.setBusinessTransaction("traceName"); trace.setStartTime(100); Component c = new Component(); c.setUri("uri"); c.setBaseTime(1); c.setDuration(200000000); c.getProperties().add(new Property(Constants.PROP_FAULT, "myFault")); trace.getNodes().add(c); TraceCompletionInformationInitiator initiator = new TraceCompletionInformationInitiator(); TraceCompletionInformation ci = null; try { ci = initiator.processOneToOne(null, trace); } catch (Exception e) { fail("Failed: " + e); } assertNotNull(ci); assertEquals(1, ci.getCommunications().size()); assertTrue(ci.getCommunications().get(0).getIds().contains("traceId:0")); assertEquals(trace.getId(), ci.getCompletionTime().getId()); assertEquals(trace.getBusinessTransaction(), ci.getCompletionTime().getBusinessTransaction()); assertEquals(trace.getStartTime(), ci.getCompletionTime().getTimestamp()); assertEquals(EndpointUtil.encodeClientURI(c.getUri()), ci.getCompletionTime().getUri()); assertEquals(200000000, ci.getCompletionTime().getDuration()); assertEquals(c.getProperties(Constants.PROP_FAULT), ci.getCompletionTime().getProperties(Constants.PROP_FAULT)); assertEquals(1, ci.getCompletionTime().getProperties(Constants.PROP_FAULT).size()); }

Target:
public void testProcessSingleComponentNoProducers() { Trace trace = new Trace(); trace.setId("traceId"); trace.setBusinessTransaction("traceName"); trace.setStartTime(100000); Component c = new Component(); c.setUri("uri"); c.setBaseTime(1); c.setDuration(200000); c.getProperties().add(new Property(Constants.PROP_FAULT, "myFault")); trace.getNodes().add(c); TraceCompletionInformationInitiator initiator = new TraceCompletionInformationInitiator(); TraceCompletionInformation ci = null; try { ci = initiator.processOneToOne(null, trace); } catch (Exception e) { fail("Failed: " + e); } assertNotNull(ci); assertEquals(1, ci.getCommunications().size()); assertTrue(ci.getCommunications().get(0).getIds().contains("traceId:0")); assertEquals(trace.getId(), ci.getCompletionTime().getId()); assertEquals(trace.getBusinessTransaction(), ci.getCompletionTime().getBusinessTransaction()); assertEquals(trace.getStartTime(), ci.getCompletionTime().getTimestamp()); assertEquals(EndpointUtil.encodeClientURI(c.getUri()), ci.getCompletionTime().getUri()); assertEquals(200000, ci.getCompletionTime().getDuration()); assertEquals(c.getProperties(Constants.PROP_FAULT), ci.getCompletionTime().getProperties(Constants.PROP_FAULT)); assertEquals(1, ci.getCompletionTime().getProperties(Constants.PROP_FAULT).size()); }
Source:
public void testEnumeratorReaderCommunication() throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); MockBaseSource source = new MockBaseSource(2, 10, Boundedness.BOUNDED); DataStream<Integer> stream = env.continuousSource(source, "TestingSource"); stream.addSink(new RichSinkFunction<Integer>() { @Override public void open(Configuration parameters) throws Exception { getRuntimeContext().addAccumulator("result", new ListAccumulator<Integer>()); } @Override public void invoke(Integer value, Context context) throws Exception { getRuntimeContext().getAccumulator("result").add(value); } }); List<Integer> result = env.execute().getAccumulatorResult("result"); SortedSet<Integer> resultSet = new TreeSet<>(result); assertEquals(0, (int) resultSet.first()); assertEquals(19, (int) resultSet.last()); assertEquals(20, resultSet.size()); }

Target:
public void testEnumeratorReaderCommunication() throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); MockBaseSource source = new MockBaseSource(2, 10, Boundedness.BOUNDED); DataStream<Integer> stream = env.continuousSource(source, "TestingSource"); executeAndVerify(env, stream, 20); }
Source:
public AuthenticationHandler() { log.info("Engaging API Security Handler"); apiList = CoreUtils.readApiFilterList(); restInvoker = new RESTInvoker(); this.handlerDesc = EMPTY_HANDLER_METADATA; }

Target:
public AuthenticationHandler() { log.info("Engaging API Security Handler"); apiList = CoreUtils.readApiFilterConfigs(); restInvoker = new RESTInvoker(); this.handlerDesc = EMPTY_HANDLER_METADATA; }
Source:
private void updateActiveConfiguration() { final boolean[] fire = new boolean[] { false }; try { ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { synchronized (sync) { if (! live) { return; } ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(project); setActiveConfiguration(projectDescription != null ? projectDescription.getActiveConfiguration() : null); qmakeInfo = null; fire[0] = true; } } }, null); } catch (CoreException e) { QtPlugin.log(e); } if (fire[0]) { notifyListeners(); } }

Target:
private void updateActiveConfiguration() { final boolean[] fire = new boolean[] { false }; IWorkspaceRunnable runnable = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { synchronized (sync) { if (! live) { return; } ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(project); setActiveConfiguration(projectDescription != null ? projectDescription.getActiveConfiguration() : null); qmakeInfo = null; fire[0] = true; } } }; try { if (ResourcesPlugin.getWorkspace().isTreeLocked()) { runnable.run(null); } else { ResourcesPlugin.getWorkspace().run(runnable, project, IWorkspace.AVOID_UPDATE, null); } } catch (CoreException e) { QtPlugin.log(e); } if (fire[0]) { notifyListeners(); } }
Source:
public void handle(final Chat chat) throws Exception { ChatMessageType position = ChatMessageType.values()[chat.getPosition()]; Supplier<BaseComponent[]> msgSupplier = new Supplier<BaseComponent[]>() { @Override public BaseComponent[] get() { return ComponentSerializer.parse( chat.getMessage() ); } }; ServerChatEvent chatEvent = new ServerChatEvent( con.getServer(), con, msgSupplier, position ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { chat.setMessage( ComponentSerializer.toString( chatEvent.getMessage() ) ); chat.setPosition( (byte) chatEvent.getPosition().ordinal() ); con.unsafe().sendPacket( chat ); } throw CancelSendSignal.INSTANCE; }

Target:
public void handle(final Chat chat) throws Exception { ChatMessageType position = ChatMessageType.values()[chat.getPosition()]; ServerChatEvent chatEvent = new ServerChatEvent( con.getServer(), con, chat.getMessage(), position ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { chat.setMessage( chatEvent.getMessageJson() ); chat.setPosition( (byte) chatEvent.getPosition().ordinal() ); con.unsafe().sendPacket( chat ); } throw CancelSendSignal.INSTANCE; }
Source:
public String getDisplayString(String[] children) { StringBuilder sb = new StringBuilder(); sb.append("assert_true("); for (int i = 0; i < children.length; ++i) { sb.append(children[i]); if (i != children.length - 1) { sb.append(", "); } } sb.append(")"); return sb.toString(); }

Target:
public String getDisplayString(String[] children) { assert (children.length == 1); return "user_agent_parser(" + children[0] + ")"; }
Source:
private static EntityManager ensureEntityManager(EntityManagerFactory entityManagerFactory) { EntityManager entityManager = EntityManagerHolder.getInstance().getThreadLocal().get(); if (entityManager == null) { entityManager = entityManagerFactory.createEntityManager(); EntityManagerHolder.getInstance().getThreadLocal().set(entityManager); } entityManager.joinTransaction(); return entityManager; }

Target:
private EntityManager ensureEntityManager(EntityManagerFactory entityManagerFactory) { EntityManager entityManager = EntityManagerHolder.getInstance().getThreadLocal().get(); if (entityManager == null) { entityManager = entityManagerFactory.createEntityManager(); EntityManagerHolder.getInstance().getThreadLocal().set(entityManager); } entityManager.joinTransaction(); return entityManager; }
Source:
public void updateNode(Node n) throws IOException { nodes.updateNode(n); }

Target:
public boolean updateNode(Node n) throws IOException { return nodes.updateNode(n); }
Source:
public ResourceGroupStateInfo getStateInfo() { synchronized (root) { return new ResourceGroupStateInfo( id, getState(), new DataSize(softMemoryLimitBytes, BYTE), new DataSize(cachedMemoryUsageBytes, BYTE), maxRunningQueries, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, getAggregatedRunningQueriesInfo(), queuedQueries.size() + descendantQueuedQueries); } }

Target:
public ResourceGroupStateInfo getStateInfo() { synchronized (root) { return new ResourceGroupStateInfo( id, getState(), DataSize.succinctBytes(softMemoryLimitBytes), DataSize.succinctBytes(cachedMemoryUsageBytes), maxRunningQueries, maxQueuedQueries, runningTimeLimit, queuedTimeLimit, getAggregatedRunningQueriesInfo(), queuedQueries.size() + descendantQueuedQueries); } }
Source:
public static Map<Integer, ? extends Collection<Tile>> readLaneTiles(final File illuminaRunDirectory, final ReadStructure readStructure, final ValidationStringency validationStringency, final boolean isNovaSeq) { final Collection<Tile> tiles; try { if (isNovaSeq) { tiles = TileMetricsUtil.parseTileMetrics( TileMetricsUtil.renderTileMetricsFileFromBasecallingDirectory(illuminaRunDirectory, true), TileMetricsUtil.renderPhasingMetricsFilesFromBasecallingDirectory(illuminaRunDirectory), readStructure, validationStringency); } else { tiles = TileMetricsUtil.parseTileMetrics(TileMetricsUtil.renderTileMetricsFileFromBasecallingDirectory(illuminaRunDirectory, false), readStructure, validationStringency ); } } catch (final FileNotFoundException e) { throw new PicardException("Unable to open laneMetrics file.", e); } return tiles.stream().filter(tile -> tile.getLaneNumber() > 0).collect(Collectors.groupingBy(Tile::getLaneNumber)); }

Target:
public static Map<Integer, ? extends Collection<Tile>> readLaneTiles(final File illuminaRunDirectory, final ReadStructure readStructure, final ValidationStringency validationStringency, final boolean isNovaSeq) { final Collection<Tile> tiles; try { File tileMetricsOutFile = TileMetricsUtil.renderTileMetricsFileFromBasecallingDirectory(illuminaRunDirectory, isNovaSeq); if (isNovaSeq) { tiles = TileMetricsUtil.parseTileMetrics( tileMetricsOutFile, TileMetricsUtil.renderPhasingMetricsFilesFromBasecallingDirectory(illuminaRunDirectory), readStructure, validationStringency); } else { tiles = TileMetricsUtil.parseTileMetrics(tileMetricsOutFile, readStructure, validationStringency ); } } catch (final FileNotFoundException e) { throw new PicardException("Unable to open laneMetrics file.", e); } return tiles.stream().filter(tile -> tile.getLaneNumber() > 0).collect(Collectors.groupingBy(Tile::getLaneNumber)); }
Source:
public void onEventMainThread(ServiceEvent event) { Log.d(TAG, "onEvent(" + event + ")"); switch(event.action) { case SERVICE_STARTED: if (controller != null) { controller.init(); } break; } }

Target:
public void onEventMainThread(ServiceEvent event) { Log.d(TAG, "onEvent(" + event + ")"); if (event.action == ServiceEvent.Action.SERVICE_STARTED) { if (controller != null) { controller.init(); } } }