auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void subtest1Select(Client client) throws IOException, ProcCallException { System.out.println("subtest1Select..."); String sql; m_receivedResponse = false; sql = "SELECT * FROM R1;"; executeLRR(client,sql); while (!m_receivedResponse) { doRandomTableManipulation(client, "R1"); } VoltTable vt = client.callProcedure("@AdHoc",sql).getResults()[0]; assertEquals(initTableSize + m_insertCount - m_deleteCount,vt.getRowCount()); }

Target:
public void subtest1Select(Client client) throws IOException, ProcCallException { System.out.println("subtest1Select..."); String sql; m_receivedResponse = false; sql = "SELECT * FROM R1;"; executeLRR(client,sql); while (!m_receivedResponse) { doRandomTableManipulation(client, "R1"); } VoltTable vt = client.callProcedure("@AdHoc",sql).getResults()[0]; assertEquals(initTableSize + m_insertCount - m_deleteCount,vt.getRowCount()); assertTrue(m_insertCount > 0 || m_deleteCount > 0 || m_updateCount > 0); }
Source:
private ProgressCallbackImpl getProgressCallback(ThingUID thingUID) { if (!progessCallbackMap.containsKey(thingUID)) { throw new IllegalStateException( String.format("No ProgressCallback available for thing with UID %s.", thingUID)); } return progessCallbackMap.get(thingUID); }

Target:
private ProgressCallbackImpl getProgressCallback(ThingUID thingUID) { if (!progressCallbackMap.containsKey(thingUID)) { throw new IllegalStateException( String.format("No ProgressCallback available for thing with UID %s.", thingUID)); } return progressCallbackMap.get(thingUID); }
Source:
private ICPPEvaluation createPointerValue(ActivationRecord record, ConstexprEvaluationContext context, ICPPEvaluation computedInitializerEval) { ICPPEvaluation initValue = initializerEval.getValue(null).get(0); if (isPointerToArray(initValue)) { EvalCompositeAccess arrayPointer = new EvalCompositeAccess(computedInitializerEval, 0); return createPointerFromCompositeAccess(record, context, arrayPointer); } else if (computedInitializerEval instanceof EvalPointer) { EvalPointer pointer = (EvalPointer)computedInitializerEval; return pointer.copy(); } return EvalFixed.INCOMPLETE; }

Target:
private ICPPEvaluation createPointerValue(ActivationRecord record, ConstexprEvaluationContext context, ICPPEvaluation computedInitializerEval) { ICPPEvaluation initValue = initializerEval.getValue(context.getPoint()).get(0); if (isPointerToArray(initValue, context)) { EvalCompositeAccess arrayPointer = new EvalCompositeAccess(computedInitializerEval, 0); return createPointerFromCompositeAccess(record, context, arrayPointer); } else if (computedInitializerEval instanceof EvalPointer) { EvalPointer pointer = (EvalPointer)computedInitializerEval; return pointer.copy(); } return EvalFixed.INCOMPLETE; }
Source:
public void testHeadHandler() throws IOException { final int lines = 5; final int headLines = 3; int totalCount = 8192; RandomInputStream rndStream = new RandomInputStream(totalCount, lines); HeadHandler handler = new HeadHandler(headLines); assertTrue(totalCount > handler.getBufferedReaderSize()); handler.processStream(rndStream); assertEquals(headLines, handler.size()); assertEquals(totalCount + 1, rndStream.getCount()); int linesLen = 0; for (int i = 0; i < headLines; i++) { linesLen += handler.get(i).length(); } assertTrue(linesLen < totalCount / 2); }

Target:
public void testHeadHandler() throws IOException { LOGGER.log(Level.INFO, "testing HeadHandler with: {0}/{1}/{2}", new Object[]{lineCnt, headLineCnt, totalCharCount}); RandomInputStream rndStream = new RandomInputStream(totalCharCount, lineCnt); HeadHandler handler = new HeadHandler(headLineCnt); assertTrue(totalCharCount >= HeadHandler.getBufferedReaderSize(), "number of characters to generate must be bigger than " + "HeadHandler internal buffer size"); handler.processStream(rndStream); assertTrue(handler.count() <= headLineCnt, "HeadHandler should not get more lines than was asked to"); assertEquals(totalCharCount, rndStream.getCharCount(), "HeadHandler should read all the characters from input stream"); String[] headLines = new String[handler.count()]; for (int i = 0; i < handler.count(); i++) { String line = handler.get(i); LOGGER.log(Level.INFO, "line [{0}]: {1}", new Object[]{i, line}); headLines[i] = line; } assertArrayEquals(headLines, Arrays.copyOfRange(rndStream.getResult().split("\n"), 0, handler.count()), "the lines retrieved by HeadHandler needs to match the input"); }
Source:
public void unvoidCondition_shouldUnvoidConditionSuccessfully(){ Condition condition = new Condition(); int patientId = 2; condition.setCondition(new CodedOrFreeText()); condition.setAdditionalDetail("unvoiding a condition"); condition.setVerificationStatus(ConditionVerificationStatus.PROVISIONAL); condition.setClinicalStatus(ConditionClinicalStatus.INACTIVE); condition.setUuid(UUID); condition.setPatient(patientService.getPatient(patientId)); expectedException = ExpectedException.none(); conditionService.unvoidCondition(condition); Condition unVoidedCondition = conditionService.getConditionByUuid(UUID); Assert.assertEquals(ConditionVerificationStatus.PROVISIONAL, unVoidedCondition.getVerificationStatus()); Assert.assertEquals(ConditionClinicalStatus.INACTIVE, unVoidedCondition.getClinicalStatus()); Assert.assertEquals(UUID, unVoidedCondition.getUuid()); }

