auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> @Test public void basicSuiteArchiveId() throws Exception { <END> archiver.setArchiveId("dasId"); FreeStyleBuild build = project.scheduleBuild2(0).get(10, TimeUnit.SECONDS); assertTestResults(build); WebClient wc = j.new WebClient(); wc.getPage(project); wc.getPage(build); wc.getPage(build, "testReport"); wc.getPage(build, "testReport/hudson.security"); wc.getPage(build, "testReport/hudson.security/HudsonPrivateSecurityRealmTest/"); HtmlPage methodPage = wc.getPage(build, "testReport/hudson.security/HudsonPrivateSecurityRealmTest/testDataCompatibilityWith1_282/"); j.assertStringContains(methodPage.asText(), "[dasId]"); TestResultAction testResultAction = build.getAction(TestResultAction.class); SuiteResult suite = testResultAction.getResult().getSuite("hudson.security.HudsonPrivateSecurityRealmTest"); assertNotNull(suite); assertEquals("dasId", suite.getArchiveId()); }</code><technical_language>Put @Test a new line public modifier</technical_language>

Target:
public void basicSuiteArchiveId() throws Exception { archiver.setArchiveId("dasId"); FreeStyleBuild build = project.scheduleBuild2(0).get(10, TimeUnit.SECONDS); assertTestResults(build); WebClient wc = j.new WebClient(); wc.getPage(project); wc.getPage(build); wc.getPage(build, "testReport"); wc.getPage(build, "testReport/hudson.security"); HtmlPage classPage = wc.getPage(build, "testReport/hudson.security/HudsonPrivateSecurityRealmTest/"); HtmlPage methodPage = wc.getPage(build, "testReport/hudson.security/HudsonPrivateSecurityRealmTest/testDataCompatibilityWith1_282/"); j.assertStringContains(methodPage.asText(), "[dasId]"); j.assertStringContains(classPage.asText(), "[dasId]"); TestResultAction testResultAction = build.getAction(TestResultAction.class); SuiteResult suite = testResultAction.getResult().getSuite("hudson.security.HudsonPrivateSecurityRealmTest"); assertNotNull(suite); assertEquals("dasId", suite.getArchiveId()); }
Source:
<code>public OverlaysNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); <START> worldRenderer = context.get(WorldRenderer.class); <END> wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL)); }</code><technical_language>This line playerCamera line below</technical_language>

Target:
public OverlaysNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); worldRenderer = context.get(WorldRenderer.class); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL)); }
Source:
<code>public List<AuditMessage> pollConsumerMessages(PerunSession perunSession, String consumerName) throws InternalErrorException, PrivilegeException { if (!AuthzResolver.isAuthorized(perunSession, Role.PERUNADMIN) <START> && !AuthzResolver.isAuthorized(perunSession, Role.PERUNOBSERVER)) { <END> throw new PrivilegeException(perunSession, "pollConsumerMessages"); } return getAuditMessagesManagerBl().pollConsumerMessages(perunSession, consumerName); }</code><technical_language>@zlamalp Do want give access polling for perun observer? is reading</technical_language>

Target:
public List<AuditMessage> pollConsumerMessages(PerunSession perunSession, String consumerName) throws InternalErrorException, PrivilegeException { if (!AuthzResolver.isAuthorized(perunSession, Role.PERUNADMIN)) { throw new PrivilegeException(perunSession, "pollConsumerMessages"); } return getAuditMessagesManagerBl().pollConsumerMessages(perunSession, consumerName); }
Source:
<code>public void setBars() { int fakeA = valueA; int fakeB = valueB; <START> if (valueA != null && valueB != null && valueA + valueB >= 99) { <END> double factor = (double)98 / (valueA + valueB); fakeA = (int)Math.round(factor * valueA); fakeB = (int)Math.round(factor * valueB); fakeA = (fakeB == 0 ? 99 : fakeA); fakeB = (fakeA == 0 ? 99 : fakeB); } if (valueB != null) { String percentageB = valueB + "%"; String fakePercentageB = fakeB + "%"; percentageLabelB.setText(valueB < 10 ? "" : percentageB); percentageLabelB.setStyleName(style.percentageLabel()); percentageBarB.setWidth(fakePercentageB); percentageBarB.setVisible(valueB != 0); percentageBarB.setTitle(percentageB); } if (valueA != null) { String percentageA = valueA + "%"; String fakePercentageA = fakeA + "%"; percentageLabelA.setText(valueA < 10 ? "" : percentageA); percentageLabelA.setStyleName(style.percentageLabelBlack()); percentageBarA.setWidth(fakePercentageA); percentageBarA.setVisible(valueA != 0); percentageBarA.setTitle(percentageA); } }</code><technical_language>consider some constants e.g.: FULL_WIDTH=99 EPSILON=1 FULL_WIDTH - EPSILON (instead of 98)</technical_language>

Target:
public void setBars() { int fakeA = valueA; int fakeB = valueB; if (valueA != null && valueB != null && valueA + valueB >= FULL_WIDTH) { double factor = (double)(FULL_WIDTH-1) / (valueA + valueB); fakeA = (int)Math.round(factor * valueA); fakeB = (int)Math.round(factor * valueB); fakeA = (fakeB == 0 ? FULL_WIDTH : fakeA); fakeB = (fakeA == 0 ? FULL_WIDTH : fakeB); } setBar(percentageBarA, percentageLabelA, valueA, fakeA, style.percentageLabelBlack()); setBar(percentageBarB, percentageLabelB, valueB, fakeB, style.percentageLabel()); }
Source:
<code><START> public ResultSet getResultSet() { <END> return Objects.requireNonNull(this.resultSet); }</code><technical_language>Clarify doc. Returns a proxy a real result set, throws NPE if initialized</technical_language>

