auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
synchronized static void cleanCachedInAppMessages(final OneSignalDbHelper dbHelper) { new Thread(new Runnable() { @Override public void run() { Thread.currentThread().setPriority(Process.THREAD_PRIORITY_BACKGROUND); new OSInAppMessageRepository(dbHelper).cleanCachedInAppMessages(); } }, OS_DELETE_CACHED_REDISPLAYED_IAMS_THREAD).start(); }

Target:
synchronized static void cleanCachedInAppMessages(final OneSignalDbHelper dbHelper) { new Thread(new Runnable() { @Override public void run() { Thread.currentThread().setPriority(Process.THREAD_PRIORITY_BACKGROUND); OSInAppMessageRepository inAppMessageRepository = OSInAppMessageController .getController() .getInAppMessageRepository(dbHelper); inAppMessageRepository.cleanCachedInAppMessages(); } }, OS_DELETE_CACHED_REDISPLAYED_IAMS_THREAD).start(); }
Source:
public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String principalName = context.getPrincipalName(); String ownerKey = args.getAsString(OWNER_KEY); Owner owner = this.ownerCurator.lockAndLoadByKey(ownerKey); log.info("GRABBED OWNER: {}", owner); if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); return String.format("Nothing to do; owner no longer exists: %s", ownerKey); } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator .getByTypeAndOwner(ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); return String.format("Nothing to do; imports no longer exist for owner: %s", displayName); } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principalName, uc); return String.format("Imported pools removed for owner: %s", displayName); }

Target:
public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String principalName = context.getPrincipalName(); String ownerKey = args.getAsString(OWNER_KEY); Owner owner = this.ownerCurator.lockAndLoadByKey(ownerKey); if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); return String.format("Nothing to do; owner no longer exists: %s", ownerKey); } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator .getByTypeAndOwner(ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); return String.format("Nothing to do; imports no longer exist for owner: %s", displayName); } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principalName, uc); return String.format("Imported pools removed for owner: %s", displayName); }
Source:
private boolean isOpenParenthesis(SyntaxToken token) { return TokenUtils.isType(token, PHPPunctuator.LPARENTHESIS); }

Target:
private static boolean isOpenParenthesis(SyntaxToken token) { return TokenUtils.isType(token, PHPPunctuator.LPARENTHESIS); }
Source:
public ValidationResult isMacAssignableValidator() { Boolean allowDupMacs = macPool.isDuplicateMacAddressesAllowed(); boolean illegalDuplicateMacUsage = !allowDupMacs && macPool.isMacInUse(macAddress); EngineMessage failMessage = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; return ValidationResult .failWith(failMessage, ReplacementUtils.getVariableAssignmentString(failMessage, macAddress)) .when(illegalDuplicateMacUsage); }

Target:
public ValidationResult isMacAssignableValidator() { boolean allowDupMacs = macPool.isDuplicateMacAddressesAllowed(); boolean illegalDuplicateMacUsage = !allowDupMacs && macPool.isMacInUse(macAddress); EngineMessage failMessage = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; return ValidationResult .failWith(failMessage, ReplacementUtils.getVariableAssignmentString(failMessage, macAddress)) .when(illegalDuplicateMacUsage); }
Source:
public void updateEntityMementos(Collection<EntityMemento> mementos) { for (EntityMemento memento : mementos) { entities.put(memento.getId(), memento); if (memento.getParent()==null) { applicationIds.add(memento.getId()); } } }

Target:
public void updateEntityMementos(Collection<EntityMemento> mementos) { for (EntityMemento memento : mementos) { entities.put(memento.getId(), memento); if (memento.isTopLevelApp()) { applicationIds.add(memento.getId()); } } }
Source:
public void actsOnResponseHeaders() throws Exception { new FtRemote( new TkFixed( HELLO_WORLD ) ).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy( String.format( FORMAT, home.getHost(), home.getPort() ) ).act(new RqFake()) ).print(), Matchers.allOf( Matchers.containsString(HELLO_WORLD), Matchers.containsString( HEADER ) ) ); } } ); }

Target:
public void actsOnResponseHeaders() throws Exception { final String testString = "TestRH"; new FtRemote( new TkFixed(testString) ).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { MatcherAssert.assertThat( new RsPrint( new TkProxy( proxy(home) ).act(new RqFake()) ).print(), Matchers.allOf( Matchers.containsString(testString), Matchers.containsString( "X-Takes-TkProxy:" ) ) ); } } ); }
Source:
String replaceUriParams(String path, MuleEvent event) { ParameterMap uriParamMap = resolveParams(event, HttpParamType.URI_PARAM); for (String uriParamName : uriParamMap.keySet()) { List<String> uriParamValues = uriParamMap.getAll(uriParamName); String uriParamValue = uriParamValues.get(uriParamValues.size() - 1); if (uriParamValue == null) { throw new NullPointerException(format("Expression {%s} evaluated to null.", uriParamName)); } String value = quoteReplacement(uriParamValue); Pattern pattern = compile("\\{" + uriParamName + "}"); path = pattern.matcher(path).replaceAll(value); } return path; }

Target:
public String replaceUriParams(String path, MuleEvent event) { ParameterMap uriParamMap = resolveParams(event, HttpParamType.URI_PARAM); for (String uriParamName : uriParamMap.keySet()) { List<String> uriParamValues = uriParamMap.getAll(uriParamName); String uriParamValue = uriParamValues.get(uriParamValues.size() - 1); if (uriParamValue == null) { throw new NullPointerException(format("Expression {%s} evaluated to null.", uriParamName)); } path = path.replaceAll(format("\\{%s\\}", uriParamName), quoteReplacement(uriParamValue)); } return path; }
Source:
public Vector<Object> findPatientsByIdentifier(String[] identifiers) { Vector<Object> patientList = new Vector<>(); for (String identifier : identifiers) { try { List<Patient> patients = Context.getPatientService().getPatients(identifier, false, 0, 1); if(patients.size() > 0){ patientList.add(new PatientListItem(patients.get(0))); } } catch (Exception e) { log.error("Error while searching for patients", e); return new Vector<>(); } } return patientList; }

