auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void heartbeat() { LinkedMultiValueMap<String, ElasticAgentMetadata> elasticAgentsOfMissingPlugins = agentService.allElasticAgents(); long pingMessageTimeToLive = elasticPluginHeartBeatInterval - 10000L; for (PluginDescriptor descriptor : elasticAgentPluginRegistry.getPlugins()) { List<ClusterProfile> clusterProfiles = clusterProfilesService.getPluginProfiles().findByPluginId(descriptor.id()); resolveSecrets(clusterProfiles); serverPingQueue.post(new ServerPingMessage(descriptor.id(), clusterProfiles), pingMessageTimeToLive); elasticAgentsOfMissingPlugins.remove(descriptor.id()); serverHealthService.removeByScope(scope(descriptor.id())); } if (!elasticAgentsOfMissingPlugins.isEmpty()) { for (String pluginId : elasticAgentsOfMissingPlugins.keySet()) { Collection<String> uuids = elasticAgentsOfMissingPlugins.get(pluginId).stream().map(ElasticAgentMetadata::uuid).collect(toList()); String description = format("Elastic agent plugin with identifier %s has gone missing, but left behind %s agent(s) with UUIDs %s.", pluginId, elasticAgentsOfMissingPlugins.get(pluginId).size(), uuids); serverHealthService.update(ServerHealthState.warning("Elastic agents with no matching plugins", description, HealthStateType.general(scope(pluginId)))); LOGGER.warn(description); } } }

Target:
public void heartbeat() { LinkedMultiValueMap<String, ElasticAgentMetadata> elasticAgentsOfMissingPlugins = agentService.allElasticAgents(); long pingMessageTimeToLive = elasticPluginHeartBeatInterval - 10000L; for (PluginDescriptor descriptor : elasticAgentPluginRegistry.getPlugins()) { elasticAgentsOfMissingPlugins.remove(descriptor.id()); List<ClusterProfile> clusterProfiles = clusterProfilesService.getPluginProfiles().findByPluginId(descriptor.id()); boolean secretsResolved = resolveSecrets(descriptor.id(), clusterProfiles); if (!secretsResolved) continue; serverPingQueue.post(new ServerPingMessage(descriptor.id(), clusterProfiles), pingMessageTimeToLive); serverHealthService.removeByScope(scope(descriptor.id())); } if (!elasticAgentsOfMissingPlugins.isEmpty()) { for (String pluginId : elasticAgentsOfMissingPlugins.keySet()) { Collection<String> uuids = elasticAgentsOfMissingPlugins.get(pluginId).stream().map(ElasticAgentMetadata::uuid).collect(toList()); String description = format("Elastic agent plugin with identifier %s has gone missing, but left behind %s agent(s) with UUIDs %s.", pluginId, elasticAgentsOfMissingPlugins.get(pluginId).size(), uuids); serverHealthService.update(ServerHealthState.warning("Elastic agents with no matching plugins", description, general(scope(pluginId)))); LOGGER.warn(description); } } }
Source:
public Response saveServiceDefinition(ServiceDefinitionPair serviceDefinition) { try { getServiceDefinitionRegistry().saveServiceDefinition(serviceDefinition); return ok().entity("{ \"added service definition\": \"" + serviceDefinition.toString() + "\" }").build(); } catch (ServiceDefinitionRegistryException e) { return serverError().entity("{ \"failed to save service definition\": \"" + e.getMessage() + "\" }").build(); } }

Target:
public Response saveServiceDefinition(ServiceDefinitionPair serviceDefinition) { try { getServiceDefinitionRegistry().saveServiceDefinition(serviceDefinition); return created(toUri(serviceDefinition)).build(); } catch (URISyntaxException | ServiceDefinitionRegistryException e) { return serverError().entity("{ \"" + ERROR_CODE_CREATION + "\": \"" + e.getMessage() + "\" }").build(); } }
Source:
private Driver createNeo4jDriver(RemoteNeo4jDatabaseIdentifier identifier, RemoteNeo4jConfiguration configuration) { String uri = identifier.getDatabaseUri(); Config.ConfigBuilder configBuilder = Config.build(); configBuilder.withMaxIdleSessions( configuration.getClientRestPoolSize() ); try { if ( configuration.isAuthenticationRequired() ) { AuthToken authToken = AuthTokens.basic( configuration.getUsername(), configuration.getPassword() ); return GraphDatabase.driver( uri, authToken, configBuilder.toConfig() ); } else { return GraphDatabase.driver( uri, configBuilder.toConfig() ); } } catch (Neo4jException e) { throw log.connectionFailed( databaseUri, e.code(), e.getMessage() ); } }

Target:
private Driver createNeo4jDriver(RemoteNeo4jDatabaseIdentifier identifier, RemoteNeo4jConfiguration configuration) { String uri = identifier.getDatabaseUri(); Config.ConfigBuilder configBuilder = Config.build(); configBuilder.withMaxIdleSessions( configuration.getClientPoolSize() ); try { if ( configuration.isAuthenticationRequired() ) { AuthToken authToken = AuthTokens.basic( configuration.getUsername(), configuration.getPassword() ); return GraphDatabase.driver( uri, authToken, configBuilder.toConfig() ); } else { return GraphDatabase.driver( uri, configBuilder.toConfig() ); } } catch (Neo4jException e) { throw log.connectionFailed( databaseUri, e.code(), e.getMessage() ); } }
Source:
String getPath(String prefix) { String Host = ""+VoltDB.instance().getHostMessenger().getHostId(); if (m_batched) { return m_uniquename ? m_dirContainingFiles.getPath() + File.separator + generation + "-" + tableName + "-" + Host + m_extension : m_dirContainingFiles.getPath() + File.separator + generation + "-" + tableName + m_extension; } else { return m_uniquename ? m_dirContainingFiles.getPath() + File.separator + prefix + m_nonce + "-" + generation + "-" + tableName + "-" + Host+ "-" + m_dateformat.get().format(start) + m_extension : m_dirContainingFiles.getPath() + File.separator + prefix + m_nonce + "-" + generation + "-" + tableName + "-" + m_dateformat.get().format(start) + m_extension; } }

