auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onMessage(String message) { logger.debug("[{}]: Message received: {}", xbmc.getHostname(), message); Map<String, Object> json; try { json = mapper.readValue(message, Map.class); } catch (JsonParseException e) { logger.error("Error parsing JSON", e); return; } catch (JsonMappingException e) { logger.error("Error mapping JSON", e); return; } catch (IOException e) { logger.error("An I/O error occured while decoding JSON", e); return; } try { if (json.containsKey("method")) { String method = (String)json.get("method"); if (method.startsWith("Player.On")) { processPlayerStateChanged(method, json); } if (method.startsWith("Application.On")) { processApplicationStateChanged(method, json); <START> } <END> } } catch (Exception e) { logger.error("Error handling player state change message", e); } }</code><technical_language>please "else if" option valid a time</technical_language>

Target:
public void onMessage(String message) { logger.debug("[{}]: Message received: {}", xbmc.getHostname(), message); Map<String, Object> json; try { json = mapper.readValue(message, Map.class); } catch (JsonParseException e) { logger.error("Error parsing JSON", e); return; } catch (JsonMappingException e) { logger.error("Error mapping JSON", e); return; } catch (IOException e) { logger.error("An I/O error occured while decoding JSON", e); return; } try { if (json.containsKey("method")) { String method = (String)json.get("method"); if (method.startsWith("Player.On")) { processPlayerStateChanged(method, json); } else if (method.startsWith("Application.On")) { processApplicationStateChanged(method, json); } } } catch (Exception e) { logger.error("Error handling player state change message", e); } }
Source:
<code>private String read(String classPathResource) throws IOException { InputStream is = getClass().getResourceAsStream(classPathResource); try { return Util.read(is); } finally { if (is != null) { <START> is.close(); <END> } } }</code><technical_language>close done in Util.read(..)</technical_language>

Target:
private String read(String classPathResource) throws IOException { InputStream is = getClass().getResourceAsStream(classPathResource); return Util.read(is); }
Source:
<code>private Accessor getAdderForType(Type collectionProperty, String pluralPropertyName) { List<Accessor> candidates; if ( collectionProperty.isCollectionType() ) { candidates = getAccessorCandidates( collectionProperty, Iterable.class ); } else if ( collectionProperty.isStreamType() ) { <START> candidates = getAccessorCandidates( collectionProperty, getClassForName( JavaStreamConstants.STREAM_FQN ) ); <END> } else { return null; } if ( candidates.isEmpty() ) { return null; } if ( candidates.size() == 1 ) { return candidates.get( 0 ); } for ( Accessor candidate : candidates ) { String elementName = accessorNaming.getElementNameForAdder( candidate ); if ( elementName != null && elementName.equals( Nouns.singularize( pluralPropertyName ) ) ) { return candidate; } } return null; }</code><technical_language>Stream.class type is a Stream means Stream is present. is safe Java 6 7 condition evaluate true throw ClassNotFoundException. remove getClassFormName method</technical_language>

Target:
private Accessor getAdderForType(Type collectionProperty, String pluralPropertyName) { List<Accessor> candidates; if ( collectionProperty.isCollectionType() ) { candidates = getAccessorCandidates( collectionProperty, Iterable.class ); } else if ( collectionProperty.isStreamType() ) { candidates = getAccessorCandidates( collectionProperty, Stream.class ); } else { return null; } if ( candidates.isEmpty() ) { return null; } if ( candidates.size() == 1 ) { return candidates.get( 0 ); } for ( Accessor candidate : candidates ) { String elementName = accessorNaming.getElementNameForAdder( candidate ); if ( elementName != null && elementName.equals( Nouns.singularize( pluralPropertyName ) ) ) { return candidate; } } return null; }
Source:
<code>private boolean isJavaProject(String path) { Optional<RegisteredProject> project = projectManager.get(path); return (project.isPresent() <START> && (project.get().getType().equals(MavenAttributes.MAVEN_ID) <END> || project.get().getType().equals(Constants.JAVAC))); }</code><technical_language>is call equals constant avoid NPE</technical_language>

Target:
private boolean isJavaProject(String path) { Optional<RegisteredProject> project = projectManager.get(path); return (project.isPresent() && (MavenAttributes.MAVEN_ID.equals(project.get().getType()) || Constants.JAVAC.equals(project.get().getType()))); }
Source:
<code>public void ArticleCRUDUser_003_addDropdown() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article.createArticleUsingDropdown(articleTitle); visualEditMode.addContent(articleContent); <START> visualEditMode.submit(PageType.Article); <END> article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }</code><technical_language>submitArticle(), submitBlog()</technical_language>

Target:
public void ArticleCRUDUser_003_addDropdown() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article.createArticleUsingDropdown(articleTitle); visualEditMode.addContent(articleContent); visualEditMode.submitArticle(); article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }
Source:
<code>public static CreateServerIp create(final List<String> serverIps) { <START> return new AutoValue_FirewallPolicy_ServerIp_CreateServerIp(serverIps == null ? ImmutableList.<String>of() : serverIps); <END> }</code><technical_language>here. copyOf for lists present enforce immutability. Apply this pattern domain classes</technical_language>

Target:
public static CreateServerIp create(final List<String> serverIps) { return new AutoValue_FirewallPolicy_ServerIp_CreateServerIp(serverIps == null ? ImmutableList.<String>of() : ImmutableList.copyOf(serverIps)); }
Source:
<code>public void testRegisterProcessorId() { <START> String assignedPath = zkUtils.registerProcessorAndGetId("0.0.0.0 1"); <END> Assert.assertTrue(assignedPath.startsWith(KEY_BUILDER.getProcessorsPath())); Assert.assertTrue(zkUtils.registerProcessorAndGetId("0.0.0.0 1").equals(assignedPath)); }</code><technical_language>is some specific data format expected this method - registerProcessorAndGetId. cleaner change API arguments, in registerProcessorAndGetId(String hostname, String processorId). Serialization format completely hidden caller. applies reading data ZK. Deserialization hidden caller if ZkUtils. a side question: Is this "hostname" anywhere</technical_language>