Target:
public Vector<Object> findPatientsByIdentifier(String[] identifiers) { Vector<Object> patientList = new Vector<>(); for (String identifier : identifiers) { List<PatientIdentifier> patientIdentifiers = Context.getPatientService().getPatientIdentifiers(identifier, null, null, null, true); if(patientIdentifiers.size() > 0){ patientList.add(new PatientListItem(patientIdentifiers.get(0).getPatient())); } } return patientList; }
Source:
private File createTmpFile(String name, String contents) throws Exception { File tmpFile = File.createTempFile(name, ".txt"); tmpFile.deleteOnExit(); Files.append(contents, tmpFile, Charset.forName("UTF-8")); return tmpFile; }

Target:
private File createTmpFile(String name, String contents) throws Exception { File tmpFile = tmp.newFile(name); Files.append(contents, tmpFile, Charset.forName("UTF-8")); return tmpFile; }
Source:
public LooseRef peel(ObjectIdRef newLeaf) { ObjectId peeledObjectId = newLeaf.getPeeledObjectId(); ObjectId objectId = getObjectId(); assert objectId != null; if (peeledObjectId != null) { return new LoosePeeledTag(snapShot, getName(), objectId, peeledObjectId); } else { return new LooseNonTag(snapShot, getName(), objectId); } }

Target:
public LooseRef peel(ObjectIdRef newLeaf) { ObjectId peeledObjectId = newLeaf.getPeeledObjectId(); ObjectId objectId = getObjectId(); if (peeledObjectId != null) { return new LoosePeeledTag(snapShot, getName(), objectId, peeledObjectId); } else { return new LooseNonTag(snapShot, getName(), objectId); } }
Source:
public static void main(String[] args) { if (args == null || args.length == 0) { usage(); throw new IllegalStateException("No Arguments provided!"); } if (args.length > 1 || DynamicConfigHelpers.isNullOrEmpty(args[0])) { usage(); throw new IllegalStateException("Expecting One non-empty argument only!"); } File file = new File(args[0]); String absoluteBasePath = DynamicConfigHelpers.formatFilePath(file.getAbsolutePath()); log.info("Absolute Path for Model Configs Directory: " + absoluteBasePath); if (!file.isDirectory()) { usage(); throw new IllegalStateException("Model Configs Directory doesn't exists"); } readVariableConfig(absoluteBasePath); if (readSecurityConfig(absoluteBasePath)) { validateRoleInSecurityConfig(elideSecurityConfig); } if (readTableConfig(absoluteBasePath)) { validateSqlInTableConfig(elideTableConfig); } log.info("Configs Validation Passed!"); }

Target:
public static void main(String[] args) throws IOException, ParseException { Options options = prepareOptions(); CommandLine cli = new DefaultParser().parse(options, args); if (cli.hasOption("help")) { printHelp(options); return; } if (!cli.hasOption("configDir")) { printHelp(options); throw new MissingOptionException("Missing required option"); } String configDir = cli.getOptionValue("configDir"); File file = new File(configDir); String absoluteBasePath = file.getAbsolutePath(); log.info("Absolute Path for Model Configs Directory: " + absoluteBasePath); if (!file.isDirectory()) { throw new IllegalStateException("Model Configs Directory doesn't exists"); } DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(); dynamicConfigValidator.readAndValidateConfigs(absoluteBasePath); log.info("Configs Validation Passed!"); }
Source:
public void readFromStream(final WritableColumn count, final WritableColumn result) throws DbException { DataInputStream dIn = pyWorker.getDataInputStream(); int c = 1; try { if (isMultiValued) { c = dIn.readInt(); count.appendInt(c); } else { if (count != null) { count.appendInt(1); } } for (int i = 0; i < c; i++) { int type = dIn.readInt(); if (type == MyriaConstants.PythonSpecialLengths.PYTHON_EXCEPTION.getVal()) { int excepLength = dIn.readInt(); byte[] excp = new byte[excepLength]; dIn.readFully(excp); throw new DbException(new String(excp, StandardCharsets.UTF_8)); } else { if (type == MyriaConstants.PythonType.DOUBLE.getVal()) { result.appendDouble(dIn.readDouble()); } else if (type == MyriaConstants.PythonType.FLOAT.getVal()) { result.appendFloat(dIn.readFloat()); } else if (type == MyriaConstants.PythonType.INT.getVal()) { result.appendInt(dIn.readInt()); } else if (type == MyriaConstants.PythonType.LONG.getVal()) { result.appendLong(dIn.readLong()); } else if (type == MyriaConstants.PythonType.BLOB.getVal()) { int l = dIn.readInt(); if (l > 0) { byte[] obj = new byte[l]; dIn.readFully(obj); result.appendBlob(ByteBuffer.wrap(obj)); } } else { throw new DbException("Type not supported by python"); } } } } catch (IOException e) { throw new DbException(e); } }

Target:
public void readFromStream(final WritableColumn count, final WritableColumn result) throws DbException { DataInputStream dIn = pyWorker.getDataInputStream(); int c = 1; try { if (isMultiValued) { c = dIn.readInt(); count.appendInt(c); } else { if (count != null) { count.appendInt(1); } } for (int i = 0; i < c; i++) { int type = dIn.readInt(); if (type == MyriaConstants.PythonSpecialLengths.PYTHON_EXCEPTION.getVal()) { int excLen = dIn.readInt(); byte[] excp = new byte[excLen]; dIn.readFully(excp); throw new DbException(new String(excp, StandardCharsets.UTF_8)); } else { if (type == MyriaConstants.PythonType.DOUBLE.getVal()) { result.appendDouble(dIn.readDouble()); } else if (type == MyriaConstants.PythonType.FLOAT.getVal()) { result.appendFloat(dIn.readFloat()); } else if (type == MyriaConstants.PythonType.INT.getVal()) { result.appendInt(dIn.readInt()); } else if (type == MyriaConstants.PythonType.LONG.getVal()) { result.appendLong(dIn.readLong()); } else if (type == MyriaConstants.PythonType.BLOB.getVal()) { int l = dIn.readInt(); if (l > 0) { byte[] obj = new byte[l]; dIn.readFully(obj); result.appendBlob(ByteBuffer.wrap(obj)); } } else { throw new DbException("Type not supported by python"); } } } } catch (IOException e) { throw new DbException(e); } }
Source:
public void test_update_by_id_returning_id_with_outputname() throws Exception { execute("create table test (id int primary key, message string) clustered into 2 shards"); execute("insert into test values(1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='msg' where id = 1 returning id as renamed"); assertThat((response.cols()[0]), is("renamed" )); refresh(); }