Target:
public void unvoidCondition_shouldUnvoidConditionSuccessfully(){ Condition voidedCondition = conditionService.voidCondition(conditionService.getCondition(4), "Test Reason"); Assert.assertTrue(voidedCondition.getVoided()); Assert.assertNotNull(voidedCondition.getVoidReason()); Assert.assertNotNull(voidedCondition.getDateVoided()); Assert.assertEquals(new Integer(1), voidedCondition.getVoidedBy().getUserId()); Condition unVoidedCondition = conditionService.unvoidCondition(voidedCondition); Assert.assertEquals(ConditionVerificationStatus.CONFIRMED, unVoidedCondition.getVerificationStatus()); Assert.assertEquals(ConditionClinicalStatus.ACTIVE, unVoidedCondition.getClinicalStatus()); Assert.assertEquals("2cb6880e-2cd6-11e4-9138-a6c5e4d20fb7", unVoidedCondition.getUuid()); Assert.assertFalse(unVoidedCondition.getVoided()); Assert.assertNull(unVoidedCondition.getVoidReason()); Assert.assertNull(unVoidedCondition.getDateVoided()); Assert.assertNull(unVoidedCondition.getVoidedBy()); }
Source:
private void sealVmTemplate() { SealVmTemplateParameters parameters = new SealVmTemplateParameters(); parameters.setVmTemplateId(getVmTemplateId()); parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); parameters.setEndProcedure(VdcActionParametersBase.EndProcedure.COMMAND_MANAGED); getBackend().runInternalAction(VdcActionType.SealVmTemplate, parameters, cloneContextAndDetachFromParent()); }

Target:
private void sealVmTemplate() { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.SealVmTemplate, buildSealVmTemplateParameters(), ExecutionHandler.createDefaultContextForTasks(getContext())); if (!returnValue.getSucceeded()) { throw new EngineException(returnValue.getFault().getError(), returnValue.getFault().getMessage()); } }
Source:
public void testFixedMeanFixedVariance() { Double[] params = new Double[2]; params[0] = MEAN; params[1] = VARIANCE; UnivarGaussian gaussian = new UnivarGaussian(); gaussian.setParams(params); testGaussian(gaussian); }

Target:
public void testFixedMeanFixedVariance() { Double[] params = { MEAN, VARIANCE }; UnivarGaussian gaussian = new UnivarGaussian(); gaussian.setParams(params); testGaussian(gaussian); }
Source:
public Block getBlockForPlacement(BlockPlacementData data) { Side mainSide = Side.TOP; boolean upsideDownPlacement = data.attachmentSide == Side.BOTTOM || data.attachmentSide != Side.TOP && data.relativeAttachmentPosition.y() > 0.5; if (upsideDownPlacement) { mainSide = Side.BOTTOM; } Side blockDirection = Side.inDirection(-data.viewingDirection.x(), 0, -data.viewingDirection.z()); return blocks.get(ExtendedSide.getExtendedSideFor(mainSide, blockDirection)); }

Target:
public Block getBlockForPlacement(BlockPlacementData data) { boolean upsideDownPlacement = data.attachmentSide == Side.BOTTOM || data.attachmentSide != Side.TOP && data.relativeAttachmentPosition.y() > 0.5; final Side mainSide = upsideDownPlacement ? Side.BOTTOM : Side.TOP; Side blockDirection = Side.inDirection(-data.viewingDirection.x(), 0, -data.viewingDirection.z()); return blocks.get(ExtendedSide.getExtendedSideFor(mainSide, blockDirection)); }
Source:
public void handleOutgoingProjectNegotiation( final AbstractOutgoingProjectNegotiation negotiation) { projectExecutor.execute(new Runnable() { @Override public void run() { ProjectNegotiation.Status status = negotiation .run(new ConsoleProgressIndicator(System.out)); switch (status) { case ERROR: log.error("ERROR running project negotiation: "+negotiation.getErrorMessage()); break; case REMOTE_ERROR: log.error("REMOTE_ERROR running project negotiation: "+negotiation.getErrorMessage()); break; case CANCEL: log.info("Project negotiation was cancelled locally"); break; case REMOTE_CANCEL: log.info("Project negotiation was cancelled by remote"); break; } } }); }

Target:
public void handleOutgoingProjectNegotiation( final AbstractOutgoingProjectNegotiation negotiation) { projectExecutor.execute(new Runnable() { @Override public void run() { ProjectNegotiation.Status status; if (ServerConfig.isInteractive()) { status = negotiation .run(new ConsoleProgressIndicator(System.out)); } else { status = negotiation .run(new NullProgressMonitor()); } switch (status) { case ERROR: log.error("ERROR running project negotiation: "+ negotiation.getErrorMessage()); break; case REMOTE_ERROR: log.error("REMOTE_ERROR running project negotiation: "+ negotiation.getErrorMessage()+" at remote: "+ negotiation.getPeer().toString()); break; case CANCEL: log.info("Project negotiation was cancelled locally"); break; case REMOTE_CANCEL: log.info("Project negotiation was cancelled by remote: "+ negotiation.getPeer().toString()); break; } } }); }
Source:
public void fetchLocationUri() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueName("info", new Language("en")))); CivicLocation civic = new CivicLocation("country", "city", "street", "number", "postCode"); GeoLocation geo = new GeoLocation(65.65656565, 75.75757575); final AccessPoint ap = new AccessPoint(new ID("id1"), "ip", new MacAddress("aa:bb"), "sn", "model", venue, geo, civic, new CapabilityList(Lists.newArrayList(new Capability(256, "a")))); context.checking(new Expectations() {{ oneOf(repository).findById("id1"); will(returnValue(Optional.of(ap))); oneOf(request).header("Host"); will(returnValue("localhost:8080")); }}); Reply<?> reply = service.fetchLocationURI("id1", request); String locationURI = "localhost:8080/r/aps/id1/location"; assertThat(reply, containsValue(locationURI)); assertThat(reply, isOk()); }