Target:
public ResultSet getResultSet() { return this.resultSet; }
Source:
<code>public boolean ack(String deviceUUID, List<String> ackKeys) { checkNotNull(deviceUUID, "deviceUUID parameter must not be null"); checkNotNull(ackKeys, "ackKeys parameter must not be null"); checkArgument(!deviceUUID.trim().isEmpty(), "deviceUUID must not be empty"); if (ackKeys.isEmpty()) return true; String url = "/sync/ack"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("ack_keys", ackKeys); String serialized = JsonSerializer.serialize(attributes); Response response = this.httpClient.request(HttpMethod.POST, url, null, buildHeaders(deviceUUID), serialized); boolean acked = response.getHttpStatus() == 202; if (!acked) { log.warn("Ack request was not accepted. Http status: {}. Response body: {}", response.getHttpStatus(), response.getBody()); } else { <START> log.debug("Items acknowledged."); <END> } return acked; }</code><technical_language>want items acknowledged many</technical_language>

Target:
public boolean ack(String deviceUUID, List<String> ackKeys) { checkNotNull(deviceUUID, "deviceUUID parameter must not be null"); checkNotNull(ackKeys, "ackKeys parameter must not be null"); checkArgument(!deviceUUID.trim().isEmpty(), "deviceUUID must not be empty"); if (ackKeys.isEmpty()) return true; String url = "/sync/ack"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("ack_keys", ackKeys); String serialized = JsonSerializer.serialize(attributes); Response response = this.httpClient.request(HttpMethod.POST, url, null, buildHeaders(deviceUUID), serialized); boolean acked = response.getHttpStatus() == ACCEPTED.getStatusCode(); if (!acked) { log.warn("Ack request was not accepted for {}. Http status: {}. Response body: {}", ackKeys, response.getHttpStatus(), response.getBody()); } else { log.debug("{} items acknowledged.", ackKeys.size()); } return acked; }
Source:
<code>protected Objects.ToStringHelper string() { return Objects.toStringHelper(this) <START> .add("extendedAttributes", projectId); <END> }</code><technical_language>This match name of field in class: .add("projectId", projectId); This apply progress field (when added)</technical_language>

Target:
protected Objects.ToStringHelper string() { return Objects.toStringHelper(this) .add("projectId", projectId).add("progress", progress); }
Source:
<code>public static void setup() throws Exception { setRunIntoMavenCLI(); fileSystemTestingUtils.setup(); ioService = fileSystemTestingUtils.getIoService(); <START> settings_XML = TestUtilMaven.getSettingsFile(); <END> }</code><technical_language>mavenSettings mavenSettingsPath describe variable</technical_language>

Target:
public static void setup() throws Exception { setRunIntoMavenCLI(); fileSystemTestingUtils.setup(); ioService = fileSystemTestingUtils.getIoService(); mavenSettingsPath = TestUtilMaven.getSettingsFile(); }
Source:
<code>PacketCubes(FriendlyByteBuf buf) { int count = buf.readVarInt(); this.cubes = new BigCube[count]; this.cubePositions = new CubePos[count]; for (int i = 0; i < count; i++) { cubePositions[i] = CubePos.of(buf.readInt(), buf.readInt(), buf.readInt()); } int length = MathUtil.ceilDiv(cubes.length, 64); this.cubeExists = BitSet.valueOf(buf.readLongArray(new long[length])); ByteBuffer biomeBuffer = ByteBuffer.allocate(count * CubeBiomeContainer.CUBE_BIOMES_SIZE * 4); buf.readBytes(biomeBuffer.array()); IntBuffer intBuf = biomeBuffer.asIntBuffer(); biomes = new int[intBuf.remaining()]; <START> intBuf.get(biomes); <END> int packetLength = buf.readVarInt(); if (packetLength > MAX_CUBE_SIZE * cubes.length) { throw new RuntimeException("Cubes Packet trying to allocate too much memory on read: " + packetLength + " bytes for " + cubes.length + " cubes"); } this.packetData = new byte[packetLength]; buf.readBytes(this.packetData); int teTagCount = buf.readVarInt(); this.tileEntityTags = new ArrayList<>(teTagCount); for (int i = 0; i < teTagCount; i++) { this.tileEntityTags.add(buf.readNbt()); } }</code><technical_language>read/writeVarIntArray</technical_language>

Target:
PacketCubes(FriendlyByteBuf buf) { int count = buf.readVarInt(); this.cubes = new BigCube[count]; this.cubePositions = new CubePos[count]; for (int i = 0; i < count; i++) { cubePositions[i] = CubePos.of(buf.readInt(), buf.readInt(), buf.readInt()); } int length = MathUtil.ceilDiv(cubes.length, 64); this.cubeExists = BitSet.valueOf(buf.readLongArray(new long[length])); biomeDataArrays = new ArrayList<>(); for (int i = 0; i < count; i++) { biomeDataArrays.add(buf.readVarIntArray()); } int packetLength = buf.readVarInt(); if (packetLength > MAX_CUBE_SIZE * cubes.length) { throw new RuntimeException("Cubes Packet trying to allocate too much memory on read: " + packetLength + " bytes for " + cubes.length + " cubes"); } this.packetData = new byte[packetLength]; buf.readBytes(this.packetData); int teTagCount = buf.readVarInt(); this.tileEntityTags = new ArrayList<>(teTagCount); for (int i = 0; i < teTagCount; i++) { this.tileEntityTags.add(buf.readNbt()); } }
Source:
<code>public long averageSizePerRowInBytes() { if (numDocs == -1) { <START> return numDocs; <END> } return sizeInBytes / numDocs; }</code><technical_language>return -1 directly. a "wait what?" moment return numDocs isolated I get return averageSizePerRowInBytes value</technical_language>

Target:
public long averageSizePerRowInBytes() { if (numDocs == -1) { return -1; } return sizeInBytes / numDocs; }
Source:
<code><START> public final void engineInit(ManagerFactoryParameters spec) <END> throws InvalidAlgorithmParameterException { if (!(spec instanceof ApplicationConfigParameters)) { throw new InvalidAlgorithmParameterException("Unsupported spec: " + spec + ". Only " + ApplicationConfigParameters.class.getName() + " supported"); } mApplicationConfig = ((ApplicationConfigParameters) spec).config; }</code><technical_language>reason for marking methods final? If want this class subclassed, mark class final instead</technical_language>