Target:
String getPath(String prefix) { String hostId = ""; if(m_uniquenames) { hostId = "-("+VoltDB.instance().getHostMessenger().getHostId()+")"; } return getPathUtility(m_extension, hostId, prefix); }
Source:
private void onHandlingComplete(RestRequestInfo restRequestInfo, Exception e) { if (restRequestInfo != null) { logger.debug("Performing onHandlingComplete tasks for RestRequestInfo {}. Handling exception, if any, attached", restRequestInfo, e); try { restRequestInfo.onHandlingComplete(e); } catch (Exception ee) { logger.error("Swallowing exception during onHandlingComplete tasks. Original exception also attached", ee, e); restServerMetrics.dequeuedRequestHandlerHandlingCompleteTasksFailure.inc(); } finally { RestResponseHandler responseHandler = restRequestInfo.getRestResponseHandler(); if (e != null) { responseHandler.onRequestComplete(e, false); } if (responseHandler.isRequestComplete()) { logger.debug("Marking request as complete based on information from the RestResponseHandler"); onRequestComplete(restRequestInfo.getRestRequestMetadata()); } logger.debug("Handling of RestRequestInfo completed (Exception, if any, attached)", restRequestInfo, e); } } }

Target:
private void onHandlingComplete(RestRequestInfo restRequestInfo, Exception e) { String uri = restRequestInfo.getRestRequestMetadata().getUri(); logger.trace("Performing onComplete tasks for RestRequestInfo of request {}", uri); try { restRequestInfo.onComplete(e); } catch (Exception ee) { logger.error("Swallowing exception during onComplete tasks.", ee); restServerMetrics.dequeuedRequestHandlerHandlingCompleteTasksError.inc(); } finally { RestResponseHandler responseHandler = restRequestInfo.getRestResponseHandler(); if (e != null) { responseHandler.onRequestComplete(e, false); } if (responseHandler.isRequestComplete()) { logger.trace("Marking request as complete based on information from the RestResponseHandler", uri); onRequestComplete(restRequestInfo.getRestRequestMetadata()); } logger.trace("Handling of RestRequestInfo of request completed", uri); } }
Source:
public void configureMethods() { dtoToDtoList("definition", TextDocumentPositionParams.class, LocationDto.class, this::definition); dtoToDtoList("codeAction", CodeActionParams.class, CommandDto.class, this::codeAction); dtoToDtoList("documentSymbol", DocumentSymbolParams.class, SymbolInformationDto.class, this::documentSymbol); dtoToDtoList("formatting", DocumentFormattingParams.class, TextEditDto.class, this::formatting); dtoToDtoList("rangeFormatting", DocumentRangeFormattingParams.class, TextEditDto.class, this::rangeFormatting); dtoToDtoList("references", ReferenceParams.class, LocationDto.class, this::references); dtoToDtoList("onTypeFormatting", DocumentOnTypeFormattingParams.class, TextEditDto.class, this::onTypeFormatting); dtoToDto("completionItem/resolve", ExtendedCompletionItem.class, ExtendedCompletionItem.class, this::completionItemResolve); dtoToDto("documentHighlight", TextDocumentPositionParams.class, DocumentHighlight.class, this::documentHighlight); dtoToDto("completion", TextDocumentPositionParams.class, ExtendedCompletionListDto.class, this::completion); dtoToDto("hover", TextDocumentPositionParams.class, HoverDto.class, this::hover); dtoToDto("signatureHelp", TextDocumentPositionParams.class, SignatureHelpDto.class, this::signatureHelp); dtoToNothing("didChange", DidChangeTextDocumentParams.class, this::didChange); dtoToNothing("didClose", DidCloseTextDocumentParams.class, this::didClose); dtoToNothing("didOpen", DidOpenTextDocumentParams.class, this::didOpen); dtoToNothing("didSave", DidSaveTextDocumentParams.class, this::didSave); }

Target:
public void configureMethods() { dtoToDtoList("definition", TextDocumentPositionParams.class, LocationDto.class, this::definition); dtoToDtoList("codeAction", CodeActionParams.class, CommandDto.class, this::codeAction); dtoToDtoList("documentSymbol", DocumentSymbolParams.class, SymbolInformationDto.class, this::documentSymbol); dtoToDtoList("formatting", DocumentFormattingParams.class, TextEditDto.class, this::formatting); dtoToDtoList("rangeFormatting", DocumentRangeFormattingParams.class, TextEditDto.class, this::rangeFormatting); dtoToDtoList("references", ReferenceParams.class, LocationDto.class, this::references); dtoToDtoList("onTypeFormatting", DocumentOnTypeFormattingParams.class, TextEditDto.class, this::onTypeFormatting); dtoToDto("completionItem/resolve", ExtendedCompletionItem.class, ExtendedCompletionItemDto.class, this::completionItemResolve); dtoToDto("documentHighlight", TextDocumentPositionParams.class, DocumentHighlight.class, this::documentHighlight); dtoToDto("completion", TextDocumentPositionParams.class, ExtendedCompletionListDto.class, this::completion); dtoToDto("hover", TextDocumentPositionParams.class, HoverDto.class, this::hover); dtoToDto("signatureHelp", TextDocumentPositionParams.class, SignatureHelpDto.class, this::signatureHelp); dtoToNothing("didChange", DidChangeTextDocumentParams.class, this::didChange); dtoToNothing("didClose", DidCloseTextDocumentParams.class, this::didClose); dtoToNothing("didOpen", DidOpenTextDocumentParams.class, this::didOpen); dtoToNothing("didSave", DidSaveTextDocumentParams.class, this::didSave); }
Source:
public void upgrade_movePassword_passwordMoved() throws IllegalArgumentException, IllegalAccessException { String vpnPassword = "upgrade_movePassword_passwordMoved"; vpnPasswordField.set(userPrivateField.get(richard), vpnPassword); UserDevice device = createDevice(); richard.addDevice(device); migrationStep.upgrade(richard); assertThat(device.getVpnPassword(), equalTo(vpnPassword)); assertThat(richard.takeVpnPassword(), equalTo(Optional.empty())); }

