auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } List<Boolean> validationResults = new ArrayList<>(expressions.size()); for (String expression : expressions) { Object value; try { value = jsMagmaScriptEvaluator.eval(expression, entity); } catch (ScriptExecutionException see) { validationResults.add(false); continue; } validationResults.add(value != null ? Boolean.valueOf(value.toString()) : null); } return validationResults; }

Target:
List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } List<Boolean> validationResults = new ArrayList<>(expressions.size()); for (String expression : expressions) { Object value = jsMagmaScriptEvaluator.eval(expression, entity); validationResults.add(value != null ? Boolean.valueOf(value.toString()) : null); } return validationResults; }
Source:
private void writeProperties(File file) { FileOutputStream outputStream = null; try { File formProperties = new File(file, "form.properties"); outputStream = new FileOutputStream(formProperties); Properties properties = new Properties(); SharedPreferences settings = CommCareApplication._().getCurrentApp().getAppPreferences(); String postUrl = settings.getString(CommCarePreferences.PREFS_SUBMISSION_URL_KEY, c.getString(R.string.PostURL)); properties.setProperty("PostURL", postUrl); properties.store(outputStream, null); } catch(IOException e){ e.printStackTrace(); } finally{ if(outputStream != null){ try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } }

Target:
private void writeProperties(File file) throws IOException{ FileOutputStream outputStream = null; try { File formProperties = new File(file, "form.properties"); outputStream = new FileOutputStream(formProperties); Properties properties = new Properties(); SharedPreferences settings = CommCareApplication._().getCurrentApp().getAppPreferences(); String postUrl = settings.getString(CommCarePreferences.PREFS_SUBMISSION_URL_KEY, c.getString(R.string.PostURL)); properties.setProperty("PostURL", postUrl); properties.store(outputStream, null); } finally{ if(outputStream != null){ try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } }
Source:
public DataFileWriter<D> appendTo(SeekableInput in, OutputStream out) throws IOException { assertNotOpen(); DataFileReader<D> reader = null; try { reader = new DataFileReader<D>(in, new GenericDatumReader<D>()); this.schema = reader.getSchema(); this.sync = reader.getHeader().sync; this.meta.putAll(reader.getHeader().meta); byte[] codecBytes = this.meta.get(DataFileConstants.CODEC); if (codecBytes != null) { String strCodec = new String(codecBytes, "UTF-8"); this.codec = CodecFactory.fromString(strCodec).createInstance(); } else { this.codec = CodecFactory.nullCodec().createInstance(); } } finally { if (reader != null) reader.close(); in.close(); } init(out); return this; }

Target:
public DataFileWriter<D> appendTo(SeekableInput in, OutputStream out) throws IOException { assertNotOpen(); DataFileReader<D> reader = new DataFileReader<D>(in, new GenericDatumReader<D>()); this.schema = reader.getSchema(); this.sync = reader.getHeader().sync; this.meta.putAll(reader.getHeader().meta); byte[] codecBytes = this.meta.get(DataFileConstants.CODEC); if (codecBytes != null) { String strCodec = new String(codecBytes, "UTF-8"); this.codec = CodecFactory.fromString(strCodec).createInstance(); } else { this.codec = CodecFactory.nullCodec().createInstance(); } init(out); return this; }
Source:
public HostAvailabilityListener withMinHosts(int numHosts) { if (moveMgr.getConnectionPolicy() == DatabaseClient.ConnectionPolicy.PRIMARY_HOST) { if (numHosts != 0) { throw new IllegalArgumentException("numHosts must be 1 when using only the primary host for the connection"); } } else { if (numHosts <= 0) throw new IllegalArgumentException("numHosts must be > 0"); int numConfigHosts = moveMgr.readForestConfig().getPreferredHosts().length; if (numHosts > numConfigHosts) throw new IllegalArgumentException ("numHosts must be less than or equal to the number of hosts in the cluster"); } this.minHosts = numHosts; return this; }

Target:
public HostAvailabilityListener withMinHosts(int numHosts) { if (moveMgr.getConnectionType() == DatabaseClient.ConnectionType.GATEWAY) { if (numHosts != 1) { throw new IllegalArgumentException("numHosts must be 1 when using only the primary host for the connection"); } } else { if (numHosts <= 0) throw new IllegalArgumentException("numHosts must be > 0"); int numConfigHosts = moveMgr.readForestConfig().getPreferredHosts().length; if (numHosts > numConfigHosts) throw new IllegalArgumentException ("numHosts must be less than or equal to the number of hosts in the cluster"); } this.minHosts = numHosts; return this; }
Source:
public void addGraphType(String pResourceName, final Class<?> pGraphClass) { aNewDiagramMap.put(aAppResources.getString(pResourceName + ".text"), pEvent -> { try { GraphFrame frame = new GraphFrame((Graph) pGraphClass.newInstance(), aTabbedPane); addTab(frame); } catch (Exception exception) { exception.printStackTrace(); } }); aNewMenu.getItems().add(aAppFactory.createMenuItem(pResourceName, pEvent -> { try { GraphFrame frame = new GraphFrame((Graph) pGraphClass.newInstance(), aTabbedPane); addTab(frame); } catch (Exception exception) { exception.printStackTrace(); } })); }

Target:
public void addGraphType(String pResourceName, final Class<?> pGraphClass) { aNewDiagramMap.put(aAppResources.getString(pResourceName + ".text"), pEvent -> { try { GraphFrame frame = new GraphFrame((Graph) pGraphClass.newInstance(), aTabbedPane); addTab(frame); } catch (InstantiationException | IllegalAccessException exception) { assert false; } }); aNewMenu.getItems().add(aAppFactory.createMenuItem(pResourceName, pEvent -> { try { GraphFrame frame = new GraphFrame((Graph) pGraphClass.newInstance(), aTabbedPane); addTab(frame); } catch (InstantiationException | IllegalAccessException exception) { assert false; } })); }
Source:
private void init() { snapshotWriter = new StreamsSnapshotWriter(runtime, config, logReplicationMetadataManager); logEntryWriter = new LogEntryWriter(runtime, config, logReplicationMetadataManager); CorfuStoreMetadata.Timestamp ts = logReplicationMetadataManager.getTimestamp(); logEntryWriter.reset(logReplicationMetadataManager.getLastSrcBaseSnapshotTimestamp(ts), logReplicationMetadataManager.getLastProcessedLogTimestamp(ts)); logEntrySinkBufferManager = new LogEntrySinkBufferManager(ackCycleTime, ackCycleCnt, bufferSize, logReplicationMetadataManager.getLastProcessedLogTimestamp(ts), this); readConfig(); }

Target:
private void init() { snapshotWriter = new StreamsSnapshotWriter(runtime, config, logReplicationMetadataManager); logEntryWriter = new LogEntryWriter(runtime, config, logReplicationMetadataManager); CorfuStoreMetadata.Timestamp ts = logReplicationMetadataManager.getTimestamp(); logEntryWriter.reset(logReplicationMetadataManager.getLastSrcBaseSnapshotTimestamp(ts), logReplicationMetadataManager.getLastProcessedLogTimestamp(ts)); logEntrySinkBufferManager = new LogEntrySinkBufferManager(ackCycleTime, ackCycleCnt, bufferSize,this); snapshotSinkBufferManager = new SnapshotSinkBufferManager(ackCycleTime, ackCycleCnt, bufferSize, this); readConfig(); }
Source:
public PerformSearchResponse performSearch(JsonRpcPeer peer, final JSONObject params) { return mDOMProvider.postAndWait(new UncheckedCallable<PerformSearchResponse>() { @Override public PerformSearchResponse call() { final PerformSearchRequest request = mObjectMapper.convertValue( params, PerformSearchRequest.class); final String lowerCaseQuery = request.query.toLowerCase(); final Object root = mShadowDOM.getRootElement(); final String id = UUID.randomUUID().toString(); final ArrayList<Integer> results = new ArrayList<>(); findMatches(lowerCaseQuery, root, results); mSearchResults.put(id, results); final PerformSearchResponse response = new PerformSearchResponse(); response.searchId = id; response.resultCount = results.size(); return response; } }); }

Target:
public PerformSearchResponse performSearch(JsonRpcPeer peer, final JSONObject params) { final PerformSearchRequest request = mObjectMapper.convertValue( params, PerformSearchRequest.class); final Pattern queryPattern = Pattern.compile(Pattern.quote(request.query), Pattern.CASE_INSENSITIVE); ArrayList<Integer> results = mDOMProvider.postAndWait(new UncheckedCallable<ArrayList<Integer>>() { @Override public ArrayList<Integer> call() { final Object rootElement = mShadowDOM.getRootElement(); final ArrayList<Integer> results = new ArrayList<>(); findMatches(queryPattern, rootElement, results); return results; } }); final String id = String.valueOf(mResultCounter.getAndIncrement()); mSearchResults.put(id, results); final PerformSearchResponse response = new PerformSearchResponse(); response.searchId = id; response.resultCount = results.size(); return response; }
Source:
public String getEditCopyActionLink() { return editCopyActionLink; }

Target:
public String getEditCopyActionLink() { return getInstructorFeedbackEditCopyActionLink(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); }
Source:
public void start(String[] filename, int playerCount) { addToLog("[LAUNCHER]\tLoading files: " + Arrays.toString(filename) + "."); try { MapParser mp = new MapParser(new BasicUnitFactory()); ArrayList<Level> levelList = new ArrayList<>(); UnitFactory unitFactory = new BasicUnitFactory(); for(String levelFileName : filename) { InputStream map = getClass().getResourceAsStream(levelFileName); Level level = mp.parseMap(map); levelList.add(level); } addToLog("[LAUNCHER]\tLoading files: " + Arrays.toString(filename) + " succeeded."); Game game = new Game(levelList, unitFactory, playerCount); Map<Integer, Action> keyMappings = createKeyMappings(game); JBubbleBobbleUI ui = new JBubbleBobbleUI(game, keyMappings); InputStream map = getClass().getResourceAsStream("/game_over.txt"); Level gameOverLevel = mp.parseMap(map); game.setGameOver(gameOverLevel); InputStream winMap = getClass().getResourceAsStream("/game_won.txt"); Level gameWonLevel = mp.parseMap(winMap); game.setGameWon(gameWonLevel); game.setKeyListener(ui.getKeyListener()); ui.start(); startScheduler(game); } catch (IOException e) { addToLog("[ERROR]\tLoading file: " + Arrays.toString(filename) + " failed."); DumpLog.getInstance().createDump(); throw new RuntimeException(); } }

Target:
public void start(String[] filename, int playerCount) { addToLog("[LAUNCHER]\tLoading files: " + Arrays.toString(filename) + "."); try { MapParser parser = new MapParser(new BasicUnitFactory()); ArrayList<Level> levelList = new ArrayList<>(); UnitFactory unitFactory = new BasicUnitFactory(); for(String levelFileName : filename) { InputStream map = getClass().getResourceAsStream(levelFileName); Level level = parser.parseMap(map); levelList.add(level); } addToLog("[LAUNCHER]\tLoading files: " + Arrays.toString(filename) + " succeeded."); Game game = new Game(levelList, unitFactory, playerCount); Map<Integer, Action> keyMappings = createKeyMappings(game); JBubbleBobbleUI ui = new JBubbleBobbleUI(game, keyMappings); InputStream map = getClass().getResourceAsStream("/game_over.txt"); Level gameOverLevel = parser.parseMap(map); game.setGameOver(gameOverLevel); InputStream winMap = getClass().getResourceAsStream("/game_won.txt"); Level gameWonLevel = parser.parseMap(winMap); game.setGameWon(gameWonLevel); game.setKeyListener(ui.getKeyListener()); ui.start(); startScheduler(game); } catch (IOException e) { addToLog("[ERROR]\tLoading file: " + Arrays.toString(filename) + " failed."); DumpLog.getInstance().createDump(); throw new RuntimeException(); } }
Source:
public History[] refreshHistory(int limit, int offset) throws Exception { Map<String,String> params = new HashMap<>(); params.put("limit", String.valueOf(limit)); params.put("offset", String.valueOf(offset)); return constructHistory(params); }

Target:
public History[] refreshHistory(int limit, int offset) throws Exception { final Map<String,String> params = new HashMap<>(); params.put("limit", String.valueOf(limit)); params.put("offset", String.valueOf(offset)); return constructHistory(params); }
Source:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() != VdcBllErrors.ImageDoesNotExistInDomainError) { throw e; } } if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() != VdcBllErrors.ImageDoesNotExistInDomainError) { throw e; } log.debugFormat("The image group with id {0} wasn't actually deleted from the storage domain {1} because it didn't exist in it", getDiskImage().getId(), getStorageDomainId()); } if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { performImageDbOperations(); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessage(receiveMode, sequenceNumber)) .map(receivedMessage -> { if (receiveMode == ReceiveMode.PEEK_LOCK && !Objects.isNull(receivedMessage.getLockToken())) { UUID lockToken = UUID.fromString(receivedMessage.getLockToken()); if (!ZERO_LOCK_TOKEN.equals(lockToken)) { messageLockContainer.addOrUpdate(lockToken, receivedMessage.getLockedUntil()); } } return receivedMessage; }); }