Target:
public void engineInit(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException { if (!(spec instanceof ApplicationConfigParameters)) { throw new InvalidAlgorithmParameterException("Unsupported spec: " + spec + ". Only " + ApplicationConfigParameters.class.getName() + " supported"); } mApplicationConfig = ((ApplicationConfigParameters) spec).config; }
Source:
<code>private static void getAllConnectorIds(PlanNode node, ImmutableSet.Builder<ConnectorId> builder) { if (node.getSources().isEmpty()) { if (node instanceof TableScanNode) { builder.add(((TableScanNode) node).getTable().getConnectorId()); } else { builder.add(EMPTY_CONNECTOR_ID); } return; } <START> for (PlanNode child : node.getSources()) { <END> getAllConnectorIds(child, builder); } }</code><technical_language>perhaps, verify node is a ValuesNode verify(node instanceof ValuesNode, "Unexpected node type: " + node.getClass().getSimpleName());</technical_language>

Target:
private static void getAllConnectorIds(PlanNode node, ImmutableSet.Builder<ConnectorId> builder) { if (node.getSources().isEmpty()) { if (node instanceof TableScanNode) { builder.add(((TableScanNode) node).getTable().getConnectorId()); } else { verify(node instanceof ValuesNode, "Unexpected node type: " + node.getClass().getSimpleName()); builder.add(EMPTY_CONNECTOR_ID); } return; } for (PlanNode child : node.getSources()) { getAllConnectorIds(child, builder); } }
Source:
<code>public Obs unvoidObs(Obs obs) throws APIException { <START> return Context.getObsService().saveObs(obs,"unretire obs"); <END> }</code><technical_language>unretire unvoid</technical_language>

Target:
public Obs unvoidObs(Obs obs) throws APIException { return Context.getObsService().saveObs(obs,"unvoid obs"); }
Source:
<code>public String toString() { return "EntrySetCommand{" + <START> "set=" + cache.size() + " elements" + <END> '}'; }</code><technical_language>skip size here, debugger invoke toString() step</technical_language>

Target:
public String toString() { return "EntrySetCommand{" + "cache=" + cache.getName() + '}'; }
Source:
<code>public void setUp() throws InjectionException { final EvaluatorRequestor mockedEvaluatorRequestor = mock(EvaluatorRequestor.class); doAnswer(new Answer() { @Override public Object answer(final InvocationOnMock invocationOnMock) { final EvaluatorRequest request = (EvaluatorRequest) invocationOnMock.getArguments()[0]; for (int i = 0; i < request.getNumber(); i++) { final String evalId = EVAL_PREFIX + evalCounter.getAndIncrement(); eventStage.onNext(generateMockedEvaluator(evalId)); } return null; } }).when(mockedEvaluatorRequestor).submit(any(EvaluatorRequest.class)); final Injector injector = Tang.Factory.getTang().newInjector(); injector.bindVolatileInstance(EvaluatorRequestor.class, mockedEvaluatorRequestor); evaluatorManager = injector.getInstance(HomogeneousEvalManager.class); driverAEHandler = new EventHandler<AllocatedEvaluator>() { @Override public void onNext(final AllocatedEvaluator allocatedEvaluator) { evaluatorManager.onEvent(allocatedEvaluator); } }; driverACHandler = new EventHandler<ActiveContext>() { @Override public void onNext(final ActiveContext activeContext) { evaluatorManager.onEvent(activeContext); } }; <START> eventStage = new ThreadPoolStage<>(new EventHandler<Object>() { <END> @Override public void onNext(final Object o) { try { Thread.sleep(RandomUtils.nextInt(MAX_SLEEP_MILLIS)); } catch (final InterruptedException e) { throw new RuntimeException(e); } if (o instanceof AllocatedEvaluator) { driverAEHandler.onNext((AllocatedEvaluator) o); } else { driverACHandler.onNext((ActiveContext) o); } } }, THREAD_POOL_SIZE); evalCounter = new AtomicInteger(0); }</code><technical_language>I this is necessary. focus making simple queries HomogeneousEvalManager</technical_language>

Target:
public void setUp() throws InjectionException { evaluatorManager = new HomogeneousEvalManager(generateMockedEvaluatorRequestor(), 0); evalCounter = new AtomicInteger(0); evalIdToActualContextIdStack = new ConcurrentHashMap<>(); evalIdToExpectedContextIdStack = new ConcurrentHashMap<>(); }
Source:
<code>private void processData() { <START> String timestampString = fData.get(CustomTraceDefinition.TAG_TIMESTAMP); <END> String timestampInputFormat = fData.get(TIMESTAMP_INPUT_FORMAT_KEY); TmfTimestamp timestamp = null; if (timestampInputFormat != null && timestampString != null) { TmfTimestampFormat timestampFormat = new TmfTimestampFormat(timestampInputFormat); try { long time = timestampFormat.parseValue(timestampString); timestamp = new TmfTimestamp(time, ITmfTimestamp.NANOSECOND_SCALE); setTimestamp(timestamp); } catch (ParseException e) { setTimestamp(TmfTimestamp.ZERO); } } else { setTimestamp(TmfTimestamp.ZERO); } int i = 0; synchronized (fColumnData) { fColumnData = new TmfEventField[fDefinition.outputs.size()]; for (OutputColumn outputColumn : fDefinition.outputs) { String value = fData.get(outputColumn.name); if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && timestamp != null) { TmfTimestampFormat timestampFormat = new TmfTimestampFormat(fDefinition.timeStampOutputFormat); fColumnData[i++] = new TmfEventField(outputColumn.name, timestampFormat.format(timestamp.getValue()), null); } else { fColumnData[i++] = new TmfEventField(outputColumn.name, (value != null ? value : ""), null); } } } CustomEventContent curContent = (CustomEventContent) getContent(); setContent(new CustomEventContent(curContent.getName(), curContent.getValue(), fColumnData)); fData = null; }</code><technical_language>get a NullPointerException fData here</technical_language>