Target:
public void upgrade_movePassword_passwordMoved() throws IllegalArgumentException, IllegalAccessException { String vpnPassword = "upgrade_movePassword_passwordMoved"; vpnPasswordField.set(userPrivateField.get(richard), vpnPassword); UserDevice device = createDevice(); richard.addDevice(device); migrationStep.upgrade(richard); assertThat(device.getVpnPassword(), equalTo(vpnPassword)); assertThat(richard.getAndClearVpnPassword(), equalTo(Optional.empty())); }
Source:
public Object poll() { return queue.poll(); }

Target:
public Object poll() { Object value = queue.poll(); if (capacity != null && value != null) { capacity.incrementAndGet(); } return value; }
Source:
public void testCheckSamples(final List<File> files1, final List<File> files2, final int expectedRetVal, final int numberOfSamples, boolean ExpectAllMatch) throws IOException { File metrics = File.createTempFile("Fingerprinting", "test.crosscheck_metrics"); metrics.deleteOnExit(); File matrix = File.createTempFile("Fingerprinting", "test.matrix"); matrix.deleteOnExit(); final List<String> args = new ArrayList<>(); files1.forEach(f->args.add("INPUT="+f.getAbsolutePath())); files2.forEach(f->args.add("INPUT2="+f.getAbsolutePath())); args.add("OUTPUT=" + metrics.getAbsolutePath()); args.add("HAPLOTYPE_MAP=" + HAPLOTYPE_MAP); args.add("LOD_THRESHOLD=" + -1.0); args.add("CROSSCHECK_BY=SAMPLE"); doTest(args.toArray(new String[args.size()]), metrics, expectedRetVal, numberOfSamples , CrosscheckMetric.DataType.SAMPLE, ExpectAllMatch); }

Target:
public void testCheckSamples(final List<File> files1, final List<File> files2, final int expectedRetVal, final int numberOfSamples, boolean ExpectAllMatch) throws IOException { File metrics = File.createTempFile("Fingerprinting", "test.crosscheck_metrics"); metrics.deleteOnExit(); final List<String> args = new ArrayList<>(); files1.forEach(f->args.add("INPUT="+f.getAbsolutePath())); files2.forEach(f->args.add("SECOND_INPUT="+f.getAbsolutePath())); args.add("OUTPUT=" + metrics.getAbsolutePath()); args.add("HAPLOTYPE_MAP=" + HAPLOTYPE_MAP); args.add("LOD_THRESHOLD=" + -1.0); args.add("CROSSCHECK_BY=SAMPLE"); doTest(args.toArray(new String[args.size()]), metrics, expectedRetVal, numberOfSamples , CrosscheckMetric.DataType.SAMPLE, ExpectAllMatch); }
Source:
public void convertsXmlToJsonArray() throws Exception { final XML xml = new XMLDocument( "<users><user>Jeff</user><user>Bauer</user><user>Iko</user></users>" ); final JsonObject json = new JsonNode(xml).json(); MatcherAssert.assertThat( json.toString(), new IsEqual<>("{\"users\": [\"Jeff\", \"Bauer\", \"Iko\"]}") ); }

Target:
public void convertsXmlToJsonArray() throws Exception { final XML xml = new XMLDocument( "<users array=\"true\"><item>Jeff</item><item>Bauer</item><item>Iko</item></users>" ); final JsonObject json = new JsonNode(xml).json(); MatcherAssert.assertThat( json.toString(), new IsEqual<>("{\"users\": [\"Jeff\", \"Bauer\", \"Iko\"]}") ); }
Source:
public boolean onCreateOptionsMenu(final Menu menu) { getMenuInflater().inflate(R.menu.wallet_options, menu); super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.wallet_options, menu); MenuItem walletLockMenuItem = menu.findItem(R.id.wallet_options_lock); walletLockMenuItem.setVisible(WalletLock.getInstance().isWalletLocked(wallet)); hidePersonalSettingsIfLocked(); return true; }

Target:
public boolean onCreateOptionsMenu(final Menu menu) { getMenuInflater().inflate(R.menu.wallet_options, menu); super.onCreateOptionsMenu(menu); MenuItem walletLockMenuItem = menu.findItem(R.id.wallet_options_lock); walletLockMenuItem.setVisible(WalletLock.getInstance().isWalletLocked(wallet)); hidePersonalSettingsIfLocked(); return true; }
Source:
public static Map<ParameterType, Object> readParameters(DataInputPlus in, int version) throws IOException { int parameterCount = in.readInt(); Map<ParameterType, Object> parameters; if (parameterCount == 0) { return Collections.emptyMap(); } else { ImmutableMap.Builder<ParameterType, Object> builder = ImmutableMap.builder(); for (int i = 0; i < parameterCount; i++) { String key = in.readUTF(); ParameterType type = ParameterType.byName.get(key); byte[] value = new byte[in.readInt()]; in.readFully(value); builder.put(type, type.serializer.deserialize(new DataInputBuffer(value), version)); } return builder.build(); } }

Target:
public static Map<ParameterType, Object> readParameters(DataInputPlus in, int version) throws IOException { int parameterCount = in.readInt(); Map<ParameterType, Object> parameters; if (parameterCount == 0) { return Collections.emptyMap(); } else { ImmutableMap.Builder<ParameterType, Object> builder = ImmutableMap.builder(); for (int i = 0; i < parameterCount; i++) { String key = in.readUTF(); ParameterType type = ParameterType.byName.get(key); if (type != null) { byte[] value = new byte[in.readInt()]; in.readFully(value); builder.put(type, type.serializer.deserialize(new DataInputBuffer(value), version)); } else { in.skipBytes(in.readInt()); } } return builder.build(); } }
Source:
private void initializeExecThread() { log.debug("Initializing exec thread"); if(scriptFile == null) { log.debug("Using manual script text for exec"); execThread = new ScriptedCommandThread(manualScriptText, manualScriptName, this, availableCommandFactory); } else { log.debug("Using file path for exec"); execThread = new ScriptedCommandThread(scriptFile, this, availableCommandFactory); } execThread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { Logger log = Logger.getLogger(ScriptedCommandThread.class); log.error("Uncaught exception in autonomous thread! " + e.toString()); } }); }

