auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void testCreateDDF() throws DDFException { <END> try { S3DDF folderDDF = manager.newDDF("jing-bucket", "testFolder/", null, null); assert (false); assert(folderDDF.getIsDir() == true); } catch (Exception e) { } S3DDF cleanFolderDDF = manager.newDDF("jing-bucket", "testFolder/folder/", null, null); S3DDF jsonDDF = manager.newDDF("jing-bucket", "testFolder/a.json", null, null); S3DDF csvDDF = manager.newDDF("jing-bucket", "testFolder/year.csv", null, null); assert (cleanFolderDDF.getIsDir() == true); assert(jsonDDF.getIsDir() == false); assert(csvDDF.getIsDir() == false); assert(jsonDDF.getDataFormat().equals(DataFormat.JSON)); assert(csvDDF.getDataFormat().equals(DataFormat.CSV)); try { S3DDF nonExistDDF = manager.newDDF("jing-bucket", "nonexist.csv", null, null); assert (false); } catch (Exception e) { } try { S3DDF nonExistDDF2 = manager.newDDF("jing-bucket", "nonexist/", null, null); assert (false); } catch (Exception e) { } S3DDF pqtDDF = manager.newDDF("adatao-sample-data", "test/parquet/sleep_parquet/", null, null); assert (pqtDDF.getIsDir() == true); assert (pqtDDF.getDataFormat().equals(DataFormat.PQT)); S3DDF avroDDF = manager.newDDF("adatao-sample-data", "test/avro/partition_avro/", null, null); assert (avroDDF.getIsDir() == true); assert (avroDDF.getDataFormat().equals(DataFormat.AVRO)); S3DDF orcDDF = manager.newDDF("adatao-test", "orc/", null, null); assert (orcDDF.getIsDir() == true); assert (orcDDF.getDataFormat().equals(DataFormat.ORC)); }</code><technical_language>a test for create ddf in nested folder</technical_language>

Target:
public void testCreateDDF() throws DDFException { try { S3DDF folderDDF = manager.newDDF("jing-bucket", "testFolder/", null, null); assert (false); assert(folderDDF.getIsDir() == true); } catch (Exception e) { } S3DDF cleanFolderDDF = manager.newDDF("jing-bucket", "testFolder/folder/", null, null); S3DDF jsonDDF = manager.newDDF("jing-bucket", "testFolder/a.json", null, null); S3DDF csvDDF = manager.newDDF("jing-bucket", "testFolder/year.csv", null, null); assert (cleanFolderDDF.getIsDir() == true); assert(jsonDDF.getIsDir() == false); assert(csvDDF.getIsDir() == false); assert(jsonDDF.getDataFormat().equals(DataFormat.JSON)); assert(csvDDF.getDataFormat().equals(DataFormat.CSV)); S3DDF pqtDDF = manager.newDDF("adatao-sample-data", "test/parquet/sleep_parquet/", null, null); assert (pqtDDF.getIsDir() == true); assert (pqtDDF.getDataFormat().equals(DataFormat.PQT)); S3DDF avroDDF = manager.newDDF("adatao-sample-data", "test/avro/single/episodes.avro", null, null); assert (avroDDF.getIsDir() == false); assert (avroDDF.getDataFormat().equals(DataFormat.AVRO)); S3DDF orcDDF = manager.newDDF("adatao-test", "orc/", null, null); assert (orcDDF.getIsDir() == true); assert (orcDDF.getDataFormat().equals(DataFormat.ORC)); }
Source:
<code>public <T> void put(final String dataType, final long id, final T value) { if (value == null) { <START> return; <END> } final String operationId = Long.toString(operationIdCounter.getAndIncrement()); final DataOperation<T> operation = new DataOperation<>(Optional.<String>empty(), operationId, DataOpType.PUT, dataType, id, Optional.of(value)); executeOperation(operation); }</code><technical_language>If want handle value==null case, need users know; Some users put(key, null) is equivalent remove(key). mentioning that, adding @NotNull T more explicit</technical_language>

Target:
public <T> Pair<Long, Boolean> put(final String dataType, final long id, final T value) { if (value == null) { return new Pair<>(id, false); } final String operationId = Long.toString(operationIdCounter.getAndIncrement()); final DataOperation<T> operation = new DataOperation<>(Optional.<String>empty(), operationId, DataOpType.PUT, dataType, id, Optional.of(value)); executeOperation(operation); return new Pair<>(id, operation.getFailedRanges().isEmpty()); }
Source:
<code>public double estimateRowCount(RelMetadataQuery mq) { double rows = super.estimateRowCount(mq); if(offset != null) { return Math.max(0, Math.min(RexLiteral.intValue(fetch), rows - RexLiteral.intValue(offset))); } <START> return Math.min(RexLiteral.intValue(fetch), rows); <END> }</code><technical_language>write: int offset = this.offset == null ? 0 : RexLiteral.intValue(this.offset); return Math.min(RexLiteral.intValue(fetch), rows - offset);</technical_language>