Target:
private void processData() { String timestampString = fData.get(CustomTraceDefinition.TAG_TIMESTAMP); String timestampInputFormat = fData.get(TIMESTAMP_INPUT_FORMAT_KEY); TmfTimestamp timestamp = null; if (timestampInputFormat != null && timestampString != null) { TmfTimestampFormat timestampFormat = new TmfTimestampFormat(timestampInputFormat); try { long time = timestampFormat.parseValue(timestampString); timestamp = new TmfTimestamp(time, ITmfTimestamp.NANOSECOND_SCALE); setTimestamp(timestamp); } catch (ParseException e) { setTimestamp(TmfTimestamp.ZERO); } } else { setTimestamp(TmfTimestamp.ZERO); } int i = 0; fColumnData = new TmfEventField[fDefinition.outputs.size()]; for (OutputColumn outputColumn : fDefinition.outputs) { String value = fData.get(outputColumn.name); if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && timestamp != null) { TmfTimestampFormat timestampFormat = new TmfTimestampFormat(fDefinition.timeStampOutputFormat); fColumnData[i++] = new TmfEventField(outputColumn.name, timestampFormat.format(timestamp.getValue()), null); } else { fColumnData[i++] = new TmfEventField(outputColumn.name, (value != null ? value : ""), null); } } CustomEventContent curContent = (CustomEventContent) getContent(); setContent(new CustomEventContent(curContent.getName(), curContent.getValue(), fColumnData)); fData = null; }
Source:
<code>public <T> T deserialize(Response response, Type returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { try { return (T) response.body().bytes(); } catch (IOException e) { throw new ApiException(e); } } else if (returnType.equals(File.class)) { return (T) downloadFileFromResponse(response); } String respBody; try { if (response.body() != null) respBody = response.body().string(); else respBody = null; } catch (IOException e) { throw new ApiException(e); } if (respBody == null || "".equals(respBody)) { return null; } String contentType = response.headers().get("Content-Type"); if (contentType == null) { contentType = "application/json"; } if (isJsonMime(contentType)) { return json.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { return (T) respBody; } else { Gson gson = JSON.createGson().setPrettyPrinting().create(); ErrorResponse errorResponse = null; try { errorResponse = gson.fromJson(respBody, ErrorResponse.class); } catch (Exception e) { throw new ApiException( "Content type \"" + contentType + "\" is not supported for type: " + returnType, e, response.code(), response.headers().toMultimap()); <START> } <END> throw new ApiException( "Content type \"" + contentType + "\" is not supported for type: " + returnType, response.code(), response.headers().toMultimap(), errorResponse); } }</code><technical_language>this is generated client, please write hands. update codegen</technical_language>

Target:
public <T> T deserialize(Response response, Type returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { try { return (T) response.body().bytes(); } catch (IOException e) { throw new ApiException(e); } } else if (returnType.equals(File.class)) { return (T) downloadFileFromResponse(response); } String respBody; try { if (response.body() != null) respBody = response.body().string(); else respBody = null; } catch (IOException e) { throw new ApiException(e); } if (respBody == null || "".equals(respBody)) { return null; } String contentType = response.headers().get("Content-Type"); if (contentType == null) { contentType = "application/json"; } if (isJsonMime(contentType)) { return json.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { return (T) respBody; } else { throw new ApiException( "Content type \"" + contentType + "\" is not supported for type: " + returnType, response.code(), response.headers().toMultimap(), respBody); } }
Source:
<code>public void testGetReturnValueWait() throws InterruptedException, ExecutionException, TimeoutException { Object value = new Object(); <START> InternalCacheEntry ice = when(mock(InternalCacheEntry.class, RETURNS_DEEP_STUBS).getValue()).thenReturn(value).getMock(); <END> sync.runL1UpdateIfPossible(ice); assertEquals(value, sync.get()); }</code><technical_language>Do need a mock here? instance of ImmortalCacheEntry instead</technical_language>

Target:
public void testGetReturnValueWait() throws InterruptedException, ExecutionException, TimeoutException { Object value = new Object(); InternalCacheEntry ice = new ImmortalCacheEntry(value, value); sync.runL1UpdateIfPossible(ice); assertEquals(value, sync.get()); }
Source:
<code>public SqlPersistenceServiceImpl(SqlPersistenceProvider provider, ConfigurationService configurationService) { this.provider = provider; <START> this.configurationService = configurationService; <END> }</code><technical_language>this.expiredObjectColumnName = getKeyColumnName(configurationService); calculate time SqlPersistenceServiceImpl creation re-use in other places</technical_language>

Target:
public SqlPersistenceServiceImpl(SqlPersistenceProvider provider, ConfigurationService configurationService) { this.provider = provider; this.configurationService = configurationService; this.expiredObjectColumnName = getKeyColumnName(configurationService); }
Source:
<code>public void testPut(Method method) { final String key1 = generateKey(method, 1); final String key2 = generateKey(method, 2); cache(0).put(key1, "value1"); assertNoLocks(key1); cache(0).put(key2, "value2"); <START> assertNoLocks(key2); <END> cache(1).put(key1, "value3"); assertNoLocks(key1); cache(1).put(key2, "value4"); assertNoLocks(key2); assertTopKeyAccesses(cache(0), key1, 1, false); assertTopKeyAccesses(cache(0), key2, 1, false); assertTopKeyAccesses(cache(0), key1, 0, true); assertTopKeyAccesses(cache(0), key2, 0, true); assertTopKeyAccesses(cache(1), key1, 1, false); assertTopKeyAccesses(cache(1), key2, 1, false); assertTopKeyAccesses(cache(1), key1, 0, true); assertTopKeyAccesses(cache(1), key2, 0, true); if (isPrimaryOwner(cache(0), key1)) { assertLockInformation(cache(0), key1, 2, 0, 0); assertLockInformation(cache(1), key1, 0, 0, 0); } else { assertLockInformation(cache(0), key1, 0, 0, 0); assertLockInformation(cache(1), key1, 2, 0, 0); } if (isPrimaryOwner(cache(0), key2)) { assertLockInformation(cache(0), key2, 2, 0, 0); assertLockInformation(cache(1), key2, 0, 0, 0); } else { assertLockInformation(cache(0), key2, 0, 0, 0); assertLockInformation(cache(1), key2, 2, 0, 0); } assertWriteSkew(cache(0), key1, 0); assertWriteSkew(cache(0), key2, 0); assertWriteSkew(cache(1), key1, 0); assertWriteSkew(cache(1), key2, 0); }</code><technical_language>faster if assertNoLock() grouped</technical_language>

Target:
public void testPut(Method method) { final String key1 = k(method, 1); final String key2 = k(method, 2); cache(0).put(key1, "value1"); cache(0).put(key2, "value2"); assertNoLocks(key1); assertNoLocks(key2); cache(1).put(key1, "value3"); cache(1).put(key2, "value4"); assertTopKeyAccesses(cache(0), key1, 1, false); assertTopKeyAccesses(cache(0), key2, 1, false); assertTopKeyAccesses(cache(0), key1, 0, true); assertTopKeyAccesses(cache(0), key2, 0, true); assertTopKeyAccesses(cache(1), key1, 1, false); assertTopKeyAccesses(cache(1), key2, 1, false); assertTopKeyAccesses(cache(1), key1, 0, true); assertTopKeyAccesses(cache(1), key2, 0, true); if (isPrimaryOwner(cache(0), key1)) { assertLockInformation(cache(0), key1, 2, 0, 0); assertLockInformation(cache(1), key1, 0, 0, 0); } else { assertLockInformation(cache(0), key1, 0, 0, 0); assertLockInformation(cache(1), key1, 2, 0, 0); } if (isPrimaryOwner(cache(0), key2)) { assertLockInformation(cache(0), key2, 2, 0, 0); assertLockInformation(cache(1), key2, 0, 0, 0); } else { assertLockInformation(cache(0), key2, 0, 0, 0); assertLockInformation(cache(1), key2, 2, 0, 0); } assertWriteSkew(cache(0), key1, 0); assertWriteSkew(cache(0), key2, 0); assertWriteSkew(cache(1), key1, 0); assertWriteSkew(cache(1), key2, 0); }
Source:
<code>protected void createPage3() { dependenciesEditor = new JobDependenciesEditor(this, designerEditor.isReadOnly()); try { int index = addPage(dependenciesEditor, getEditorInput()); <START> setPageText(index, "Dependencies"); <END> setPageImage(index, DesignerPlugin.getImageDescriptor("icons/dependencies/dependencies.gif").createImage()); } catch (PartInitException e) { ExceptionHandler.process(e); } }</code><technical_language>i18n</technical_language>

Target:
protected void createPage3() { dependenciesEditor = new JobDependenciesEditor(this, designerEditor.isReadOnly()); try { int index = addPage(dependenciesEditor, getEditorInput()); setPageText(index, Messages.getString("AbstractMultiPageTalendEditor.DependenciesPage")); setPageImage(index, DesignerPlugin.getImageDescriptor("icons/dependencies/dependencies.gif").createImage()); } catch (PartInitException e) { ExceptionHandler.process(e); } }
Source:
<code>public void beginWindow(long windowId) { super.beginWindow(windowId); currentWindowId = windowId; <START> if ( currentWindowId != Stateless.WINDOW_ID) { <END> if (currentWindowId > reconcilingWindowId) { isInSafeMode = false; isInReconcilingMode = false; } if (currentWindowId == reconcilingWindowId) { isInReconcilingMode = true; isInSafeMode = false; } if (currentWindowId < reconcilingWindowId) { isInReconcilingMode = false; isInSafeMode = true; } } numDeletedInThisWindow = 0; numInsertsInThisWindow = 0; numUpdatesInThisWindow = 0; numUpsertsInThisWindow = 0; }</code><technical_language>This condition true. unnecessary.</technical_language>

Target:
public void beginWindow(long windowId) { super.beginWindow(windowId); currentWindowId = windowId; if ( currentWindowId != Stateless.WINDOW_ID) { if (currentWindowId > reconcilingWindowId) { isInReplayMode = false; isInReconcilingMode = false; } if (currentWindowId == reconcilingWindowId) { isInReconcilingMode = true; isInReplayMode = false; } if (currentWindowId < reconcilingWindowId) { isInReconcilingMode = false; isInReplayMode = true; } } numDeletes = 0; numInserts = 0; numUpdates = 0; numUpserts = 0; }
Source:
<code>public DeviceFirmware convertFrom(final DeviceFirmwareFile source, final Type<DeviceFirmware> destinationType, final MappingContext mappingContext) { final DeviceFirmware destination = new DeviceFirmware(); destination.setDeviceIdentification(source.getDevice().getDeviceIdentification()); <START> final FirmwareConverter firmwareConverter = new FirmwareConverter(); <END> final Firmware firmware = firmwareConverter.convert(source.getFirmwareFile(), firmwareConverter.getBType(), mappingContext); destination.setFirmware(firmware); final GregorianCalendar gCalendar = new GregorianCalendar(); gCalendar.setTime(source.getInstallationDate()); try { destination.setInstallationDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(gCalendar)); } catch (final DatatypeConfigurationException e) { LOGGER.error("Bad date format in the installation date", e); } destination.setInstalledBy(source.getInstalledBy()); destination.setActive(true); return destination; }</code><technical_language>mappingContext? mappingFacade.map(source.getFirmwareFile(), Firmware.class);</technical_language>

Target:
public DeviceFirmware convertFrom(final DeviceFirmwareFile source, final Type<DeviceFirmware> destinationType, final MappingContext mappingContext) { final DeviceFirmware destination = new DeviceFirmware(); destination.setDeviceIdentification(source.getDevice().getDeviceIdentification()); final Firmware firmware = this.mapperFacade.map(source.getFirmwareFile(), Firmware.class, mappingContext); destination.setFirmware(firmware); final GregorianCalendar gCalendar = new GregorianCalendar(); gCalendar.setTime(source.getInstallationDate()); try { destination.setInstallationDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(gCalendar)); } catch (final DatatypeConfigurationException e) { LOGGER.error("Bad date format in the installation date", e); } destination.setInstalledBy(source.getInstalledBy()); destination.setActive(true); return destination; }
Source:
<code>public Message<Object> receive() { for (Object key : correlationLocks.keySet()) { Object lock = getLock(key); synchronized (lock) { MessageGroup group = store.getMessageGroup(key); if (group != null) { if (releaseStrategy.canRelease(group)) { Message<?> nextMessage = null; Iterator<Message<?>> messages = group.getMessages().iterator(); if (messages.hasNext()) { nextMessage = messages.next(); <START> this.store.removeMessagesFromGroup(key, Collections.<Message<?>>singletonList(nextMessage)); <END> if (log.isDebugEnabled()) { log.debug(String.format("Released message for key [%s]: %s.", key, nextMessage)); } } else { remove(key); } @SuppressWarnings("unchecked") Message<Object> result = (Message<Object>) nextMessage; return result; } } } } return null; }</code><technical_language>mind adding overloaded version for removeMessagesFromGroup vararg avoid this extra collection creation for single message</technical_language>

