auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private InputStream openStream(String url) throws IOException { <END> return new URL(url).openStream(); }</code><technical_language>suggestion private static InputStream openStream(String url) throws IOException {</technical_language>

Target:
private static InputStream openStream(String url) throws IOException { return new URL(url).openStream(); }
Source:
<code><START> protected EventBus getEventBus() { <END> return eventBus; }</code><technical_language>final user override method</technical_language>

Target:
protected final EventBus getEventBus() { return eventBus; }
Source:
<code><START> public static void configureStaticResources(String folder) { <END> if (!isStaticResourcesSet()) { if (folder != null) { try { ClassPathResource resource = new ClassPathResource(folder); if (resource.getFile().isDirectory()) { if (staticResourceHandlers == null) { staticResourceHandlers = new ArrayList<>(); } staticResourceHandlers.add(new ClassPathResourceHandler(folder, "index.html")); LOG.info("StaticResourceHandler configured with folder = " + folder); } else { LOG.error("Static resource location must be a folder"); } } catch (IOException e) { LOG.error("Error when creating StaticResourceHandler", e); } } staticResourcesSet = true; } }</code><technical_language>Flip some ifs return early</technical_language>

Target:
public static void configureStaticResources(String folder) { Assert.notNull(folder, "'folder' must not be null"); if (!isStaticResourcesSet()) { try { ClassPathResource resource = new ClassPathResource(folder); if (!resource.getFile().isDirectory()) { LOG.error("Static resource location must be a folder"); return; } if (staticResourceHandlers == null) { staticResourceHandlers = new ArrayList<>(); } staticResourceHandlers.add(new ClassPathResourceHandler(folder, "index.html")); LOG.info("StaticResourceHandler configured with folder = " + folder); } catch (IOException e) { LOG.error("Error when creating StaticResourceHandler", e); } staticResourcesSet = true; } }
Source:
<code>public static Table getHTableSystemChildLink (RegionCoprocessorEnvironment env) throws IOException { <START> if (coprocessorScanWorks(env)) { <END> try { return env.getConnection().getTable(SchemaUtil.getPhysicalTableName(SYSTEM_CHILD_LINK_NAME_BYTES, env.getConfiguration())); } catch (Exception e){ return env.getConnection().getTable(SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES, env.getConfiguration())); } } try { return getTableFromSingletonPool(env, SchemaUtil.getPhysicalTableName(SYSTEM_CHILD_LINK_NAME_BYTES, env.getConfiguration())); } catch (Exception e){ return getTableFromSingletonPool(env, SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES, env.getConfiguration())); } }</code><technical_language>coprocessorScanWorks return true for HBase version >= 0.98.6, earliest version currently support is 1.3. rid of getTableFromSingletonPool calls</technical_language>

Target:
public static Table getHTableSystemChildLink (RegionCoprocessorEnvironment env) throws IOException { try { return env.getConnection().getTable(SchemaUtil.getPhysicalTableName(SYSTEM_CHILD_LINK_NAME_BYTES, env.getConfiguration())); } catch (Exception e){ return env.getConnection().getTable(SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES, env.getConfiguration())); } }
Source:
<code>public void testLazyTransformSet() { Set<String> original = Sets.newSet("John", "Jane", "Adam", "Tom"); Function<String, String> function = new Function<String, String>() { @Override public String apply(String input) { return input+"HI"; } }; Set<String> output = Transformers.transformSetLazily(original, function); Set<String> transformedSetOutput = Transformers.transformSet(original, function); Iterator<String> it1 = output.iterator(); Iterator<String> it2 = transformedSetOutput.iterator(); while(it1.hasNext() && it2.hasNext()) { <START> assertTrue(it1.next().equals(it2.next())); <END> } }</code><technical_language>assertEquals instead of assertTrue</technical_language>

Target:
public void testLazyTransformSet() { Set<String> original = Sets.newSet("John", "Jane", "Adam", "Tom"); Function<String, String> function = new Function<String, String>() { @Override public String apply(String input) { return input+"HI"; } }; Set<String> output = Transformers.transformSetLazily(original, function); Set<String> transformedSetOutput = Transformers.transformSet(original, function); Iterator<String> it1 = output.iterator(); Iterator<String> it2 = transformedSetOutput.iterator(); while(it1.hasNext() && it2.hasNext()) { assertEquals(it1.next(), it2.next()); } }
Source:
<code>public static Page mergePages(List<Type> types, List<Page> pages) { PageBuilder pageBuilder = new PageBuilder(types); int totalPositionCount = 0; for (Page page : pages) { <START> verify(page.getChannelCount() == types.size()); <END> for (int i = 0; i < types.size(); i++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(i); Block block = page.getBlock(i); for (int position = 0; position < page.getPositionCount(); position++) { if (block.isNull(position)) { blockBuilder.appendNull(); } else { block.writePositionTo(position, blockBuilder); } } } totalPositionCount += page.getPositionCount(); } pageBuilder.declarePositions(totalPositionCount); return pageBuilder.build(); }</code><technical_language>add a message values, in case fails</technical_language>