Target:
public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessage(receiveMode, sequenceNumber)) .map(receivedMessage -> { if (receiveMode == ReceiveMode.PEEK_LOCK && !CoreUtils.isNullOrEmpty(receivedMessage.getLockToken())) { receivedMessage.setLockedUntil(messageLockContainer.addOrUpdate(receivedMessage.getLockToken(), receivedMessage.getLockedUntil())); } return receivedMessage; }); }
Source:
protected void handleSwingNodeClick(TreePath path, final int swingMouseButton) { if (getUpdateSwingFromScoutLock().isAcquired()) { return; } if (getScoutObject() != null) { ensurePathSelected(path); final ITreeNode scoutNode = treePathToScoutNode(path); if (scoutNode != null) { Runnable t = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireNodeClickFromUI(scoutNode, SwingUtility.swingToScoutMouseButton(swingMouseButton)); getScoutObject().getUIFacade().setNodesCheckedFromUI(CollectionUtility.arrayList(scoutNode), !scoutNode.isChecked()); } }; getSwingEnvironment().invokeScoutLater(t, 0); } } }

Target:
protected void handleSwingNodeClick(TreePath path, final int swingMouseButton) { if (getUpdateSwingFromScoutLock().isAcquired()) { return; } if (getScoutObject() != null) { ensurePathSelected(path); final ITreeNode scoutNode = treePathToScoutNode(path); if (scoutNode != null) { Runnable t = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireNodeClickFromUI(scoutNode, SwingUtility.swingToScoutMouseButton(swingMouseButton)); if (getScoutObject().isCheckable()) { getScoutObject().getUIFacade().setNodesCheckedFromUI(CollectionUtility.arrayList(scoutNode), !scoutNode.isChecked()); } } }; getSwingEnvironment().invokeScoutLater(t, 0); } } }
Source:
private void downloadNotebook(String noteId, FileObject rootDir) throws IOException { logger.debug("download notebook from hdfs: " + rootDir.getName().getBaseName()); OneFileStatus fileStatus; Gson gson = new Gson(); String notebook = this.hdfsNotebookDir + "/" + noteId + "/" + NOTE_JSON; try { String notebookStatus = this.hdfsCmd.runCommand(this.hdfsCmd.getFileStatus, notebook, null); fileStatus = gson.fromJson(notebookStatus, OneFileStatus.class); } catch (Exception e) { logger.warn("Warning: ", e); return; } long length = fileStatus.length; if (length > this.hdfsMaxLength) { this.hdfsCmd = new HDFSCommand(this.hdfsUrl, this.hdfsUser, logger, (int) length); } FileObject noteDir; try { noteDir = rootDir.resolveFile(noteId, NameScope.CHILD); this.hdfsCmd.runCommand(this.hdfsCmd.openFile, notebook, noteDir, conf.getString(ConfVars.ZEPPELIN_ENCODING), null); } catch (Exception e) { throw new IOException(e.getCause()); } }