Target:
public void test_update_by_id_returning_id_with_outputname() throws Exception { execute("create table test (id int primary key, message string) clustered into 2 shards"); execute("insert into test values(1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='msg' where id = 1 returning id as renamed"); assertThat((response.cols()[0]), is("renamed" )); assertThat(printedTable(response.rows()), is("1\n" )); }
Source:
private List<VDS> createHosts() { List<VDS> hosts = new LinkedList<>(); VDS vds = new VDS(); vds.setId(OTHER_HOST_ID_1); vds.setVdsGroupId(OTHER_CLUSTER_ID); vds.setStoragePoolId(OTHER_DATACENTER_ID); vds.setVdsGroupCompatibilityVersion(Version.v3_5); hosts.add(vds); vds = new VDS(); vds.setId(OTHER_HOST_ID_2); vds.setVdsGroupId(OTHER_CLUSTER_ID); vds.setStoragePoolId(FENCED_HOST_DATACENTER_ID); vds.setVdsGroupCompatibilityVersion(Version.v3_5); hosts.add(vds); return hosts; }

Target:
private List<VDS> createHosts() { List<VDS> hosts = new LinkedList<>(); VDS vds = new VDS(); vds.setId(OTHER_HOST_ID_1); vds.setVdsGroupId(OTHER_CLUSTER_ID); vds.setStoragePoolId(OTHER_DATACENTER_ID); vds.setVdsGroupCompatibilityVersion(Version.v3_5); hosts.add(vds); vds = new VDS(); vds.setId(OTHER_HOST_ID_2); vds.setVdsGroupId(OTHER_CLUSTER_ID_2); vds.setStoragePoolId(FENCED_HOST_DATACENTER_ID); vds.setVdsGroupCompatibilityVersion(Version.v3_5); hosts.add(vds); return hosts; }
Source:
public List<Object> toList() { List<Object> array = new ArrayList<>(); for (int i = 0; i < count(); i++) array.add(getObject(i)); return array; }

Target:
public List<Object> toList() { List<Object> array = new ArrayList<>(); for (int i = 0; i < count(); i++) { SharedKeys sk = rs.getQuery().getDatabase().getSharedKeys(); array.add(SharedKeys.valueToObject(fleeceValue(i), sk)); } return array; }
Source:
public void dispatcherLogsWarningWhenAllThreadsArePotentiallyStuck() throws Throwable { @SuppressWarnings("unused") class DispatcherLogsWarning extends MultithreadedTestCase { public void threadDispatcher() throws InterruptedException { when(workflowInstances.pollNextWorkflowInstanceIds(anyInt())) .thenAnswer(waitForTickAndAnswer(2, Collections.emptyList(), this)); when(executorFactory.getPotentiallyStuckProcessors()).thenReturn(executor.getThreadCount()); dispatcher.run(); } public void threadShutdown() { waitForTick(1); dispatcher.shutdown(); } @Override public void finish() { verify(mockAppender, atLeast(1)).doAppend(loggingEventCaptor.capture()); for (ILoggingEvent event : loggingEventCaptor.getAllValues()) { if (event.getLevel().equals(Level.WARN) && event.getFormattedMessage() .equals("2 of 2 state processor threads are potentially stuck (processing longer than 60 seconds)")) { return; } } Assertions.fail("Expected warning was not logged"); } } runOnce(new DispatcherLogsWarning()); }

Target:
public void dispatcherLogsWarningWhenAllThreadsArePotentiallyStuck() throws Throwable { @SuppressWarnings("unused") class DispatcherLogsWarning extends MultithreadedTestCase { public void threadDispatcher() throws InterruptedException { when(workflowInstances.pollNextWorkflowInstanceIds(anyInt())) .thenAnswer(waitForTickAndAnswer(2, emptyList(), this)); when(executorFactory.getPotentiallyStuckProcessors()).thenReturn(executor.getThreadCount()); dispatcher.run(); } public void threadShutdown() { waitForTick(1); dispatcher.shutdown(); } @Override public void finish() { verify(mockAppender, atLeast(1)).doAppend(loggingEventCaptor.capture()); for (ILoggingEvent event : loggingEventCaptor.getAllValues()) { if (event.getLevel().equals(Level.WARN) && event.getFormattedMessage() .equals("2 of 2 state processor threads are potentially stuck (processing longer than 60 seconds)")) { return; } } Assertions.fail("Expected warning was not logged"); } } runOnce(new DispatcherLogsWarning()); }
Source:
public void clickOnFirstEventButtonDetails() { findFirst(".event").findFirst(".btn-see-event-info").click(); }

Target:
public void clickOnFirstEventButtonDetails() { findFirst(".event .btn-see-event-info").click(); }
Source:
public CompletableFuture<Boolean> removeWithVersionAsync(K key, long version) { TransactionContext<K, V> txContext = getTransactionContext(); return txContext == null ? super.removeWithVersionAsync(key, version) : txContext.compute(key, entry -> removeEntryIfSameVersion(entry, version), super::getWithMetadata); }