Target:
public static Page mergePages(List<Type> types, List<Page> pages) { PageBuilder pageBuilder = new PageBuilder(types); int totalPositionCount = 0; for (Page page : pages) { verify(page.getChannelCount() == types.size(), format("Number of channels in page %d is not equal to number of types %d", page.getChannelCount(), types.size())); for (int i = 0; i < types.size(); i++) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(i); Block block = page.getBlock(i); for (int position = 0; position < page.getPositionCount(); position++) { if (block.isNull(position)) { blockBuilder.appendNull(); } else { block.writePositionTo(position, blockBuilder); } } } totalPositionCount += page.getPositionCount(); } pageBuilder.declarePositions(totalPositionCount); return pageBuilder.build(); }
Source:
<code>public static boolean isRestfulWmtsRequest(MutableHttpServletRequest mutableRequest) { String url = mutableRequest.getRequestURL().toString(); String service = mutableRequest.getParameterIgnoreCase("service"); if (!StringUtils.isEmpty(service) && service.equalsIgnoreCase("wmts")) { return false; <START> } <END> return Pattern.compile(".*/geoserver.action/.*/wmts/\\d+/(.*)").matcher(url).matches(); }</code><technical_language>This test fragile, check for presence of a pattern {TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png (like in isRestfulWmtsGetFeatureinfo() below)</technical_language>

Target:
public static boolean isRestfulWmtsRequest(MutableHttpServletRequest mutableRequest) { String url = mutableRequest.getRequestURL().toString(); boolean defaultRestfulRequest = Pattern.compile("[^\\/]*\\/[^\\/]*[^\\/]\\/\\d+\\/\\d+").matcher(url).find(); boolean isWmtsUrl = Pattern.compile(".*/geoserver.action/.*/wmts/\\d+/(.*)").matcher(url).matches(); return defaultRestfulRequest && isWmtsUrl; }
Source:
<code><START> public Set<String> getIndexCollections() { <END> return IndexCentralizerUtil.indexCollectionMap.keySet(); }</code><technical_language>I guess setIndexCollections addIndexCollection is coming later</technical_language>

Target:
public List<String> getIndexCollections() { return collections; }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) { ServerRequest server = new ServerRequest(checkNotNull(postParams.get("name"), "name parameter not present").toString(), checkNotNull(postParams.get("imageRef"), "imageRef parameter not present").toString(), checkNotNull(postParams.get("flavorRef"), "flavorRef parameter not present").toString()); if (metadata.size() > 0) server.metadata = metadata; if (personality.size() > 0) server.personality = personality; if (keyName != null) server.key_name = keyName; if (userData != null) server.user_data = base64().encode(userData); if (securityGroupNames.size() > 0) { server.securityGroupNames = Sets.newLinkedHashSet(); for (String groupName : securityGroupNames) { server.securityGroupNames.add(new NamedThingy(groupName)); } } if (adminPass != null) { server.adminPass = adminPass; } <START> if (networks.size() > 0) { <END> server.networks = Sets.<ImmutableMap<String, String>>newLinkedHashSet(); for (String network : networks) { server.networks.add(ImmutableMap.of("uuid", network)); } } return bindToRequest(request, ImmutableMap.of("server", server)); }</code><technical_language>!networks.isEmpty()</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) { ServerRequest server = new ServerRequest(checkNotNull(postParams.get("name"), "name parameter not present").toString(), checkNotNull(postParams.get("imageRef"), "imageRef parameter not present").toString(), checkNotNull(postParams.get("flavorRef"), "flavorRef parameter not present").toString()); if (metadata.size() > 0) server.metadata = metadata; if (personality.size() > 0) server.personality = personality; if (keyName != null) server.key_name = keyName; if (userData != null) server.user_data = base64().encode(userData); if (securityGroupNames.size() > 0) { server.securityGroupNames = Sets.newLinkedHashSet(); for (String groupName : securityGroupNames) { server.securityGroupNames.add(new NamedThingy(groupName)); } } if (adminPass != null) { server.adminPass = adminPass; } if (diskConfig != null) { server.diskConfig = diskConfig; } if (!networks.isEmpty()) { server.networks = Sets.newLinkedHashSet(); for (String network : networks) { server.networks.add(ImmutableMap.of("uuid", network)); } } return bindToRequest(request, ImmutableMap.of("server", server)); }
Source:
<code>public Map<ColumnHandle, ColumnHandle> pushdownSubfieldPruning( ConnectorSession session, ConnectorTableHandle table, Map<ColumnHandle, List<SubfieldPath>> desiredSubfields) { if (!isSubfieldPushdownEnabled(session)) { <START> return Collections.emptyMap(); <END> } return desiredSubfields.keySet().stream() .map(column -> (TpchColumnHandle) column) .collect(toImmutableMap(Function.identity(), column -> new TpchColumnHandle(column.getColumnName(), column.getType(), Optional.of(desiredSubfields.get(column))))); }</code><technical_language>ImmutableMap.of()</technical_language>

Target:
public Map<ColumnHandle, ColumnHandle> pushdownSubfieldPruning( ConnectorSession session, ConnectorTableHandle table, Map<ColumnHandle, List<SubfieldPath>> desiredSubfields) { if (!isSubfieldPushdownEnabled(session)) { return ImmutableMap.of(); } return desiredSubfields.keySet().stream() .map(column -> (TpchColumnHandle) column) .collect(toImmutableMap(Function.identity(), column -> new TpchColumnHandle(column.getColumnName(), column.getType(), desiredSubfields.get(column)))); }
Source:
<code>public Set<Integer> addContainers(Integer count) { List<String> auroraCmd = new ArrayList<>(Arrays.asList( "aurora", "job", "add", "--wait-until", "RUNNING", jobSpec + "/0", count.toString(), "--verbose")); LOG.info(String.format("Requesting %s new aurora containers %s", count, auroraCmd)); StringBuilder stderr = new StringBuilder(); if (!runProcess(auroraCmd, null, stderr)) { throw new RuntimeException("Failed to create " + count + " new aurora instances"); } <START> String stdoutStr = stderr.toString(); <END> String pattern = "Querying instance statuses: ["; int idx1 = stdoutStr.indexOf(pattern) + pattern.length(); int idx2 = stdoutStr.indexOf("]", idx1); String containerIdStr = stdoutStr.substring(idx1, idx2); LOG.info("container IDs returned by Aurora " + containerIdStr); return Arrays.asList(containerIdStr.split(", ")) .stream().map(x->Integer.valueOf(x)).collect(Collectors.toSet()); }</code><technical_language>suggest factory out this block a new function extractContainerIds() test it</technical_language>

Target:
public Set<Integer> addContainers(Integer count) { List<String> auroraCmd = new ArrayList<>(Arrays.asList( "aurora", "job", "add", "--wait-until", "RUNNING", jobSpec + "/0", count.toString(), "--verbose")); LOG.info(String.format("Requesting %s new aurora containers %s", count, auroraCmd)); StringBuilder stderr = new StringBuilder(); if (!runProcess(auroraCmd, null, stderr)) { throw new RuntimeException("Failed to create " + count + " new aurora instances"); } if (stderr.length() <= 0) { throw new RuntimeException("empty output by Aurora"); } return extractContainerIds(stderr.toString()); }
Source:
<code><START> public ExtensionScript getExtensionScript() { <END> return this.extensionScript; }</code><technical_language>protected</technical_language>