Target:
public double estimateRowCount(RelMetadataQuery mq) { double rows = super.estimateRowCount(mq); int offset = this.offset == null ? 0 : RexLiteral.intValue(this.offset); int fetch = this.fetch == null ? Integer.MAX_VALUE : RexLiteral.intValue(this.fetch); return Math.max(0, Math.min(fetch, rows - offset)); }
Source:
<code>public long download(boolean resume, DownloadCompleteCallback callback) { if (skipDownloadOnStatus()) return 0; int bytes = 0; File file = new File(toFile); try { long localFileSize = checkLocalFileSizeForResume(resume, file); Date start = new Date(); if (checkServerResponse(localFileSize)) return 0; if (!tryAndGetRemoteSize()) return 0; if (!canHandleDownloadSize()) return 0; checkAndSetDownloadSize(); try (InputStream in = request.getResponseBodyAsStream(); RandomAccessFile out = new RandomAccessFile(file, "rw"); ) { out.seek(localFileSize); s_logger.info("Starting download from " + downloadUrl + " to " + toFile + " remoteSize=" + remoteSize + " , max size=" + maxTemplateSizeInBytes); if (copyBytes(file, in, out)) return 0; Date finish = new Date(); checkDowloadCompletion(); downloadTime += finish.getTime() - start.getTime(); } finally { } return totalBytes; } catch (HttpException hte) { status = TemplateDownloader.Status.UNRECOVERABLE_ERROR; errorString = hte.getMessage(); } catch (IOException ioe) { status = TemplateDownloader.Status.UNRECOVERABLE_ERROR; <START> if (errorString.isEmpty()){ <END> errorString = ioe.getMessage(); } } finally { if (status == Status.UNRECOVERABLE_ERROR && file.exists() && !file.isDirectory()) { file.delete(); } request.releaseConnection(); if (callback != null) { callback.downloadComplete(status); } } return 0; }</code><technical_language>errorString contains a single space initially. String.isEmpty returns (this.value.length == 0) this is happening</technical_language>

Target:
public long download(boolean resume, DownloadCompleteCallback callback) { if (skipDownloadOnStatus()) return 0; int bytes = 0; File file = new File(toFile); try { long localFileSize = checkLocalFileSizeForResume(resume, file); Date start = new Date(); if (checkServerResponse(localFileSize)) return 0; if (!tryAndGetRemoteSize()) return 0; if (!canHandleDownloadSize()) return 0; checkAndSetDownloadSize(); try (InputStream in = request.getResponseBodyAsStream(); RandomAccessFile out = new RandomAccessFile(file, "rw"); ) { out.seek(localFileSize); s_logger.info("Starting download from " + downloadUrl + " to " + toFile + " remoteSize=" + remoteSize + " , max size=" + maxTemplateSizeInBytes); if (copyBytes(file, in, out)) return 0; Date finish = new Date(); checkDowloadCompletion(); downloadTime += finish.getTime() - start.getTime(); } finally { } return totalBytes; } catch (HttpException hte) { status = TemplateDownloader.Status.UNRECOVERABLE_ERROR; errorString = hte.getMessage(); } catch (IOException ioe) { status = TemplateDownloader.Status.UNRECOVERABLE_ERROR; if (errorString.equals(" ")){ errorString = ioe.getMessage(); } } finally { if (status == Status.UNRECOVERABLE_ERROR && file.exists() && !file.isDirectory()) { file.delete(); } request.releaseConnection(); if (callback != null) { callback.downloadComplete(status); } } return 0; }
Source:
<code>public void createGroup(String group) { <START> throw new RuntimeException("Creating a group is not supporting in LDAP"); <END> }</code><technical_language>UnsupportedOperationException instead of a generic RuntimeException</technical_language>

Target:
public void createGroup(String group) { throw new UnsupportedOperationException("Creating a group is not supporting in LDAP"); }
Source:
<code>public FileSystemPersistenceProvider(String mapName, String persistencePath) { this.mapName = mapName; this.persistencePath = persistencePath; File dir = new File(getPersistencePath()); if (!dir.exists() && !dir.mkdir()) { <START> LOGGER.debug("Unable to create directory: {}", dir.getAbsolutePath()); <END> } }</code><technical_language>throw exception if fail instead of logging? happen if directory created, written it, system shuts this method called system restarts? this prevent persisted</technical_language>

Target:
public FileSystemPersistenceProvider(String mapName, String persistencePath) { this.mapName = mapName; this.persistencePath = persistencePath; File dir = new File(getPersistencePath()); if (!dir.exists() && !dir.mkdir()) { throw new IllegalArgumentException( String.format("Unable to create persistence directory for [%s]", dir.getAbsoluteFile())); } }
Source:
<code>protected String extractId(String expression) { try { Matcher matcher = PATTERN.matcher(expression); if (matcher.matches()) { return matcher.group(1); } else { throw new FacesException("Expression does not match following pattern @id(id). Expression: \"" + expression + "\""); } <START> } catch (Exception e) { <END> throw new FacesException("Expression does not match following pattern @id(id). Expression: \"" + expression + "\"", e); } }</code><technical_language>exactly</technical_language>

Target:
protected String extractId(String expression) { Matcher matcher = PATTERN.matcher(expression); if (matcher.matches()) { return matcher.group(1); } else { throw new FacesException("Expression does not match following pattern @id(id). Expression: \"" + expression + "\""); } }
Source:
<code>public void should_fail_on_different_files() throws Exception { File actual = createDeleteOnExitTempFileWithContent("assertJ"); File expected = createDeleteOnExitTempFileWithContent("assertJ++"); assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> { assertThat(actual).hasSameBinaryContentAs(expected); <START> }).withMessageContaining("does not have expected binary content at offset"); <END> }</code><technical_language>prefer expectAssertionError <LINK_0> add sections</technical_language>