Target:
public void testRegisterProcessorId() { String assignedPath = zkUtils.registerProcessorAndGetId(new ProcessorData("host", "1")); Assert.assertTrue(assignedPath.startsWith(KEY_BUILDER.getProcessorsPath())); Assert.assertTrue(zkUtils.registerProcessorAndGetId(new ProcessorData("host", "1")).equals(assignedPath)); }
Source:
<code>public boolean deleteRecommendation(String postUuid) throws ForumServiceException{ String recommendationsUrl = resolveUrl(ForumType.RECOMMENDATIONS, FilterType.ENTRIES); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(POST_UNIQUE_IDENTIFIER, postUuid); <START> boolean success = true; <END> try { deleteData(recommendationsUrl, parameters, postUuid); } catch (Exception e) { success = false; throw new ForumServiceException(e); } return success; }</code><technical_language>Success variable required here. In case of failure throw exception</technical_language>

Target:
public boolean deleteRecommendation(String postUuid) throws ForumServiceException{ if(StringUtil.isNotEmpty(this.endpoint.getApiVersion())){ double apiVersion = Double.parseDouble(this.endpoint.getApiVersion()); if(APIVERSION > apiVersion ){ throw new UnsupportedOperationException("This API is only supported on connections 4.5 or above"); } } String recommendationsUrl = resolveUrl(ForumType.RECOMMENDATIONS, FilterType.ENTRIES); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(POST_UNIQUE_IDENTIFIER, postUuid); try { deleteData(recommendationsUrl, parameters, postUuid); return true; } catch (Exception e) { throw new ForumServiceException(e); } }
Source:
<code>protected CommandContext createUpdateVmContext(VmStatic vmStatic) { ExecutionContext ctx = new ExecutionContext(); try { Step step = executionHandler.addSubStep(getExecutionContext(), <START> getExecutionContext().getJob().getStep(StepEnum.EXECUTING), <END> StepEnum.UPDATE_VM, ExecutionMessageDirector.resolveStepMessage( StepEnum.UPDATE_VM, Collections.singletonMap(VdcObjectType.VM.name().toLowerCase(), vmStatic.getName()))); ctx.setJob(getExecutionContext().getJob()); ctx.setStep(step); ctx.setMonitored(true); } catch (RuntimeException e) { log.error("Failed to create ExecutionContext for AddVmFromScratch", e); } return cloneContextAndDetachFromParent().withExecutionContext(ctx); }</code><technical_language>Is guaranteed getJob() exist in this context</technical_language>

Target:
protected CommandContext createUpdateVmContext(VmStatic vmStatic) { ExecutionContext ctx = new ExecutionContext(); try { Step step = executionHandler.addSubStep(getExecutionContext(), getExecutionContext().getJob().getStep(StepEnum.EXECUTING), StepEnum.UPDATE_VM, ExecutionMessageDirector.resolveStepMessage( StepEnum.UPDATE_VM, Collections.singletonMap(VdcObjectType.VM.name().toLowerCase(), vmStatic.getName()))); ctx.setJob(getExecutionContext().getJob()); ctx.setStep(step); ctx.setMonitored(true); } catch (RuntimeException e) { log.error("Failed to create ExecutionContext for UpdateVM", e); } return cloneContextAndDetachFromParent().withExecutionContext(ctx); }
Source:
<code>public static void main(String[] args) { <START> if (Platform.getCurrent().equals(org.controlsfx.tools.Platform.OSX)) { <END> try { AppleHandlers.getAppleHandlers().addOpenFileListener(list -> { try { openFileHandler.get().accept(list); } catch (Exception e) { LOG.error("exception handling file open event", e); throw new RuntimeException(e); } }); } catch (Throwable e) { LOG.error("exception adding OSX file open handler", e); } } final Optional<RemoteInstance> remoteInstance = SingleInstanceManager.getRemoteInstance(MainApplication.APPLICATION_KEY); if (remoteInstance.isPresent()) { try (RemoteInstance instance = remoteInstance.get()) { LOG.info("An instance of Cryptomator is already running at {}.", instance.getRemotePort()); for (int i = 0; i < args.length; i++) { remoteInstance.get().sendMessage(args[i], 1000); } } catch (Exception e) { LOG.error("Error forwarding arguments to remote instance", e); } } else { Application.launch(MainApplication.class, args); } }</code><technical_language>Please commons lang's SystemUtils.IS_OS_MAC_OSX stay consistent WebDavMounter strategy</technical_language>

Target:
public static void main(String[] args) { if (SystemUtils.IS_OS_MAC_OSX) { try { AppleHandlers.getAppleHandlers().addOpenFileListener(file -> { try { OPEN_FILE_HANDLER.get().accept(file); } catch (Exception e) { LOG.error("exception handling file open event", e); throw new RuntimeException(e); } }); } catch (RuntimeException e) { LOG.error("exception adding OSX file open handler", e); } } final Optional<RemoteInstance> remoteInstance = SingleInstanceManager.getRemoteInstance(MainApplication.APPLICATION_KEY); if (remoteInstance.isPresent()) { try (RemoteInstance instance = remoteInstance.get()) { LOG.info("An instance of Cryptomator is already running at {}.", instance.getRemotePort()); for (int i = 0; i < args.length; i++) { remoteInstance.get().sendMessage(args[i], 1000); } } catch (Exception e) { LOG.error("Error forwarding arguments to remote instance", e); } } else { Application.launch(MainApplication.class, args); } }
Source:
<code>private boolean locateConf() { this.conf_path = System.getProperty("HDFS_CONF"); if (this.conf_path == null) { Properties prop = new Properties(); String propFilePath = "../vxquery-server/src/main/resources/conf/cluster.properties"; try { prop.load(new FileInputStream(propFilePath)); } catch (FileNotFoundException e) { propFilePath = "vxquery-server/src/main/resources/conf/cluster.properties"; <START> try { <END> prop.load(new FileInputStream(propFilePath)); } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } this.conf_path = prop.getProperty("HDFS_CONF"); if (this.conf_path == null) { return false; } return true; } return true; }</code><technical_language>potential paths here</technical_language>