Target:
public void fetchLocationUri() throws Exception { final AccessPoint ap = newAp().build(); context.checking(new Expectations() {{ oneOf(repository).findById("id1"); will(returnValue(Optional.of(ap))); oneOf(request).header("Host"); will(returnValue("localhost:8080")); }}); Reply<?> reply = service.fetchLocationURI("id1", request); String locationURI = "localhost:8080/r/aps/id1/location"; assertThat(reply, containsValue(locationURI)); assertThat(reply, isOk()); }
Source:
private PlugwiseDevice createPlugwiseDevice(String deviceType, String MAC, String deviceName) { PlugwiseDevice device = null; if ("circleplus".equals(deviceType) || "circleplus".equals(deviceName)) { device = new CirclePlus(MAC, stick, deviceName); logger.info("Plugwise created Circle+ with name: and MAC address: {}", deviceName, MAC); } else if ("circle".equals(deviceType) || deviceType == null) { device = new Circle(MAC, stick, deviceName); logger.info("Plugwise created Circle with name: and MAC address: {}", deviceName, MAC); } else if ("scan".equals(deviceType)) { device = new Scan(MAC, stick, deviceName); logger.info("Plugwise created Scan with name: and MAC address: {}", deviceName, MAC); } else if ("sense".equals(deviceType)) { device = new Sense(MAC, stick, deviceName); logger.info("Plugwise created Sense with name: and MAC address: {}", deviceName, MAC); } else if ("stealth".equals(deviceType)) { device = new Stealth(MAC, stick, deviceName); logger.info("Plugwise created Stealth with name: and MAC address: {}", deviceName, MAC); } else if ("switch".equals(deviceType)) { device = new Switch(MAC, stick, deviceName); logger.info("Plugwise created Switch with name: and MAC address: {}", deviceName, MAC); } else { logger.error( "Plugwise can not create device with name: '{}' because it has an unknown device type: '{}'. " + "Known device types are: circle|circleplus|scan|sense|stealth|switch", deviceName, deviceType); } return device; }

Target:
private PlugwiseDevice createPlugwiseDevice(String deviceType, String MAC, String deviceName) { PlugwiseDevice device = null; if ("circleplus".equals(deviceType) || "circleplus".equals(deviceName)) { device = new CirclePlus(MAC, stick, deviceName); logger.debug("Plugwise created Circle+ with name: and MAC address: {}", deviceName, MAC); } else if ("circle".equals(deviceType) || deviceType == null) { device = new Circle(MAC, stick, deviceName); logger.debug("Plugwise created Circle with name: and MAC address: {}", deviceName, MAC); } else if ("scan".equals(deviceType)) { device = new Scan(MAC, stick, deviceName); logger.debug("Plugwise created Scan with name: and MAC address: {}", deviceName, MAC); } else if ("sense".equals(deviceType)) { device = new Sense(MAC, stick, deviceName); logger.debug("Plugwise created Sense with name: and MAC address: {}", deviceName, MAC); } else if ("stealth".equals(deviceType)) { device = new Stealth(MAC, stick, deviceName); logger.debug("Plugwise created Stealth with name: and MAC address: {}", deviceName, MAC); } else if ("switch".equals(deviceType)) { device = new Switch(MAC, stick, deviceName); logger.debug("Plugwise created Switch with name: and MAC address: {}", deviceName, MAC); } else { logger.warn( "Plugwise can not create device with name: '{}' because it has an unknown device type: '{}'. " + "Known device types are: circle|circleplus|scan|sense|stealth|switch", deviceName, deviceType); } return device; }
Source:
public boolean shouldUpdateFragmentOnErrorEvent(StatsEvents.SectionUpdateError errorEvent) { if (!shouldUpdateFragmentOnUpdateEvent(errorEvent)) { return false; } StatsService.StatsEndpointsEnum sectionToUpdate = errorEvent.mEndPointName; StatsService.StatsEndpointsEnum[] sectionsToUpdate = getSectionsToUpdate(); int indexOfDatamodelMatch = -1; for (int i = 0; i < getSectionsToUpdate().length; i++) { if (sectionToUpdate == sectionsToUpdate[i]) { indexOfDatamodelMatch = i; break; } } if (-1 == indexOfDatamodelMatch) { return false; } return true; }

Target:
public boolean shouldUpdateFragmentOnErrorEvent(StatsEvents.SectionUpdateError errorEvent) { if (!shouldUpdateFragmentOnUpdateEvent(errorEvent)) { return false; } StatsService.StatsEndpointsEnum sectionToUpdate = errorEvent.mEndPointName; StatsService.StatsEndpointsEnum[] sectionsToUpdate = sectionsToUpdate(); for (int i = 0; i < sectionsToUpdate().length; i++) { if (sectionToUpdate == sectionsToUpdate[i]) { return true; } } return false; }
Source:
public void setText(final String text) { getElement().setInnerText(text); }

Target:
public void setText(final String text) { textMixin.setText(text); }
Source:
private Shape getSkyBackgroundCurve(Function<Long, WorldCoords> coords, long start, long end, String obsId) { synchronized (cacheLock) { Map<String, CachedShapeId> cache = skyBackgroundCurveCache; CachedShapeId cs = cache.get(obsId); if (cs != null && cs.matches(obsId)) return cs.shape; ImprovedSkyCalc calc = new ImprovedSkyCalc(model.getSchedule().getSite()); GeneralPath path = new GeneralPath(); boolean hop = true; for (long t = start; t < end; t += INTEGRATION_STEP) { calc.calculate(coords.apply(t), new Date(t), true); if (calc.getAltitude() > 0) { if (hop) { path.moveTo(t, calc.getTotalSkyBrightness().floatValue()); hop = false; } else { path.lineTo(t, calc.getTotalSkyBrightness().floatValue()); } } else { hop = true; continue; } } calc.calculate(coords.apply(end), new Date(end), true); if (!hop) path.lineTo(end, calc.getTotalSkyBrightness().floatValue()); cs = new CachedShapeId(timeSB2XY.createTransformedShape(path), obsId); cache.put(obsId, cs); return cs.shape; } }