Target:
private void downloadNotebook(String noteId, FileObject rootDir) throws IOException { logger.debug("download notebook from hdfs: " + rootDir.getName().getBaseName()); OneFileStatus fileStatus; Gson gson = new Gson(); String notebook = this.hdfsNotebookDir + "/" + noteId + "/" + NOTE_JSON; try { String notebookStatus = this.hdfsCmd.runCommand(this.hdfsCmd.getFileStatus, notebook, null); fileStatus = gson.fromJson(notebookStatus, OneFileStatus.class); } catch (Exception e) { logger.warn("exception occurred during checking hdfs file status: ", e); return; } long length = fileStatus.length; if (length > this.hdfsMaxLength) { this.hdfsCmd = new HDFSCommand(this.hdfsUrl, this.hdfsUser, logger, (int) length); } FileObject noteDir; try { noteDir = rootDir.resolveFile(noteId, NameScope.CHILD); this.hdfsCmd.runCommand(this.hdfsCmd.openFile, notebook, noteDir, conf.getString(ConfVars.ZEPPELIN_ENCODING), null); } catch (Exception e) { throw new IOException(e.getCause()); } }
Source:
private Assignment forgeMapping(SourceRHS sourceRHS) { Type sourceType = sourceRHS.getSourceType(); if ( sourceType.isPrimitive() || targetType.isPrimitive() ) { return null; } String name = getName( sourceType, targetType ); List<Parameter> parameters = new ArrayList( method.getContextParameters() ); ForgedMethod forgedMethod; if ( method.isUpdateMethod() ) { parameters.add( Parameter.forForgedMappingTarget( targetType ) ); forgedMethod = new ForgedMethod( name, sourceType, ctx.getTypeFactory().getType( ctx.getTypeUtils().getNoType( TypeKind.VOID ) ), method.getMapperConfiguration(), method.getExecutable(), parameters, getForgedMethodHistory( sourceRHS ) ); } else { forgedMethod = new ForgedMethod( name, sourceType, targetType, method.getMapperConfiguration(), method.getExecutable(), parameters, getForgedMethodHistory( sourceRHS ) ); } Assignment assignment = new MethodReference( forgedMethod, null, ParameterBinding.fromParameters( forgedMethod.getParameters() ) ); assignment.setAssignment( sourceRHS ); this.forgedMethods.add( forgedMethod ); return assignment; }