Target:
private boolean locateConf() { if (this.conf_path == null) { Properties prop = new Properties(); String propFilePath = "../vxquery-server/src/main/resources/conf/cluster.properties"; nodeXMLfile = new File("../vxquery-server/src/main/resources/conf/cluster.xml"); if(!nodeXMLfile.exists()) { nodeXMLfile = new File("vxquery-server/src/main/resources/conf/cluster.xml"); if(!nodeXMLfile.exists()) { nodeXMLfile = new File("vxquery-server/src/main/resources/conf/local.xml"); } if(!nodeXMLfile.exists()) { nodeXMLfile = new File("../vxquery-server/src/main/resources/conf/local.xml"); } } try { prop.load(new FileInputStream(propFilePath)); } catch (FileNotFoundException e) { propFilePath = "vxquery-server/src/main/resources/conf/cluster.properties"; try { prop.load(new FileInputStream(propFilePath)); } catch (IOException e1) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe(e1.getMessage()); } } } catch (IOException e) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe(e.getMessage()); } return false; } this.conf_path = prop.getProperty("HDFS_CONF"); if (this.conf_path == null) { this.conf_path = System.getenv("HADOOP_CONF_DIR"); return this.conf_path != null; } return this.conf_path != null; } return this.conf_path != null; }
Source:
<code>public synchronized void stop() { if (container != null) { try { LOGGER.info("Shutting down the container: of stream processor: {}.", container, processorId); container.shutdown(); LOGGER.info("Waiting milliseconds for the container: to shutdown.", taskShutdownMs, container); jcContainerShutdownLatch.await(taskShutdownMs, TimeUnit.MILLISECONDS); if (executorService != null) { executorService.shutdown(); executorService.awaitTermination(taskShutdownMs, TimeUnit.MILLISECONDS); if (!executorService.isShutdown()) { LOGGER.info("Forcefully shutting down the executor service of the container: {}.", container); executorService.shutdownNow(); } } } catch (Exception exception) { LOGGER.info(String.format("Shutdown of container: %s threw an exception.", container), exception); } } <START> stopJobCoordinator(); <END> }</code><technical_language>this logic of shutting container jobCoordinator in order complicated. Is a simplify it</technical_language>