Target:
protected ExtensionScript getExtensionScript() { return this.extensionScript; }
Source:
<code>public void save() { activate(); log.info("Save editor"); try { <START> new ShellMenuItem(new WorkbenchShell(), "File", "Save").select(); <END> } catch (CoreLayerException coreExc) { if (coreExc.getMessage().contains("Menu item is not enabled")) { throw new WorkbenchLayerException("Menu item 'Save' is not enabled"); } throw coreExc; } new WaitWhile(new EditorIsDirty(this)); activate(); }</code><technical_language>a lot safer if call ShellMenuItem.isEnabled -> if false throw ex</technical_language>

Target:
public void save() { activate(); log.info("Save editor"); ShellMenuItem saveItem = new ShellMenuItem(new WorkbenchShell(), "File", "Save"); if (saveItem.isEnabled()) { saveItem.select(); } else { throw new WorkbenchLayerException("Menu item 'Save' is not enabled"); } new WaitWhile(new EditorIsDirty(this)); activate(); }
Source:
<code>public void testGoBackToDiscardXChanges() { onBrickAtPosition(brickPosition).checkShowsText(R.string.brick_place_at); onBrickAtPosition(brickPosition).onFormulaTextField(R.id.brick_place_at_edit_text_x) .perform(click()); onFormulaEditor() .performEnterFormula("1234"); pressBack(); onView(withText(R.string.formula_editor_discard_changes_dialog_title)) .check(matches(isDisplayed())); <START> onView(withText(no)) <END> .perform(click()); onToast(withText(R.string.formula_editor_changes_discarded)) .check(matches(isDisplayed())); onBrickAtPosition(brickPosition).onFormulaTextField(R.id.brick_place_at_edit_text_x) .checkShowsNumber(0); }</code><technical_language>irritates me, tests clicks 'no' = 'do discard' positions set default zero. do I get this wrong</technical_language>

Target:
public void testGoBackToDiscardXChanges() { onBrickAtPosition(brickPosition).checkShowsText(R.string.brick_place_at); onBrickAtPosition(brickPosition).onFormulaTextField(R.id.brick_place_at_edit_text_x) .perform(click()); onFormulaEditor() .performEnterFormula("1234"); pressBack(); onView(withText(R.string.formula_editor_save_changes_dialog_title)) .check(matches(isDisplayed())); onView(withText(no)) .perform(click()); onToast(withText(R.string.formula_editor_changes_discarded)) .check(matches(isDisplayed())); onBrickAtPosition(brickPosition).onFormulaTextField(R.id.brick_place_at_edit_text_x) .checkShowsNumber(0); }
Source:
<code>public void dockerMachineTestFileScanner(){ DumbSlave dockerSlave = (DumbSlave) getDockerSlave(dockerContainer.get()); FreeStyleJob job = prepairDockerSlave(dockerSlave); job.configure(); job.copyResource(resource("/warnings_plugin/out.txt")); job.addPublisher(WarningsPublisher.class).addWorkspaceFileScanner(JAVA_ID, "out.txt"); job.save(); Build build = job.startBuild().shouldSucceed(); assertThatActionExists(job, build, "Java Warnings"); <START> <END> }</code><technical_language>Add a check for number of warnings</technical_language>

Target:
public void dockerMachineTestFileScanner(){ DumbSlave dockerSlave = getDockerSlave(dockerContainer.get()); FreeStyleJob job = prepareDockerSlave(dockerSlave); job.configure(); job.copyResource(resource("/warnings_plugin/out.txt")); job.addPublisher(WarningsPublisher.class).addWorkspaceFileScanner(JAVA_ID, "out.txt"); job.save(); Build build = job.startBuild().shouldSucceed(); assertThatActionExists(job, build, "Java Warnings"); build.open(); assertThat(driver, hasContent("Java Warnings: " + 2)); }
Source:
<code>private static WorkloadClockConfiguration generateTps(JLoadProfileTps jLoadProfile) { TpsClockConfiguration tpsClockConfiguration = new TpsClockConfiguration(); tpsClockConfiguration.setValue(jLoadProfile.getTransactionsPerSecond()); <START> tpsClockConfiguration.setWarmUpTime(jLoadProfile.getWarmUpTimeInSeconds()); <END> tpsClockConfiguration.setMaxThreadNumber((int) jLoadProfile.getMaxLoadThreads()); tpsClockConfiguration.setTickInterval(jLoadProfile.getTickInterval()); return tpsClockConfiguration; }</code><technical_language>I needed convert milliseconds</technical_language>

Target:
private static WorkloadClockConfiguration generateTps(JLoadProfileTps jLoadProfile) { TpsClockConfiguration tpsClockConfiguration = new TpsClockConfiguration(); tpsClockConfiguration.setValue(jLoadProfile.getTransactionsPerSecond()); tpsClockConfiguration.setWarmUpTime(jLoadProfile.getWarmUpTimeInMilliseconds()); tpsClockConfiguration.setMaxThreadNumber((int) jLoadProfile.getMaxLoadThreads()); tpsClockConfiguration.setTickInterval(jLoadProfile.getTickInterval()); return tpsClockConfiguration; }
Source:
<code>public void delete(String id) { CuratorFramework client = zkConnection.getClient(); try { client.setData().forPath( Paths.build(Paths.JOB_DEPLOYMENTS, id, Paths.STATUS), ZooKeeperUtils.mapToBytes(new DeploymentUnitStatus( DeploymentUnitStatus.State.undeploying).toMap())); } catch (Exception e) { <START> logger.warn("Exception while transitioning job state to " + <END> DeploymentUnitStatus.State.undeploying, e); } try { client.delete().deletingChildrenIfNeeded() .forPath(Paths.build(Paths.JOB_DEPLOYMENTS, id)); } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, KeeperException.NoNodeException.class); } }</code><technical_language>this mention name of job state is transitioned</technical_language>