Target:
private void initializeExecThread() { log.info("Initializing exec thread"); if(manualScriptText != null && manualScriptName != null) { log.info("Using manual script text for exec"); execThread = new ScriptedCommandThread(manualScriptText, manualScriptName, this, availableCommandFactory); } else if (scriptFile != null && scriptFile.canRead() && scriptFile.isFile()) { log.info("Using file path for exec"); execThread = new ScriptedCommandThread(scriptFile, this, availableCommandFactory); } else { log.error("Exec thread not initialized due to lack of viable script source."); return; } execThread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { Logger log = Logger.getLogger(ScriptedCommandThread.class); log.error("Uncaught exception in autonomous thread! " + e.toString()); e.printStackTrace(); } }); }
Source:
public static boolean isValidCheckstyleClass(Class<?> clazz) { return AutomaticBean.class.isAssignableFrom(clazz) && !Modifier.isAbstract(clazz.getModifiers()) && !clazz.getSimpleName().startsWith("Input"); }

Target:
public static boolean isValidCheckstyleClass(Class<?> clazz) { return AutomaticBean.class.isAssignableFrom(clazz) && !Modifier.isAbstract(clazz.getModifiers()); }
Source:
private void configureChatSetting(Preferences preferences) { chatComboBox.setButtonCell(new StringListCell<>(chatFormat -> i18n.get(chatFormat.getI18nKey()))); chatComboBox.setCellFactory(param -> new StringListCell<>(chatFormat -> i18n.get(chatFormat.getI18nKey()))); chatComboBox.setItems(FXCollections.observableArrayList(ChatFormat.values())); chatComboBox.setDisable(false); chatComboBox.setFocusTraversable(true); chatComboBox.getSelectionModel().select(preferences.getChat().getChatFormat()); }

Target:
private void configureChatSetting(Preferences preferences) { chatComboBox.setButtonCell(new StringListCell<>(chatFormat -> i18n.get(chatFormat.getI18nKey()))); chatComboBox.setCellFactory(param -> new StringListCell<>(chatFormat -> i18n.get(chatFormat.getI18nKey()))); chatComboBox.setItems(FXCollections.observableArrayList(ChatFormat.values())); chatComboBox.getSelectionModel().select(preferences.getChat().getChatFormat()); }
Source:
public static StorageConnection map(StorageServerConnections entity, StorageConnection template) { StorageConnection model = template != null ? template : new StorageConnection(); model.setId(entity.getid()); model.setType(map(entity.getstorage_type(), null)); if (entity.getstorage_type() == org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI) { model.setAddress(entity.getconnection()); model.setPort(Integer.parseInt(entity.getport())); model.setUsername(entity.getuser_name()); model.setTarget(entity.getiqn()); } if (entity.getstorage_type().isFileDomain()) { setPath(entity, model); } if (entity.getstorage_type().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.NFS)) { if (entity.getNfsVersion() != null) { model.setNfsVersion(entity.getNfsVersion().toString()); } if (entity.getNfsRetrans() != null) { model.setNfsRetrans(entity.getNfsRetrans().intValue()); } if (entity.getNfsTimeo() != null) { model.setNfsTimeo(entity.getNfsTimeo().intValue()); } if (entity.getMountOptions() != null) { model.setMountOptions(entity.getMountOptions()); } } else if (entity.getstorage_type().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.POSIXFS) || entity.getstorage_type().equals(StorageType.GLUSTERFS)) { model.setMountOptions(entity.getMountOptions()); model.setVfsType(entity.getVfsType()); } return model; }

Target:
public static StorageConnection map(StorageServerConnections entity, StorageConnection template) { StorageConnection model = template != null ? template : new StorageConnection(); model.setId(entity.getid()); model.setType(map(entity.getstorage_type(), null)); if (entity.getstorage_type() == org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI) { model.setAddress(entity.getconnection()); model.setPort(Integer.parseInt(entity.getport())); model.setUsername(entity.getuser_name()); model.setTarget(entity.getiqn()); } if (entity.getstorage_type().isFileDomain()) { setPath(entity, model); } if (entity.getstorage_type().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.NFS)) { if (entity.getNfsVersion() != null) { model.setNfsVersion(entity.getNfsVersion().toString()); } if (entity.getNfsRetrans() != null) { model.setNfsRetrans(entity.getNfsRetrans().intValue()); } if (entity.getNfsTimeo() != null) { model.setNfsTimeo(entity.getNfsTimeo().intValue()); } if (entity.getMountOptions() != null) { model.setMountOptions(entity.getMountOptions()); } } else if (entity.getstorage_type().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.POSIXFS) || entity.getstorage_type().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.GLUSTERFS)) { model.setMountOptions(entity.getMountOptions()); model.setVfsType(entity.getVfsType()); } return model; }
Source:
HaxeParameterDescription(String name, String type, String initialValue, boolean isOptional, ResultHolder resultHolder) { this.isOptional = isOptional; this.hasInitialValue = initialValue != null; this.text = compileDescription(name, type, initialValue); this.resultHolder = resultHolder; }

Target:
HaxeParameterDescription(String name, String type, String initialValue, boolean isOptional, ResultHolder resultHolder) { this.isOptional = isOptional; this.hasInitialValue = initialValue != null; this.description = compilePresentableDescription(name, type, initialValue); this.resultHolder = resultHolder; }
Source:
public static void preprocess() { File f = new File(home, "OSGI-INF/deployment-container.xml"); if (!f.isFile()) { return; } try { Class<?> klass = loader.loadClass("org.nuxeo.runtime.deployment.preprocessor.DeploymentPreprocessor"); Method main = klass.getMethod("main", String[].class); main.invoke(null, new Object[] { new String[] { home.getAbsolutePath() } }); } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); } }