Target:
private Assignment forgeMapping(SourceRHS sourceRHS) { Type sourceType = sourceRHS.getSourceType(); if ( sourceType.isPrimitive() || targetType.isPrimitive() ) { return null; } String name = getName( sourceType, targetType ); List<Parameter> parameters = new ArrayList( method.getContextParameters() ); Type returnType; if ( method.isUpdateMethod() ) { parameters.add( Parameter.forForgedMappingTarget( targetType ) ); returnType = ctx.getTypeFactory().createVoidType(); } else { returnType = targetType; } ForgedMethod forgedMethod = new ForgedMethod( name, sourceType, returnType, method.getMapperConfiguration(), method.getExecutable(), parameters, getForgedMethodHistory( sourceRHS ) ); Assignment assignment = new MethodReference( forgedMethod, null, ParameterBinding.fromParameters( forgedMethod.getParameters() ) ); assignment.setAssignment( sourceRHS ); this.forgedMethods.add( forgedMethod ); return assignment; }
Source:
public EventHubClientBuilder initialPartitionPublishingStates(Map<String, PartitionPublishingProperties> states) { if (states != null) { this.initialPartitionPublishingStates = new HashMap<>(); states.forEach((partitionId, state) -> { this.initialPartitionPublishingStates.put(partitionId, new PartitionPublishingState(state)); }); } return this; }

Target:
public EventHubClientBuilder initialPartitionPublishingStates(Map<String, PartitionPublishingProperties> states) { if (states != null) { this.initialPartitionPublishingStates = new HashMap<>(); states.forEach((partitionId, state) -> { this.initialPartitionPublishingStates.put(partitionId, new PartitionPublishingState(state)); }); this.initialPartitionPublishingStates = Collections.unmodifiableMap(this.initialPartitionPublishingStates); } else { this.initialPartitionPublishingStates = null; } return this; }
Source:
public void checkRemoteStatusOf(Task task) { if (!task.remoteId().isPresent()) { log.error("attempted to check remote status for task with no remote id", task.id()); } resultHandler.handleRemoteCheckResult(task, client.checkRemoteStatusOf(task.remoteId().get())); }

Target:
public void checkRemoteStatusOf(Task task) { if (!task.remoteId().isPresent()) { throw new RuntimeException("attempted to check remote status for task " + task.id() + " with no remote id"); } resultHandler.handleRemoteCheckResult(task, client.checkRemoteStatusOf(task.remoteId().get())); }
Source:
public UserAgentPolicy(String applicationId, String sdkName, String sdkVersion, Configuration configuration, ServiceVersion version) { boolean telemetryDisabled = configuration.get(Configuration.PROPERTY_AZURE_TELEMETRY_DISABLED, false); if (telemetryDisabled) { this.userAgent = String.format(DISABLED_TELEMETRY_USER_AGENT_FORMAT, sdkName, sdkVersion, version.getVersion()); } else { if (applicationId == null) { this.userAgent = String.format(USER_AGENT_FORMAT, sdkName, sdkVersion, getPlatformInfo(), version.getVersion()); } else { this.userAgent = String.format(APPLICATION_ID_USER_AGENT_FORMAT, applicationId, sdkName, sdkVersion, getPlatformInfo(), version.getVersion()); } } }

Target:
public UserAgentPolicy(String applicationId, String sdkName, String sdkVersion, Configuration configuration, ServiceVersion version) { Objects.requireNonNull(configuration, "'configuration' cannot be null."); boolean telemetryDisabled = configuration.get(Configuration.PROPERTY_AZURE_TELEMETRY_DISABLED, false); if (telemetryDisabled) { this.userAgent = String.format(DISABLED_TELEMETRY_USER_AGENT_FORMAT, sdkName, sdkVersion, version.getVersion()); } else { if (applicationId == null) { this.userAgent = String.format(USER_AGENT_FORMAT, sdkName, sdkVersion, getPlatformInfo(), version.getVersion()); } else { this.userAgent = String.format(APPLICATION_ID_USER_AGENT_FORMAT, applicationId, sdkName, sdkVersion, getPlatformInfo(), version.getVersion()); } } }
Source:
private boolean handleForget() { if ((_theXAResource != null) && (_tranID != null)) { _heuristic = TwoPhaseOutcome.FINISH_OK; try { _theXAResource.forget(_tranID); } catch (Exception e) { return false; } } return true; }

Target:
private void handleForget() throws org.omg.CORBA.SystemException { if ((_theXAResource != null) && (_tranID != null)) { try { _theXAResource.forget(_tranID); _heuristic = TwoPhaseOutcome.FINISH_OK; _forgotten = true; } catch (Exception e) { jtaLogger.i18NLogger.warn_recovery_forgetfailed( "XAResourceRecord forget failed:", e); throw new UNKNOWN(e.getMessage()); } } }
Source:
public Builder assetFile(Context context, final String assetFile) { if (context == null) { throw new IllegalArgumentException("A non-null Context must be provided"); } if (TextUtils.isEmpty(assetFile)) { throw new IllegalArgumentException("A non-empty asset file path must be provided"); } if (new File(folder, fileName).exists()) { throw new RealmException("Asset file can not be used if Realm file exists."); } if (durability == SharedGroup.Durability.MEM_ONLY) { throw new RealmException("Realm can not use in-memory configuration if asset file is present."); } this.contextWeakRef = new WeakReference<>(context); this.assetFilePath = assetFile; return this; }

Target:
public Builder assetFile(Context context, final String assetFile) { if (context == null) { throw new IllegalArgumentException("A non-null Context must be provided"); } if (TextUtils.isEmpty(assetFile)) { throw new IllegalArgumentException("A non-empty asset file path must be provided"); } if (durability == SharedGroup.Durability.MEM_ONLY) { throw new RealmException("Realm can not use in-memory configuration if asset file is present."); } this.contextWeakRef = new WeakReference<>(context); this.assetFilePath = assetFile; return this; }
Source:
public void parseSingleGeneTest() { ArrayList<Gene> genes = new ArrayList<>(); Map<String, Label> labelMap = new HashMap<>(); Map<Integer, Gene> geneStart = new HashMap<>(); Map<Integer, Gene> geneEnd = new HashMap<>(); String line = "585 Corndogp005 chr - 1110 1581 1110 1581 1 1110, 1581, 5 none cmpl cmpl 0,"; Integer start = 1110; Integer end = 1581; Gene gene = new Gene("Corndogp005", start, end); GeneData.parseGene(line, genes, geneStart, geneEnd, labelMap); assertTrue(genes.get(0).equals(gene)); assertTrue(geneStart.get(start).equals(gene)); assertTrue(geneEnd.get(end).equals(gene)); }