Target:
public CompletableFuture<Boolean> removeWithVersionAsync(K key, long version) { TransactionContext<K, V> txContext = getTransactionContext(); return txContext == null ? super.removeWithVersionAsync(key, version) : txContext.compute(key, entry -> removeEntryIfSameVersion(entry, version), remoteGet); }
Source:
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { if (JSONB_DISABLED) { return false; } ResteasyConfiguration context = ResteasyProviderFactory.getContextData(ResteasyConfiguration.class); if (context != null && Boolean.parseBoolean(context.getParameter("resteasy.jsonb.disable"))) { return false; } if (context != null && Boolean.parseBoolean(context.getParameter("resteasy.jsonp.enable"))) { return false; } if (annotations != null && hasJacksonJaxbAnnotation(annotations)) { return false; } Class<?> classType = getGenericClass(type, genericType); if (classType != null && isJaxbClass(classType) && isJaxbClass(classType)) { return false; } Annotation[] annos = this.getAllAnnotations(classType); if (hasJacksonJaxbAnnotation(annos)) { return false; } if (classType.getSuperclass() != Object.class) { Class<?> superClass = classType.getSuperclass(); while (superClass != null) { if (hasJacksonJaxbAnnotation(getAllAnnotations(superClass))) { return false; } superClass = superClass.getSuperclass(); } } return (isSupportedMediaType(mediaType)) && ((!isJaxbClass(type)) || (FindAnnotation.findJsonBindingAnnotations(annotations).length != 0)); }

Target:
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { ResteasyConfiguration context = ResteasyProviderFactory.getContextData(ResteasyConfiguration.class); if (context != null && Boolean.parseBoolean(context.getParameter("resteasy.jsonb.disable"))) { return false; } if (JSONB_DISABLED) { return false; } if (context != null && Boolean.parseBoolean(context.getParameter("resteasy.jsonp.enable"))) { return false; } if (annotations != null && hasJacksonJaxbAnnotation(annotations)) { return false; } Class<?> classType = getGenericClass(type, genericType); if (classType != null && isJaxbClass(classType) && isJaxbClass(classType)) { return false; } Annotation[] annos = this.getAllAnnotations(classType); if (hasJacksonJaxbAnnotation(annos)) { return false; } if (classType.getSuperclass() != Object.class) { Class<?> superClass = classType.getSuperclass(); while (superClass != null) { if (hasJacksonJaxbAnnotation(getAllAnnotations(superClass))) { return false; } superClass = superClass.getSuperclass(); } } return (isSupportedMediaType(mediaType)) && ((!isJaxbClass(type)) || (FindAnnotation.findJsonBindingAnnotations(annotations).length != 0)); }
Source:
private void parseFile(String filePath, String objectID) { String[] pathParts = filePath.split("\\."); String fileType = pathParts[pathParts.length - 1]; if (fileType.equals("xlsx") || fileType.equals("xls")) { getOpenedView().clearSelection(); parseExcelDocument(filePath, fileType, objectID); } else if (fileType.equals("docx") || fileType.equals("doc")) { getOpenedView().clearSelection(); parseWordDocument(filePath, fileType, objectID); } else { showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Not an Excel or Word file."); } }

Target:
private void parseFile(String filePath, String objectID) { String fileType = Files.getFileExtension(filePath); if (fileType.equals(XLSX) || fileType.equals(XLS)) { getOpenedView().clearSelection(); parseExcelDocument(filePath, objectID); } else if (fileType.equals(DOCX)) { getOpenedView().clearSelection(); parseWordDocument(filePath, objectID); } else if (fileType.equals(DOC)) { showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", ".doc file format not supported, use .docx"); } else { showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Not an Excel or Word file."); } }
Source:
public void Login_005_japaneseUserLogin() { SpecialUserLoginPageObject specialLogin = new SpecialUserLoginPageObject(driver); specialLogin.loginAndVerify(credentials.userNameJapanese2, credentials.passwordJapanese2, "<LINK_0>"); }

Target:
public void Login_005_japaneseUserLogin() { SpecialUserLoginPageObject specialLogin = new SpecialUserLoginPageObject(driver); specialLogin.loginAndVerify(credentials.userNameJapanese2, credentials.passwordJapanese2, wikiURL); }
Source:
private RetryPolicy buildRetryPolicy() { RetryPolicy retryPolicy = new RetryPolicy().withMaxRetries(0); Properties userConfig = configurationGenerator.getUserConfig(); if ("true".equals((userConfig.getProperty(PARAM_RETRY_POLICY_ENABLED,"false")))) { int maxRetries = Integer.parseInt(userConfig.getProperty(PARAM_RETRY_POLICY_MAX_RETRIES, "20")); int delay = Integer.parseInt(userConfig.getProperty(PARAM_RETRY_POLICY_DELAY_IN_MS, "5000")); retryPolicy = retryPolicy.retryOn(ConfigurationException.class).withMaxRetries(maxRetries).withDelay(delay, TimeUnit.MILLISECONDS); } return retryPolicy; }

Target:
protected RetryPolicy buildRetryPolicy() { RetryPolicy retryPolicy = new RetryPolicy().withMaxRetries(0); Properties userConfig = configurationGenerator.getUserConfig(); if (Boolean.parseBoolean((userConfig.getProperty(PARAM_RETRY_POLICY_ENABLED, "false")))) { int maxRetries = Integer.parseInt( userConfig.getProperty(PARAM_RETRY_POLICY_MAX_RETRIES, PARAM_RETRY_POLICY_DEFAULT_RETRIES)); int delay = Integer.parseInt( userConfig.getProperty(PARAM_RETRY_POLICY_DELAY_IN_MS, PARAM_POLICY_DEFAULT_DELAY_IN_MS)); retryPolicy = retryPolicy.retryOn(ConfigurationException.class).withMaxRetries(maxRetries).withDelay(delay, TimeUnit.MILLISECONDS); } return retryPolicy; }
Source:
default T getValueOrThrow() { return getValue().orElseThrow(() -> new NoSuchElementException()); }

Target:
default T getValueOrThrow() { return getValue().orElseThrow(); }
Source:
private void handleMidrowCode(byte cc1, byte cc2) { boolean transparentOrUnderline = (cc2 & 0x1) != 0; int attribute = cc2 >> 1 & 0xF; if ((cc1 & 0x1) != 0) { captionStyles.put(getSpanStartIndex(), new BackgroundColorSpan(transparentOrUnderline ? COLOR_MAP[attribute] & TRANSPARENCY_MASK : COLOR_MAP[attribute])); } else { captionStyles.put(getSpanStartIndex(), new ForegroundColorSpan(COLOR_MAP[attribute])); if (transparentOrUnderline) { captionStyles.put(getSpanStartIndex(), new UnderlineSpan()); } } }

Target:
private void handleMidrowCode(byte cc1, byte cc2) { boolean transparentOrUnderline = (cc2 & 0x1) != 0; int attribute = cc2 >> 1 & 0xF; if ((cc1 & 0x1) == 0) { currentCue.setCharacterStyle(new BackgroundColorSpan(transparentOrUnderline ? COLOR_MAP[attribute] & TRANSPARENCY_MASK : COLOR_MAP[attribute])); } else { if (attribute < 7) { currentCue.setCharacterStyle(new ForegroundColorSpan(COLOR_MAP[attribute])); } else { currentCue.setCharacterStyle(new StyleSpan(STYLE_ITALIC)); } if (transparentOrUnderline) { currentCue.setCharacterStyle(new UnderlineSpan()); } } }
Source:
public void startListening() { mData.getSnapshots().observeForever(mDataObserver); mData.getLoadingState().observeForever(mStateObserver); }

Target:
public void startListening() { mSnapshots.observeForever(mDataObserver); mLoadingState.observeForever(mStateObserver); }
Source:
private static String getDefaultBrowser(Context context) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>")); PackageManager pm = context.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivity(browserIntent,PackageManager.MATCH_DEFAULT_ONLY); return resolveInfo.activityInfo.packageName; }

Target:
private static String getDefaultBrowser(Context context) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>")); PackageManager pm = context.getPackageManager(); ResolveInfo resolveInfo = pm.resolveActivity(browserIntent, PackageManager.MATCH_DEFAULT_ONLY); if (resolveInfo == null) { return null; } return resolveInfo.activityInfo.packageName; }
Source:
public WheelchairFlagEncoder(PMap properties) { this((int) properties.getLong("speedBits", 4), properties.getDouble("speedFactor", 1)); this.properties = properties; this.setBlockFords(properties.getBool("block_fords", true)); }

Target:
public WheelchairFlagEncoder(PMap properties) { this((int) properties.getLong("speed_bits", 4), properties.getDouble("speed_factor", 1)); this.setBlockFords(properties.getBool("block_fords", true)); }
Source:
public void init() { super.init(); getMutableEntityType().addEffector(EXECUTE_SCRIPT, new EffectorBody<String>() { @Override public String call(ConfigBag parameters) { return executeScript((String)parameters.getStringKey("commands")); } }); Entities.checkRequiredUrl(this, getCassandraConfigTemplateUrl()); Entities.getRequiredUrlConfig(this, CASSANDRA_RACKDC_CONFIG_TEMPLATE_URL); }

Target:
public void init() { super.init(); getMutableEntityType().addEffector(EXECUTE_SCRIPT, new EffectorBody<String>() { @Override public String call(ConfigBag parameters) { return executeScript((String)parameters.getStringKey("commands")); } }); Entities.checkRequiredUrl(this, getCassandraConfigTemplateUrl()); Entities.getRequiredUrlConfig(this, CASSANDRA_RACKDC_CONFIG_TEMPLATE_URL); connectEnrichers(); }
Source:
protected Class<?> findClass(String name) throws ClassNotFoundException { InputStream resource = getResourceAsStream(name.replace('.', '/') + ".class"); if (resource == null) { throw new ClassNotFoundException(name); } try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); while (true) { int read = resource.read(); if (read == -1) { return defineClass(name, bout.toByteArray(), 0, bout.size()); } else { bout.write(read); } } } catch (IOException ex) { throw new ClassNotFoundException(name, ex); } finally { try { resource.close(); } catch (IOException ex) { } } }