Target:
public void should_fail_on_different_files() throws Exception { File actual = createTempFileWithContent("assertJ"); File expected = createTempFileWithContent("assertJ++"); AssertionError assertionError = expectAssertionError(() -> { assertThat(actual).hasSameBinaryContentAs(expected); }); then(assertionError).hasMessageContaining("does not have expected binary content at offset"); }
Source:
<code>public void testGetAllEmptyRequestNoLoader() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(null); final Map<String, String> actual = ehcache.getAll(Collections.<String>emptySet()); assertThat(actual, is(notNullValue())); assertThat(actual.isEmpty(), is(true)); verify(this.store, never()).bulkComputeIfAbsent(eq(Collections.<String>emptySet()), getAnyIterableFunction()); <START> verify(this.spiedResilienceStrategy, never()) <END> .getAllFailure(eq(Collections.<String>emptySet()), any(CacheAccessException.class)); verifyZeroInteractions(this.store, this.spiedResilienceStrategy); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }</code><technical_language>verifyZeroInteractions inserted individual verifications redundant</technical_language>

Target:
public void testGetAllEmptyRequestNoLoader() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(null); final Map<String, String> actual = ehcache.getAll(Collections.<String>emptySet()); assertThat(actual, is(notNullValue())); assertThat(actual.isEmpty(), is(true)); verify(this.store, never()).bulkComputeIfAbsent(eq(Collections.<String>emptySet()), getAnyIterableFunction()); verify(this.spiedResilienceStrategy, never()).getAllFailure(eq(Collections.<String>emptySet()), any(CacheAccessException.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }
Source:
<code>private static String convertPatternsToString(List<String> input) { <START> StringBuilder toStringBuilder = new StringBuilder(); <END> if (input.isEmpty()) { return ""; } if (input.size() == 1) { return toStringBuilder.append(input.get(0)).toString(); } return toStringBuilder.append(input.get(0)).append(", ...").toString(); }</code><technical_language>suggestion: rename output</technical_language>

Target:
private static String convertPatternsToString(List<String> input) { StringBuilder output = new StringBuilder(); if (input.isEmpty()) { return ""; } if (input.size() == 1) { return output.append(input.get(0)).toString(); } return output.append(input.get(0)).append(", ...").toString(); }
Source:
<code>public void testConvertDs3EnumConstants() { final Ds3EnumConstant alpha = new Ds3EnumConstant("ALPHA", null); final Ds3EnumConstant bravo = new Ds3EnumConstant("BRAVO", null); <START> final ImmutableList.Builder<Ds3EnumConstant> enumsBuilder = ImmutableList.builder(); <END> enumsBuilder.add(alpha); enumsBuilder.add(bravo); final ImmutableList<Ds3EnumConstant> enumConstants = enumsBuilder.build(); final ImmutableList<String> stringsList = EnumHelper.convertDs3EnumConstants(enumConstants); assertFalse(stringsList.isEmpty()); assertEquals(2, stringsList.size()); assertEquals("ALPHA", stringsList.get(0)); assertEquals("BRAVO", stringsList.get(1)); }</code><technical_language>replace this with, final ImmutableList<Ds3EnumConstant> enumConstants = ImmutableList.of(alpha, bravo);</technical_language>

Target:
public void testConvertDs3EnumConstants() { final Ds3EnumConstant alpha = new Ds3EnumConstant("ALPHA", null); final Ds3EnumConstant bravo = new Ds3EnumConstant("BRAVO", null); final ImmutableList<Ds3EnumConstant> enumConstants = ImmutableList.of(alpha, bravo); final ImmutableList<String> stringsList = EnumHelper.convertDs3EnumConstants(enumConstants); assertFalse(stringsList.isEmpty()); assertEquals(2, stringsList.size()); assertEquals("ALPHA", stringsList.get(0)); assertEquals("BRAVO", stringsList.get(1)); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { <START> View view; <END> if (getArguments().getString(BUNDLE_ARGUMENTS_SELECTED_CATEGORY).equals(getContext().getString(R.string.category_user_bricks))) { view = inflater.inflate(R.layout.fragment_brick_add_userbrick, container, false); } else { view = inflater.inflate(R.layout.fragment_brick_add, container, false); } previousActionBarTitle = ((AppCompatActivity) getActivity()).getSupportActionBar().getTitle(); ((AppCompatActivity) getActivity()) .getSupportActionBar().setTitle(getArguments().getString(BUNDLE_ARGUMENTS_SELECTED_CATEGORY)); setupSelectedBrickCategory(); return view; }</code><technical_language>dont do this. this this a "tagged class", completely layouts in a single class. next guy add behaviour of some boolean flag. <LINK_0> <LINK_1> <LINK_2> this a separate fragment</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_brick_add, container, false); previousActionBarTitle = ((AppCompatActivity) getActivity()).getSupportActionBar().getTitle(); ((AppCompatActivity) getActivity()) .getSupportActionBar().setTitle(getArguments().getString(BUNDLE_ARGUMENTS_SELECTED_CATEGORY)); setupSelectedBrickCategory(); return view; }
Source:
<code>public void inputRecipient(String recipient) { WebElement recipientBox = this.getRecipientBox(); <START> recipientBox.clear(); <END> recipientBox.sendKeys(recipient); }</code><technical_language>is this needed</technical_language>

Target:
public void inputRecipient(String recipient) { WebElement recipientBox = this.getRecipientBox(); recipientBox.sendKeys(recipient); }
Source:
<code>public void should_successfully_build_city_even_if_user_does_not_have_resources_in_preparation_stage() { startNewGame(12, 2) .BUILD_SETTLEMENT(1).atNode(2, -2, "topLeft") .BUILD_ROAD(1).atEdge(2, -2, "topLeft") .END_TURN(1) .BUILD_SETTLEMENT(2).atNode(2, -1, "bottomRight") .BUILD_ROAD(2).atEdge(2, -1, "bottomRight") .END_TURN(2) .BUILD_SETTLEMENT(3).atNode(0, 2, "topRight") .BUILD_ROAD(3).atEdge(0, 2, "topRight") .END_TURN(3) .getGameDetails(3).gameUser(3).check("resources.wheat", is(0)) .getGameDetails(3).gameUser(3).check("resources.stone", is(0)) .BUILD_CITY(3).atNode(0, 0, "bottomRight").successfully() <START> .getGameDetails(3).gameUser(3).check("resources.wheat", is(0)) <END> .getGameDetails(3).gameUser(3).check("resources.stone", is(0)); }</code><technical_language>this check is required</technical_language>