Target:
private Shape getSkyBackgroundCurve(Function<Long, WorldCoords> coords, long start, long end, String obsId) { synchronized (cacheLock) { Map<String, CachedShape> cache = skyBackgroundCurveCache; CachedShape cs = cache.get(obsId); if (cs != null && cs.matches(start, end)) return cs.shape; ImprovedSkyCalc calc = new ImprovedSkyCalc(model.getSchedule().getSite()); GeneralPath path = new GeneralPath(); boolean hop = true; for (long t = start; t < end; t += INTEGRATION_STEP) { calc.calculate(coords.apply(t), new Date(t), true); if (calc.getAltitude() > 0) { if (hop) { path.moveTo(t, calc.getTotalSkyBrightness().floatValue()); hop = false; } else { path.lineTo(t, calc.getTotalSkyBrightness().floatValue()); } } else { hop = true; continue; } } calc.calculate(coords.apply(end), new Date(end), true); if (!hop) path.lineTo(end, calc.getTotalSkyBrightness().floatValue()); cs = new CachedShape(timeSB2XY.createTransformedShape(path), start, end); cache.put(obsId, cs); return cs.shape; } }
Source:
public Flux<ByteBuffer> getBody() { return bodyIntern().doFinally(s -> { if (!reactorNettyConnection.isDisposed()) { reactorNettyConnection.channel().eventLoop().execute(reactorNettyConnection::dispose); } }).map(byteBuf -> { if (this.disableBufferCopy) { return byteBuf.nioBuffer(); } return deepCopyBuffer(byteBuf); }); }

Target:
public Flux<ByteBuffer> getBody() { return bodyIntern().doFinally(s -> { if (!reactorNettyConnection.isDisposed()) { reactorNettyConnection.channel().eventLoop().execute(reactorNettyConnection::dispose); } }).map(byteBuf -> this.disableBufferCopy ? byteBuf.nioBuffer() : deepCopyBuffer(byteBuf)); }
Source:
protected void checkpointIfNecessary() { if (context.requireCheckpoint()) { boolean completed = false; try { checkpoint(); completed = true; inCheckpointRecords = inRecords; } catch (Exception e) { log.error(e, e); } finally { if (!completed) { log.error(metadata.name() + ": CHECKPOINT FAILURE: Resume may create duplicates."); } } } }

Target:
protected void checkpointIfNecessary() { if (context.requireCheckpoint()) { boolean completed = false; try { checkpoint(); completed = true; inCheckpointRecords = inRecords; } finally { if (!completed) { log.error(metadata.name() + ": CHECKPOINT FAILURE: Resume may create duplicates."); } } } }
Source:
private boolean getMapAdditionalInfo() { mTitle = mTitleEditText.getText().toString(); mDescription = mDescEditText.getText().toString(); String[] tags = (mTagsEditText.getText().toString()).split(","); for (String tag : tags) { mTagsList.add(tag); } if (TextUtils.isEmpty(mTitle)) { mTitleEditText.setError(getString(R.string.title_error)); return false; } if (TextUtils.isEmpty(mTagsEditText.getText().toString())) { mTagsEditText.setError(getString(R.string.tags_error)); return false; } return true; }

Target:
private boolean getMapAdditionalInfo() { mTitle = mTitleEditText.getText().toString(); mDescription = mDescEditText.getText().toString(); String[] tags = (mTagsEditText.getText().toString()).split(","); Collections.addAll(mTagsList, tags); if (TextUtils.isEmpty(mTitle)) { mTitleEditText.setError(getString(R.string.title_error)); return false; } if (TextUtils.isEmpty(mTagsEditText.getText().toString())) { mTagsEditText.setError(getString(R.string.tags_error)); return false; } return true; }
Source:
public boolean isCertExpired(X509Certificate cert) { if (cert != null) { if (cert.getNotAfter().before(new Date())) { return true; } } return false; }

Target:
private boolean isCertExpired(X509Certificate cert) { if (cert != null && cert.getNotAfter().before(new Date())) { return true; } return false; }
Source:
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) { return builder .add( attr(CONSTRAINT_VALUES_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ConstraintValueInfo.PROVIDER.id())) .add(attr(REMOTE_EXECUTION_PROPS_ATTR, Type.STRING)) .add( attr(PARENTS_PLATFORM_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(PlatformInfo.PROVIDER.id())) .add( attr(HOST_PLATFORM_ATTR, Type.BOOLEAN) .value(false) .undocumented("Should only be used by internal packages.")) .add( attr(TARGET_PLATFORM_ATTR, Type.BOOLEAN) .value(false) .undocumented("Should only be used by internal packages.")) .add( attr(CPU_CONSTRAINTS_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ImmutableList.of(ConstraintValueInfo.PROVIDER.id())) .undocumented("Should only be used by internal packages.")) .add( attr(OS_CONSTRAINTS_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ImmutableList.of(ConstraintValueInfo.PROVIDER.id())) .undocumented("Should only be used by internal packages.")) .build(); }

Target:
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) { return builder .add( attr(CONSTRAINT_VALUES_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ConstraintValueInfo.PROVIDER.id())) .add( attr(PARENTS_PLATFORM_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(PlatformInfo.PROVIDER.id())) .add(attr(REMOTE_EXECUTION_PROPS_ATTR, Type.STRING)) .add( attr(HOST_PLATFORM_ATTR, Type.BOOLEAN) .value(false) .undocumented("Should only be used by internal packages.")) .add( attr(TARGET_PLATFORM_ATTR, Type.BOOLEAN) .value(false) .undocumented("Should only be used by internal packages.")) .add( attr(CPU_CONSTRAINTS_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ImmutableList.of(ConstraintValueInfo.PROVIDER.id())) .undocumented("Should only be used by internal packages.")) .add( attr(OS_CONSTRAINTS_ATTR, BuildType.LABEL_LIST) .allowedFileTypes(FileTypeSet.NO_FILE) .mandatoryProviders(ImmutableList.of(ConstraintValueInfo.PROVIDER.id())) .undocumented("Should only be used by internal packages.")) .build(); }
Source:
public void setup() throws IOException { checkState(this.bufferPool == null, "Bug in input gate setup logic: Already registered buffer pool."); setupChannels(); if (consumedPartitionType.isBlocking()) { Collection<MemorySegment> segments = memorySegmentProvider.requestMemorySegments(1); memorySegmentForLocalChannel = Iterables.getOnlyElement(segments); } BufferPool bufferPool = bufferPoolFactory.get(); setBufferPool(bufferPool); }

Target:
public void setup() throws IOException { checkState(this.bufferPool == null, "Bug in input gate setup logic: Already registered buffer pool."); setupChannels(); BufferPool bufferPool = bufferPoolFactory.get(); setBufferPool(bufferPool); }
Source:
public static File createBundle(File workDir, String actual, String basis) throws IllegalArgumentException, IOException { Git git; try { git = Git.open(workDir); } catch (IOException e) { throw new IllegalArgumentException("workDir can't be resolved", e); } Repository repo = git.getRepository(); BundleWriter bundlewriter = new BundleWriter(repo); Ref actualRef; try { actualRef = repo.exactRef(actual); } catch (IOException e) { throw new IllegalArgumentException("actual can't be resolved", e); } if (actualRef == null) throw new IllegalArgumentException("actual can't be resolved"); bundlewriter.include("refs/heads/bundle", actualRef.getObjectId()); if (basis != "") { try { RevWalk walk = new RevWalk(repo); RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); bundlewriter.assume(basisCommit); } catch (Exception e) { throw new IllegalArgumentException("basis can't be resolved", e); } } File bundle; try { bundle = File.createTempFile("file", ".bundle"); OutputStream fos = new FileOutputStream(bundle); NullProgressMonitor monitor = NullProgressMonitor.INSTANCE; bundlewriter.writeBundle(monitor, fos); } catch (Exception e) { throw new IOException("failed to write bundle", e); } return bundle; }