Target:
public static void preprocess() { File f = new File(home, "OSGI-INF/deployment-container.xml"); if (!f.isFile()) { return; } try { Class<?> klass = loader.loadClass("org.nuxeo.runtime.deployment.preprocessor.DeploymentPreprocessor"); Method main = klass.getMethod("main", String[].class); main.invoke(null, new Object[] { new String[] { home.getAbsolutePath() } }); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } }
Source:
public void scanFile(JavaFileScannerContext context) { contexts.clear(); super.scanFile(context); }

Target:
public void scanFile(JavaFileScannerContext context) { assignmentsByMethod.clear(); super.scanFile(context); }
Source:
public void execute() { Account caller = CallContext.current().getCallingAccount(); List<QuotaSummaryResponse> responses; if (caller.getAccountId() <= 2) { if (getAccountName() != null && getDomainId() != null) responses = _responseBuilder.createQuotaSummaryResponse(caller.getAccountName(), caller.getDomainId()); else responses = _responseBuilder.createQuotaSummaryResponse(getListAll()); } else { responses = _responseBuilder.createQuotaSummaryResponse(caller.getAccountName(), caller.getDomainId()); } final ListResponse<QuotaSummaryResponse> response = new ListResponse<QuotaSummaryResponse>(); response.setResponses(responses); response.setResponseName(getCommandName()); setResponseObject(response); }

Target:
public void execute() { Account caller = CallContext.current().getCallingAccount(); List<QuotaSummaryResponse> responses; if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN) { if (getAccountName() != null && getDomainId() != null) responses = _responseBuilder.createQuotaSummaryResponse(caller.getAccountName(), caller.getDomainId()); else responses = _responseBuilder.createQuotaSummaryResponse(getListAll()); } else { responses = _responseBuilder.createQuotaSummaryResponse(caller.getAccountName(), caller.getDomainId()); } final ListResponse<QuotaSummaryResponse> response = new ListResponse<QuotaSummaryResponse>(); response.setResponses(responses); response.setResponseName(getCommandName()); setResponseObject(response); }
Source:
public void testRelease01() throws Exception { tag.release(); assertNull(getField(tag, "page")); assertNull(getField(tag, "pathTmpl")); assertNull(getField(tag, "queryTmpl")); assertNull(getField(tag, "criteriaQuery")); assertFalse((boolean) getField(tag, "disableHtmlEscapeOfCriteriaQuery")); assertFalse((boolean) getField(tag, "enableLinkOfCurrentPage")); assertNull(getField(tag, "outerElement")); assertNull(getField(tag, "outerElementClass")); assertNull(getField(tag, "innerElement")); assertNull(getField(tag, "innerElementClass")); assertNull(getField(tag, "firstLinkText")); assertNull(getField(tag, "previousLinkText")); assertNull(getField(tag, "nextLinkText")); assertNull(getField(tag, "lastLinkText")); assertNull(getField(tag, "disabledHref")); assertNull(getField(tag, "activeClass")); assertNull(getField(tag, "disabledClass")); }

Target:
public void testRelease01() throws Exception { tag.release(); assertNull(ReflectionTestUtils.getField(tag, "page")); assertNull(ReflectionTestUtils.getField(tag, "pathTmpl")); assertNull(ReflectionTestUtils.getField(tag, "queryTmpl")); assertNull(ReflectionTestUtils.getField(tag, "criteriaQuery")); assertFalse((boolean) ReflectionTestUtils.getField(tag, "disableHtmlEscapeOfCriteriaQuery")); assertFalse((boolean) ReflectionTestUtils.getField(tag, "enableLinkOfCurrentPage")); assertNull(ReflectionTestUtils.getField(tag, "outerElement")); assertNull(ReflectionTestUtils.getField(tag, "outerElementClass")); assertNull(ReflectionTestUtils.getField(tag, "innerElement")); assertNull(ReflectionTestUtils.getField(tag, "innerElementClass")); assertNull(ReflectionTestUtils.getField(tag, "firstLinkText")); assertNull(ReflectionTestUtils.getField(tag, "previousLinkText")); assertNull(ReflectionTestUtils.getField(tag, "nextLinkText")); assertNull(ReflectionTestUtils.getField(tag, "lastLinkText")); assertNull(ReflectionTestUtils.getField(tag, "disabledHref")); assertNull(ReflectionTestUtils.getField(tag, "activeClass")); assertNull(ReflectionTestUtils.getField(tag, "disabledClass")); }
Source:
public void setNavigator(Person p) { setNavigator(Objects.requireNonNull(p), false); }

Target:
public void setNavigator(Person p) { setNavigator(p, false); }
Source:
private void updateContentFiles(List<Process> processes) { for (Process proz : processes) { try { FileformatInterface myRdf = serviceManager.getProcessService().readMetadataFile(proz); myRdf.getDigitalDocument().addAllContentFiles(); serviceManager.getFileService().writeMetadataFile(myRdf, proz); Helper.setMeldung("kitodoScriptfield", "ContentFiles updated: ", proz.getTitle()); } catch (org.kitodo.api.ugh.exceptions.DocStructHasNoTypeException e) { Helper.setFehlerMeldung("DocStructHasNoTypeException", e.getMessage()); } catch (Exception e) { Helper.setFehlerMeldung("kitodoScriptfield", "Error while updating content files", e); } } Helper.setMeldung("kitodoScriptfield", "", "updateContentFiles finished"); }

Target:
private void updateContentFiles(List<Process> processes) { for (Process proz : processes) { try { FileformatInterface myRdf = serviceManager.getProcessService().readMetadataFile(proz); myRdf.getDigitalDocument().addAllContentFiles(); serviceManager.getFileService().writeMetadataFile(myRdf, proz); Helper.setMeldung("kitodoScriptfield", "ContentFiles updated: ", proz.getTitle()); } catch (DocStructHasNoTypeException e) { Helper.setFehlerMeldung("DocStructHasNoTypeException", e.getMessage()); } catch (Exception e) { Helper.setFehlerMeldung("kitodoScriptfield", "Error while updating content files", e); } } Helper.setMeldung("kitodoScriptfield", "", "updateContentFiles finished"); }
Source:
protected SqlNode parseAndValidate(String sql) { Objects.requireNonNull(m_validator, "m_validator"); SqlNode sqlNode; try { sqlNode = SqlParserFactory.parse(sql); } catch (Throwable e) { throw new RuntimeException("Error while parsing query: " + sql, e); } return m_validator.validate(sqlNode); }