Target:
public void should_successfully_build_city_even_if_user_does_not_have_resources_in_preparation_stage() { startNewGame(12, 2) .BUILD_SETTLEMENT(1).atNode(2, -2, "topLeft") .BUILD_ROAD(1).atEdge(2, -2, "topLeft") .END_TURN(1) .BUILD_SETTLEMENT(2).atNode(2, -1, "bottomRight") .BUILD_ROAD(2).atEdge(2, -1, "bottomRight") .END_TURN(2) .BUILD_SETTLEMENT(3).atNode(0, 2, "topRight") .BUILD_ROAD(3).atEdge(0, 2, "topRight") .END_TURN(3) .getGameDetails(3).gameUser(3).check("resources.wheat", is(0)) .getGameDetails(3).gameUser(3).check("resources.stone", is(0)) .BUILD_CITY(3).atNode(0, 0, "bottomRight").successfully(); }
Source:
<code>public Void execute(final WriteBinding binding) { return withConnection(binding, new CallableWithConnection<Void>() { @Override public Void call(final Connection connection) { <START> if (connection.getServerDescription().getVersion().compareTo(new ServerVersion(2, 6)) >= 0) { <END> try { executeWrappedCommandProtocol(namespace.getDatabaseName(), getCommand(), connection); } catch (MongoCommandFailureException e) { throw checkForDuplicateKeyError(e); } } else { for (Index index : indexes) { asInsertProtocol(index).execute(connection); } } return null; } }); }</code><technical_language>Replace serverIsAtLeastVersionTwoDotSix helper</technical_language>

Target:
public Void execute(final WriteBinding binding) { return withConnection(binding, new CallableWithConnection<Void>() { @Override public Void call(final Connection connection) { if (serverIsAtLeastVersionTwoDotSix(connection)) { try { executeWrappedCommandProtocol(namespace.getDatabaseName(), getCommand(), connection); } catch (MongoCommandFailureException e) { throw checkForDuplicateKeyError(e); } } else { for (Index index : indexes) { asInsertProtocol(index).execute(connection); } } return null; } }); }
Source:
<code>protected boolean beforeInvoke() throws Exception { if (0 <= commandTopologyId && commandTopologyId < handler.stateTransferManager.getFirstTopologyAsMember()) { if (handler.isTraceEnabled()) { handler.getLog().tracef("Ignoring command sent before the local node was a member " + "(command topology id is %d)", commandTopologyId); } <START> response = CacheNotFoundResponse.INSTANCE; <END> return false; } return true; }</code><technical_language>I if making this more explicit cleaner. if beforeInvoke method declaration changed return a Response. If null considered continue running if null return response? WDYT</technical_language>

Target:
protected Response beforeInvoke() throws Exception { if (0 <= commandTopologyId && commandTopologyId < handler.stateTransferManager.getFirstTopologyAsMember()) { if (handler.isTraceEnabled()) { handler.getLog().tracef("Ignoring command sent before the local node was a member " + "(command topology id is %d)", commandTopologyId); } return CacheNotFoundResponse.INSTANCE; } return null; }
Source:
<code>public TaskResult runTask() { Optional<String> paramServerType = systemConfig.getOptional("param_server.database.type", String.class); if(!paramServerType.isPresent()){ throw new ConfigException("param_server.database.type is required to use this operator."); } Config params = request.getLocalConfig(); List<String> keys = params.getKeys(); if (keys.size() == 0) { throw new ConfigException("no key is set."); } paramServerClient.begin(); for (String key : keys) { Optional<String> value = params.getOptional(key, String.class); if (value.isPresent()) { paramServerClient.set(key, value.get(), request.getSiteId()); } } <START> paramServerClient.finalize(); <END> return TaskResult.empty(request); }</code><technical_language>try-finally is necessary</technical_language>

Target:
public TaskResult runTask() { Optional<String> paramServerType = systemConfig.getOptional("param_server.type", String.class); if (!paramServerType.isPresent()) { throw new ConfigException("param_server.type is required to use this operator."); } Config localParams = request.getLocalConfig(); List<String> keys = localParams.getKeys(); if (keys.size() == 0) { throw new ConfigException("no key is set."); } paramServerClient.doTransaction(client -> { for (String key : keys) { Optional<String> value = localParams.getOptional(key, String.class); if (value.isPresent()) { paramServerClient.set(key, value.get(), request.getSiteId()); } } }); return TaskResult.empty(request); }
Source:
<code>public void setJSRuntimeArguments(String runtimeArgs) { <START> if (fRuntimeArgs == null) { <END> if (runtimeArgs == null) { return; } } else if (fRuntimeArgs.equals(runtimeArgs)) { return; } fRuntimeArgs = runtimeArgs; }</code><technical_language>Is a reason for update fRuntimeArgs if changes</technical_language>