Target:
protected Class<?> findClass(String name) throws ClassNotFoundException { InputStream resource = getResourceAsStream(name.replace('.', '/') + ".class"); if (resource == null) { throw new ClassNotFoundException(name); } try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); try { while (true) { int read = resource.read(); if (read == -1) { return defineClass(name, bout.toByteArray(), 0, bout.size()); } else { bout.write(read); } } } finally { bout.close(); } } catch (IOException ex) { throw new ClassNotFoundException(name, ex); } finally { try { resource.close(); } catch (IOException ex) { } } }
Source:
private RetrievableStateHandle<T> get(String pathInZooKeeper, boolean lock) throws Exception { checkNotNull(pathInZooKeeper, "Path in ZooKeeper"); final String path = normalizePath(pathInZooKeeper); if (lock) { try { client.create().withMode(CreateMode.EPHEMERAL).forPath(getLockPath(path)); } catch (KeeperException.NodeExistsException ignored) { } catch (KeeperException.NoNodeException ex) { throw new StateHandleStore.NotExistException(ex.getMessage()); } } boolean success = false; try { byte[] data = client.getData().forPath(path); RetrievableStateHandle<T> retrievableStateHandle = InstantiationUtil.deserializeObject( data, Thread.currentThread().getContextClassLoader()); success = true; return retrievableStateHandle; } catch (KeeperException.NoNodeException ex) { throw new StateHandleStore.NotExistException(ex.getMessage()); } catch (IOException | ClassNotFoundException e) { throw new IOException("Failed to deserialize state handle from ZooKeeper data from " + path + '.', e); } finally { if (!success && lock) { release(path); } } }