Target:
public synchronized void stop() { boolean containerShutdownInvoked = false; if (container != null) { try { LOGGER.info("Shutting down the container: of stream processor: {}.", container, processorId); container.shutdown(); LOGGER.info("Waiting milliseconds for the container: to shutdown.", taskShutdownMs, container); containerShutdownInvoked = true; } catch (Exception exception) { LOGGER.error(String.format("Ignoring the exception during the shutdown of container: %s.", container), exception); } } if (!containerShutdownInvoked) { LOGGER.info("Shutting down JobCoordinator from StreamProcessor"); jobCoordinator.stop(); } }
Source:
<code>protected void init() { if (properties == null) { properties = new DescribableList<AbstractFolderProperty<?>,AbstractFolderPropertyDescriptor>(this); } for (AbstractFolderProperty p : properties) { p.setOwner(this); } if (icon == null) { <START> icon = new StockFolderIcon(); <END> } else { icon.setOwner(this); } if (views == null) { views = new CopyOnWriteArrayList<View>(); } if (views.isEmpty()) { try { initViews(views); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to set up the initial view", e); } } if (viewsTabBar == null) { viewsTabBar = new DefaultViewsTabBar(); } if (primaryView == null) { primaryView = views.get(0).getViewName(); } viewGroupMixIn = new ViewGroupMixIn(this) { @Override protected List<View> views() { return views; } @Override protected String primaryView() { return primaryView; } @Override protected void primaryView(String name) { primaryView = name; } }; if (healthMetrics == null) { List<FolderHealthMetric> metrics = new ArrayList<FolderHealthMetric>(); for (FolderHealthMetricDescriptor d : FolderHealthMetricDescriptor.all()) { FolderHealthMetric metric = d.createDefault(); if (metric != null) { metrics.add(metric); } } healthMetrics = new DescribableList<FolderHealthMetric, FolderHealthMetricDescriptor>(this, metrics); } }</code><technical_language>I StockFolderIcon owner field... change in future... this call icon.setOwner(this); if _currently_ is a no-op for StockFolderIcon</technical_language>

Target:
protected void init() { if (properties == null) { properties = new DescribableList<AbstractFolderProperty<?>,AbstractFolderPropertyDescriptor>(this); } else { properties.setOwner(this); } for (AbstractFolderProperty p : properties) { p.setOwner(this); } if (icon == null) { icon = new StockFolderIcon(); } icon.setOwner(this); if (views == null) { views = new CopyOnWriteArrayList<View>(); } if (viewsTabBar == null) { viewsTabBar = new DefaultViewsTabBar(); } viewGroupMixIn = new ViewGroupMixIn(this) { @Override protected List<View> views() { return views; } @Override protected String primaryView() { return primaryView == null ? views.get(0).getViewName() : primaryView; } @Override protected void primaryView(String name) { primaryView = name; } }; if (views.isEmpty()) { try { initViews(views); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to set up the initial view", e); } } if (healthMetrics == null) { List<FolderHealthMetric> metrics = new ArrayList<FolderHealthMetric>(); for (FolderHealthMetricDescriptor d : FolderHealthMetricDescriptor.all()) { FolderHealthMetric metric = d.createDefault(); if (metric != null) { metrics.add(metric); } } healthMetrics = new DescribableList<FolderHealthMetric, FolderHealthMetricDescriptor>(this, metrics); } }
Source:
<code><START> protected void increaseCount(final String key) { <END> if (ScenarioContext.Current().get(key) == null) { ScenarioContext.Current().put(key, 1); } else { ScenarioContext.Current().put(key, (Integer) ScenarioContext.Current().get(key) + 1); } }</code><technical_language>this method signature, specific step classes dealing a single action for bundle need deal things: 1. retrieving bundle request scenario context; 2. creating action adding action list of bundle request; 3. increasing count of actions in bundle. addActionToBundleRequest(Action) nicer for step classes, instead of increaseCount(String). individual step classes need concerned internals of is track of in scenario context, some duplication avoided</technical_language>

Target:
private void increaseCount(final String key) { if (ScenarioContext.Current().get(key) == null) { ScenarioContext.Current().put(key, 1); } else { ScenarioContext.Current().put(key, (Integer) ScenarioContext.Current().get(key) + 1); } }
Source:
<code>private Font getOrderLabelFont() { FontData[] fontData = JFaceResources.getFontRegistry() .getFontData(org.eclipse.fordiac.ide.util.preferences.PreferenceConstants.DIAGRAM_FONT).clone(); <START> for (int i = 0; i < fontData.length; ++i) { fontData[i].setHeight(TRANSITON_ORDER_LABEL_FONT_SIZE); } <END> JFaceResources.getFontRegistry().put(TRANSITION_ORDER_LABEL_FONT, fontData); return JFaceResources.getFont(TRANSITION_ORDER_LABEL_FONT); }</code><technical_language>done more elegantly a for-each</technical_language>

Target:
private Font getOrderLabelFont() { FontData[] fontData = JFaceResources.getFontRegistry() .getFontData(org.eclipse.fordiac.ide.util.preferences.PreferenceConstants.DIAGRAM_FONT).clone(); Arrays.stream(fontData).forEach(fd -> fd.setHeight(TRANSITON_ORDER_LABEL_FONT_SIZE)); JFaceResources.getFontRegistry().put(TRANSITION_ORDER_LABEL_FONT, fontData); return JFaceResources.getFont(TRANSITION_ORDER_LABEL_FONT); }
Source:
<code>protected void executeVmCommand() { Collection<DiskImage> vmDisks = super.getAdjustedDiskImagesFromConfiguration(); for (DiskImage diskImage : vmDisks) { MoveOrCopyImageGroupParameters copyParams = createCopyParams(diskImage); ActionReturnValue returnValue = runInternalAction(ActionType.CopyImageGroup, copyParams, <START> cloneContextAndDetachFromParent()); <END> if (!returnValue.getSucceeded()) { setSucceeded(false); return; } getParameters().getSrcDiskIdToTargetDiskIdMapping() .put(diskImage.getId(), copyParams.getDestImageGroupId()); } persistCommandIfNeeded(); setSucceeded(true); }</code><technical_language>idea right, detach parent</technical_language>

Target:
protected void executeVmCommand() { Collection<DiskImage> vmDisks = super.getAdjustedDiskImagesFromConfiguration(); for (DiskImage diskImage : vmDisks) { MoveOrCopyImageGroupParameters copyParams = createCopyParams(diskImage); ActionReturnValue returnValue = runInternalAction(ActionType.CopyImageGroup, copyParams, createStepsContext()); if (!returnValue.getSucceeded()) { setSucceeded(false); return; } getParameters().getSrcDiskIdToTargetDiskIdMapping() .put(diskImage.getId(), copyParams.getDestImageGroupId()); } persistCommandIfNeeded(); setSucceeded(true); }
Source:
<code>private CsvRowSerializationSchema( RowTypeInfo typeInfo, CsvSchema csvSchema) { this.typeInfo = typeInfo; this.runtimeConverter = createRowRuntimeConverter(typeInfo, true); this.csvMapper = new CsvMapper(); <START> this.csvSchema = csvSchema.withLineSeparator(""); <END> this.objectWriter = csvMapper.writer(this.csvSchema); }</code><technical_language>ditto. I recommend changing legacy csv format</technical_language>

Target:
private CsvRowSerializationSchema( RowTypeInfo typeInfo, CsvSchema csvSchema) { this.typeInfo = typeInfo; this.runtimeConverter = createRowRuntimeConverter(typeInfo, true); this.csvMapper = new CsvMapper(); this.csvSchema = csvSchema; this.objectWriter = csvMapper.writer(csvSchema); }
Source:
<code>public void testConnectorSendsHelloVerifyRequestWithoutCreatingSession() throws Exception { final CountDownLatch latch = new CountDownLatch(1); final List<Record> receivedRecords = new ArrayList<>(); InetSocketAddress endpoint = new InetSocketAddress(12000); LatchDecrementingDataHandler handler = new LatchDecrementingDataHandler(latch) { @Override <START> public boolean process(InetSocketAddress endpoint, final byte[] data) { <END> receivedRecords.addAll(Record.fromByteArray(data, endpoint, null)); return true; } }; UdpConnector rawClient = new UdpConnector(endpoint.getPort(), handler); try{ rawClient.start(); ClientHello clientHello = createClientHello(); rawClient.sendRecord(serverHelper.serverEndpoint, DtlsTestTools.newDTLSRecord(ContentType.HANDSHAKE.getCode(), 0, 0, clientHello.toByteArray())); Assert.assertTrue(latch.await(MAX_TIME_TO_WAIT_SECS, TimeUnit.SECONDS)); Assert.assertFalse(receivedRecords.isEmpty()); Record record = receivedRecords.get(0); Assert.assertThat("Expected HANDSHAKE message from server", record.getType(), is(ContentType.HANDSHAKE)); HandshakeMessage handshake = (HandshakeMessage) record.getFragment(); Assert.assertThat("Expected HELLO_VERIFY_REQUEST from server", handshake.getMessageType(), is(HandshakeType.HELLO_VERIFY_REQUEST)); Assert.assertNull("Server should not have created session for CLIENT_HELLO containging no cookie", serverHelper.serverConnectionStore.get(endpoint)); } finally { rawClient.stop(); } }</code><technical_language>reason data final</technical_language>

Target:
public void testConnectorSendsHelloVerifyRequestWithoutCreatingSession() throws Exception { final CountDownLatch latch = new CountDownLatch(1); final List<Record> receivedRecords = new ArrayList<>(); InetSocketAddress endpoint = new InetSocketAddress(12000); LatchDecrementingDataHandler handler = new LatchDecrementingDataHandler(latch) { @Override public boolean process(InetSocketAddress endpoint, byte[] data) { receivedRecords.addAll(Record.fromByteArray(data, endpoint, null)); return true; } }; UdpConnector rawClient = new UdpConnector(endpoint.getPort(), handler); try{ rawClient.start(); ClientHello clientHello = createClientHello(); rawClient.sendRecord(serverHelper.serverEndpoint, DtlsTestTools.newDTLSRecord(ContentType.HANDSHAKE.getCode(), 0, 0, clientHello.toByteArray())); Assert.assertTrue(latch.await(MAX_TIME_TO_WAIT_SECS, TimeUnit.SECONDS)); Assert.assertFalse(receivedRecords.isEmpty()); Record record = receivedRecords.get(0); Assert.assertThat("Expected HANDSHAKE message from server", record.getType(), is(ContentType.HANDSHAKE)); HandshakeMessage handshake = (HandshakeMessage) record.getFragment(); Assert.assertThat("Expected HELLO_VERIFY_REQUEST from server", handshake.getMessageType(), is(HandshakeType.HELLO_VERIFY_REQUEST)); Assert.assertNull("Server should not have created session for CLIENT_HELLO containging no cookie", serverHelper.serverConnectionStore.get(endpoint)); } finally { rawClient.stop(); } }
Source:
<code>public void createRecommendationsResponseShouldReturnAResult() throws Exception { String string = Utils.getTestResource("response.recommendations.home_page_1.json"); RecommendationsResponse response = ConstructorIO.createRecommendationsResponse(string); assertEquals("pod display name exists", response.getResponse().getPod().getDisplayName(), "You may also like"); <START> assertEquals("pod display name exists", response.getResponse().getPod().getId(), "item_page_1"); <END> assertEquals("search results exist", response.getResponse().getResults().size(), 10); assertEquals("total number of results", (int)response.getResponse().getTotalNumberOfResults(), 10); assertTrue("search result id exists", response.getResultId() != null); }</code><technical_language>pod id exists</technical_language>

Target:
public void createRecommendationsResponseShouldReturnAResult() throws Exception { String string = Utils.getTestResource("response.recommendations.home_page_1.json"); RecommendationsResponse response = ConstructorIO.createRecommendationsResponse(string); assertEquals("pod display name exists", response.getResponse().getPod().getDisplayName(), "You may also like"); assertEquals("pod display id exists", response.getResponse().getPod().getId(), "item_page_1"); assertEquals("recommendation results exist", response.getResponse().getResults().size(), 10); assertEquals("total number of results", (int)response.getResponse().getTotalNumberOfResults(), 10); assertTrue("recommendation result id exists", response.getResultId() != null); }
Source:
<code>public Block getRegion(int position, int length) { int positionCount = getPositionCount(); if (position < 0 || length < 0 || position + length > positionCount) { throw new IndexOutOfBoundsException(format("Invalid position range [%s, %s) in block with %s positions", position, position + length, positionCount)); } <START> <END> return new ArrayBlock( position + getOffsetBase(), length, getValueIsNull(), getOffsets(), getValues()); }</code><technical_language>correct behavior for ArrayBlock, unexpected for ArrayBlockBuilder? ArrayBlockBuilder simply override this method. move this method ArrayBlock unsuitable for of subclasses</technical_language>

Target:
public Block getRegion(int position, int length) { int positionCount = getPositionCount(); checkValidRegion(positionCount, position, length); return new ArrayBlock( position + getOffsetBase(), length, getValueIsNull(), getOffsets(), getValues()); }
Source:
<code>public void clickCancelButton() { <START> new WebDriverWait(seleniumWebDriver, ELEMENT_TIMEOUT_SEC) <END> .until(ExpectedConditions.visibilityOf(cancelButton)) .click(); waitRevertPanelClosed(); }</code><technical_language>helper class [WebDriverWaitFactory](<LINK_0> ) aimed avoid creation of enormous WebDriverWait instances</technical_language>

Target:
public void clickCancelButton() { seleniumWebDriverHelper.waitAndClick(cancelButton, ELEMENT_TIMEOUT_SEC); waitRevertPanelClosed(); }
Source:
<code>protected void stopActions() { <START> server = null; <END> }</code><technical_language>dispose actions do cleanly close server? fServer.dispose()</technical_language>

Target:
protected void stopActions() { if(fServer != null) { try { fServer.dispose(); } catch (IOException e) { e.printStackTrace(); } } }
Source:
<code>public boolean accept(WindupRuleProvider ruleProvider) { <START> Class<? extends WindupRuleProvider> cls = ruleProvider.getClass(); <END> if(Proxies.isProxyType(cls)) cls = (Class<? extends WindupRuleProvider>) Proxies.unwrapProxyTypes(cls); return this.ruleProviders.contains(cls.getName()); }</code><technical_language>rename cls -> clazz type</technical_language>

Target:
public boolean accept(WindupRuleProvider ruleProvider) { Class<? extends WindupRuleProvider> clazz = ruleProvider.getClass(); if(Proxies.isProxyType(clazz)) clazz = (Class<? extends WindupRuleProvider>) Proxies.unwrapProxyTypes(clazz); return this.ruleProviders.contains(clazz.getName()); }
Source:
<code>@Override public List<Pair<RelTraitSet, List<RelTraitSet>>> passThroughCorrelation(RelTraitSet nodeTraits, List<RelTraitSet> inTraits) { if (RexUtils.hasCorrelation(getProjects())) <START> return ImmutableList.of(); <END> return ImmutableList.of(Pair.of(nodeTraits, ImmutableList.of(inTraits.get(0).replace(TraitUtils.correlation(nodeTraits))))); }</code><technical_language>empty list returned in case correlations derived getProjects() is subset of TraitUtils.correlation(nodeTraits))</technical_language>

Target:
@Override public List<Pair<RelTraitSet, List<RelTraitSet>>> passThroughCorrelation(RelTraitSet nodeTraits, List<RelTraitSet> inTraits) { Set<CorrelationId> corrIds = RexUtils.extractCorrelationIds(getProjects()); Set<CorrelationId> traitCorrIds = TraitUtils.correlation(nodeTraits).correlationIds(); if (!traitCorrIds.containsAll(corrIds)) return ImmutableList.of(); return ImmutableList.of(Pair.of(nodeTraits, ImmutableList.of(inTraits.get(0).replace(TraitUtils.correlation(nodeTraits))))); }
Source:
<code>private static String extractDoiFromDoiUrl(String doiUrl) { String doi = doiUrl; try { URI uri = new URI(doiUrl); String[] segments = uri.getPath().split("/"); <START> doi = segments[segments.length - 2] + "/" + segments[segments.length - 1]; <END> } catch (URISyntaxException e) { LOG.error("Could not extract DOI. Error is " + e.getMessage(), e); } return doi; }</code><technical_language>URL url = new URL(doiUrl); doi = StringUtils.stripStart(uri.getPath(), "/"); alot simpler in opinion</technical_language>

Target:
protected static String extractDoiFromDoiUrl(String doiUrl) { String doi = doiUrl; try { URI uri = new URI(doiUrl); doi = StringUtils.stripStart(uri.getPath(), "/"); } catch (URISyntaxException e) { LOG.error("Could not extract DOI. Error is " + e.getMessage(), e); } return doi; }
Source:
<code>public void configure(WebSecurity web) throws Exception { <START> super.configure(web); <END> web.httpFirewall(allowUrlEncodedSlashHttpFirewall()); }</code><technical_language>(this well)</technical_language>

Target:
public void configure(WebSecurity web) throws Exception { web.httpFirewall(allowUrlEncodedSlashHttpFirewall()); }
Source:
<code>public VSizeIndexedIntsWriter( final IOPeon ioPeon, final String filenameBase, final int maxValue ) { this.ioPeon = ioPeon; <START> this.valueFileName = StringUtils.safeFormat("%s.values", filenameBase); <END> this.numBytes = VSizeIndexedInts.getNumBytesForMax(maxValue); }</code><technical_language>crash if bad format string</technical_language>

Target:
public VSizeIndexedIntsWriter( final IOPeon ioPeon, final String filenameBase, final int maxValue ) { this.ioPeon = ioPeon; this.valueFileName = StringUtils.format("%s.values", filenameBase); this.numBytes = VSizeIndexedInts.getNumBytesForMax(maxValue); }
Source:
<code>public void setup() { super.setup(); archiveApi = api.getArchiveApi(); archiveUser = identity.toLowerCase() + "_test9"; archiveCounter = retry(new Predicate<Integer>() { public boolean apply(Integer value) { <START> return archiveApi.list().size() == value; <END> } }, 30, 1, SECONDS); }</code><technical_language>this == here</technical_language>

Target:
public void setup() { super.setup(); archiveApi = api.getArchiveApi(); archiveUser = identity.toLowerCase() + "_test9"; archiveCounter = retry(new Predicate<Integer>() { public boolean apply(Integer value) { return archiveApi.list().size() == value.intValue(); } }, 30, 1, SECONDS); }
Source:
<code>public void testNull_Event() { XDRResponseEventType eventA = new XDRResponseEventType(); <START> XDREventType eventB = new XDREventType(); <END> eventA = null; eventB = null; assertNull(xdrTransformHelper.transformXDRResponseToCheckPolicy(eventA)); assertNull(xdrTransformHelper.transformXDRToCheckPolicy(eventB)); }</code><technical_language>Do need declare object assign null? remove</technical_language>

Target:
public void testNull_Event() { assertNull(xdrTransformHelper.transformXDRResponseToCheckPolicy(null)); assertNull(xdrTransformHelper.transformXDRToCheckPolicy(null)); }
Source:
<code>public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { final List<Future<StepExecution>> tasks = new ArrayList<Future<StepExecution>>(); final Set<StepExecution> result = new HashSet<StepExecution>(); final ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); <START> Set<StepExecution> partitionStepExecutions = new HashSet<StepExecution>(); <END> int stepExecutionCount = jobRepository.getStepExecutionCount(stepExecution.getJobExecution().getJobInstance(), stepExecution.getStepName()); boolean isRestart = stepExecutionCount > 1; partitionStepExecutions = splitStepExecution(stepSplitter, stepExecution, isRestart); taskExecutor.setCorePoolSize(threads); taskExecutor.setMaxPoolSize(threads); taskExecutor.initialize(); for (final StepExecution curStepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, curStepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); curStepExecution.setStatus(BatchStatus.FAILED); curStepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } processPartitionResults(tasks, result); return result; }</code><technical_language>minor inited call splitStepExecution</technical_language>

Target:
public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { final List<Future<StepExecution>> tasks = new ArrayList<Future<StepExecution>>(); final Set<StepExecution> result = new HashSet<StepExecution>(); final ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); int stepExecutionCount = jobRepository.getStepExecutionCount(stepExecution.getJobExecution().getJobInstance(), stepExecution.getStepName()); boolean isRestart = stepExecutionCount > 1; Set<StepExecution> partitionStepExecutions = splitStepExecution(stepExecution, isRestart); taskExecutor.setCorePoolSize(threads); taskExecutor.setMaxPoolSize(threads); taskExecutor.initialize(); for (final StepExecution curStepExecution : partitionStepExecutions) { final FutureTask<StepExecution> task = createTask(step, curStepExecution); try { taskExecutor.execute(task); tasks.add(task); } catch (TaskRejectedException e) { ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); curStepExecution.setStatus(BatchStatus.FAILED); curStepExecution.setExitStatus(exitStatus); result.add(stepExecution); } } processPartitionResults(tasks, result); return result; }
Source:
<code>public final void saveBoardAs() { Optional<String> response = promptForNewBoardName(); response.ifPresent(boardName -> { createAndOpenNewBoard(boardName, panels.getCurrentPanelInfos()); <START> }); <END> }</code><technical_language>this ui.triggerEvent(new BoardSavedEvent());</technical_language>

Target:
public final void saveBoardAs() { Optional<String> response = promptForBoardName(); response.ifPresent(boardName -> { createAndOpenNewBoard(boardName, panels.getCurrentPanelInfos()); }); }
Source:
<code>public Map<Map.Entry<Long, Long>, Map.Entry<Long, Long>> apply(Set<Map.Entry<Long, Long>> request) { if (offHeapTimestampCache.cacheDescriptor.get().currentSize().get() >= offHeapTimestampCache.maxSize) { <START> offHeapTimestampCache.taggedMetricRegistry.meter(CACHE_NUKE).mark(); <END> offHeapTimestampCache.clear(); } CacheDescriptor cacheDescriptor = offHeapTimestampCache.cacheDescriptor.get(); try { Map<Long, Long> response = offHeapTimestampCache.persistentTimestampStore.multiGet( cacheDescriptor.storeNamespace(), request.stream().map(Map.Entry::getKey).collect(Collectors.toList())); Map<Long, Long> toWrite = ImmutableMap.copyOf(Sets.difference(request, response.entrySet())); offHeapTimestampCache.persistentTimestampStore.multiPut( cacheDescriptor.storeNamespace(), toWrite); cacheDescriptor.currentSize().addAndGet(toWrite.size()); offHeapTimestampCache.taggedMetricRegistry.counter(CACHE_SIZE).inc(toWrite.size()); } catch (SafeIllegalArgumentException exception) { log.warn("Clear called concurrently, writing failed", exception); } finally { offHeapTimestampCache.inflightRequests.clear(); } return KeyedStream.of(request.stream()).collectToMap(); }</code><technical_language>Hmm. A meter is plausible here, registers a bunch of series interesting for operation I is super common</technical_language>

Target:
public Map<Map.Entry<Long, Long>, Map.Entry<Long, Long>> apply(Set<Map.Entry<Long, Long>> request) { if (offHeapTimestampCache.cacheDescriptor.get().currentSize().get() >= offHeapTimestampCache.maxSize) { offHeapTimestampCache.taggedMetricRegistry.counter(CACHE_NUKE).inc(); offHeapTimestampCache.clear(); } CacheDescriptor cacheDescriptor = offHeapTimestampCache.cacheDescriptor.get(); try { Map<Long, Long> response = offHeapTimestampCache.persistentTimestampStore.multiGet( cacheDescriptor.storeNamespace(), request.stream().map(Map.Entry::getKey).collect(Collectors.toList())); Map<Long, Long> toWrite = ImmutableMap.copyOf(Sets.difference(request, response.entrySet())); offHeapTimestampCache.persistentTimestampStore.multiPut( cacheDescriptor.storeNamespace(), toWrite); cacheDescriptor.currentSize().addAndGet(toWrite.size()); } catch (SafeIllegalArgumentException exception) { log.warn("Clear called concurrently, writing failed", exception); } finally { offHeapTimestampCache.inflightRequests.clear(); } return KeyedStream.of(request.stream()).collectToMap(); }
Source:
<code>public EntityInteractHandler getItemHandler() { return (e, item, offhand) -> { Entity entity = e.getRightClicked(); if (entity.getType() == EntityType.ZOMBIE_VILLAGER) { Player p = e.getPlayer(); if (p.getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, false); } p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CONVERTED, 1, 1); ZombieVillager zombieVillager = (ZombieVillager) entity; zombieVillager.setConversionTime(1); if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) { zombieVillager.setConversionPlayer(p); } } <START> else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) && entity.getType() == EntityType.ZOMBIFIED_PIGLIN) { Player p = e.getPlayer(); if (p.getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, false); } Location loc = entity.getLocation(); p.playSound(loc, Sound.ENTITY_ZOMBIE_VILLAGER_CONVERTED, 1, 1); entity.remove(); loc.getWorld().spawnEntity(loc, EntityType.PIGLIN); } <END> }; }</code><technical_language>This is pretty redundant above, lots of ways refactor this</technical_language>