Target:
public void setJSRuntimeArguments(String runtimeArgs) { fRuntimeArgs = runtimeArgs; }
Source:
<code>public void testAtleastOnce() throws Exception { try { HBaseTestHelper.clearHBase(); TestHBasePutOperator thop = new TestHBasePutOperator(); thop.getStore().setTableName("table1"); thop.getStore().setZookeeperQuorum("127.0.0.1"); thop.getStore().setZookeeperClientPort(2181); HBaseTuple t1=new HBaseTuple(); t1.setColFamily("colfam0");t1.setColName("street");t1.setRow("row1");t1.setColValue("ts"); HBaseTuple t2=new HBaseTuple(); t2.setColFamily("colfam0");t2.setColName("city");t2.setRow("row2");t2.setColValue("tc"); thop.setup(new OperatorContext() { @Override public <T> T getValue(Attribute<T> key) { if(key.equals(PROCESSING_MODE)){ return (T) ProcessingMode.AT_LEAST_ONCE; } return key.defaultValue; } @Override public AttributeMap getAttributes() { return null; } @Override public int getId() { return 0; } @Override public void setCounters(Object counters) { } @Override public void sendMetrics(Collection<String> collection) { } @Override public int getWindowsFromCheckpoint() { return 0; } <START> <END> @Override public String getName() { return "TestHBasePutOperator"; } }); thop.beginWindow(0); thop.input.process(t1); thop.input.process(t2); thop.endWindow(); HBaseTuple tuple; tuple = HBaseTestHelper .getHBaseTuple("row1", "colfam0", "street"); Assert.assertNotNull("Tuple", tuple); Assert.assertEquals("Tuple row", tuple.getRow(), "row1"); Assert.assertEquals("Tuple column family", tuple.getColFamily(), "colfam0"); Assert.assertEquals("Tuple column name", tuple.getColName(),"street"); Assert.assertEquals("Tuple column value", tuple.getColValue(),"ts"); } catch (IOException e) { logger.error(e.getMessage()); } }</code><technical_language>replaced MockContext <LINK_0></technical_language>

Target:
public void testAtleastOnce() throws Exception { try { HBaseTestHelper.clearHBase(); TestHBasePutOperator thop = new TestHBasePutOperator(); thop.getStore().setTableName("table1"); thop.getStore().setZookeeperQuorum("127.0.0.1"); thop.getStore().setZookeeperClientPort(2181); HBaseTuple t1=new HBaseTuple(); t1.setColFamily("colfam0");t1.setColName("street");t1.setRow("row1");t1.setColValue("ts"); HBaseTuple t2=new HBaseTuple(); t2.setColFamily("colfam0");t2.setColName("city");t2.setRow("row2");t2.setColValue("tc"); AttributeMap.DefaultAttributeMap attributeMap = new AttributeMap.DefaultAttributeMap(); attributeMap.put(OperatorContext.PROCESSING_MODE, ProcessingMode.AT_LEAST_ONCE); thop.setup(mockOperatorContext(0, attributeMap)); thop.beginWindow(0); thop.input.process(t1); thop.input.process(t2); thop.endWindow(); HBaseTuple tuple; tuple = HBaseTestHelper .getHBaseTuple("row1", "colfam0", "street"); Assert.assertNotNull("Tuple", tuple); Assert.assertEquals("Tuple row", tuple.getRow(), "row1"); Assert.assertEquals("Tuple column family", tuple.getColFamily(), "colfam0"); Assert.assertEquals("Tuple column name", tuple.getColName(),"street"); Assert.assertEquals("Tuple column value", tuple.getColValue(),"ts"); } catch (IOException e) { logger.error(e.getMessage()); } }
Source:
<code>public void canUpdateConservativeMetrics() { metrics.updateEnqueuedWrites(CONS_ZERO, 10); metrics.updateEntriesRead(CONS_ZERO, 21); metrics.updateNumberOfTombstones(CONS_ZERO, 1); metrics.updateAbortedWritesDeleted(CONS_ZERO, 2); metrics.updateSweepTimestamp(CONS_ZERO, 7); metrics.updateProgressForShard(CONS_ZERO, 4); waitForProgressToRecompute(); assertEnqueuedWritesConservativeEquals(10); assertEntriesReadConservativeEquals(21); assertTombstonesPutConservativeEquals(1); assertAbortedWritesDeletedConservativeEquals(2); assertSweepTimestampConservativeEquals(7); assertLastSweptTimestampConservativeEquals(4); puncherStore.put(3, 2); <START> puncherStore.put(4, 4); <END> puncherStore.put(5, 40); assertMillisSinceLastSweptConservativeEquals(4); }</code><technical_language>wallClock = 4 for atlasTs = 4 is potentially confusing (ditto 6/6)</technical_language>

Target:
public void canUpdateConservativeMetrics() { metrics.updateEnqueuedWrites(CONS_ZERO, 10); metrics.updateEntriesRead(CONS_ZERO, 21); metrics.updateNumberOfTombstones(CONS_ZERO, 1); metrics.updateAbortedWritesDeleted(CONS_ZERO, 2); metrics.updateSweepTimestamp(CONS_ZERO, 7); metrics.updateProgressForShard(CONS_ZERO, 4); waitForProgressToRecompute(); assertEnqueuedWritesConservativeEquals(10); assertEntriesReadConservativeEquals(21); assertTombstonesPutConservativeEquals(1); assertAbortedWritesDeletedConservativeEquals(2); assertSweepTimestampConservativeEquals(7); assertLastSweptTimestampConservativeEquals(4); puncherStore.put(3, 2); puncherStore.put(4, 15); puncherStore.put(5, 40); assertMillisSinceLastSweptConservativeEqualsClockTimeMinus(15); }
Source:
<code>public static InterfaceParams getByName(String name) { <START> if (name == null) return null; <END> try { final NetworkInterface netif = NetworkInterface.getByName(name); if (netif != null) { final MacAddress macAddr = netif.isLoopback() ? null : MacAddress.fromBytes(netif.getHardwareAddress()); return new InterfaceParams( name, netif.getIndex(), macAddr, netif.getMTU()); } } catch (IllegalArgumentException|SocketException e) return null; }</code><technical_language>This is a clear programming error, right? If so, suggest throwing NPE instead</technical_language>