Target:
protected SqlNode parseAndValidate(String sql) { assertNotNull("m_validator is null", m_validator); SqlNode sqlNode; try { sqlNode = SqlParserFactory.parse(sql); } catch (Throwable e) { throw new RuntimeException("Error while parsing query: " + sql, e); } return m_validator.validate(sqlNode); }
Source:
public Optional<Git> getGitRepo() { if (gitRepo != null) { return Optional.of(gitRepo); } else { return Optional.empty(); } }

Target:
public Optional<Git> getGitRepo() { return Optional.ofNullable(gitRepo); }
Source:
public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException { ElytronMessages.tls.tracef("AtomicLoadKeyStore loading: stream = %s, password = %b", stream, password); try { KeyStore keyStore = keyStoreFactory.getInstance(); keyStore.load(stream, password); currentStore.set(keyStore); } catch (KeyStoreException e) { throw log.unableToCreateKeyStore(e); } }

Target:
public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException { ElytronMessages.tls.tracef("AtomicLoadKeyStore loading: stream = %s, password = %b", stream, password != null); try { KeyStore keyStore = keyStoreFactory.getInstance(); keyStore.load(stream, password); currentStore.set(keyStore); } catch (KeyStoreException e) { throw log.unableToCreateKeyStore(e); } }
Source:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { final long start = System.currentTimeMillis(); boolean willBeLogged = false; try { filterChain.doFilter(request, response); if (request.isAsyncStarted()) { request.getAsyncContext().addListener(new AsyncRequestListener(request, response, start)); willBeLogged = true; } } finally { if(!willBeLogged) { writeToAccessLogAndEventType(request, response, start); } } }

Target:
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws IOException, ServletException{ final long start = System.currentTimeMillis(); try { filterChain.doFilter(request, response); if (request.isAsyncStarted()) { final String flowId = FlowIdUtils.peek(); request.getAsyncContext().addListener(new AsyncRequestListener(request, response, start, flowId)); } } finally { if(!request.isAsyncStarted()) { final RequestLogInfo requestLogInfo = new RequestLogInfo(request, start); writeToAccessLogAndEventType(requestLogInfo, response); } } }
Source:
public boolean hasNext() { computeNext(); return (next != null); }

Target:
public boolean hasNext() { try { return fileStatusIterator.hasNext(); } catch (IOException e) { throw processException(e); } }
Source:
public void init() { if (this.url.substring(this.url.length() - 1) != "/") { this.url += "/"; } }

Target:
public void init() { if (!this.url.endsWith("/")) { this.url += "/"; } }
Source:
public void sendCalendarSyncErrorNotification(String calendarName, Absence absence, String exception) { Map<String, Object> model = new HashMap<>(); model.put(CALENDAR, calendarName); model.put("absence", absence); model.put(EXCEPTION, exception); final Mail toTechnical = Mail.builder() .withRecipient(true) .withSubject("subject.error.calendar.sync") .withTemplate("error_calendar_sync", model) .build(); mailService.send(toTechnical); }

Target:
public void sendCalendarSyncErrorNotification(String calendarName, Absence absence, String exception) { Map<String, Object> model = new HashMap<>(); model.put(CALENDAR, calendarName); model.put("absence", absence); model.put(EXCEPTION, exception); final Mail mailToTechnical = Mail.builder() .withTechnicalRecipient(true) .withSubject("subject.error.calendar.sync") .withTemplate("error_calendar_sync", model) .build(); mailService.send(mailToTechnical); }
Source:
protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); for (URI currentUri : uriCollection) { lock.lock(); try { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { monitor.setWorkRemaining(1000); ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } finally { lock.unlock(); } } }

Target:
protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { monitor.setWorkRemaining(1000); ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }
Source:
private void setMinScaffoldingSeedLength(GenomixJobConf conf) throws IOException { Counters counters = GraphStatistics.run(curOutput, curOutput + "-kmerLength-stats", conf); long totalNodes = counters.getGroup("totals").getCounter("nodes"); float percentage = 0.2f; long numOfSeeds; if (Math.abs((float) totalNodes * percentage) < 100) numOfSeeds = (long) Math.abs((float) totalNodes * percentage); else numOfSeeds = 100; long curNumOfSeeds = 0; for (Counter c : counters.getGroup("kmerLength-bins")) { curNumOfSeeds += c.getValue(); if (curNumOfSeeds > numOfSeeds) { conf.setInt(GenomixJobConf.MIN_SCAFFOLDING_SEED_LENGTH, Integer.parseInt(c.getName())); return; } } throw new IllegalStateException("It is impossible to reach here!"); }

Target:
private void setMinScaffoldingSeedLength(GenomixJobConf conf) throws IOException { Counters counters = GraphStatistics.run(curOutput, curOutput + "-kmerLength-stats", conf); long totalNodes = counters.getGroup("totals").getCounter("nodes"); float fraction = 0.01f; long numOfSeeds; if (Math.round((float) totalNodes * fraction) < 100) numOfSeeds = (long) Math.round((float) totalNodes * fraction); else numOfSeeds = 100; ArrayList<Long> sortedCounter = new ArrayList<Long>(); int maxLength = sortCounters(counters.getGroup("kmerLength-bins"), sortedCounter); long curNumOfSeeds = 0; for (int i = sortedCounter.size() - 1; i >= 0; i--) { curNumOfSeeds += sortedCounter.get(i); if (curNumOfSeeds > numOfSeeds) { conf.setInt(GenomixJobConf.MIN_SCAFFOLDING_SEED_LENGTH, maxLength - (sortedCounter.size() - 1 - i)); return; } } throw new IllegalStateException("It is impossible to reach here!"); }
Source:
public ResourceNotFoundException(IdString id) { super(id.encoded()); }