Target:
public EntityInteractHandler getItemHandler() { return (e, item, offhand) -> { Entity entity = e.getRightClicked(); Player p = e.getPlayer(); if (entity instanceof ZombieVillager) { useItem(p); healZombieVillager((ZombieVillager) entity, p); } else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16) && entity instanceof PigZombie) { useItem(p); healZombifiedPiglin((PigZombie) entity); } }; }
Source:
<code>private void next(final String email) { FirebaseAuth firebaseAuth = mActivityHelper.getFirebaseAuth(); firebaseAuth.sendPasswordResetEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error sending password reset email")) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { mActivityHelper.dismissDialog(); new AlertDialog.Builder(RecoverPasswordActivity.this, R.style.FirebaseUI_Dialog) .setTitle(R.string.title_confirm_recover_password_activity) .setMessage(String.format( getString(R.string.confirm_recovery_body), email)) .setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface anInterface) { finish(RESULT_OK, new Intent()); } }) .setPositiveButton(android.R.string.ok, null) <START> .show(); <END> } }) .addOnFailureListener(this, new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { mActivityHelper.dismissDialog(); if (e instanceof FirebaseAuthInvalidUserException) { mEmailEditText.setError(getString(R.string.error_email_does_not_exist)); } } }); }</code><technical_language>This is great. Activity. a DialogFragment AlertDialog (to survive rotations) I fine leave a TODO</technical_language>

Target:
private void next(final String email) { FirebaseAuth firebaseAuth = mActivityHelper.getFirebaseAuth(); firebaseAuth.sendPasswordResetEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error sending password reset email")) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { mActivityHelper.dismissDialog(); RecoveryEmailSentDialog.show(email, getSupportFragmentManager()); } }) .addOnFailureListener(this, new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { mActivityHelper.dismissDialog(); if (e instanceof FirebaseAuthInvalidUserException) { mEmailEditText.setError(getString(R.string.error_email_does_not_exist)); } } }); }
Source:
<code>public void testOtherFieldsNotValidatedInImport() { ImportVmParameters parameters = createParameters(); <START> String stringOf5000Chars = StringUtils.repeat("A", BusinessEntitiesDefinitions.GENERAL_MAX_SIZE + 1); <END> parameters.getVm().setUserDefinedProperties(stringOf5000Chars); parameters.setImportAsNewEntity(true); ImportVmCommand command = new ImportVmCommand(parameters); Set<ConstraintViolation<ImportVmParameters>> validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); assertTrue(validate.isEmpty()); parameters.getVm().setUserDefinedProperties(stringOf5000Chars); parameters.setImportAsNewEntity(false); command = new ImportVmCommand(parameters); validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); assertTrue(validate.isEmpty()); }</code><technical_language>is "A" previous ones? stringOf5000Chars - is it</technical_language>