Target:
public static InterfaceParams getByName(String name) { final NetworkInterface netif = getNetworkInterfaceByName(name); if (netif == null) return null; final MacAddress macAddr = getMacAddress(netif); try { return new InterfaceParams(name, netif.getIndex(), macAddr, netif.getMTU()); } catch (IllegalArgumentException|NullPointerException|SocketException e) { return null; } }
Source:
<code>private PDataType getViewIndexType(Cell[] tableKeyValues) { <START> Cell dataTypeKv = tableKeyValues[VIEW_INDEX_ID_DATA_TYPE]; <END> return PDataType.fromTypeId(PInteger.INSTANCE.getCodec() .decodeInt(dataTypeKv.getValueArray(), dataTypeKv.getValueOffset(), SortOrder.getDefault())); }</code><technical_language>I need a null check similar getViewIndexId. If view index created client VIEW_INDEX_ID_DATA_TYPE assume a short</technical_language>

Target:
private PDataType getViewIndexType(Cell[] tableKeyValues) { Cell dataTypeKv = tableKeyValues[VIEW_INDEX_ID_DATA_TYPE_INDEX]; return dataTypeKv == null ? MetaDataUtil.getLegacyViewIndexIdDataType() : PDataType.fromTypeId(PInteger.INSTANCE.getCodec() .decodeInt(dataTypeKv.getValueArray(), dataTypeKv.getValueOffset(), SortOrder.getDefault())); }
Source:
<code>public void succededToHibernate() { TransactionSupport.executeInNewTransaction( new TransactionMethod<Object>() { @Override public Object runInTransaction() { <START> VmDynamic vmDynamic = db().getVmDynamicDao().get(id); <END> vmDynamic.setStatus(VMStatus.SavingState); update(vmDynamic); return null; } } ); }</code><technical_language>getVmDynamicDao()</technical_language>

Target:
public void succededToHibernate() { TransactionSupport.executeInNewTransaction( new TransactionMethod<Object>() { @Override public Object runInTransaction() { VmDynamic vmDynamic = getVmDynamicDao().get(id); vmDynamic.setStatus(VMStatus.SavingState); update(vmDynamic); return null; } } ); }
Source:
<code>private void declareGenericFlowParameters(@Nullable FlowGenericParameterClauseTree flowGenericParameterClauseTree) { if (flowGenericParameterClauseTree != null) { List<IdentifierTree> genericParams = flowGenericParameterClauseTree.genericParameters().stream().map(FlowGenericParameterTree::identifier).collect(Collectors.toList()); <START> declareParameters(genericParams); <END> } }</code><technical_language>@saberduck if good idea Kind.Parameter for Generic parameter. create a new kind? discuss</technical_language>

Target:
private void declareGenericFlowParameters(@Nullable FlowGenericParameterClauseTree flowGenericParameterClauseTree) { if (flowGenericParameterClauseTree != null) { flowGenericParameterClauseTree.genericParameters().stream() .map(FlowGenericParameterTree::identifier) .forEach(identifier -> symbolModel.declareSymbol(identifier.name(), Symbol.Kind.FLOW_GENERIC_TYPE, currentScope) .addUsage(identifier, Usage.Kind.LEXICAL_DECLARATION)); } }
Source:
<code>private double cleanNumber(double dirtyNumber) { <START> double clean; <END> if (dirtyNumber < 1) clean = 0; else clean = dirtyNumber; return clean; }</code><technical_language>simplified to: java return dirtyNumber < 1 ? 0 : dirtyNumber;</technical_language>

Target:
private double cleanNumber(double dirtyNumber) { return dirtyNumber < 1 ? 0 : dirtyNumber; }
Source:
<code>void sendScheduledMessageAndReceive(MessagingEntityType entityType, boolean isSessionEnabled) { setSenderAndReceiver(entityType, 0, isSessionEnabled); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); final OffsetDateTime scheduledEnqueueTime = OffsetDateTime.now().plusSeconds(2); sender.scheduleMessage(message, scheduledEnqueueTime).block(TIMEOUT); StepVerifier.create(Mono.delay(Duration.ofSeconds(4)).then(receiver.receiveMessages().next())) .assertNext(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); <START> receiver.complete(receivedMessage).block(Duration.ofSeconds(15)); <END> messagesPending.decrementAndGet(); }) .verifyComplete(); }</code><technical_language>a TIMEOUT duration defined. replace instances of this Duration.ofSeconds</technical_language>