Target:
public Message<Object> receive() { for (Object key : correlationLocks.keySet()) { Object lock = getLock(key); synchronized (lock) { MessageGroup group = store.getMessageGroup(key); if (group != null) { if (releaseStrategy.canRelease(group)) { Message<?> nextMessage = null; Iterator<Message<?>> messages = group.getMessages().iterator(); if (messages.hasNext()) { nextMessage = messages.next(); this.store.removeMessagesFromGroup(key, nextMessage); if (log.isDebugEnabled()) { log.debug(String.format("Released message for key [%s]: %s.", key, nextMessage)); } } else { remove(key); } @SuppressWarnings("unchecked") Message<Object> result = (Message<Object>) nextMessage; return result; } } } } return null; }
Source:
<code>private List<V> pullEncodedKeys(final List<EncodedKey<K>> encodedKeys) { final boolean traceEnabled = RAND.nextDouble() < traceProbability; final TraceScope pullListScope = traceEnabled ? Trace.startSpan("pull_list. num_keys: " + encodedKeys.size(), pwTraceScope.getSpan()) : NullScope.INSTANCE; <START> try { <END> final List<PullOp> pullOps = new ArrayList<>(encodedKeys.size()); for (final EncodedKey<K> encodedKey : encodedKeys) { Span detached = null; try (final TraceScope pullEnqueueScope = Trace.startSpan("pull. key: " + encodedKey.getKey(), pullListScope.getSpan())) { final int threadId = getThreadIndex(encodedKey.getHash()); detached = pullEnqueueScope.detach(); final PullOp pullOp = new PullOp(workerThreads[threadId], encodedKey, TraceInfo.fromSpan(detached)); pullOps.add(pullOp); workerThreads[threadId].enqueue(pullOp); } finally { Trace.continueSpan(detached).close(); } } final List<V> values = new ArrayList<>(pullOps.size()); for (final PullOp pullOp : pullOps) { values.add(pullOp.getResult()); } return values; } finally { pullListScope.close(); } }</code><technical_language>this a try-with-resources statement</technical_language>