Target:
public static byte[] createBundle(File workDir, String actual, String basis) throws IllegalArgumentException, IOException { Git git; try { if (workDir == null) throw new IllegalArgumentException("workDir is null and can't be resolved"); git = Git.open(workDir); } catch (IOException e) { throw new IOException("failed while read from workDir", e); } Repository repo = git.getRepository(); BundleWriter bundlewriter = new BundleWriter(repo); Ref actualRef; try { actualRef = repo.exactRef(actual); } catch (IOException e) { throw new IOException("failed while resolved second parameter", e); } if (actualRef == null) throw new IllegalArgumentException( "failed to resolve the second parameter: not existing ref"); bundlewriter.include("refs/heads/bundle", actualRef.getObjectId()); if (basis != "") { try { RevWalk walk = new RevWalk(repo); RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); walk.close(); bundlewriter.assume(basisCommit); } catch (NullPointerException | IOException e) { throw new IOException("failed while resolved third parameter", e); } } NullProgressMonitor monitor = NullProgressMonitor.INSTANCE; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bundlewriter.writeBundle(monitor, byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); }
Source:
public static ValidationResultState valueOf(int wellFormed, int valid) { switch (wellFormed) { case RepInfo.UNDETERMINED: return UNKNOWN; case RepInfo.FALSE: return NOT_WELL_FORMED; case RepInfo.TRUE: switch (valid) { case RepInfo.UNDETERMINED: return WELL_FORMED; case RepInfo.FALSE: return WELL_FORMED_BUT_NOT_VALID; case RepInfo.TRUE: return VALID; default: throw new IllegalStateException("Complete switch"); } default: throw new IllegalStateException("Complete switch"); } }

Target:
public static ValidationResultState valueOf(int wellFormed, int valid) { switch (wellFormed) { case RepInfo.UNDETERMINED: return UNKNOWN; case RepInfo.FALSE: return NOT_WELL_FORMED; case RepInfo.TRUE: switch (valid) { case RepInfo.UNDETERMINED: return WELL_FORMED; case RepInfo.FALSE: return WELL_FORMED_BUT_NOT_VALID; case RepInfo.TRUE: return VALID; default: throw new IllegalArgumentException("No enum constant"); } default: throw new IllegalArgumentException("No enum constant"); } }
Source:
private void processModuleOutputTuple(String tuple) { try { JSONObject jo = new JSONObject(tuple); String tb = jo.getJSONObject("groupByKey").getString("timeBucket"); switch (tb) { case "1m": addFinalizedStringToWindowIdBucket(jo, minFinalizedData); if (printFinalizedData) { System.out.println("FinalizedData (min bucket): " + tuple); } break; case "1h": addFinalizedStringToWindowIdBucket(jo, hourFinalizedData); if (printFinalizedData) { System.out.println("FinalizedData (hour bucket): " + tuple); } break; case "1d": addFinalizedStringToWindowIdBucket(jo, dayFinalizedData); if (printFinalizedData) { System.out.println("FinalizedData (day bucket): " + tuple); } break; default: throw new RuntimeException("Something went wrong."); } } catch (JSONException e) { throw new RuntimeException(e); } }