Target:
private RetrievableStateHandle<T> get(String pathInZooKeeper, boolean lock) throws Exception { checkNotNull(pathInZooKeeper, "Path in ZooKeeper"); final String path = normalizePath(pathInZooKeeper); if (lock) { try { client.create().withMode(CreateMode.EPHEMERAL).forPath(getLockPath(path)); } catch (KeeperException.NodeExistsException ignored) { } catch (KeeperException.NoNodeException ex) { throw new NotExistException("ZooKeeper node " + path + " does not exist.", ex); } } boolean success = false; try { byte[] data = client.getData().forPath(path); RetrievableStateHandle<T> retrievableStateHandle = InstantiationUtil.deserializeObject( data, Thread.currentThread().getContextClassLoader()); success = true; return retrievableStateHandle; } catch (KeeperException.NoNodeException ex) { throw new NotExistException("ZooKeeper node " + path + " does not exist.", ex); } catch (IOException | ClassNotFoundException e) { throw new IOException("Failed to deserialize state handle from ZooKeeper data from " + path + '.', e); } finally { if (!success && lock) { release(path); } } }
Source:
protected void resolveInputPriorityConflict(ExecNode<?, ?> node, int higherInput, int lowerInput) { throw new IllegalStateException( "A conflict is detected. This is a bug. Please consider filing an issue.\n" + "To work around this bug, please set " + OptimizerConfigOptions.TABLE_OPTIMIZER_MULTIPLE_INPUT_ENABLED.key() + " to false to disable multiple input operator."); }

Target:
protected void resolveInputPriorityConflict(ExecNode<?, ?> node, int higherInput, int lowerInput) { throw new IllegalStateException( "A conflict is detected. This is a bug. Please file an issue.\n" + "To work around this bug, please set " + OptimizerConfigOptions.TABLE_OPTIMIZER_MULTIPLE_INPUT_ENABLED.key() + " to false to disable multiple input operator."); }
Source:
public byte[] generateOutputFile(Collection<LicenseInfoParsingResult> projectLicenseInfoResults, String projectName, String projectVersion, String licenseInfoHeaderText) throws SW360Exception { ByteArrayOutputStream docxOutputStream = new ByteArrayOutputStream(); try { byte[] docxTemplateFile = CommonUtils.loadResource(DocxGenerator.class, DOCX_TEMPLATE_FILE).orElse(null); XWPFDocument xwpfDocument = new XWPFDocument(new ByteArrayInputStream(docxTemplateFile)); switch (getOutputVariant()) { case DISCLOSURE: fillDocument(xwpfDocument, projectLicenseInfoResults, projectName, projectVersion, licenseInfoHeaderText, false); break; case REPORT: fillDocument(xwpfDocument, projectLicenseInfoResults, projectName, projectVersion, licenseInfoHeaderText, true); break; default: throw new IllegalArgumentException("Unknown generator variant type: " + getOutputVariant()); } xwpfDocument.write(docxOutputStream); docxOutputStream.close(); } catch (XmlException e) { throw new SW360Exception("Got XmlException while generating docx document: " + e.getMessage()); } catch (IOException e) { throw new SW360Exception("Got IOException when generating docx document: " + e.getMessage()); } catch (TException e) { throw new SW360Exception("Error reading sw360 licenses: " + e.getMessage()); } return docxOutputStream.toByteArray(); }

Target:
public byte[] generateOutputFile(Collection<LicenseInfoParsingResult> projectLicenseInfoResults, String projectName, String projectVersion, String licenseInfoHeaderText) throws SW360Exception { ByteArrayOutputStream docxOutputStream = new ByteArrayOutputStream(); Optional<byte[]> docxTemplateFile = CommonUtils.loadResource(DocxGenerator.class, DOCX_TEMPLATE_FILE); if (docxTemplateFile.isPresent()) { try { XWPFDocument xwpfDocument = new XWPFDocument(new ByteArrayInputStream(docxTemplateFile.get())); switch (getOutputVariant()) { case DISCLOSURE: fillDocument(xwpfDocument, projectLicenseInfoResults, projectName, projectVersion, licenseInfoHeaderText, false); break; case REPORT: fillDocument(xwpfDocument, projectLicenseInfoResults, projectName, projectVersion, licenseInfoHeaderText, true); break; default: throw new IllegalArgumentException("Unknown generator variant type: " + getOutputVariant()); } xwpfDocument.write(docxOutputStream); docxOutputStream.close(); } catch (XmlException e) { throw new SW360Exception("Got XmlException while generating docx document: " + e.getMessage()); } catch (IOException e) { throw new SW360Exception("Got IOException when generating docx document: " + e.getMessage()); } catch (TException e) { throw new SW360Exception("Error reading sw360 licenses: " + e.getMessage()); } return docxOutputStream.toByteArray(); } else { throw new SW360Exception("Could not load the template for xwpf document: " + DOCX_TEMPLATE_FILE); } }
Source:
private boolean isBalloonDeviceActiveOnVm(VmInternalData vmInternalData) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); VmBalloonInfo balloonInfo = vmInternalData.getVmStatistics().getVmBalloonInfo(); return savedVm.getMinAllocatedMem() < savedVm.getMemSizeMb() && savedVm.getMinAllocatedMem() < savedVm.getTotalMemorySizeInBytes() && balloonInfo.isBalloonDeviceEnabled() && balloonInfo.getBalloonTargetMemory() != balloonInfo.getBalloonMaxMemory(); }

Target:
private boolean isBalloonDeviceActiveOnVm(VmInternalData vmInternalData) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); if (savedVm != null) { VmBalloonInfo balloonInfo = vmInternalData.getVmStatistics().getVmBalloonInfo(); return savedVm.getMinAllocatedMem() < savedVm.getMemSizeMb() && balloonInfo.isBalloonDeviceEnabled() && balloonInfo.getBalloonTargetMemory().intValue() != balloonInfo.getBalloonMaxMemory().intValue(); } return false; }
Source:
public void compileRoutes() { if (routes != null) { throw new IllegalStateException("Routes already compiled"); } List<Route> routesLocal = new ArrayList<>(); allRouteBuilders.forEach(routeBuilder -> { routesLocal.add(routeBuilder.buildRoute(injector)); }); this.routes = ImmutableList.copyOf(routesLocal); this.reverseRoutes = new HashMap<>(this.routes.size()); this.routes.forEach(route -> { Class<?> methodClass = route.getControllerClass(); String methodName = Optional.ofNullable(route.getControllerMethod()) .map(Method::getName) .orElse(""); MethodReference controllerMethodRef = new MethodReference(methodClass, methodName); if (this.reverseRoutes.containsKey(controllerMethodRef)) { } else { this.reverseRoutes.put(controllerMethodRef, route); } if (route.isHttpMethodWebSocket()) { if (this.webSockets == null) { throw new IllegalStateException( "WebSockets instance was null. Unable to configure route " + route.getUri() + "."); } if (!this.webSockets.isEnabled()) { throw new IllegalStateException( "WebSockets are not enabled. Unable to configure route " + route.getUri() + "." + " Using implementation " + this.webSockets.getClass().getCanonicalName()); } webSockets.compileRoute(route); } }); logRoutes(); }