Target:
public void delete(String id) { CuratorFramework client = zkConnection.getClient(); try { client.setData().forPath( Paths.build(Paths.JOB_DEPLOYMENTS, id, Paths.STATUS), ZooKeeperUtils.mapToBytes(new DeploymentUnitStatus( DeploymentUnitStatus.State.undeploying).toMap())); } catch (Exception e) { logger.warn("Exception while transitioning job '{}' state to {}", id, DeploymentUnitStatus.State.undeploying, e); } try { client.delete().deletingChildrenIfNeeded() .forPath(Paths.build(Paths.JOB_DEPLOYMENTS, id)); } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, KeeperException.NoNodeException.class); } }
Source:
<code>Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) throws IOException; } private final Path root; private final Map<Path, ParseResult<CompilationUnit>> content = new HashMap<>(); private JavaParser javaParser = new JavaParser(); public SourceRoot(Path root) { <START> if (Files.isRegularFile(root)) { <END> throw new IllegalArgumentException("Only directories are allowed as root path!"); } this.root = root.normalize(); Log.info("New source root at \"%s\"", this.root); }</code><technical_language>thing</technical_language>

Target:
Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) throws IOException; } private final Path root; private final Map<Path, ParseResult<CompilationUnit>> content = new HashMap<>(); private JavaParser javaParser = new JavaParser(); public SourceRoot(Path root) { if (!Files.isDirectory(root)) { throw new IllegalArgumentException("Only directories are allowed as root path!"); } this.root = root.normalize(); Log.info("New source root at \"%s\"", this.root); }
Source:
<code>public void setupNewValue(Message message) { if (message.getContent() == null) { return; } Map<String, Map<String,String>> dataMap = ((Map<String, Map<String, String>>) message.getContent().get(DATA)); if (dataMap != null && !dataMap.isEmpty()) { Map<String, String> stateMap = dataMap.get(STATE); if (stateMap != null && !stateMap.isEmpty()) { Object newValue = null; if (stateMap.containsKey("value")) { newValue = stateMap.get("value"); <START> } else if (stateMap.containsKey("index")) { <END> newValue = stateMap.get("index"); } widget.setValue(newValue); } } }</code><technical_language>this if statement simplified a</technical_language>