Target:
private void processModuleOutputTuple(String tuple) { try { JSONObject jo = new JSONObject(tuple); String tb = jo.getJSONObject("groupByKey").getString("timeBucket"); switch (tb) { case "1m": addFinalizedStringToWindowIdBucket(jo, minFinalizedData); if (printFinalizedData) { logger.info("FinalizedData (min bucket): {}", tuple); } break; case "1h": addFinalizedStringToWindowIdBucket(jo, hourFinalizedData); if (printFinalizedData) { logger.info("FinalizedData (hour bucket): {}", tuple); } break; case "1d": addFinalizedStringToWindowIdBucket(jo, dayFinalizedData); if (printFinalizedData) { logger.info("FinalizedData (day bucket): {}", tuple); } break; default: throw new RuntimeException("Something went wrong."); } } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
public void saveGridPreferences() { if (gridPreferencesStore != null && preferencesService != null) { gridPreferencesStore.setPreferenceKey(gridPreferencesStore.getPreferenceKey()); gridPreferencesStore.setType(UserPreferencesType.GRIDPREFERENCES); preferencesService.call(response -> { }).saveUserPreferences(gridPreferencesStore); } }

Target:
public void saveGridPreferences() { if (gridPreferencesStore != null) { gridPreferencesStore.setPreferenceKey(gridPreferencesStore.getGlobalPreferences().getKey()); saveGridToUserPreferences(); } }
Source:
public RsWithoutHeader(final Response res, final CharSequence name) { super( new Response() { @Override @SuppressWarnings("unchecked") public Iterable<String> head() throws IOException { final String prefix = String.format( "%s:", name.toString().toLowerCase(Locale.ENGLISH) ); return new Concat<String>( res.head(), Collections.EMPTY_LIST, new Condition.LowerCase(prefix) ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }

Target:
public RsWithoutHeader(final Response res, final CharSequence name) { super( new Response() { @Override public Iterable<String> head() throws IOException { final String prefix = String.format( "%s:", name.toString().toLowerCase(Locale.ENGLISH) ); return new Select<String>( res.head(), new Condition<String>() { @Override public boolean fits(final String header) { return !header.toLowerCase(Locale.ENGLISH) .startsWith(prefix); } } ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }
Source:
public void testThumbSmallRouteForceFileExists() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".png"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); createContext(smallThumbRoute); getMockEndpoint("mock:exec:/bin/sh").expectedMessageCount(1); Map<String, Object> headers = createEvent(fileID, eventTypes, "true"); template.sendBodyAndHeaders("", headers); verify(addSmallThumbnailProcessor).process(any(Exchange.class)); assertMockEndpointsSatisfied(); existingFile.delete(); }

Target:
public void testThumbSmallRouteForceFileExists() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".png"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); createContext(smallThumbRoute); getMockEndpoint("mock:exec:/bin/sh").expectedMessageCount(1); Map<String, Object> headers = createEvent(fileID, eventTypes, "true"); template.sendBodyAndHeaders("", headers); verify(addSmallThumbnailProcessor).process(any(Exchange.class)); assertMockEndpointsSatisfied(); }
Source:
public void testSpatialPartitions() throws Exception { String kdbTreeJson = makeKDBTreeJson(); assertSpatialPartitions(kdbTreeJson, "POINT EMPTY", null); assertSpatialPartitions(kdbTreeJson, "POINT (0 0)", ImmutableList.of(0)); assertSpatialPartitions(kdbTreeJson, "POINT (3 1)", ImmutableList.of(2)); assertSpatialPartitions(kdbTreeJson, "POINT (1 2.5)", ImmutableList.of(1)); assertSpatialPartitions(kdbTreeJson, "POINT (4.5 2.5)", ImmutableList.of(4)); assertSpatialPartitions(kdbTreeJson, "POINT (2 6)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT (3 -1)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT (10 3)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", ImmutableList.of(3)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 5.5 3, 6 2)", ImmutableList.of(3, 4)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (3 2, 8 3)", ImmutableList.of(2, 3, 4, 5)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (2 6, 3 7)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT EMPTY", 1.2, null); assertSpatialPartitions(kdbTreeJson, "POINT (1 1)", 1.2, ImmutableList.of(0)); assertSpatialPartitions(kdbTreeJson, "POINT (1 1)", 2.3, ImmutableList.of(0, 1, 2)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", 0.2, ImmutableList.of(3)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", 1.2, ImmutableList.of(2, 3, 4)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (2 6, 3 7)", 1.2, ImmutableList.of()); }

Target:
public void testSpatialPartitions() { String kdbTreeJson = makeKdbTreeJson(); assertSpatialPartitions(kdbTreeJson, "POINT EMPTY", null); assertSpatialPartitions(kdbTreeJson, "POINT (0 0)", ImmutableList.of(0)); assertSpatialPartitions(kdbTreeJson, "POINT (3 1)", ImmutableList.of(2)); assertSpatialPartitions(kdbTreeJson, "POINT (1 2.5)", ImmutableList.of(1)); assertSpatialPartitions(kdbTreeJson, "POINT (4.5 2.5)", ImmutableList.of(4)); assertSpatialPartitions(kdbTreeJson, "POINT (2 6)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT (3 -1)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT (10 3)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", ImmutableList.of(3)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 5.5 3, 6 2)", ImmutableList.of(3, 4)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (3 2, 8 3)", ImmutableList.of(2, 3, 4, 5)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (2 6, 3 7)", ImmutableList.of()); assertSpatialPartitions(kdbTreeJson, "POINT EMPTY", 1.2, null); assertSpatialPartitions(kdbTreeJson, "POINT (1 1)", 1.2, ImmutableList.of(0)); assertSpatialPartitions(kdbTreeJson, "POINT (1 1)", 2.3, ImmutableList.of(0, 1, 2)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", 0.2, ImmutableList.of(3)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (5 0.1, 6 2)", 1.2, ImmutableList.of(2, 3, 4)); assertSpatialPartitions(kdbTreeJson, "MULTIPOINT (2 6, 3 7)", 1.2, ImmutableList.of()); }
Source:
public Response restore(Action action) { action.setAsync(false); TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(parentId, guid); if (action.isSetRestoreMemory()) { tryBackParams.setRestoreMemory(action.isRestoreMemory()); } if (action.isSetDisks()) { Set<Guid> disksGuid = new HashSet<>(); List<DiskImage> disks = collection.mapDisks(action.getDisks()); if (disks != null) { disksGuid = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); } tryBackParams.setDisks(disksGuid); } tryBackParams.setCorrelationId(RESTORE_SNAPSHOT_CORRELATION_ID); Response response = doAction(ActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action, PollingType.JOB); if (response.getStatus()==Response.Status.OK.getStatusCode()) { RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(parentId, SnapshotActionEnum.COMMIT); restoreParams.setCorrelationId(RESTORE_SNAPSHOT_CORRELATION_ID); Response response2 = doAction(ActionType.RestoreAllSnapshots, restoreParams, action); if (response2.getStatus()!=Response.Status.OK.getStatusCode()) { return response2; } } return response; }

Target:
public Response restore(Action action) { action.setAsync(false); TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(parentId, guid); if (action.isSetRestoreMemory()) { tryBackParams.setRestoreMemory(action.isRestoreMemory()); } if (action.isSetDisks()) { Set<Guid> disksGuids = new HashSet<>(); List<DiskImage> disks = collection.mapDisks(action.getDisks()); if (disks != null) { disksGuids = getDisksGuidSet(disks); } tryBackParams.setDisks(disksGuids); } tryBackParams.setCorrelationId(RESTORE_SNAPSHOT_CORRELATION_ID); Response response = doAction(ActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action, PollingType.JOB); if (response.getStatus()==Response.Status.OK.getStatusCode()) { RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(parentId, SnapshotActionEnum.COMMIT); restoreParams.setCorrelationId(RESTORE_SNAPSHOT_CORRELATION_ID); Response response2 = doAction(ActionType.RestoreAllSnapshots, restoreParams, action); if (response2.getStatus()!=Response.Status.OK.getStatusCode()) { return response2; } } return response; }
Source:
public BatchingLeaderElectionService(LeaderElectionService delegate) { this.delegate = delegate; this.batcher = Autobatchers.independent(this::processBatch) .safeLoggablePurpose(BatchingLeaderElectionService.class.getSimpleName()) .build(); }

Target:
public BatchingLeaderElectionService(LeaderElectionService delegate) { this.delegate = delegate; this.batcher = Autobatchers.independent(this::processBatch) .safeLoggablePurpose("leader-election-service") .build(); }
Source:
private void updateBatchCountIfNeeded(Date roundedStartDate) { boolean isNewBatchPeriod = isNewBatchPeriod(roundedStartDate); if (isNewBatchPeriod) { SessionCount prev = batchCount.getAndSet(new SessionCount(roundedStartDate)); if (prev != null && prev.getSessionsStarted() > 0) { enqueuedSessionCounts.add(prev); } } }

Target:
private void updateBatchCountIfNeeded(Date roundedStartDate) { if (isNewBatchPeriod(roundedStartDate)) { synchronized (batchCount) { if (isNewBatchPeriod(roundedStartDate)) { SessionCount newCount = new SessionCount(roundedStartDate); SessionCount prevCount = batchCount.getAndSet(newCount); if (prevCount != null && prevCount.getSessionsStarted() > 0) { enqueuedSessionCounts.add(prevCount); } } } } }
Source:
ColorConsoleAnnotator(String colorMapName, List<AnsiAttributeElement> openTags) { this.colorMapName = colorMapName; this.openTags = openTags; LOGGER.log(Level.FINE, "creating annotator with colorMapName={0} openTags={2}", new Object[] { colorMapName, openTags }); }

Target:
ColorConsoleAnnotator(String colorMapName, List<AnsiAttributeElement> openTags) { this.colorMapName = colorMapName; this.openTags = openTags; LOGGER.log(Level.FINE, "creating annotator with colorMapName={0} openTags={1}", new Object[] { colorMapName, openTags }); }
Source:
private void updateDriverBlockedFuture(ListenableFuture<?> sourceBlockedFuture) { checkState(initialized.get(), "Driver is not initialized"); checkState(Thread.holdsLock(driverBlockedFutureLock), "driverBlockedFutureLock must be held to call updateDriverBlockedFuture"); driverBlockedFuture = SettableFuture.create(); sourceBlockedFuture.addListener(this::completeDriverBlockedFuture, newDirectExecutorService()); }

Target:
private ListenableFuture<?> updateDriverBlockedFuture(ListenableFuture<?> sourceBlockedFuture) { checkState(initialized.get(), "Driver is not initialized"); SettableFuture<?> newDriverBlockedFuture = SettableFuture.create(); driverBlockedFuture.set(newDriverBlockedFuture); sourceBlockedFuture.addListener(() -> newDriverBlockedFuture.set(null), newDirectExecutorService()); return newDriverBlockedFuture; }
Source:
private static Personname formatPatientName(String nameString, EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, EnExplicitPrefix prefix, EnExplicitSuffix suffix) { boolean namefound; Personname personNameDBModel = new Personname(); namefound = checkNameContents(lastname, firstname, middlename, prefix, suffix, personNameDBModel); if (!namefound && !nameString.trim().contentEquals("")) { LOG.info("setting name by nameString " + nameString); personNameDBModel.setLastName(nameString); } return personNameDBModel; }

Target:
private static Personname formatPatientName(String nameString, EnExplicitFamily lastname, EnExplicitGiven firstname, EnExplicitGiven middlename, EnExplicitPrefix prefix, EnExplicitSuffix suffix) { boolean namefound; Personname personNameDBModel = new Personname(); namefound = checkNameContents(lastname, firstname, middlename, prefix, suffix, personNameDBModel); if (!namefound && StringUtils.isNotEmpty(nameString)) { LOG.info("setting name by nameString ", nameString); personNameDBModel.setLastName(nameString); } return personNameDBModel; }
Source:
public void instantiationTest() throws IOException { VerifiableProperties verifiableProperties = getVProps(new Properties()); ClusterMap clusterMap = new MockClusterMap(); Coordinator coordinator = new MockCoordinator(verifiableProperties, clusterMap); try { new CoordinatorBackedRouter(null, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, null, coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), null); } catch (IllegalArgumentException e) { } Properties properties = new Properties(); properties.setProperty("coordinator.backed.router.operation.pool.size", "0"); verifiableProperties = getVProps(properties); try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorOperation(coordinator, new FutureRouterResult<String>(), "@@blobid@@", null, CoordinatorOperationType.PutBlob); } catch (IllegalArgumentException e) { } }

Target:
public void instantiationTest() throws IOException { VerifiableProperties verifiableProperties = getVProps(new Properties()); ClusterMap clusterMap = new MockClusterMap(); Coordinator coordinator = new MockCoordinator(verifiableProperties, clusterMap); try { new CoordinatorBackedRouter(null, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, null, coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), null); } catch (IllegalArgumentException e) { } Properties properties = new Properties(); properties.setProperty("router.coordinator.backed.router.operation.pool.size", "0"); verifiableProperties = getVProps(properties); try { new CoordinatorBackedRouter(verifiableProperties, clusterMap.getMetricRegistry(), coordinator); } catch (IllegalArgumentException e) { } try { new CoordinatorOperation(coordinator, new FutureRouterResult<String>(), "@@blobid@@", null, CoordinatorOperationType.PutBlob); } catch (IllegalArgumentException e) { } }
Source:
public void dgeqrf(int M, int N, INDArray A, INDArray R, INDArray INFO) { INDArray tau = Nd4j.create( N ) ; int status = LAPACKE_dgeqrf(getColumnOrder(A), M, N, A.data().asNioDouble(), getLda(A), tau.data().asNioDouble() ); if( status != 0 ) { throw new Error( "Failed to execute dgeqrf, code:" + status ) ; } if( R != null ) { for( int ro=0 ; ro<M ; ro++ ) { for( int c=ro ; c<N ; c++ ) { R.putScalar( ro, c, A.getDouble(ro,c) ) ; } } } status = LAPACKE_dorgqr( getColumnOrder(A), M, N, N, A.data().asNioDouble(), getLda(A), tau.data().asNioDouble() ) ; if( status != 0 ) { throw new Error( "Failed to execute dorgqr, code:" + status ) ; } }

Target:
public void dgeqrf(int M, int N, INDArray A, INDArray R, INDArray INFO) { INDArray tau = Nd4j.create( N ) ; int status = LAPACKE_dgeqrf(getColumnOrder(A), M, N, (DoublePointer)A.data().addressPointer(), getLda(A), (DoublePointer)tau.data().addressPointer() ); if( status != 0 ) { throw new BlasException( "Failed to execute dgeqrf", status ) ; } if( R != null ) { R.assign( A.get( NDArrayIndex.interval( 0, A.columns() ), NDArrayIndex.all() ) ) ; INDArrayIndex ix[] = new INDArrayIndex[ 2 ] ; for( int i=1 ; i<Math.min( A.rows(), A.columns() ) ; i++ ) { ix[0] = NDArrayIndex.point( i ) ; ix[1] = NDArrayIndex.interval( 0, i ) ; R.put(ix, 0) ; } } status = LAPACKE_dorgqr( getColumnOrder(A), M, N, N, (DoublePointer)A.data().addressPointer(), getLda(A), (DoublePointer)tau.data().addressPointer() ); if( status != 0 ) { throw new BlasException( "Failed to execute dorgqr", status ) ; } }
Source:
public void close() { Closeables.closeQuietly(ioPool); Closeables.closeQuietly(httpClient); }

Target:
public void close() { Closeables.closeQuietly(httpClient); Closeables.closeQuietly(ioPool); }
Source:
URI toIntermediaryDataServerURI(String supervisorTaskId) { return URI.create( StringUtils.format( "http://%s:%d/druid/worker/v1/shuffle/task/%s/%s/partition?startTime=%s&endTime=%s&partitionId=%d", host, port, StringUtils.urlEncode(supervisorTaskId), StringUtils.urlEncode(subTaskId), interval.getStart(), interval.getEnd(), partitionId ) ); }

Target:
URI toIntermediaryDataServerURI(String supervisorTaskId) { return URI.create( StringUtils.format( "%s://%s:%d/druid/worker/v1/shuffle/task/%s/%s/partition?startTime=%s&endTime=%s&partitionId=%d", useHttps ? "https" : "http", host, port, StringUtils.urlEncode(supervisorTaskId), StringUtils.urlEncode(subTaskId), interval.getStart(), interval.getEnd(), partitionId ) ); }
Source:
public StatsManagerMetrics(MetricRegistry registry) { this.registry = registry; statsPublishFailureCount = registry.counter(MetricRegistry.name(StatsManager.class, "StatsPublishFailureCount")); totalFetchAndAggregateTime = registry.histogram(MetricRegistry.name(StatsManager.class, "TotalFetchAndAggregateTime")); fetchAndAggregateTimePerStore = registry.histogram(MetricRegistry.name(StatsManager.class, "FetchAndAggregateTimePerStore")); }

Target:
public StatsManagerMetrics(MetricRegistry registry) { statsPublishFailureCount = registry.counter(MetricRegistry.name(StatsManager.class, "StatsPublishFailureCount")); totalFetchAndAggregateTime = registry.histogram(MetricRegistry.name(StatsManager.class, "TotalFetchAndAggregateTime")); fetchAndAggregateTimePerStore = registry.histogram(MetricRegistry.name(StatsManager.class, "FetchAndAggregateTimePerStore")); }
Source:
private static boolean hasOnlyInitialization(DetailAST objBlock) { final boolean hasInitBlock = objBlock.findFirstToken(TokenTypes.INSTANCE_INIT) != null; final Predicate<DetailAST> hasMembers = token -> !IGNORED_TYPES.contains(token.getType()); return hasInitBlock && !TokenUtil.findFirstTokenByPredicate(objBlock, hasMembers).isPresent(); }

Target:
private static boolean hasOnlyInitialization(DetailAST objBlock) { final boolean hasInitBlock = objBlock.findFirstToken(TokenTypes.INSTANCE_INIT) != null; return hasInitBlock && !TokenUtil.findFirstTokenByPredicate(objBlock, HAS_MEMBERS).isPresent(); }
Source:
public boolean equals(Object o) { if (!(o instanceof DefaultHttp2UnknownFrame)) { return false; } DefaultHttp2UnknownFrame other = (DefaultHttp2UnknownFrame) o; return (stream == other.stream() || stream != null && stream.equals(other.stream())) && flags.equals(other.flags()) && frameType == other.frameType() && super.equals(other); }

Target:
public boolean equals(Object o) { if (!(o instanceof DefaultHttp2UnknownFrame)) { return false; } DefaultHttp2UnknownFrame other = (DefaultHttp2UnknownFrame) o; Http2FrameStream otherStream = other.stream(); return (stream == otherStream || otherStream != null && otherStream.equals(stream)) && flags.equals(other.flags()) && frameType == other.frameType() && super.equals(other); }
Source:
private void unLockIfNecessary(final Contentlet content, final User user) { try { if (content.isLocked()) { ContentletVersionInfo contentletVersionInfo = APILocator.getVersionableAPI().getContentletVersionInfo(content.getIdentifier(), content.getLanguageId()); if (user.getUserId().equals(contentletVersionInfo.getLockedBy())) { conAPI.unlock(content, user, false); } } } catch (DotDataException|DotSecurityException e) { new DotRuntimeException(e); } }

Target:
private void unLockIfNecessary(final Contentlet content, final User user) { try { if (content.isLocked()) { ContentletVersionInfo contentletVersionInfo = APILocator.getVersionableAPI().getContentletVersionInfo(content.getIdentifier(), content.getLanguageId()); if (user.getUserId().equals(contentletVersionInfo.getLockedBy())) { conAPI.unlock(content, user, false); } } } catch (DotDataException|DotSecurityException e) { Logger.error(EditContentletAction.class, e.getMessage(), e); new DotRuntimeException(e); } }