Target:
public void compileRoutes() { if (routes != null) { throw new IllegalStateException("Routes already compiled"); } List<Route> routesLocal = new ArrayList<>(); allRouteBuilders.forEach(routeBuilder -> { routesLocal.add(routeBuilder.buildRoute(injector)); }); this.routes = ImmutableList.copyOf(routesLocal); this.reverseRoutes = new HashMap<>(this.routes.size()); this.routes.forEach(route -> { Class<?> methodClass = route.getControllerClass(); String methodName = route.getControllerMethod().getName(); MethodReference controllerMethodRef = new MethodReference(methodClass, methodName); if (this.reverseRoutes.containsKey(controllerMethodRef)) { } else { this.reverseRoutes.put(controllerMethodRef, route); } if (route.isHttpMethodWebSocket()) { if (this.webSockets == null) { throw new IllegalStateException( "WebSockets instance was null. Unable to configure route " + route.getUri() + "."); } if (!this.webSockets.isEnabled()) { throw new IllegalStateException( "WebSockets are not enabled. Unable to configure route " + route.getUri() + "." + " Using implementation " + this.webSockets.getClass().getCanonicalName()); } webSockets.compileRoute(route); } }); logRoutes(); }
Source:
public ResponseEntity<List<GetCommitResponse>> listCommits(@PathVariable("projectId") Long projectId) { List<Commit> commits = getCommitsInProjectUseCase.get(projectId); int commitsSize = commits.size(); List<GetCommitResponse> responses = new ArrayList<>(commitsSize); for(int i = 0; i < commitsSize; ++i){ Commit commit = commits.get(i); responses.add(new GetCommitResponse() .setName(commit.getName()) .setAnalyzed(commit.isAnalyzed()) .setAuthor(commit.getAuthor()) .setComment(commit.getComment()) .setTimestamp(commit.getTimestamp())); } return new ResponseEntity<>(responses, HttpStatus.OK); }

Target:
public ResponseEntity<List<GetCommitResponse>> listCommits(@PathVariable("projectId") Long projectId) { List<Commit> commits = getCommitsInProjectUseCase.get(projectId); List<GetCommitResponse> responses = new ArrayList<>(commits.size()); for (Commit commit : commits) { responses.add(new GetCommitResponse() .setName(commit.getName()) .setAnalyzed(commit.isAnalyzed()) .setAuthor(commit.getAuthor()) .setComment(commit.getComment()) .setTimestamp(commit.getTimestamp())); } return new ResponseEntity<>(responses, HttpStatus.OK); }
Source:
public ImmutableList<? extends Step> getBuildSteps( BuildContext context, BuildableContext buildableContext) { buildableContext.recordArtifact(outputPath); ImmutableList.Builder<String> compilerCommand = ImmutableList.builder(); compilerCommand.addAll(swiftCompiler.getCommandPrefix(context.getSourcePathResolver())); compilerCommand.add( "-module-name", this.moduleName, "-module-name", this.moduleName, "-c", this.bitcodePath.toString(), "-o", this.outputPath.toString()); compilerCommand.addAll(Arg.stringify(compilerFlags, context.getSourcePathResolver())); compilerCommand.add("-disable-llvm-optzns"); ProjectFilesystem projectFilesystem = getProjectFilesystem(); return ImmutableList.of( MkdirStep.of( BuildCellRelativePath.fromCellRelativePath( context.getBuildCellRootPath(), getProjectFilesystem(), outputPath.getParent())), new SwiftCompileStep( projectFilesystem.getRootPath(), ImmutableMap.of(), compilerCommand.build())); }

Target:
public ImmutableList<? extends Step> getBuildSteps( BuildContext context, BuildableContext buildableContext) { buildableContext.recordArtifact(outputPath); ImmutableList.Builder<String> compilerCommand = ImmutableList.builder(); compilerCommand.addAll(swiftCompiler.getCommandPrefix(context.getSourcePathResolver())); compilerCommand.add( "-module-name", this.moduleName, "-c", this.bitcodePath.toString(), "-o", this.outputPath.toString()); compilerCommand.addAll(Arg.stringify(compilerFlags, context.getSourcePathResolver())); compilerCommand.add("-disable-llvm-optzns"); ProjectFilesystem projectFilesystem = getProjectFilesystem(); return ImmutableList.of( MkdirStep.of( BuildCellRelativePath.fromCellRelativePath( context.getBuildCellRootPath(), getProjectFilesystem(), outputPath.getParent())), new SwiftCompileStep( projectFilesystem.getRootPath(), ImmutableMap.of(), compilerCommand.build())); }
Source:
public static Maybe<Map<Object,Object>> getAsYamlMap(Object planData) { if (!(planData instanceof String)) return Maybe.absent("not a string"); Iterable<Object> result; try { result = Yamls.parseAll((String)planData); } catch (Exception e) { Exceptions.propagateIfFatal(e); return Maybe.absent(e); } Iterator<Object> ri = result.iterator(); if (!ri.hasNext()) return Maybe.absent("YAML has no elements in it"); Object r1 = ri.next(); if (ri.hasNext()) return Maybe.absent("YAML has multiple elements in it"); if (r1 instanceof Map) return Maybe.of((Map<Object,Object>)r1); return Maybe.absent("YAML does not contain a map"); }