Target:
void sendScheduledMessageAndReceive(MessagingEntityType entityType, boolean isSessionEnabled) { setSenderAndReceiver(entityType, 0, isSessionEnabled); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); final OffsetDateTime scheduledEnqueueTime = OffsetDateTime.now().plusSeconds(2); sender.scheduleMessage(message, scheduledEnqueueTime).block(TIMEOUT); StepVerifier.create(Mono.delay(Duration.ofSeconds(4)).then(receiver.receiveMessages().next())) .assertNext(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); receiver.complete(receivedMessage).block(OPERATION_TIMEOUT); messagesPending.decrementAndGet(); }) .verifyComplete(); }
Source:
<code>private List<FeedbackResponseAttributes> filterResponsesForStatistics(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, <START> FeedbackSessionResultsBundle bundle, String view) { <END> boolean isViewedByStudent = "student".equals(view); if (!isViewedByStudent) { return responses; } FeedbackParticipantType[] typesToSkipFiltering = {FeedbackParticipantType.INSTRUCTORS, FeedbackParticipantType.NONE, FeedbackParticipantType.SELF}; FeedbackParticipantType recipientType = question.getRecipientType(); for (FeedbackParticipantType skipType : typesToSkipFiltering) { if (recipientType.equals(skipType)) { return responses; } } FeedbackParticipantType[] typesToFilterByTeams = {FeedbackParticipantType.OWN_TEAM, FeedbackParticipantType.TEAMS}; boolean toFilterByTeams = false; for (FeedbackParticipantType teamType : typesToFilterByTeams) { if (recipientType.equals(teamType)) { toFilterByTeams = true; } } List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>(); String recipientString = toFilterByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail; for (FeedbackResponseAttributes response : responses) { boolean isReceivedResponse = response.recipient.equals(recipientString); if (isReceivedResponse) { receivedResponses.add(response); } } if (receivedResponses.isEmpty()) { return responses; } return receivedResponses; }</code><technical_language>Do try line length 110 chars, method written private List<FeedbackResponseAttributes> filterResponsesForStatistics( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) {</technical_language>

Target:
private List<FeedbackResponseAttributes> filterResponsesForStatistics( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { boolean isViewedByStudent = "student".equals(view); if (!isViewedByStudent) { return responses; } FeedbackParticipantType recipientType = question.getRecipientType(); boolean isFilteringSkipped = recipientType.equals(FeedbackParticipantType.INSTRUCTORS) || recipientType.equals(FeedbackParticipantType.NONE) || recipientType.equals(FeedbackParticipantType.SELF); if (isFilteringSkipped) { return responses; } boolean isFilteringByTeams = recipientType.equals(FeedbackParticipantType.OWN_TEAM) || recipientType.equals(FeedbackParticipantType.TEAMS); List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>(); String recipientString = isFilteringByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail; for (FeedbackResponseAttributes response : responses) { boolean isReceivedResponse = response.recipient.equals(recipientString); if (isReceivedResponse) { receivedResponses.add(response); } } return receivedResponses; }
Source:
<code>private View makeSpaceView(int width, int height) { View view = new View(getActivity()); view.setLayoutParams(new ListView.LayoutParams(width, height)); view.setClickable(true); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { dismiss(); } <START> return false; <END> } }); return view; }</code><technical_language>return true</technical_language>

Target:
private View makeSpaceView(int width, int height) { View view = new View(getActivity()); view.setLayoutParams(new ListView.LayoutParams(width, height)); view.setClickable(true); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { dismiss(); } return true; } }); return view; }
Source:
<code>public String getContentIdentifier() { <START> return RevUtils.truncatedRevision(revCommit.getName()); <END> }</code><technical_language>abbreviate commit ID eg: revCommit.abbreviate(7).name() + "..."</technical_language>

Target:
public String getContentIdentifier() { return revCommit.abbreviate(7).name() + "..."; }
Source:
<code><START> public void testCreateTenantSpecificTable() throws Exception { <END> long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE PARENT_TABLE ( \n" + " user VARCHAR ,\n" + " id INTEGER not null primary key desc\n" + " ) "); conn.close(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE TENANT_SPECIFIC_TABLE ( \n" + " tenantCol VARCHAR\n" + " ) BASE_TABLE='PARENT_TABLE'"); conn.close(); HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES).getAdmin(); assertEquals(0, admin.listTables("TENANT_SPECIFIC_TABLE").length); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE TENANT_SPECIFIC_TABLE"); conn.close(); props.remove(PhoenixRuntime.TENANT_ID_ATTRIB); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE PARENT_TABLE"); conn.close(); }</code><technical_language>This is frick'n awesome</technical_language>

Target:
public void testCreateTenantSpecificTable() throws Exception { long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE PARENT_TABLE ( \n" + " user VARCHAR ,\n" + " tenant_id VARCHAR not null,\n" + " id INTEGER not null\n" + " constraint pk primary key (tenant_id, id)) "); conn.close(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE TENANT_SPECIFIC_TABLE ( \n" + " tenantCol VARCHAR\n" + " ) BASE_TABLE='PARENT_TABLE'"); conn.close(); HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES).getAdmin(); assertEquals(0, admin.listTables("TENANT_SPECIFIC_TABLE").length); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE TENANT_SPECIFIC_TABLE"); conn.close(); props.remove(PhoenixRuntime.TENANT_ID_ATTRIB); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE PARENT_TABLE"); conn.close(); }
Source:
<code>public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDesc) { TableSpec tableSpec = tableDesc.getTableSpec(); if (tables.containsKey(tableSpec)) { throw new IllegalStateException(String.format( "getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } <START> tables.put(tableSpec, new TableImpl(tableSpec)); <END> return tables.get(tableSpec); }</code><technical_language>question: do need TableImpl class? usage of tables map is in ExecutionPlanner.createJobGraph() is TableSpec keySet. Also, TableImpl class provide functions a container for TableSpec. remove it</technical_language>

Target:
public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDesc) { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tables.containsKey(tableSpec)) { throw new IllegalStateException(String.format( "getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tables.put(tableSpec, new TableImpl(tableSpec)); return tables.get(tableSpec); }
Source:
<code>public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); <START> CreateTableRequest createTableRequest = <END> CreateTableRequest.of(desc.getTableName().getNameAsString()); for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); createTableRequest.addFamily(columnName, buildGarbageCollectionRule(column)); } if (splitKeys != null) { for (byte[] splitKey : splitKeys) { createTableRequest.addSplit(ByteString.copyFrom(splitKey)); } } createTableAsync(createTableRequest, desc.getTableName()); }</code><technical_language>here. duplication</technical_language>

Target:
public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); createTableAsync(desc.getTableName(), TableAdapter.adapt(desc, splitKeys)); }
Source:
<code>public IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException { boolean applies = appliesToTraceType(trace.getClass(), false); if (!applies && (trace instanceof TmfExperiment)) { <START> if (appliesToTraceType(trace.getClass(), true)) { <END> boolean expApplies = false; for (ITmfTrace expTrace : TmfTraceManager.getTraceSet(trace)) { if (appliesToTraceType(expTrace.getClass())) { expApplies = true; break; } } applies = expApplies; } } if (!applies) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, getName())); } IAnalysisModule module = createModule(); if (module == null) { return null; } module.setAutomatic(isAutomatic()); final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR); if (paramName == null) { continue; } module.addParameter(paramName); String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(paramName, defaultValue); } } module.setTrace(trace); TmfAnalysisManager.analysisModuleCreated(module); return module; }</code><technical_language>This return true for experiment if *any* of tracetype in module applies_experiment=true</technical_language>