Target:
private void setupNewValue(Message message) { if (message.getContent() == null) { return; } Map<String, Map<String,String>> dataMap = ((Map<String, Map<String, String>>) message.getContent().get(DATA)); if (dataMap != null && !dataMap.isEmpty()) { Map<String, String> stateMap = dataMap.get(STATE); if (stateMap != null && !stateMap.isEmpty()) { getNewValue(stateMap).ifPresent(newValue -> widget.setValue(newValue)); } } }
Source:
<code>public void onCreate() { super.onCreate(); AndroidClassHasher.registerAndroidClassHashStrategy(); AndroidUtil.initializeStaticHandlers(); CommCareApplication.app = this; PreInitLogger pil = new PreInitLogger(); Logger.registerLogger(pil); System.setProperty("http.keepAlive", "false"); Thread.setDefaultUncaughtExceptionHandler(new CommCareExceptionHandler(Thread.getDefaultUncaughtExceptionHandler(), this)); PropertyManager.setPropertyManager(new ODKPropertyManager()); SQLiteDatabase.loadLibs(this); setRoots(); prepareTemporaryStorage(); dbState = initGlobalDb(); try { LegacyInstallUtils.checkForLegacyInstall(this, this.getGlobalStorage(ApplicationRecord.class)); } catch (SessionUnavailableException sfe) { throw new RuntimeException(sfe); } finally { Logger.registerLogger(new AndroidLogger(this.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); pil.dumpToNewLogger(); } <START> XPathErrorLogger.registerStorage(getGlobalStorage(XPathErrorEntry.STORAGE_KEY, XPathErrorEntry.class)); <END> intializeDefaultLocalizerData(); if (dbState != STATE_MIGRATION_FAILED && dbState != STATE_MIGRATION_QUESTIONABLE) { initializeAnAppOnStartup(); } ACRAUtil.initACRA(this); if (!GoogleAnalyticsUtils.versionIncompatible()) { analyticsInstance = GoogleAnalytics.getInstance(this); } }</code><technical_language>@phillipm Related conversation yesterday need sit this, want this app storage instead of global storage</technical_language>

Target:
public void onCreate() { super.onCreate(); AndroidClassHasher.registerAndroidClassHashStrategy(); AndroidUtil.initializeStaticHandlers(); CommCareApplication.app = this; PreInitLogger pil = new PreInitLogger(); Logger.registerLogger(pil); System.setProperty("http.keepAlive", "false"); Thread.setDefaultUncaughtExceptionHandler(new CommCareExceptionHandler(Thread.getDefaultUncaughtExceptionHandler(), this)); PropertyManager.setPropertyManager(new ODKPropertyManager()); SQLiteDatabase.loadLibs(this); setRoots(); prepareTemporaryStorage(); dbState = initGlobalDb(); try { LegacyInstallUtils.checkForLegacyInstall(this, this.getGlobalStorage(ApplicationRecord.class)); } catch (SessionUnavailableException sfe) { throw new RuntimeException(sfe); } finally { Logger.registerLogger(new AndroidLogger(this.getGlobalStorage(AndroidLogEntry.STORAGE_KEY, AndroidLogEntry.class))); pil.dumpToNewLogger(); } intializeDefaultLocalizerData(); if (dbState != STATE_MIGRATION_FAILED && dbState != STATE_MIGRATION_QUESTIONABLE) { initializeAnAppOnStartup(); } ACRAUtil.initACRA(this); if (!GoogleAnalyticsUtils.versionIncompatible()) { analyticsInstance = GoogleAnalytics.getInstance(this); } }
Source:
<code><START> public boolean handle(CorfuMsg message, ChannelHandlerContext ctx) { <END> if (!handlerMap.containsKey(message.getMsgType())) { return false; } try { Object ret = handlerMap.get(message.getMsgType()) .handle(message, ctx, client.getRouter()); if (ret != null) { client.getRouter().completeRequest(message.getRequestID(), ret); } } catch (Exception ex) { client.getRouter().completeExceptionally(message.getRequestID(), ex); } return true; }</code><technical_language>return is used. I suggest removing throwing IllegalStateException if a message type needs handled, is mapping a handler</technical_language>

Target:
public boolean handle(CorfuMsg message, ChannelHandlerContext ctx) { if (handlerMap.containsKey(message.getMsgType())) { try { Object ret = handlerMap.get(message.getMsgType()) .handle(message, ctx, client.getRouter()); if (ret != null) { client.getRouter().completeRequest(message.getRequestID(), ret); } } catch (Throwable e) { client.getRouter().completeExceptionally(message.getRequestID(), e); } return true; } return false; }
Source:
<code>@Override public void initCubicWorld() { this.isCubicWorld = true; this.entitySpawner = new CubeWorldEntitySpawner(); ServerCubeCache chunkProvider = new ServerCubeCache(this); this.chunkProvider = chunkProvider; this.generatorPipeline = new GeneratorPipeline(); this.lightingManager = new LightingManager(this); ICubicChunksWorldType type = (ICubicChunksWorldType) this.getWorldType(); type.registerWorldGen(this, this.generatorPipeline); GeneratorPipeline.checkStages(this.generatorPipeline); <START> this.cubeGenerator = new WorldGenerator(this, this.generatorPipeline); <END> this.thePlayerManager = new PlayerCubeMap(this); this.chunkGc = new ChunkGc(getCubeCache(), getPlayerCubeMap()); this.maxHeight = type.getMaxHeight(); this.minHeight = type.getMinHeight(); this.saveHandler = new CubicChunksSaveHandler(this, this.getSaveHandler()); this.generateWorld(); }</code><technical_language>~~If cubeGenerator contains generatorPipeline longer in this class, remove field completely world (unless is some other reason for there)~~ Considering GeneratorPipeline work StageRegistry I suggest renaming GeneratorStageRegistry in World</technical_language>

Target:
@Override public void initCubicWorld() { this.isCubicWorld = true; this.entitySpawner = new CubeWorldEntitySpawner(); ServerCubeCache chunkProvider = new ServerCubeCache(this); this.chunkProvider = chunkProvider; this.generatorStageRegistry = new GeneratorStageRegistry(); this.lightingManager = new LightingManager(this); ICubicChunksWorldType type = (ICubicChunksWorldType) this.getWorldType(); type.registerWorldGen(this, this.generatorStageRegistry); GeneratorStageRegistry.checkStages(this.generatorStageRegistry); this.cubeGenerator = new WorldGenerator(this, this.generatorStageRegistry); this.thePlayerManager = new PlayerCubeMap(this); this.chunkGc = new ChunkGc(getCubeCache(), getPlayerCubeMap()); this.maxHeight = type.getMaxHeight(); this.minHeight = type.getMinHeight(); this.saveHandler = new CubicChunksSaveHandler(this, this.getSaveHandler()); this.generateWorld(); }
Source:
<code>public void upgrade(User user) { Optional<String> vpnPassword = user.takeVpnPassword(); <START> vpnPassword.ifPresent(p -> setPassworOnDefaultDevice(user, p)); <END> }</code><technical_language>setPasswor... -> setPassword</technical_language>

Target:
public void upgrade(User user) { Optional<String> vpnPassword = user.getAndClearVpnPassword(); vpnPassword.ifPresent(p -> setPasswordOnDefaultDevice(user, p)); }
Source:
<code>public FuzzyBlockState build() { checkNotNull(internalState); if (values.isEmpty()) { return internalState.getBlockType().getFuzzyMatcher(); } FuzzyBlockState blockState = new FuzzyBlockState(internalState.getBlockType()); <START> for (Map.Entry<Property<?>, Object> entry : values.entrySet()) { <END> blockState.setState(entry.getKey(), entry.getValue()); } return blockState; }</code><technical_language>I pass map FBS constructor do this there, more sense part of initialization</technical_language>

Target:
public FuzzyBlockState build() { checkNotNull(type); if (values.isEmpty()) { return type.getFuzzyMatcher(); } return new FuzzyBlockState(type, values); }
Source:
<code>private String getApiToken(Map<String, Comparable> properties) { <START> String apiToken = getOrDefault(properties, KUBERNETES_SYSTEM_PREFIX, KUBERNETES_API_TOKEN, null); <END> if (apiToken == null) { apiToken = readAccountToken(); } return apiToken; }</code><technical_language>I check is argument pass null good create overloaded methods if is easy for easy readability..</technical_language>

Target:
private String getApiToken(Map<String, Comparable> properties) { String apiToken = getOrNull(properties, KUBERNETES_SYSTEM_PREFIX, KUBERNETES_API_TOKEN); if (apiToken == null) { apiToken = readAccountToken(); } return apiToken; }
Source:
<code>public static AutobatchingPaxosLearnerNetworkClientFactory create( LocalAndRemotes<WithDedicatedExecutor<BatchPaxosLearner>> learners, int quorumSize) { DisruptorAutobatcher<Map.Entry<Client, PaxosValue>, PaxosResponse> learn = Autobatchers.coalescing(new LearnCoalescingConsumer(learners.local(), learners.remotes())) .safeLoggablePurpose("batch-paxos-learner.learn") .build(); Map<BatchPaxosLearner, ExecutorService> executors = KeyedStream.of(learners.all()) .map(WithDedicatedExecutor::executor) <START> .mapKeys(WithDedicatedExecutor::service) <END> .collectToMap(); List<BatchPaxosLearner> remotes = learners.all() .stream() .map(WithDedicatedExecutor::service) .collect(Collectors.toList()); DisruptorAutobatcher<WithSeq<Client>, PaxosResponses<PaxosContainer<Optional<PaxosValue>>>> learnedValues = Autobatchers.coalescing( wrap( remotes, executors, quorumSize, LearnedValuesCoalescingFunction::new)) .safeLoggablePurpose("batch-paxos-learner.learned-values") .build(); DisruptorAutobatcher<WithSeq<Client>, PaxosResponses<PaxosUpdate>> learnedValuesSince = Autobatchers.coalescing( wrap( remotes, executors, quorumSize, LearnedValuesSinceCoalescingFunction::new)) .safeLoggablePurpose("batch-paxos-learner.learned-values-since") .build(); return new AutobatchingPaxosLearnerNetworkClientFactory( learn, learnedValues, learnedValuesSince); }</code><technical_language>I missed in this before, WithDedicatedExecutor.convert(learners.all())</technical_language>

Target:
public static AutobatchingPaxosLearnerNetworkClientFactory create( LocalAndRemotes<WithDedicatedExecutor<BatchPaxosLearner>> learners, int quorumSize) { DisruptorAutobatcher<Map.Entry<Client, PaxosValue>, PaxosResponse> learn = Autobatchers.coalescing(new LearnCoalescingConsumer(learners.local(), learners.remotes())) .safeLoggablePurpose("batch-paxos-learner.learn") .build(); Map<BatchPaxosLearner, ExecutorService> executors = WithDedicatedExecutor.convert(learners.all()); List<BatchPaxosLearner> remotes = ImmutableList.copyOf(executors.keySet()); DisruptorAutobatcher<WithSeq<Client>, PaxosResponses<PaxosContainer<Optional<PaxosValue>>>> learnedValues = Autobatchers.coalescing( wrap( remotes, executors, quorumSize, LearnedValuesCoalescingFunction::new)) .safeLoggablePurpose("batch-paxos-learner.learned-values") .build(); DisruptorAutobatcher<WithSeq<Client>, PaxosResponses<PaxosUpdate>> learnedValuesSince = Autobatchers.coalescing( wrap( remotes, executors, quorumSize, LearnedValuesSinceCoalescingFunction::new)) .safeLoggablePurpose("batch-paxos-learner.learned-values-since") .build(); return new AutobatchingPaxosLearnerNetworkClientFactory( learn, learnedValues, learnedValuesSince); }
Source:
<code>public String author() throws IOException { try { return new JdbcSession(this.sql.source()) <START> .sql("SELECT author FROM attachment WHERE bout = ? AND name = ?") <END> .set(this.bout) .set(this.label) .select(new SingleOutcome<>(String.class)); } catch (final SQLException ex) { throw new IOException(ex); } }</code><technical_language>@CarlosGines I try this one: java .sql( "SELECT author attachment bout = ? name = ?" )</technical_language>

Target:
public String author() throws IOException { try { return new JdbcSession(this.sql.source()) .sql( "SELECT author FROM attachment WHERE bout = ? AND name = ?" ) .set(this.bout) .set(this.label) .select(new SingleOutcome<>(String.class)); } catch (final SQLException ex) { throw new IOException( String.format("Can't fetch author from bout #%d", this.bout), ex ); } }
Source:
<code>public static boolean rulesetNeedUpdate(DependencyResolver dependencyResolver) { List<Coordinate> resolveVersions = dependencyResolver.resolveVersions(DependencyQueryBuilder.create(CoordinateBuilder.create() .setGroupId("org.jboss.windup.rules") .setArtifactId("windup-rulesets"))); int i = 0; Coordinate latestCoordinate; <START> do{ <END> i++; latestCoordinate = resolveVersions.get(resolveVersions.size() - i); }while(latestCoordinate.isSnapshot()); Path windupRulesDir = PathUtil.getWindupRulesDir(); Path coreRulesPropertiesPath = windupRulesDir.resolve(RULESET_CORE_DIRECTORY + "/META-INF/maven/org.jboss.windup.rules/windup-rulesets/pom.properties"); try (BufferedReader br = Files.newBufferedReader(coreRulesPropertiesPath, StandardCharsets.UTF_8)) { String line; while ((line = br.readLine()) != null) { if (line.startsWith(META_INF_VERSION_KEY)) { String installedVersion = line.substring(META_INF_VERSION_KEY.length()); String latestVersion = latestCoordinate.getVersion(); return versionIsOld(installedVersion,latestVersion); } } } catch (IOException e) { e.printStackTrace(); } return false; }</code><technical_language>this file is formatted incorrectly. run formatter please rebase this</technical_language>

Target:
public static boolean rulesetNeedUpdate(DependencyResolver dependencyResolver) { List<Coordinate> resolveVersions = dependencyResolver.resolveVersions(DependencyQueryBuilder.create(CoordinateBuilder.create() .setGroupId("org.jboss.windup.rules") .setArtifactId("windup-rulesets"))); int i = 0; Coordinate latestCoordinate; do { i++; latestCoordinate = resolveVersions.get(resolveVersions.size() - i); } while (latestCoordinate.isSnapshot()); Path windupRulesDir = PathUtil.getWindupRulesDir(); Imported<ResourceFactory> imported = FurnaceHolder.getFurnace().getAddonRegistry().getServices(ResourceFactory.class); ResourceFactory factory = imported.get(); Path coreRulesPropertiesPath = windupRulesDir.resolve(RULESET_CORE_DIRECTORY + "/META-INF/maven/org.jboss.windup.rules/windup-rulesets/pom.xml"); File pomXml = coreRulesPropertiesPath.toFile(); if (pomXml.exists()) { MavenModelResource pom = (MavenModelResource) factory.create(pomXml); String installedVersion = pom.getCurrentModel().getVersion(); String latestVersion = latestCoordinate.getVersion(); SingleVersion installed = new SingleVersion(installedVersion); SingleVersion latest = new SingleVersion(latestVersion); return versionIsOld(installed, latest); } else { return false; } }
Source:
<code>private void deployHADeployments() { <START> int size = toDeployOnQuorum.size(); <END> if (size != 0) { log.info("There are " + size + " HA deployments waiting on a quorum. These will now be deployed"); for (final Runnable task: new ArrayList<>(toDeployOnQuorum)) { try { task.run(); } catch (Throwable t) { log.error("Failed to run redeployment task", t); } } toDeployOnQuorum.clear(); } }</code><technical_language>This is a Linked Queue impl. size expensive... isEmpty() ? log size afer copied ArrayList</technical_language>

Target:
private void deployHADeployments() { int size = toDeployOnQuorum.size(); if (size != 0) { log.info("There are " + size + " HA deployments waiting on a quorum. These will now be deployed"); Runnable task; while ((task = toDeployOnQuorum.poll()) != null) { try { task.run(); } catch (Throwable t) { log.error("Failed to run redeployment task", t); } } } }
Source:
<code>public void visit(Method method) { if (!predicate.test(method)) { return; } TypedClassOperation operation = TypedOperation.forMethod(method); if (classType.isSubtypeOf(operation.getDeclaringType()) && operation.isStatic()) { int declaringClassMods = method.getDeclaringClass().getModifiers() & Modifier.classModifiers(); if (!Modifier.isPublic(declaringClassMods)) { operation = operation.getOperationForType(classType); } } if (operation == null) { <START> System.out.println("null operation for " + classType + " method " + method.getName()); <END> } if (!omitPredicate.shouldOmit(classType, operation, method)) { addOperation(operation); } }</code><technical_language>this code issue a more prominent error, crashing Randoop? If not, this message more specific this is a problem normal operation</technical_language>

Target:
public void visit(Method method) { if (!reflectionPredicate.test(method)) { return; } TypedClassOperation operation = instantiateTypes(TypedOperation.forMethod(method)); checkSubTypes(operation); if (operation.isStatic()) { int declaringClassMods = method.getDeclaringClass().getModifiers() & Modifier.classModifiers(); if (!Modifier.isPublic(declaringClassMods)) { operation = operation.getOperationForType(classType); } } if (!omitPredicate.shouldOmit(operation.getOperationForType(classType))) { operations.add(operation); } }
Source:
<code>public void testIDetectParentIsAFile() throws Exception { final Path cwd = path("/" + getMethodName() + "-" + UUID.randomUUID()); final Path file = new Path(cwd, "file"); try { <START> touch(guardedFs, file); <END> awaitFileStatus(guardedFs, file); final S3AFileStatus newParentFile = MetadataStoreTestBase .basicFileStatus(cwd, 1, false, 1); metadataStore.put(new PathMetadata(newParentFile)); final S3GuardFsck s3GuardFsck = new S3GuardFsck(rawFS, metadataStore); final List<S3GuardFsck.ComparePair> comparePairs = s3GuardFsck.compareS3ToMs(cwd); assertEquals("Number of pairs should be two. The cwd (parent) and the " + "child.", 2, comparePairs.size()); final S3GuardFsck.ComparePair cwdPair = comparePairs.stream() .filter(p -> p.getPath().equals(cwd)) .findFirst().get(); assertNotNull("The pair should not be null.", cwdPair); assertTrue("The cwdPair must contain a violation.", cwdPair.containsViolation()); Assertions.assertThat(cwdPair.getViolations()) .describedAs("Violations in the cwdPair") .contains(S3GuardFsck.Violation.DIR_IN_S3_FILE_IN_MS); final S3GuardFsck.ComparePair childPair = comparePairs.stream() .filter(p -> p.getPath().equals(file)) .findFirst().get(); assertNotNull("The pair should not be null.", childPair); assertTrue("The childPair must contain a violation.", childPair.containsViolation()); Assertions.assertThat(childPair.getViolations()) .describedAs("Violations in the childPair") .contains(S3GuardFsck.Violation.PARENT_IS_A_FILE); } finally { rawFS.delete(cwd, true); metadataStore.forgetMetadata(file); metadataStore.forgetMetadata(cwd); } }</code><technical_language>this combination of touch await is here...enough worthwhile factoring is method. But: is guardedFS want wait for, unguarded one</technical_language>

Target:
public void testIDetectParentIsAFile() throws Exception { final Path cwd = path("/" + getMethodName() + "-" + UUID.randomUUID()); final Path file = new Path(cwd, "file"); try { touchGuardedAndWaitRaw(file); final S3AFileStatus newParentFile = MetadataStoreTestBase .basicFileStatus(cwd, 1, false, 1); metadataStore.put(new PathMetadata(newParentFile)); final S3GuardFsck s3GuardFsck = new S3GuardFsck(rawFs, metadataStore); final List<S3GuardFsck.ComparePair> comparePairs = s3GuardFsck.compareS3ToMs(cwd); assertComparePairsSize(comparePairs, 2); checkForViolationInPairs(cwd, comparePairs, S3GuardFsck.Violation.DIR_IN_S3_FILE_IN_MS); checkForViolationInPairs(file, comparePairs, S3GuardFsck.Violation.PARENT_IS_A_FILE); } finally { cleanup(file, cwd); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } <START> AbstractAccessControl other = (AbstractAccessControl) obj; <END> if (!Objects.equals(this.id, other.id)) { return false; } return true; }</code><technical_language>Is this a good practice? Casting abstract class? interface AccessControl AbstractAccessControl implements interface... program interfaces cleaner me</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } AccessControl other = (AccessControl) obj; if (!Objects.equals(this.id, other.getId())) { return false; } return true; }
Source:
<code>public void testStreamInputPacketIndexOverlappingBothSides() { assertTrue(fFixture.append(new <START> PacketStub(1, 0, <END> 3))); assertTrue(fFixture.append(new PacketStub(2, 0, 3))); assertTrue(fFixture.append(new PacketStub(3, 0, 3))); assertTrue(fFixture.append(new PacketStub(4, 7, 9))); assertTrue(fFixture.append(new PacketStub(5, 7, 9))); assertTrue(fFixture.append(new PacketStub(6, 7, 9))); assertEquals(0, fFixture.search(3)); assertEquals(2, fFixture.search(6)); assertEquals(3, fFixture.search(8)); }</code><technical_language>Start 0</technical_language>