Target:
public void parseSingleGeneTest() { ArrayList<Gene> genes = new ArrayList<>(); Map<String, Label> labelMap = new HashMap<>(); Map<Integer, Gene> geneStart = new HashMap<>(); Map<Integer, Gene> geneEnd = new HashMap<>(); String line = "MT_H37RV_BRD_V5\tnull\tCDS\t3057261\t3058073\t0.0\t-\t.\tcalhounClass=Gene;Name=alanine rich " + "protein;ID=7000008459999039;displayName=RVBD_2744c.5 alanine rich protein"; Integer start = 3057261; Integer end = 3058073; Gene gene = new Gene("RVBD_2744c.5 alanine rich protein", start, end); GeneData.parseGene(line, genes, geneStart, geneEnd, labelMap); assertTrue(genes.get(0).equals(gene)); assertTrue(geneStart.get(start).equals(gene)); assertTrue(geneEnd.get(end).equals(gene)); }
Source:
public static boolean isCounterClockwise(Geometry geometry) { if (geometry == null) return false; Coordinate[] coordinates = geometry.getCoordinates(); boolean orientation = false; try { orientation = CGAlgorithms.isCCW(coordinates); } catch (IllegalArgumentException ex) { System.err.println("Illegal Argument"); } return orientation; }

Target:
public static boolean isCounterClockwise(Geometry geometry) { if (geometry == null) return false; Coordinate[] coordinates = geometry.getCoordinates(); boolean orientation = false; orientation = CGAlgorithms.isCCW(coordinates); return orientation; }
Source:
private static void initializeRealm(Realm realm) { boolean commitChanges = false; try { realm.beginTransaction(true); long currentVersion = realm.getVersion(); boolean unversioned = currentVersion == UNVERSIONED; commitChanges = unversioned; RealmConfiguration configuration = realm.getConfiguration(); Set<Class<? extends RealmModel>> modelClasses = Collections.emptySet(); RealmProxyMediator mediator = null; if (!configuration.isReadOnly()) { if (unversioned) { realm.setVersion(configuration.getSchemaVersion()); } mediator = configuration.getSchemaMediator(); modelClasses = mediator.getModelClasses(); if (unversioned) { for (Class<? extends RealmModel> modelClass : modelClasses) { mediator.createRealmObjectSchema(modelClass, realm.getSchema()); } } } final Map<Class<? extends RealmModel>, ColumnInfo> columnInfoMap = new HashMap<>(modelClasses.size()); for (Class<? extends RealmModel> modelClass : modelClasses) { columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedRealm, false)); } realm.getSchema().setInitialColumnIndices( (unversioned) ? configuration.getSchemaVersion() : currentVersion, columnInfoMap); if (unversioned && !configuration.isReadOnly()) { final Transaction transaction = configuration.getInitialDataTransaction(); if (transaction != null) { transaction.execute(realm); } } } catch (Exception e) { commitChanges = false; throw e; } finally { if (commitChanges) { realm.commitTransaction(); } else { if (realm.isInTransaction()) { realm.cancelTransaction(); } } } }

Target:
private static void initializeRealm(Realm realm) { boolean commitChanges = false; try { realm.beginTransaction(true); long currentVersion = realm.getVersion(); boolean unversioned = currentVersion == UNVERSIONED; commitChanges = unversioned; RealmConfiguration configuration = realm.getConfiguration(); RealmProxyMediator mediator = configuration.getSchemaMediator(); Set<Class<? extends RealmModel>> modelClasses = mediator.getModelClasses(); if (unversioned) { if (configuration.isReadOnly()) { throw new IllegalArgumentException("Cannot create the Realm schema in a read-only file."); } realm.setVersion(configuration.getSchemaVersion()); for (Class<? extends RealmModel> modelClass : modelClasses) { mediator.createRealmObjectSchema(modelClass, realm.getSchema()); } } final Map<Class<? extends RealmModel>, ColumnInfo> columnInfoMap = new HashMap<>(modelClasses.size()); for (Class<? extends RealmModel> modelClass : modelClasses) { columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedRealm, false)); } realm.getSchema().setInitialColumnIndices( (unversioned) ? configuration.getSchemaVersion() : currentVersion, columnInfoMap); final Transaction transaction = configuration.getInitialDataTransaction(); if (transaction != null && unversioned) { transaction.execute(realm); } } catch (Exception e) { commitChanges = false; throw e; } finally { if (commitChanges) { realm.commitTransaction(); } else if (realm.isInTransaction()) { realm.cancelTransaction(); } } }
Source:
public TaskTracker tasks() throws Exception { Database parentDb = context.hiveDb.getDatabase(tableDesc.getDatabaseName()); LoadTable.TableLocationTuple tableLocationTuple = LoadTable.tableLocation(tableDesc, parentDb, tableContext, context); tableDesc.setLocation(tableLocationTuple.location); if (table == null) { table = tableDesc.toTable(context.hiveConf); if (isPartitioned(tableDesc)) { updateReplicationState(initialReplicationState()); if (!forNewTable().hasReplicationState()) { Task<?> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); tracker.addDependentTask(replLogTask); } return tracker; } } else { if (table.isPartitioned()) { List<AlterTableAddPartitionDesc> partitionDescs = event.partitionDescriptions(tableDesc); if (!event.replicationSpec().isMetadataOnly() && !Utils.shouldDumpMetaDataOnlyForExternalTables(table, context.hiveConf) && !partitionDescs.isEmpty()) { updateReplicationState(initialReplicationState()); if (!forExistingTable(lastReplicatedPartition).hasReplicationState()) { Task<?> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); tracker.addDependentTask(replLogTask); } return tracker; } } } return tracker; }