Target:
private List<V> pullEncodedKeys(final List<EncodedKey<K>> encodedKeys) { final boolean traceEnabled = RAND.nextDouble() < traceProbability; try (final TraceScope pullListScope = traceEnabled ? Trace.startSpan(String.format("pull_list. num_keys: %d", encodedKeys.size()), pwTraceScope.getSpan()) : NullScope.INSTANCE) { final List<PullOp> pullOps = new ArrayList<>(encodedKeys.size()); for (final EncodedKey<K> encodedKey : encodedKeys) { Span detached = null; try (final TraceScope pullEnqueueScope = Trace.startSpan(String.format("pull. key: %s", encodedKey.getKey()), pullListScope.getSpan())) { final int threadId = getThreadIndex(encodedKey.getHash()); detached = pullEnqueueScope.detach(); final PullOp pullOp = new PullOp(workerThreads[threadId], encodedKey, TraceInfo.fromSpan(detached)); pullOps.add(pullOp); workerThreads[threadId].enqueue(pullOp); } finally { Trace.continueSpan(detached).close(); } } final List<V> values = new ArrayList<>(pullOps.size()); for (final PullOp pullOp : pullOps) { values.add(pullOp.getResult()); } return values; } }
Source:
<code><START> public Integer getTopStateAssignmentTotalSize() { <END> int totalSize = 0; for (Set<String> topStates : _currentTopStateAssignments.values()) { totalSize += topStates.size(); } return totalSize; }</code><technical_language>return int</technical_language>

Target:
public int getTopStateAssignmentTotalSize() { return _currentTopStateAssignments.values().stream().mapToInt(Set::size).sum(); }
Source:
<code>public void execute(SensorContext context) { List<TreeVisitor> treeVisitors = Lists.newArrayList(); Map<InputFile, Set<Integer>> linesOfCode = new HashMap<>(); <START> boolean sqGreater61 = context.getSonarQubeVersion().isGreaterThanOrEqual(V6_2); <END> treeVisitors.add(new MetricsVisitor(context, noSonarFilter, settings.getBoolean(JavaScriptPlugin.IGNORE_HEADER_COMMENTS), fileLinesContextFactory, linesOfCode, sqGreater61)); treeVisitors.add(new HighlighterVisitor(context, fileSystem)); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.add(new CpdVisitor(fileSystem, context)); treeVisitors.addAll(checks.visitorChecks()); for (TreeVisitor check : treeVisitors) { if (check instanceof ParsingErrorCheck) { parsingErrorRuleKey = checks.ruleKeyFor((JavaScriptCheck) check); break; } } ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate))); analyseFiles(context, treeVisitors, fileSystem.inputFiles(mainFilePredicate), progressReport); executeCoverageSensors(context, linesOfCode, sqGreater61); }</code><technical_language>@vilchik-elena Suggested name: isAtLeastSq62</technical_language>