Target:
public IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException { boolean applies = appliesToTraceType(trace.getClass()); if (!applies && (trace instanceof TmfExperiment) && appliesToExperiment()) { for (ITmfTrace expTrace : TmfTraceManager.getTraceSet(trace)) { if (appliesToTraceType(expTrace.getClass())) { applies = true; break; } } } if (!applies) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, getName())); } IAnalysisModule module = createModule(); if (module == null) { return null; } module.setAutomatic(isAutomatic()); final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR); if (paramName == null) { continue; } module.addParameter(paramName); String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(paramName, defaultValue); } } module.setTrace(trace); TmfAnalysisManager.analysisModuleCreated(module); return module; }
Source:
<code><START> public void testCompare() { <END> Bytes b1 = Bytes.of("a"); Bytes b2 = Bytes.of("b"); Bytes b3 = Bytes.of("a"); Assert.assertEquals(-1, b1.compareTo(b2)); Assert.assertEquals(1, b2.compareTo(b1)); Assert.assertEquals(0, b1.compareTo(b3)); Assert.assertEquals(0, b1.compareTo(b1)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); byte[] b1Arr = b1.toArray(); byte[] b2Arr = b2.toArray(); byte[] b3Arr = b3.toArray(); Assert.assertEquals(-1, b1.compareTo(b2Arr)); Assert.assertEquals(1, b2.compareTo(b1Arr)); Assert.assertEquals(0, b1.compareTo(b3Arr)); Assert.assertEquals(0, b1.compareTo(b1Arr)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); }</code><technical_language>A test for non-zero offsets nice</technical_language>

Target:
public void testCompare() { Bytes b1 = Bytes.of("a"); Bytes b2 = Bytes.of("b"); Bytes b3 = Bytes.of("a"); Assert.assertEquals(-1, b1.compareTo(b2)); Assert.assertEquals(1, b2.compareTo(b1)); Assert.assertEquals(0, b1.compareTo(b3)); Assert.assertEquals(0, b1.compareTo(b1)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); byte[] b1Arr = b1.toArray(); byte[] b2Arr = b2.toArray(); byte[] b3Arr = b3.toArray(); Assert.assertEquals(-1, b1.compareTo(b2Arr)); Assert.assertEquals(1, b2.compareTo(b1Arr)); Assert.assertEquals(0, b1.compareTo(b3Arr)); Assert.assertEquals(0, b1.compareTo(b1Arr)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); Bytes b4 = Bytes.of("abc"); byte[] b4Arr = b4.toArray(); Bytes b5 = Bytes.of("baz"); byte[] b5Arr = b5.toArray(); Bytes b6 = Bytes.of("ab"); byte[] b7Arr = Bytes.of("dabc").toArray(); Assert.assertEquals(0, b4.compareTo(b4Arr, 0, 3)); Assert.assertTrue(b4.compareTo(b4Arr, 1, 2) < 0); Assert.assertTrue(b5.compareTo(b4Arr, 1, 2) < 0); Assert.assertTrue(b5.compareTo(b5Arr, 1, 2) > 0); Assert.assertTrue(b4.compareTo(b4Arr, 0, 2) > 0); Assert.assertTrue(b6.compareTo(b7Arr, 1, 3) < 0); Assert.assertTrue(b6.compareTo(b1Arr) > 0); }
Source:
<code>public int hashCode() { <START> return Objects.hash(value); <END> }</code><technical_language>minor, return avoid integer boxing Objects.hash Integer#hashCode</technical_language>

Target:
public int hashCode() { return value; }
Source:
<code>protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { factory(AddBranch.Factory.class); factory(AddRefRight.Factory.class); factory(ChangeProjectSettings.Factory.class); factory(DeleteBranches.Factory.class); factory(DeleteRefRights.Factory.class); factory(ListBranches.Factory.class); factory(VisibleProjects.Factory.class); factory(ProjectDetailFactory.Factory.class); <START> bind(ApprovalCategoryConstraintsConfig.class); <END> } }); rpc(ProjectAdminServiceImpl.class); }</code><technical_language>I this in GerritGlobalModule, requires moving this type gerrit-server package. if support editing permissions SSH (which git-store enables!) need run this logic in a context gerrit-http code visible</technical_language>

Target:
protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { factory(AddBranch.Factory.class); factory(ChangeProjectAccess.Factory.class); factory(ChangeProjectSettings.Factory.class); factory(DeleteBranches.Factory.class); factory(ListBranches.Factory.class); factory(VisibleProjects.Factory.class); factory(ProjectAccessFactory.Factory.class); factory(ProjectDetailFactory.Factory.class); bind(RestrictionsConfig.class); } }); rpc(ProjectAdminServiceImpl.class); }