Target:
public static Maybe<Map<?,?>> getAsYamlMap(Object planData) { if (!(planData instanceof String)) return Maybe.absent("not a string"); Iterable<Object> result; try { result = Yamls.parseAll((String)planData); } catch (Exception e) { Exceptions.propagateIfFatal(e); return Maybe.absent(e); } Iterator<Object> ri = result.iterator(); if (!ri.hasNext()) return Maybe.absent("YAML has no elements in it"); Object r1 = ri.next(); if (ri.hasNext()) return Maybe.absent("YAML has multiple elements in it"); if (r1 instanceof Map) return (Maybe<Map<?,?>>)(Maybe<?>) Maybe.of(r1); return Maybe.absent("YAML does not contain a map"); }
Source:
public ElementOption withElement(WebElement element) { checkNotNull(element); checkArgument(true, "Element should be an instance of the class which " + "extends org.openqa.selenium.remote.RemoteWebElement", (HasIdentity.class.isAssignableFrom(element.getClass()))); elementId = HasIdentity.class.cast(element).getId(); return this; }

Target:
public ElementOption withElement(WebElement element) { checkNotNull(element); checkArgument(true, "Element should be an instance of the class which " + "implements org.openqa.selenium.internal.HasIdentity", element instanceof HasIdentity); elementId = ((HasIdentity) element).getId(); return this; }
Source:
public static int getPort() { if (instance != null) { return instance.port; } else { return -1; } }

Target:
int getPort() { return port; }
Source:
protected boolean isOsSupported(VM vm) { String[] oses = Config.<String> GetValue(ConfigValues.HotPlugSupportedOsList).split(","); for (String os : oses) { if (os.equalsIgnoreCase(vm.getguest_os())) { return true; } } addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED); return false; }

Target:
protected boolean isOsSupported(VM vm) { for (String os : oses) { if (os.equalsIgnoreCase(vm.getguest_os())) { return true; } } addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED); return false; }
Source:
public List<Project.NameKey> get() throws OrmException { final List<Project.NameKey> r = new ArrayList<Project.NameKey>(); for (Project.NameKey p : projectCache.all()) { try { final ProjectControl project = projectControlFactory.controlFor(p); final Project.NameKey parent = project.getProject().getParent(); if (parent != null) { ProjectControl c = projectControlFactory.controlFor(parent); if (c.isVisible() || c.isOwner()) { if (!r.contains(parent)) { r.add(parent); } } } } catch (NoSuchProjectException e) { continue; } } if (!r.contains(allProject)) { r.add(allProject); } Collections.sort(r); return r; }

Target:
public List<Project.NameKey> get() throws OrmException, NoSuchProjectException { final List<Project.NameKey> result = new ArrayList<Project.NameKey>(); List<Project> pList = getParentCandidates(); for (Project p : pList) { result.add(p.getNameKey()); } return result; }
Source:
public void invoke(ExtMap input, ExtMap output) { try { if (tasks != null) { tasks.execute(); } if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.LOAD)) { doLoad(input, output); } else if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.INITIALIZE)) { doInit(input, output); } else if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.TERMINATE)) { } else if ( (input.get(Base.InvokeKeys.COMMAND).equals(Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS)) || (input.get(Base.InvokeKeys.COMMAND).equals(Authn.InvokeCommands.CREDENTIALS_CHANGE)) ) { doAuth(input, output); } else { output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.UNSUPPORTED); throw new IllegalArgumentException("unsupported:" + input.get(Base.InvokeKeys.COMMAND)); } } catch (Throwable e) { LOG.error( "Unexpected Exception invoking: {}", input.get(Base.InvokeKeys.COMMAND) ); LOG.debug( "Exception:", e ); output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED); } }

Target:
public void invoke(ExtMap input, ExtMap output) { try { if (tasks != null) { tasks.execute(); } if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.LOAD)) { doLoad(input); } else if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.INITIALIZE)) { doInit(input); } else if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.TERMINATE)) { } else if ( (input.get(Base.InvokeKeys.COMMAND).equals(Authn.InvokeCommands.AUTHENTICATE_CREDENTIALS)) || (input.get(Base.InvokeKeys.COMMAND).equals(Authn.InvokeCommands.CREDENTIALS_CHANGE)) ) { doAuth(input, output); } else { output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.UNSUPPORTED); throw new IllegalArgumentException("unsupported:" + input.get(Base.InvokeKeys.COMMAND)); } output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); } catch (Throwable e) { LOG.error( "Unexpected Exception invoking: {}", input.get(Base.InvokeKeys.COMMAND) ); LOG.debug( "Exception:", e ); output.putIfAbsent(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED); output.put(Base.InvokeKeys.MESSAGE, e.getMessage()); } }
Source:
private static void complete(AbstractFuture<?> future) { boolean maskExecutorExceptions = future != null ? future.maskExecutorExceptions : true; Listener next = null; outer: while (true) { future.releaseWaiters(); future.afterDone(); next = future.clearListeners(next); future = null; while (next != null) { Listener curr = next; next = next.next; Runnable task = curr.task; if (task instanceof AbstractFuture.SetFuture) { AbstractFuture.SetFuture<?> setFuture = (AbstractFuture.SetFuture) task; future = setFuture.owner; if (future.value == setFuture) { Object valueToSet = getFutureValue(setFuture.future); if (ATOMIC_HELPER.casValue(future, setFuture, valueToSet)) { continue outer; } } } else { executeListener(task, curr.executor, maskExecutorExceptions); } } break; } }

Target:
private static void complete(AbstractFuture<?> future) { boolean maskExecutorExceptions = future.maskExecutorExceptions; Listener next = null; outer: while (true) { future.releaseWaiters(); future.afterDone(); next = future.clearListeners(next); future = null; while (next != null) { Listener curr = next; next = next.next; Runnable task = curr.task; if (task instanceof AbstractFuture.SetFuture) { AbstractFuture.SetFuture<?> setFuture = (AbstractFuture.SetFuture) task; future = setFuture.owner; if (future.value == setFuture) { Object valueToSet = getFutureValue(setFuture.future); if (ATOMIC_HELPER.casValue(future, setFuture, valueToSet)) { continue outer; } } } else { executeListener(task, curr.executor, maskExecutorExceptions); } } break; } }