Target:
public void execute(SensorContext context) { List<TreeVisitor> treeVisitors = Lists.newArrayList(); boolean isAtLeastSq62 = context.getSonarQubeVersion().isGreaterThanOrEqual(V6_2); MetricsVisitor metricsVisitor = new MetricsVisitor( context, noSonarFilter, settings.getBoolean(JavaScriptPlugin.IGNORE_HEADER_COMMENTS), fileLinesContextFactory, isAtLeastSq62); treeVisitors.add(metricsVisitor); treeVisitors.add(new HighlighterVisitor(context, fileSystem)); treeVisitors.add(new SeChecksDispatcher(checks.seChecks())); treeVisitors.add(new CpdVisitor(fileSystem, context)); treeVisitors.addAll(checks.visitorChecks()); for (TreeVisitor check : treeVisitors) { if (check instanceof ParsingErrorCheck) { parsingErrorRuleKey = checks.ruleKeyFor((JavaScriptCheck) check); break; } } ProgressReport progressReport = new ProgressReport("Report about progress of Javascript analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(Lists.newArrayList(fileSystem.files(mainFilePredicate))); analyseFiles(context, treeVisitors, fileSystem.inputFiles(mainFilePredicate), progressReport); executeCoverageSensors(context, metricsVisitor.linesOfCode(), isAtLeastSq62); }
Source:
<code>public void testUnhandledNullModelObject() { IModel<String> nameModel = new LambdaModel<>(Model.of((Person)null), Person::getName); <START> assertEquals("A", nameModel.getObject()); <END> }</code><technical_language>Please simplify this nameModel.getObject() is a bit confusing sight</technical_language>

Target:
public void testUnhandledNullModelObject() { IModel<String> nameModel = new LambdaModel<>(Model.of((Person)null), Person::getName); nameModel.getObject(); }
Source:
<code>private static void validateExistsArgument(Object exists) throws QueryException { if (!(exists instanceof Boolean)) { <START> throw new QueryException("$exists operator expects true or false"); <END> } }</code><technical_language>I "$exists operator requires operand true false" a error message</technical_language>

Target:
private static void validateExistsArgument(Object exists) throws QueryException { if (!(exists instanceof Boolean)) { throw new QueryException("$exists operator requires operand to be true or false"); } }
Source:
<code>public boolean isValidPhenotype(final Integer experimentId, final Integer phenotypeId) { final Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.add(Restrictions.eq("phenotypeId", phenotypeId)); final ExperimentModel experiment = new ExperimentModel(); experiment.setNdExperimentId(experimentId); <START> criteria.add(Restrictions.eq("experiment", experiment)); <END> criteria.setProjection(Projections.property("phenotypeId")); final Integer id = (Integer) criteria.uniqueResult(); return id != null; }</code><technical_language>do criteria.add(Restrictions.eq("experiment.ndExperimentId", experimentId)) I</technical_language>

Target:
public boolean isValidPhenotype(final Integer experimentId, final Integer phenotypeId) { final Criteria criteria = this.getSession().createCriteria(this.getPersistentClass()); criteria.add(Restrictions.eq("phenotypeId", phenotypeId)); criteria.add(Restrictions.eq("experiment.ndExperimentId", experimentId)); criteria.setProjection(Projections.property("phenotypeId")); final Integer id = (Integer) criteria.uniqueResult(); return id != null; }
Source:
<code>private static String findRootPath(File extFile) { <START> File currPath = null; <END> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { currPath = extFile; try { while (Environment.isExternalStorageRemovable(currPath.getParentFile())) { currPath = currPath.getParentFile(); } } catch (IllegalArgumentException e) { return currPath.getAbsolutePath(); } } return currPath.getAbsolutePath(); }</code><technical_language>@chaviw check for extFile null</technical_language>

Target:
private static String findRootPath(File extFile) { if (extFile == null) { return null; } File currPath = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { currPath = extFile; try { while (Environment.isExternalStorageRemovable(currPath.getParentFile())) { currPath = currPath.getParentFile(); } } catch (IllegalArgumentException e) { return currPath.getAbsolutePath(); } } return currPath.getAbsolutePath(); }
Source:
<code>public void onSignDye(PlayerInteractEvent event) { if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) return; Material clickedBlock = event.getClickedBlock().getBlockData().getMaterial(); Action action = event.getAction(); <START> User user = ess.getUser(event.getPlayer()); <END> Material itemInHand = user.getItemInHand().getType(); if (MaterialUtil.isSign(clickedBlock) && action == Action.RIGHT_CLICK_BLOCK && MaterialUtil.isDye(itemInHand)) { event.setCancelled(prot.getSettingBool(ProtectConfig.disable_sign_dyeing)); } }</code><technical_language>User? PlayerInteractEvent#getItem returns stack player used</technical_language>

Target:
public void onSignDye(PlayerInteractEvent event) { if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_14_R01)) return; Material clickedBlock = event.getClickedBlock().getBlockData().getMaterial(); Material itemInHand = event.getItem().getType(); Action action = event.getAction(); if (MaterialUtil.isSign(clickedBlock) && action == Action.RIGHT_CLICK_BLOCK && MaterialUtil.isDye(itemInHand)) { event.setCancelled(prot.getSettingBool(ProtectConfig.disable_sign_dyeing)); } }
Source:
<code>public void shutdown(ShutdownInput shutDownInput) { if (isDebugEnabled()) { <START> debug(null, "shard ID: " + (m_shardId.trim().isEmpty()? "unknown" : m_shardId) <END> + ", shutdown reason: " + shutDownInput.getShutdownReason().name()); } if (ShutdownReason.TERMINATE.equals(shutDownInput.getShutdownReason())) { commitCheckPoint(shutDownInput.getCheckpointer()); } }</code><technical_language>blocker: please put a space</technical_language>

Target:
public void shutdown(ShutdownInput shutDownInput) { if (isDebugEnabled()) { debug(null, "shard ID: " + m_shardId + ", shutdown reason: " + shutDownInput.getShutdownReason().name()); } if (ShutdownReason.TERMINATE.equals(shutDownInput.getShutdownReason())) { commitCheckPoint(shutDownInput.getCheckpointer()); } }
Source:
<code><START> public void testAllComposingConstraintsMustBeApplicableToAnnotatedType() { <END> validator.validate( new Shoe( 41 ) ); fail( "Shoe defines @NotEmpty on an int. Validation should have failed." ); }</code><technical_language>long _expectedExceptions_ fail I fine it. I change existing tests though</technical_language>

Target:
public void testAllComposingConstraintsMustBeApplicableToAnnotatedType() { validator.validate( new Shoe( 41 ) ); }
Source:
<code>protected void updateTreeNode(ITreeNode node) { <START> if (getSwtTreeViewer() != null) { <END> getSwtTreeViewer().update(node, null); } }</code><technical_language>null check needed</technical_language>