Target:
public TaskTracker tasks() throws Exception { Database parentDb = context.hiveDb.getDatabase(tableDesc.getDatabaseName()); LoadTable.TableLocationTuple tableLocationTuple = LoadTable.tableLocation(tableDesc, parentDb, tableContext, context); tableDesc.setLocation(tableLocationTuple.location); if (table == null) { table = tableDesc.toTable(context.hiveConf); if (isPartitioned(tableDesc)) { updateReplicationState(initialReplicationState()); if (!forNewTable().hasReplicationState()) { Task<?> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); tracker.addDependentTask(replLogTask); } return tracker; } } else { if (table.isPartitioned()) { List<AlterTableAddPartitionDesc> partitionDescs = event.partitionDescriptions(tableDesc); if (!event.replicationSpec().isMetadataOnly() && !partitionDescs.isEmpty()) { updateReplicationState(initialReplicationState()); if (!forExistingTable(lastReplicatedPartition).hasReplicationState()) { Task<?> replLogTask = ReplUtils.getTableReplLogTask(tableDesc, replLogger, context.hiveConf); tracker.addDependentTask(replLogTask); } return tracker; } } } return tracker; }
Source:
public View getView(int i, View v, ViewGroup vg) { Object mObject = objectData[i]; if(DeveloperPreferences.isGridMenuEnabled()){ MenuGridEntryView emv = (MenuGridEntryView)v; String mQuestionText = textViewHelper(mObject); if(emv == null) { emv = new MenuGridEntryView(context); } if(mQuestionText != null) { mQuestionText = Localizer.processArguments(mQuestionText, new String[] {""}).trim(); } emv.setAVT(mQuestionText, getImageURI(mObject)); return emv; } MenuListEntryView emv = (MenuListEntryView)v; String mQuestionText = textViewHelper(mObject); if(emv == null) { emv = new MenuListEntryView(context); } if(mQuestionText != null) { mQuestionText = Localizer.processArguments(mQuestionText, new String[] {""}).trim(); } emv.setAVT(mQuestionText, getAudioURI(mObject), getImageURI(mObject)); return emv; }

Target:
public View getView(int i, View v, ViewGroup vg) { Object mObject = objectData[i]; HorizontalMediaView emv = (HorizontalMediaView)v; String mQuestionText = textViewHelper(mObject); if(emv == null) { emv = new HorizontalMediaView(context); } int iconChoice = HorizontalMediaView.NAVIGATION_NEXT; if(mObject instanceof Entry) { SessionDatum datum = asw.getSession().getNeededDatum((Entry)mObject); if(datum == null) { iconChoice = HorizontalMediaView.NAVIGATION_JUMP; } else if(datum.getNodeset() == null) { iconChoice = HorizontalMediaView.NAVIGATION_JUMP; } } if(!DeveloperPreferences.isNewNavEnabled()) { iconChoice = HorizontalMediaView.NAVIGATION_NONE; } if(mQuestionText != null) { mQuestionText = Localizer.processArguments(mQuestionText, new String[] {""}).trim(); } emv.setAVT(mQuestionText, getAudioURI(mObject), getImageURI(mObject), iconChoice); return emv; }
Source:
SftpObjectDB(String path) throws TransportException { if (path.startsWith("/~")) path = path.substring(1); if (path.startsWith("~/")) path = path.substring(2); try { ftp = newSftp(); ftp.cd(path); ftp.cd(Constants.OBJECTS); objectsPath = ftp.pwd(); } catch (FtpChannel.FtpException f) { throw new TransportException(MessageFormat.format( JGitText.get().cannotEnterObjectsPath, path, f.getMessage()), f); } catch (IOException ioe) { close(); throw new TransportException(uri, ioe.getMessage(), ioe); } }

Target:
SftpObjectDB(String path) throws TransportException { if (path.startsWith("/~")) path = path.substring(1); if (path.startsWith("~/")) path = path.substring(2); try { ftp = newSftp(); ftp.cd(path); ftp.cd(OBJECTS); objectsPath = ftp.pwd(); } catch (FtpChannel.FtpException f) { throw new TransportException(MessageFormat.format( JGitText.get().cannotEnterObjectsPath, path, f.getMessage()), f); } catch (IOException ioe) { close(); throw new TransportException(uri, ioe.getMessage(), ioe); } }
Source:
private static Duration computeIndexTimeout(String timeoutValue, EvaluationContext evaluationContext) { Object evaluatedTimeout = evaluatePotentialTemplateExpression(timeoutValue, evaluationContext); if (evaluatedTimeout == null) { return Duration.ZERO; } if (evaluatedTimeout instanceof Duration) { return (Duration) evaluatedTimeout; } String val = evaluatedTimeout.toString(); if (val == null) { return Duration.ZERO; } Matcher matcher = TIMEOUT_PATTERN.matcher(val); if (matcher.find()) { long timeout = NumberUtils.parseNumber(matcher.group(1), Long.class); String unit = matcher.group(3); switch (unit) { case "d": return Duration.ofDays(timeout); case "h": return Duration.ofHours(timeout); case "m": return Duration.ofMinutes(timeout); case "s": return Duration.ofSeconds(timeout); } } throw new IllegalArgumentException( String.format("Index timeout %s cannot be parsed. Please use the pattern '\\d+\\W?[dhms]'.", val)); }

Target:
private static Duration computeIndexTimeout(String timeoutValue, EvaluationContext evaluationContext) { Object evaluatedTimeout = evaluate(timeoutValue, evaluationContext); if (evaluatedTimeout == null) { return Duration.ZERO; } if (evaluatedTimeout instanceof Duration) { return (Duration) evaluatedTimeout; } String val = evaluatedTimeout.toString(); if (val == null) { return Duration.ZERO; } return DurationStyle.detectAndParse(val); }
Source:
public int hashCode() { int hash = 3; return hash; }

Target:
public int hashCode() { int hash = 7; hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0); hash = 83 * hash + (this.parameters != null ? this.parameters.hashCode() : 0); hash = 83 * hash + (this.returnType != null ? this.returnType.hashCode() : 0); return hash; }
Source:
public void execute() throws ExecutionFailedException { if (theme == null || theme.getName().isEmpty()) { return; } themeImportFile.getParentFile().mkdirs(); try { FileUtils.write( themeImportFile, "import {applyTheme as _applyTheme} from 'theme/" + theme.getName() + "/" + theme.getName() + ".js';\nexport const applyTheme = _applyTheme;\n", StandardCharsets.UTF_8); } catch (IOException e) { throw new ExecutionFailedException("Unable to write theme import file", e); } }