Target:
public void testStreamInputPacketIndexOverlappingBothSides() { assertTrue(fFixture.append(new PacketStub(0, 0, 3))); assertTrue(fFixture.append(new PacketStub(1, 0, 3))); assertTrue(fFixture.append(new PacketStub(2, 0, 3))); assertTrue(fFixture.append(new PacketStub(3, 7, 9))); assertTrue(fFixture.append(new PacketStub(4, 7, 9))); assertTrue(fFixture.append(new PacketStub(5, 7, 9))); assertEquals(0, fFixture.search(3)); assertEquals(2, fFixture.search(6)); assertEquals(3, fFixture.search(8)); }
Source:
<code>public PlanNodeStatsEstimate mapSymbolColumnStatistics(Symbol symbol, Function<SymbolStatsEstimate, SymbolStatsEstimate> mappingFunction) { return buildFrom(this) .setSymbolStatistics(symbolStatistics.entrySet().stream() <START> .collect(Collectors.toMap( <END> Map.Entry::getKey, e -> { if (e.getKey().equals(symbol)) { return mappingFunction.apply(e.getValue()); } return e.getValue(); }))) .build(); }</code><technical_language>toImmutableMap</technical_language>

Target:
public PlanNodeStatsEstimate mapSymbolColumnStatistics(Symbol symbol, Function<SymbolStatsEstimate, SymbolStatsEstimate> mappingFunction) { return buildFrom(this) .setSymbolStatistics(symbolStatistics.entrySet().stream() .collect(toImmutableMap( Map.Entry::getKey, e -> { if (e.getKey().equals(symbol)) { return mappingFunction.apply(e.getValue()); } return e.getValue(); }))) .build(); }
Source:
<code>public PolicyDecision isAuthorized(IdentifierBundle whoToAuth, RequestedAction whatToAuth) { if (whoToAuth == null) { return defaultDecision("whomToAuth was null"); } if (whatToAuth == null) { return defaultDecision("whatToAuth was null"); } <START> List<String> userUris = new ArrayList<String>(HasAssociatedIndividual.getIndividualUris(whoToAuth)); <END> for (Permission p : HasPermission.getPermissions(whoToAuth)) { if (p.isAuthorized(userUris, whatToAuth)) { log.debug("Permission " + p + " approves request " + whatToAuth); return new BasicPolicyDecision(Authorization.AUTHORIZED, "PermissionsPolicy: approved by " + p); } else { log.trace("Permission " + p + " denies request " + whatToAuth); } } log.debug("No permission will approve " + whatToAuth); return defaultDecision("no permission will approve " + whatToAuth); }</code><technical_language>Please diamond operator: new ArrayList<>(HasAssociatedIndividual.getIndividualUris(whoToAuth));</technical_language>