Target:
protected void updateTreeNode(ITreeNode node) { getSwtTreeViewer().update(node, null); }
Source:
<code>private static TypeCompatibility compatibility(DataType<?> fromType, DataType<?> toType) { if (fromType.equals(toType)) { return compatible(toType, true); } if (fromType.equals(UndefinedType.INSTANCE)) { return compatible(toType, true); } if (toType.equals(UndefinedType.INSTANCE)) { return compatible(fromType, false); } String fromTypeBaseName = fromType.getTypeSignature().getBaseTypeName(); String toTypeBaseName = toType.getTypeSignature().getBaseTypeName(); if (fromTypeBaseName.equals(toTypeBaseName)) { if (!fromType.getTypeParameters().isEmpty() || !toType.getTypeParameters().isEmpty()) { return typeCompatibilityForParametrizedType(fromType, toType); } <START> return compatible(fromType, false); <END> } DataType<?> commonType = convertTypeByPrecedence(fromType, toType); if (commonType != null) { return compatible(commonType, commonType.equals(toType)); } return INCOMPATIBLE; }</code><technical_language>this compatible</technical_language>

Target:
private static DataType<?> compatibility(DataType<?> fromType, DataType<?> toType) { if (fromType.equals(toType)) { return toType; } if (fromType.equals(UndefinedType.INSTANCE)) { return toType; } if (toType.equals(UndefinedType.INSTANCE)) { return fromType; } String fromTypeBaseName = fromType.getTypeSignature().getBaseTypeName(); String toTypeBaseName = toType.getTypeSignature().getBaseTypeName(); if (fromTypeBaseName.equals(toTypeBaseName)) { if (!fromType.getTypeParameters().isEmpty() || !toType.getTypeParameters().isEmpty()) { return typeCompatibilityForParametrizedType(fromType, toType); } return fromType; } return convertTypeByPrecedence(fromType, toType); }
Source:
<code>public void writeInfoFromNode(List<ITmfStateInterval> stateInfo, long t) throws TimeRangeException { fRwl.readLock().lock(); try { for (int i = getStartIndexFor(t); i < fIntervals.size(); i++) { ITmfStateInterval interval = fIntervals.get(i); if <START> (interval.getStartTime() <= t && interval.getEndTime() >= t && <END> interval.getAttribute() < stateInfo.size()) { stateInfo.set(interval.getAttribute(), interval); } } } finally { fRwl.readLock().unlock(); } }</code><technical_language>This condition is more readable t >= interval.getStartTime() && t <= interval.getEndTime()</technical_language>

Target:
public void writeInfoFromNode(List<ITmfStateInterval> stateInfo, long t) throws TimeRangeException { fRwl.readLock().lock(); try { for (int i = getStartIndexFor(t); i < fIntervals.size(); i++) { ITmfStateInterval interval = fIntervals.get(i); if (t >= interval.getStartTime() && interval.getAttribute() < stateInfo.size()) { stateInfo.set(interval.getAttribute(), interval); } } } finally { fRwl.readLock().unlock(); } }
Source:
<code>public void validateAndDeleteCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); <START> if (service.validateTrustStorePassKey(trustStorePasskey)) { <END> saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('deletePassKeyDlg').hide();"); deleteCertificate(hashToken); } else { HelperUtil.addMessageError(DELETE_PASS_ERR_MSG_ID, INVALID_PASS_ERR_MSG); } } else { deleteCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }</code><technical_language>validate hashtoken client system password</technical_language>

Target:
public void validateAndDeleteCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); if (deleteCertificate(hashToken)) { saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('deletePassKeyDlg').hide();"); } else { HelperUtil.addMessageError(DELETE_PASS_ERR_MSG_ID, BAD_MISMATCH_TOKEN); } } else { deleteCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }
Source:
<code>public void validateInputTask(PluginTask task) { super.validateInputTask(task); if (StringUtils.isBlank(task.getCustomObjectFilterType())) { <START> throw new ConfigException("`custom_object_filter_type` cannot empty"); <END> } if (StringUtils.isBlank(task.getCustomObjectAPIName())) { throw new ConfigException("`custom_object_api_name` cannot empty"); } if (task.getToValue().isPresent() && task.getToValue().get() < task.getFromValue()) { throw new ConfigException(String.format("`to_value` (%s) cannot less than the `from_value` (%s)", task.getToValue().get(), task.getFromValue())); } }</code><technical_language>**be** empty</technical_language>

Target:
public void validateInputTask(PluginTask task) { super.validateInputTask(task); if (StringUtils.isBlank(task.getCustomObjectFilterType())) { throw new ConfigException("`custom_object_filter_type` cannot be empty"); } if (StringUtils.isBlank(task.getCustomObjectAPIName())) { throw new ConfigException("`custom_object_api_name` cannot be empty"); } if (task.getToValue().isPresent() && task.getToValue().get() < task.getFromValue()) { throw new ConfigException(String.format("`to_value` (%s) cannot be less than the `from_value` (%s)", task.getToValue().get(), task.getFromValue())); } }
Source:
<code>private static ZipOutputStream newZipOutputStreamFor(Path decryptFile) { Validate.notNull(decryptFile, "invalid null decrypt file"); try { return new ZipOutputStream( new BufferedOutputStream(new FileOutputStream(decryptFile.toFile()))); } catch (SecurityException | FileNotFoundException e) { <START> throw new MigrationException(Messages.DECRYPT_FILE_CREATE_ERROR, decryptFile, e); <END> } }</code><technical_language>treat FileNotFound exception a migration problem, more a user-input problem, i.e., IllegalArgumentException? way, message reported is clear. Right now, admin failed provided a bad file name</technical_language>

Target:
private static ZipOutputStream newZipOutputStreamFor(Path decryptFile) { Validate.notNull(decryptFile, "invalid null decrypt file"); try { return new ZipOutputStream( new BufferedOutputStream(new FileOutputStream(decryptFile.toFile()))); } catch (FileNotFoundException e) { throw new MigrationException(Messages.DECRYPT_FILE_CREATE_ERROR, decryptFile, e); } }