Target:
public ResourceNotFoundException(IdString id) { super(id.get()); }
Source:
private static @Nullable IAnalysisModuleHelper findModule(Iterable<IAnalysisModuleHelper> modules, String moduleName) { for (IAnalysisModuleHelper helper : modules) { if (moduleName.equals(helper.getId())) { return helper; } } return null; }

Target:
private static @Nullable IAnalysisModuleHelper findModule(Iterable<IAnalysisModuleHelper> modules, String moduleName) { return Iterables.tryFind(modules, helper -> moduleName.equals(helper.getId())).orNull(); }
Source:
public <C extends IdCredentials> ListBoxModel getCredentialIds(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements, @NonNull CredentialsMatcher matcher) { ListBoxModel result = new ListBoxModel(); Set<String> ids = new HashSet<String>(); if (ACL.SYSTEM.equals(authentication)) { while (itemGroup != null) { if (itemGroup instanceof AbstractFolder) { final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); FolderCredentialsProperty property = folder.getProperties().get(FolderCredentialsProperty.class); if (property != null) { for (C c : DomainCredentials.getCredentials( property.getDomainCredentialsMap(), type, domainRequirements, matcher)) { if (ids.add(c.getId())) { result.add(CredentialsNameProvider.name(c), c.getId()); } } } } if (itemGroup instanceof Item) { itemGroup = Item.class.cast(itemGroup).getParent(); } else { break; } } } return result; }

Target:
public <C extends IdCredentials> ListBoxModel getCredentialIds(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements, @NonNull CredentialsMatcher matcher) { ListBoxModel result = new ListBoxModel(); Set<String> ids = new HashSet<String>(); if (ACL.SYSTEM.equals(authentication)) { while (itemGroup != null) { if (itemGroup instanceof AbstractFolder) { final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); FolderCredentialsProperty property = folder.getProperties().get(FolderCredentialsProperty.class); if (property != null) { for (C c : DomainCredentials.getCredentials( property.getDomainCredentialsMap(), type, domainRequirements, matcher)) { if (ids.add(c.getId())) { result.add(CredentialsNameProvider.name(c), c.getId()); } } } } if (itemGroup instanceof Item) { itemGroup = ((Item)itemGroup).getParent(); } else { break; } } } return result; }
Source:
public void creatTable( CairoSecurityContext securityContext, AppendMemory mem, Path path, TableStructure struct ) { CairoSecurityContext.checkWritePermission(securityContext); TableUtils.createTable( configuration.getFilesFacade(), mem, path, configuration.getRoot(), struct, configuration.getMkDirMode() ); }

Target:
public void creatTable( CairoSecurityContext securityContext, AppendMemory mem, Path path, TableStructure struct ) { securityContext.checkWritePermission(); TableUtils.createTable( configuration.getFilesFacade(), mem, path, configuration.getRoot(), struct, configuration.getMkDirMode() ); }
Source:
protected void reject(Diff diff, boolean rightToLeft) { final Optional<OpaqueElementBodyChange> possibleBodyChange = getOpaqueElementBodyChange(diff); if (possibleBodyChange.isPresent()) { final OpaqueElementBodyChange bodyChange = possibleBodyChange.get(); if (LOGGER.isDebugEnabled()) { int refinedElementCount = bodyChange.getRefinedBy().size(); LOGGER.debug("Reject OpaqueElement change - " + refinedElementCount + " refined diffs merged"); } switch (bodyChange.getKind()) { case ADD: rejectRefiningDiffs(bodyChange, rightToLeft); break; case DELETE: rejectRefiningDiffs(bodyChange, rightToLeft); break; case CHANGE: changeElement(bodyChange, rightToLeft); break; case MOVE: moveElement(bodyChange, rightToLeft); break; default: break; } } }

Target:
protected void reject(Diff diff, boolean rightToLeft) { final Optional<OpaqueElementBodyChange> possibleBodyChange = getOpaqueElementBodyChange(diff); if (possibleBodyChange.isPresent()) { final OpaqueElementBodyChange bodyChange = possibleBodyChange.get(); if (LOGGER.isDebugEnabled()) { int refinedElementCount = bodyChange.getRefinedBy().size(); LOGGER.debug("Reject(Diff, boolean)" + refinedElementCount + " refined diffs to merge for diff " + diff.hashCode()); } switch (bodyChange.getKind()) { case ADD: rejectRefiningDiffs(bodyChange, rightToLeft); break; case DELETE: rejectRefiningDiffs(bodyChange, rightToLeft); break; case CHANGE: changeElement(bodyChange, rightToLeft); break; case MOVE: moveElement(bodyChange, rightToLeft); break; default: break; } } }
Source:
private Set<Class<?>> getParentTypes(String name, Class<?> type) { String[] path = name.split("\\."); try { for (int i = 0; i < path.length - 1; i++) { Field field = checkNotNull(new Mirror().on(type).reflect().field(path[i])); type = getActualType(field.getGenericType()); } if (!isIgnoreFieldNotFound()) checkNotNull(new Mirror().on(type).reflect().field(path[path.length -1])); } catch (NullPointerException e) { throw new IllegalArgumentException("Field path '" + name + "' doesn't exists in " + type, e); } Set<Class<?>> types = new HashSet<>(); while (type != Object.class) { types.add(type); type = type.getSuperclass(); } return types; }