Target:
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth, RequestedAction whatToAuth) { if (whoToAuth == null) { return defaultDecision("whomToAuth was null"); } if (whatToAuth == null) { return defaultDecision("whatToAuth was null"); } List<String> personUris = new ArrayList<String>(HasAssociatedIndividual.getIndividualUris(whoToAuth)); for (Permission p : HasPermission.getPermissions(whoToAuth)) { if (p.isAuthorized(personUris, whatToAuth)) { log.debug("Permission " + p + " approves request " + whatToAuth); return new BasicPolicyDecision(Authorization.AUTHORIZED, "PermissionsPolicy: approved by " + p); } else { log.trace("Permission " + p + " denies request " + whatToAuth); } } log.debug("No permission will approve " + whatToAuth); return defaultDecision("no permission will approve " + whatToAuth); }
Source:
<code>private static <T> T lookup(Context context, Class<T> clazz, String name) throws NamingException { Object object = context.lookup(name); try { return clazz.cast(object); } catch (ClassCastException ex) { if (object instanceof Reference) { Reference ref = (Reference) object; String errorMessage = "JNDI failed to de-reference Reference with name " + name + "; is the " + "factory " + ref .getFactoryClassName() + " in your classpath?"; throw new NamingException(errorMessage); } else { String errorMessage = "JNDI lookup of name " + name + " returned a " + object.getClass().getName() + " while a " + clazz + " was expected"; <START> logger.error(errorMessage); <END> throw new NamingException(errorMessage); } } }</code><technical_language>log throw error. This is practice, handle throw it</technical_language>