Target:
public void testOtherFieldsNotValidatedInImport() { ImportVmParameters parameters = createParameters(); String stringOf5000Chars = RandomUtils.instance().nextNameString(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE + 1); parameters.getVm().setUserDefinedProperties(stringOf5000Chars); parameters.setImportAsNewEntity(true); ImportVmCommand command = new ImportVmCommand(parameters); Set<ConstraintViolation<ImportVmParameters>> validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); assertTrue(validate.isEmpty()); parameters.getVm().setUserDefinedProperties(stringOf5000Chars); parameters.setImportAsNewEntity(false); command = new ImportVmCommand(parameters); validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); assertTrue(validate.isEmpty()); }
Source:
<code>public void startBroadcast() { try { sendBroadCast(); service = Executors.newSingleThreadScheduledExecutor(); Runnable runnable = new Runnable() { public void run() { logger.info("Listening to broadcast"); try { listenToBroadCast(); } catch (Exception e) { logger.error("Broadcasting has been interrupted" + e.getMessage()); } } }; service.scheduleAtFixedRate(runnable, 0, 300, TimeUnit.SECONDS); } catch (Exception e) { <START> logger.info("Broadcasting has been interrupted " + e.getMessage()); e.printStackTrace(); <END> } }</code><technical_language>Formatting. indent. e.printStackTrace, logger(Logger#error(String msg, Throwable t) for it). I logging level error</technical_language>

Target:
public void startBroadcast() { BroadCastServer.turnOnBroadcast = true; try { sendBroadCast(); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override public void run() { while (!Thread.currentThread().isInterrupted()) { try { while (turnOnBroadcast) { listenToBroadCast(); } } catch (Exception e) { logger.error("Broadcasting has been interrupted" + e.getMessage()); stopBroadCast(); } } } }); } catch (Exception e) { logger.info("Broadcasting has been interrupted " + e.getMessage()); stopBroadCast(); } }
Source:
<code><START> protected void sanityCheckTableMetadata(TableReference tableRef, byte[] tableMetadata) { <END> if (tableMetadata == null || Arrays.equals(tableMetadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { throw new IllegalArgumentException( String.format( "Passing in empty table metadata for table '%s' is disallowed," + " as reasoning about such tables is hard. Consider using" + " AtlasDbConstants.GENERIC_TABLE_METADATA instead.", tableRef)); } }</code><technical_language>this need non-static? added in clockfort's PR</technical_language>

Target:
protected static void sanityCheckTableMetadata(TableReference tableRef, byte[] tableMetadata) { if (tableMetadata == null || Arrays.equals(tableMetadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { throw new IllegalArgumentException( String.format( "Passing in empty table metadata for table '%s' is disallowed," + " as reasoning about such tables is hard. Consider using" + " AtlasDbConstants.GENERIC_TABLE_METADATA instead.", tableRef)); } }
Source:
<code>public void onDiscordGameJoinEvent(DiscordJoinEvent discordJoinEvent) { Integer gameId = discordJoinEvent.getGameId(); Game game = getByUid(gameId); boolean disallowJoinsViaDiscord = preferencesService.getPreferences().isDisallowJoinsViaDiscord(); if (disallowJoinsViaDiscord) { log.debug("Join was requested via Discord but was rejected due to it being disabled in settings"); return; } if (game == null) { <START> throw new IllegalStateException(MessageFormat.format("Could not find game to join, with id: {0}", discordJoinEvent.getGameId())); <END> } joinGame(game, ""); }</code><technical_language>System.out.println(MessageFormat.format("{0}", 11111111)); results in: 11,111,111 Therefore, MessageFormat (instead StringFormat) {0,number,#} prevent formatting. a rule of thumb, message displayed user, MessageFormat, if technical only, StringFormat</technical_language>

Target:
public void onDiscordGameJoinEvent(DiscordJoinEvent discordJoinEvent) { Integer gameId = discordJoinEvent.getGameId(); Game game = getByUid(gameId); boolean disallowJoinsViaDiscord = preferencesService.getPreferences().isDisallowJoinsViaDiscord(); if (disallowJoinsViaDiscord) { log.debug("Join was requested via Discord but was rejected due to it being disabled in settings"); return; } if (game == null) { throw new IllegalStateException(String.format("Could not find game to join, with id: %d", discordJoinEvent.getGameId())); } joinGame(game, ""); }