Target:
private Set<Class<?>> getParentTypes(String name, Class<?> type) { String[] path = name.split("\\."); try { for (int i = 0; i < path.length; i++) { Field field = reflectField(path[i], type); if (field == null) break; if (i < path.length - 1) type = getActualType(field.getGenericType()); } } catch (NullPointerException e) { throw new IllegalArgumentException("Field path '" + name + "' doesn't exists in " + type, e); } Set<Class<?>> types = new HashSet<>(); while (type != Object.class) { types.add(type); type = type.getSuperclass(); } return types; }
Source:
public void setMaxWriteDelay(int maxWriteDelay) { if (maxWriteDelay < 0) { throw new IllegalArgumentException("Maximum write delay cannot be less than 1"); } else if (maxWriteDelay < minWriteDelay) { throw new IllegalArgumentException("Maximum write delay must be larger than minimum write delay"); } this.maxWriteDelay = maxWriteDelay; }

Target:
public void setMaxWriteDelay(int maxWriteDelay) { if (maxWriteDelay < 0) { throw new IllegalArgumentException("Maximum write delay cannot be less than 1"); } else if (maxWriteDelay < minWriteDelay) { throw new IllegalArgumentException("Maximum write delay (" + maxWriteDelay + ") must be larger than or equal to minimum write delay (" + minWriteDelay + ")"); } this.maxWriteDelay = maxWriteDelay; }
Source:
public void testEnsureNextSequenceIsCalledLazilyInToYielder() throws Exception { final AtomicBoolean lastSeqFullyRead = new AtomicBoolean(true); Sequence<Integer> seq = Sequences.concat( Sequences.map( Sequences.simple( ImmutableList.of( ImmutableList.of(1, 2, 3), ImmutableList.of(4, 5, 6) ) ), new Function<ImmutableList<Integer>, Sequence<Integer>>() { @Override public Sequence<Integer> apply(final ImmutableList<Integer> input) { if (lastSeqFullyRead.getAndSet(false)) { return Sequences.simple( new Iterable<Integer>() { private Iterator<Integer> baseIter = input.iterator(); @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { @Override public boolean hasNext() { boolean result = baseIter.hasNext(); if(!result) { lastSeqFullyRead.set(true); } return result; } @Override public Integer next() { return baseIter.next(); } }; } } ); } else { throw new IllegalStateException("called before previous sequence is read fully"); } } } ) ); Yielder<Integer> yielder = seq.toYielder( null, new YieldingAccumulator<Integer, Integer>() { @Override public Integer accumulate(Integer accumulated, Integer in) { yield(); return in; } } ); List<Integer> result = new ArrayList<>(); while(!yielder.isDone()) { result.add(yielder.get()); yielder = yielder.next(null); } yielder.close(); Assert.assertEquals(ImmutableList.of(1,2,3,4,5,6), result); }

Target:
public void testEnsureNextSequenceIsCalledLazilyInToYielder() throws Exception { final AtomicBoolean lastSeqFullyRead = new AtomicBoolean(true); Sequence<Integer> seq = Sequences.concat( Sequences.map( Sequences.simple( ImmutableList.of( ImmutableList.of(1, 2, 3), ImmutableList.of(4, 5, 6) ) ), new Function<ImmutableList<Integer>, Sequence<Integer>>() { @Override public Sequence<Integer> apply(final ImmutableList<Integer> input) { if (lastSeqFullyRead.getAndSet(false)) { return Sequences.simple( new Iterable<Integer>() { private Iterator<Integer> baseIter = input.iterator(); @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { @Override public boolean hasNext() { boolean result = baseIter.hasNext(); if(!result) { lastSeqFullyRead.set(true); } return result; } @Override public Integer next() { return baseIter.next(); } @Override public void remove() { throw new UnsupportedOperationException("Remove Not Supported"); } }; } } ); } else { throw new IllegalStateException("called before previous sequence is read fully"); } } } ) ); Yielder<Integer> yielder = seq.toYielder( null, new YieldingAccumulator<Integer, Integer>() { @Override public Integer accumulate(Integer accumulated, Integer in) { yield(); return in; } } ); List<Integer> result = new ArrayList<>(); while(!yielder.isDone()) { result.add(yielder.get()); yielder = yielder.next(null); } yielder.close(); Assert.assertEquals(ImmutableList.of(1,2,3,4,5,6), result); }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean doSetGamemode = false; GameMode targetGamemode = GameMode.CREATIVE; if (args.length != 0) { if (args[0].equals("-c")) { doSetGamemode = true; targetGamemode = GameMode.CREATIVE; } else if (args[0].equals("-s")) { doSetGamemode = true; targetGamemode = GameMode.SURVIVAL; } } for (Player player : server.getOnlinePlayers()) { if (!player.isOp()) { TFM_Util.adminAction(sender.getName(), "Opping all players on the server", false); player.setOp(true); player.sendMessage(TFM_Command.YOU_ARE_OP); } else { playerMsg("All players are currently Op."); return false; } if (doSetGamemode) { player.setGameMode(targetGamemode); } } return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean doSetGamemode = false; GameMode targetGamemode = GameMode.CREATIVE; if (args.length != 0) { if (args[0].equals("-c")) { doSetGamemode = true; targetGamemode = GameMode.CREATIVE; } else if (args[0].equals("-s")) { doSetGamemode = true; targetGamemode = GameMode.SURVIVAL; } } for (Player player : server.getOnlinePlayers()) { if (!player.isOp()) { TFM_Util.adminAction(sender.getName(), "Opping all players on the server", false); player.setOp(true); player.sendMessage(TFM_Command.YOU_ARE_OP); } else { playerMsg("All players are currently Op."); } if (doSetGamemode) { player.setGameMode(targetGamemode); } } return true; }
Source:
public ExerciseUpdateHandler(ExerciseChecksumCache cache, TmcApi tmcApi) throws TmcCoreException { super(tmcApi); exerciseChecksums = new HashMap<>(); if (cache == null) { String errorMessage = "ExerciseUpdateHandler requires non-null cacheFile to function"; throw new TmcCoreException(errorMessage); } this.cache = cache; }

Target:
public ExerciseUpdateHandler(ExerciseChecksumCache cache, TmcApi tmcApi) throws TmcCoreException { super(tmcApi); exerciseChecksums = new HashMap<>(); if (cache == null) { throw new TmcCoreException( "ExerciseUpdateHandler requires non-null cacheFile to function"); } this.cache = cache; }