Target:
private static <T> T lookup(Context context, Class<T> clazz, String name) throws NamingException { Object object = context.lookup(name); try { return clazz.cast(object); } catch (ClassCastException ex) { if (object instanceof Reference) { Reference ref = (Reference) object; String errorMessage = "JNDI failed to de-reference Reference with name " + name + "; is the " + "factory " + ref .getFactoryClassName() + " in your classpath?"; throw new NamingException(errorMessage); } else { String errorMessage = "JNDI lookup of name " + name + " returned a " + object.getClass().getName() + " while a " + clazz + " was expected"; throw new NamingException(errorMessage); } } }
Source:
<code>public AzureCloudInstanceInformation build() { <START> return new AzureCloudInstanceInformation(_cloudInstanceInfoMap); <END> }</code><technical_language>Safer clone construct a new map newly built instances do share anything</technical_language>

Target:
public AzureCloudInstanceInformation build() { return new AzureCloudInstanceInformation(new HashMap<>(_cloudInstanceInfoMap)); }
Source:
<code>public static IterableMapping fromPrism(IterableMappingPrism iterableMapping, ExecutableElement method, FormattingMessager messager) { if ( iterableMapping == null ) { return null; } boolean elementTargetTypeIsDefined = !TypeKind.VOID.equals( iterableMapping.elementTargetType().getKind() ); if ( !elementTargetTypeIsDefined && iterableMapping.dateFormat().isEmpty() && iterableMapping.qualifiedBy().isEmpty() ) { <START> messager.printMessage( Diagnostic.Kind.ERROR, method, Message.iterablemapping_noelements ); <END> } return new IterableMapping( iterableMapping.dateFormat(), iterableMapping.qualifiedBy(), elementTargetTypeIsDefined ? iterableMapping.elementTargetType() : null, iterableMapping.mirror, iterableMapping.values.dateFormat() ); }</code><technical_language>enum approach in place, severity/kind part of enum definition? I message is reported kinds places, move simplify calls printMessage()</technical_language>

Target:
public static IterableMapping fromPrism(IterableMappingPrism iterableMapping, ExecutableElement method, FormattingMessager messager) { if ( iterableMapping == null ) { return null; } boolean elementTargetTypeIsDefined = !TypeKind.VOID.equals( iterableMapping.elementTargetType().getKind() ); if ( !elementTargetTypeIsDefined && iterableMapping.dateFormat().isEmpty() && iterableMapping.qualifiedBy().isEmpty() ) { messager.printMessage( method, Message.ITERABLEMAPPING_NO_ELEMENTS ); } return new IterableMapping( iterableMapping.dateFormat(), iterableMapping.qualifiedBy(), elementTargetTypeIsDefined ? iterableMapping.elementTargetType() : null, iterableMapping.mirror, iterableMapping.values.dateFormat() ); }
Source:
<code>public void createUnloggedTableIfNotExists(final RelationKey relationKey, final Schema schema) throws DbException { <START> Objects.requireNonNull(jdbcConnection); <END> Objects.requireNonNull(jdbcInfo); Objects.requireNonNull(relationKey); Objects.requireNonNull(schema); execute(createIfNotExistsStatementFromSchema(schema, relationKey, true)); }</code><technical_language>I tend Preconditions.checkState (they're arguments this function) is. Also, put field name in call (like Objects.requireNonNull(schema "schema");) in order give some insight problem source</technical_language>

Target:
public void createUnloggedTableIfNotExists(final RelationKey relationKey, final Schema schema) throws DbException { Objects.requireNonNull(jdbcConnection, "jdbcConnection"); Objects.requireNonNull(jdbcInfo, "jdbcInfo"); Objects.requireNonNull(relationKey, "relationKey"); Objects.requireNonNull(schema, "schema"); execute(createIfNotExistsStatementFromSchema(schema, relationKey, true)); }