Target:
public void execute() throws ExecutionFailedException { if (theme == null || theme.getName().isEmpty()) { return; } if (!themeImportFile.getParentFile().mkdirs()) { LoggerFactory.getLogger(getClass()).debug( "Didn't create folders as they probably already exist. " + "If there is a problem check access rights for folder {}", themeImportFile.getParentFile().getAbsolutePath()); } try { FileUtils.write(themeImportFile, "import {applyTheme as _applyTheme} from 'theme/" + theme .getName() + "/" + theme.getName() + ".js';\nexport const applyTheme = _applyTheme;\n", StandardCharsets.UTF_8); } catch (IOException e) { throw new ExecutionFailedException( "Unable to write theme import file", e); } }
Source:
private void parseSummaryInformation(DirectoryNode root, Metadata metadata) throws UnsupportedHwpFormatException { try { Entry summaryEntry = root.getEntry("HwpSummaryInformation"); SummaryInformation si = getSummaryInformation(summaryEntry); setMetadataWithSummaryInformation(si, metadata); } catch (NoPropertySetStreamException | IOException e) { throw new UnsupportedHwpFormatException( "cannot parse the Summary Information"); } }

Target:
private void parseSummaryInformation(DirectoryNode root, Metadata metadata) throws TikaException { try { Entry summaryEntry = root.getEntry("\u0005HwpSummaryInformation"); populateMatadata(summaryEntry, metadata); } catch (NoPropertySetStreamException | IOException e) { throw new UnsupportedFormatException( "cannot parse the Summary Information"); } }
Source:
public XStreamJSONMessageConverter() { super(MediaType.APPLICATION_JSON); }

Target:
public XStreamJSONMessageConverter() { super(MediaType.APPLICATION_JSON, TEXT_JSON); }
Source:
private ListenableFuture<List<SyncStat>> standardSyncing(List<TreeResponse> trees) { InetAddressAndPort local = FBUtilities.getLocalAddressAndPort(); List<AbstractSyncTask> syncTasks = new ArrayList<>(); for (int i = 0; i < trees.size() - 1; ++i) { TreeResponse r1 = trees.get(i); for (int j = i + 1; j < trees.size(); ++j) { TreeResponse r2 = trees.get(j); if (isTransient(r1.endpoint) && isTransient(r2.endpoint)) continue; AbstractSyncTask task; if (r1.endpoint.equals(local) || r2.endpoint.equals(local)) { TreeResponse self = r1.endpoint.equals(local) ? r1 : r2; TreeResponse remote = r2.endpoint.equals(local) ? r1 : r2; boolean requestRanges = !isTransient(self.endpoint); boolean transfterRanges = !isTransient(remote.endpoint) && !session.pullRepair; if (!requestRanges && !transfterRanges) continue; task = new LocalSyncTask(desc, self, remote, isIncremental ? desc.parentSessionId : null, requestRanges, transfterRanges, session.previewKind); } else if (isTransient(r1.endpoint) || isTransient(r2.endpoint)) { TreeResponse streamFrom = isTransient(r1.endpoint) ? r1 : r2; TreeResponse streamTo = isTransient(r1.endpoint) ? r2 : r1; task = new AsymmetricRemoteSyncTask(desc, streamTo, streamFrom, previewKind); session.waitForSync(Pair.create(desc, task.nodePair()), (AsymmetricRemoteSyncTask) task); } else { task = new SymmetricRemoteSyncTask(desc, r1, r2, session.previewKind); session.waitForSync(Pair.create(desc, task.nodePair()), (SymmetricRemoteSyncTask) task); } syncTasks.add(task); taskExecutor.submit(task); } } return Futures.allAsList(syncTasks); }

Target:
private ListenableFuture<List<SyncStat>> standardSyncing(List<TreeResponse> trees) { InetAddressAndPort local = FBUtilities.getLocalAddressAndPort(); List<AbstractSyncTask> syncTasks = new ArrayList<>(); for (int i = 0; i < trees.size() - 1; ++i) { TreeResponse r1 = trees.get(i); for (int j = i + 1; j < trees.size(); ++j) { TreeResponse r2 = trees.get(j); if (isTransient(r1.endpoint) && isTransient(r2.endpoint)) continue; AbstractSyncTask task; if (r1.endpoint.equals(local) || r2.endpoint.equals(local)) { TreeResponse self = r1.endpoint.equals(local) ? r1 : r2; TreeResponse remote = r2.endpoint.equals(local) ? r1 : r2; boolean requestRanges = !isTransient(self.endpoint); boolean transferRanges = !isTransient(remote.endpoint) && !session.pullRepair; if (!requestRanges && !transferRanges) continue; task = new LocalSyncTask(desc, self, remote, isIncremental ? desc.parentSessionId : null, requestRanges, transferRanges, session.previewKind); } else if (isTransient(r1.endpoint) || isTransient(r2.endpoint)) { TreeResponse streamFrom = isTransient(r1.endpoint) ? r1 : r2; TreeResponse streamTo = isTransient(r1.endpoint) ? r2 : r1; task = new AsymmetricRemoteSyncTask(desc, streamTo, streamFrom, previewKind); session.waitForSync(Pair.create(desc, task.nodePair()), (AsymmetricRemoteSyncTask) task); } else { task = new SymmetricRemoteSyncTask(desc, r1, r2, session.previewKind); session.waitForSync(Pair.create(desc, task.nodePair()), (SymmetricRemoteSyncTask) task); } syncTasks.add(task); taskExecutor.submit(task); } } return Futures.allAsList(syncTasks); }
Source:
private String obsfucateIfSecret( Map.Entry<String,String> param ) { return secrets.contains( param.getKey() ) ? Secret.OBSFUCATED : param.getValue(); }

Target:
private String obsfucateIfSecret( Map.Entry<String,String> param ) { return obsfucateIfSecret( param.getKey(), param.getValue() ); }
Source:
protected boolean deploymentNeverEnabled(List<String> previewListItems) { return itemInListExistsLowerCase(previewListItems, "the deployment was never enabled"); }

Target:
public boolean deploymentNeverEnabled(List<String> previewListItems) { return itemInListExistsLowerCase(previewListItems, "the deployment was never enabled"); }
Source:
public AutodetectResult(StreamInput in) throws IOException { if (in.readBoolean()) { this.bucket = new Bucket(in); } else { this.bucket = null; } if (in.readBoolean()) { this.records = in.readList(AnomalyRecord::new); } else { this.records = null; } if (in.readBoolean()) { this.influencers = in.readList(Influencer::new); } else { this.influencers = null; } if (in.readBoolean()) { this.quantiles = new Quantiles(in); } else { this.quantiles = null; } if (in.readBoolean()) { this.modelSnapshot = new ModelSnapshot(in); } else { this.modelSnapshot = null; } if (in.readBoolean()) { this.modelSizeStats = new ModelSizeStats(in); } else { this.modelSizeStats = null; } if (in.readBoolean()) { this.modelPlot = new ModelPlot(in); } else { this.modelPlot = null; } if (in.getVersion().onOrAfter(Version.V_7_9_0)) { if (in.readBoolean()) { this.annotation = new Annotation(in); } else { this.annotation = null; } } else { this.annotation = null; } if (in.readBoolean()) { this.categoryDefinition = new CategoryDefinition(in); } else { this.categoryDefinition = null; } if (in.readBoolean()) { this.flushAcknowledgement = new FlushAcknowledgement(in); } else { this.flushAcknowledgement = null; } if (in.readBoolean()) { this.forecast = new Forecast(in); } else { this.forecast = null; } if (in.readBoolean()) { this.forecastRequestStats = new ForecastRequestStats(in); } else { this.forecastRequestStats = null; } }

Target:
public AutodetectResult(StreamInput in) throws IOException { if (in.readBoolean()) { this.bucket = new Bucket(in); } else { this.bucket = null; } if (in.readBoolean()) { this.records = in.readList(AnomalyRecord::new); } else { this.records = null; } if (in.readBoolean()) { this.influencers = in.readList(Influencer::new); } else { this.influencers = null; } if (in.readBoolean()) { this.quantiles = new Quantiles(in); } else { this.quantiles = null; } if (in.readBoolean()) { this.modelSnapshot = new ModelSnapshot(in); } else { this.modelSnapshot = null; } if (in.readBoolean()) { this.modelSizeStats = new ModelSizeStats(in); } else { this.modelSizeStats = null; } if (in.readBoolean()) { this.modelPlot = new ModelPlot(in); } else { this.modelPlot = null; } if (in.readBoolean()) { this.annotation = new Annotation(in); } else { this.annotation = null; } if (in.readBoolean()) { this.categoryDefinition = new CategoryDefinition(in); } else { this.categoryDefinition = null; } if (in.readBoolean()) { this.flushAcknowledgement = new FlushAcknowledgement(in); } else { this.flushAcknowledgement = null; } if (in.readBoolean()) { this.forecast = new Forecast(in); } else { this.forecast = null; } if (in.readBoolean()) { this.forecastRequestStats = new ForecastRequestStats(in); } else { this.forecastRequestStats = null; } }
Source:
public void setup() { try { orientDBClient = new OrientDBClient(); Properties p = new Properties(); p.setProperty("orientdb.url", TEST_DB_URL); orientDBClient.setProperties(p); orientDBClient.init(); orientDBConnection = new ODatabaseDocumentTx(TEST_DB_URL).open("admin","admin"); orientDBDictionary = orientDBConnection.getMetadata().getIndexManager().getDictionary(); } catch (DBException e) { e.printStackTrace(); fail("Could not create OrientDBClient instance"); } }

Target:
public void setup() throws DBException { orientDBClient = new OrientDBClient(); Properties p = new Properties(); p.setProperty("orientdb.url", TEST_DB_URL); orientDBClient.setProperties(p); orientDBClient.init(); orientDBConnection = new ODatabaseDocumentTx(TEST_DB_URL).open("admin","admin"); orientDBDictionary = orientDBConnection.getMetadata().getIndexManager().getDictionary(); }
Source:
private static void reportOnMissingParameters(SubscriptionContext ctx, FunctionSymbol overriddenMethod, FunctionDef functionDef) { int indexFirstMissingParam = TreeUtils.nonTupleParameters(functionDef).size(); StringBuilder missingParametersBuilder = new StringBuilder(); for (int i = indexFirstMissingParam; i < overriddenMethod.parameters().size(); i++) { FunctionSymbol.Parameter parameter = overriddenMethod.parameters().get(i); if (!parameter.hasDefaultValue()) { missingParametersBuilder.append(parameter.name()).append(" "); } } String missingParameters = missingParametersBuilder.toString(); if (!missingParameters.isEmpty()) { PreciseIssue preciseIssue = ctx.addIssue(functionDef.name(), "Add missing parameters " + missingParameters.trim() + "."); addDefinitionSecondaryLocation(preciseIssue, overriddenMethod.definitionLocation()); } }

Target:
private static void reportOnMissingParameters(SubscriptionContext ctx, FunctionSymbol overriddenMethod, FunctionDef functionDef) { int indexFirstMissingParam = TreeUtils.nonTupleParameters(functionDef).size(); List<FunctionSymbol.Parameter> overridenParams = overriddenMethod.parameters(); String missingParameters = overridenParams.subList(indexFirstMissingParam, overridenParams.size()) .stream() .filter(parameter -> !parameter.hasDefaultValue()) .map(FunctionSymbol.Parameter::name) .collect(Collectors.joining(" ")); if (!missingParameters.isEmpty()) { PreciseIssue preciseIssue = ctx.addIssue(functionDef.name(), "Add missing parameters " + missingParameters.trim() + "."); addDefinitionSecondaryLocation(preciseIssue, overriddenMethod.definitionLocation()); } }
Source:
public void waitUntilAllCompleted() { while (completed.get() < scheduled.get()) { try { poll(100, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }

Target:
public void waitUntilAllCompleted() { while (completed.get() < scheduled.get()) { try { Future<Void> future = poll(100, TimeUnit.MILLISECONDS); if (future != null) { future.get(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } catch (ExecutionException e) { if (firstException.get() == null) { firstException.compareAndSet(null, e); } } } }