auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNextLine()) { String line = scanner.nextLine(); logger.info(MorphaStemmer.stem(line)); } }

Target:
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNextLine()) { String line = scanner.nextLine(); System.out.println(MorphaStemmer.stem(line)); } }
Source:
public void shutdown(final String taskId) { if (!started) { log.info("This TaskRunner is stopped. Ignorning shutdown command for task: %s", taskId); } else if (pendingTasks.remove(taskId) != null) { log.info("Removed task from pending queue: %s", taskId); } else if (completeTasks.containsKey(taskId)) { cleanup(completeTasks.get(taskId).getWorker().getHost(), taskId); } else { final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { log.info("Can't shutdown! No worker running task %s", taskId); return; } try { final URL url = makeWorkerURL(zkWorker.getWorker(), String.format("/task/%s/shutdown", taskId)); final StatusResponseHolder response = httpClient.post(url) .go(RESPONSE_HANDLER) .get(); log.info( "Sent shutdown message to worker: %s, status %s, response: %s", zkWorker.getWorker().getHost(), response.getStatus(), response.getContent() ); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { log.error("Shutdown failed for %s! Are you sure the task was running?", taskId); } } catch (Exception e) { throw Throwables.propagate(e); } } }

Target:
public void shutdown(final String taskId) { if (!started) { log.info("This TaskRunner is stopped. Ignoring shutdown command for task: %s", taskId); } else if (pendingTasks.remove(taskId) != null) { pendingTaskPayloads.remove(taskId); log.info("Removed task from pending queue: %s", taskId); } else if (completeTasks.containsKey(taskId)) { cleanup(completeTasks.get(taskId).getWorker().getHost(), taskId); } else { final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { log.info("Can't shutdown! No worker running task %s", taskId); return; } try { final URL url = makeWorkerURL(zkWorker.getWorker(), String.format("/task/%s/shutdown", taskId)); final StatusResponseHolder response = httpClient.post(url) .go(RESPONSE_HANDLER) .get(); log.info( "Sent shutdown message to worker: %s, status %s, response: %s", zkWorker.getWorker().getHost(), response.getStatus(), response.getContent() ); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { log.error("Shutdown failed for %s! Are you sure the task was running?", taskId); } } catch (Exception e) { throw Throwables.propagate(e); } } }
Source:
public synchronized int getLast() { if (data.isEmpty()) { return -1; } return data.get(data.size() - 1); }

Target:
public synchronized int getLast() { return data.isEmpty() ? -1 : data.get(data.size() - 1); }
Source:
public void setId(String id) throws FormatException, IOException { super.setId(id); if(zarrService == null) { try { ServiceFactory factory = new ServiceFactory(); zarrService = factory.getInstance(ZarrService.class); } catch (DependencyException e) { throw new FormatException(ZarrServiceImpl.NO_ZARR_MSG, e); } } if(zarrService != null) { if (!zarrService.isOpen() && zarrService.getID() != id) { MetadataRetrieve meta = getMetadataRetrieve(); MetadataTools.verifyMinimumPopulated(meta, series); int x = meta.getPixelsSizeX(series).getValue().intValue(); int y = meta.getPixelsSizeY(series).getValue().intValue(); int z = meta.getPixelsSizeZ(series).getValue().intValue(); int c = meta.getPixelsSizeC(series).getValue().intValue(); int t = meta.getPixelsSizeT(series).getValue().intValue(); int shape = {x, y, z, c, t}; int chunkX = getTileSizeX(); int chunkY = getTileSizeY(); boolean usingTiling = chunkX > 0 && chunkY > 0; if (!usingTiling) { chunkX = CHUNK_DEFAULT; chunkY = CHUNK_DEFAULT; } int chunks = {chunkX, chunkY, 1, 1, 1}; int pixelType = FormatTools.pixelTypeFromString( meta.getPixelsType(series).toString()); zarrService.create(id, shape, chunks, pixelType, !meta.getPixelsBigEndian(series)); } } }

Target:
public void setId(String id) throws FormatException, IOException { super.setId(id); if(zarrService == null) { zarrService = new ZarrServiceImpl(); } if(zarrService != null) { if (!zarrService.isOpen() && zarrService.getID() != id) { MetadataRetrieve meta = getMetadataRetrieve(); MetadataTools.verifyMinimumPopulated(meta, series); int x = meta.getPixelsSizeX(series).getValue().intValue(); int y = meta.getPixelsSizeY(series).getValue().intValue(); int z = meta.getPixelsSizeZ(series).getValue().intValue(); int c = meta.getPixelsSizeC(series).getValue().intValue(); int t = meta.getPixelsSizeT(series).getValue().intValue(); int shape = {x, y, z, c, t}; int chunkX = getTileSizeX(); int chunkY = getTileSizeY(); boolean usingTiling = chunkX > 0 && chunkY > 0; if (!usingTiling) { chunkX = CHUNK_DEFAULT; chunkY = CHUNK_DEFAULT; } int chunks = {chunkX, chunkY, 1, 1, 1}; int pixelType = FormatTools.pixelTypeFromString( meta.getPixelsType(series).toString()); zarrService.create(id, shape, chunks, pixelType, !meta.getPixelsBigEndian(series)); } } }
Source:
public void testSuccessWithIncludeOptionalMetadataTrue() throws Exception { Response<InstitutionsGetByIdResponse> response = client().service().institutionsGetById( new InstitutionsGetByIdRequest(TARTAN_BANK_INSTITUTION_ID).withIncludeOptionalMetadata(true)) .execute(); assertSuccessResponse(response); Institution institution = response.body().getInstitution(); assertFalse(institution.getCredentials().isEmpty()); for (Institution.Credential c : institution.getCredentials()) { assertNotNull(c.getLabel()); assertNotNull(c.getType()); assertNotNull(c.getName()); } assertIsValidInstitution(institution); assertEquals("<LINK_0>", institution.getUrl()); assertEquals("#174e7c", institution.getPrimaryColor()); }

Target:
public void testSuccessWithIncludeOptionalMetadataTrue() throws Exception { Response<InstitutionsGetByIdResponse> response = client().service().institutionsGetById( new InstitutionsGetByIdRequest(TARTAN_BANK_INSTITUTION_ID).withIncludeOptionalMetadata(true)) .execute(); assertSuccessResponse(response); Institution institution = response.body().getInstitution(); assertFalse(institution.getCredentials().isEmpty()); for (Institution.Credential c : institution.getCredentials()) { assertNotNull(c.getLabel()); assertNotNull(c.getType()); assertNotNull(c.getName()); } assertIsValidInstitution(institution); assertEquals("<LINK_0>", institution.getUrl()); assertNotNull(institution.getLogo()); assertEquals("#174e7c", institution.getPrimaryColor()); }
Source:
public void testInvalidConfig() throws Exception { XMLParser.Config config = new XMLParser.Config("body", "UTF-8", "category://book/@category,title://book/title," + "year:/bookstore/book[price>35.00]/year,price:/bookstore/book[price>35.00]/price,subcategory://book/subcategory", "category:,title:string,price:double,year:int,subcategory:string", "Exit on error"); MockPipelineConfigurer configurer = new MockPipelineConfigurer(INPUT); String caughtMessage = ""; try { new XMLParser(config).configurePipeline(configurer); Assert.fail(); } catch (Exception e) { caughtMessage = e.getMessage(); } Assert.assertEquals(validationExceptionMessage, caughtMessage); FailureCollector collector = configurer.getStageConfigurer().getFailureCollector(); Assert.assertEquals(1, collector.getValidationFailures().size()); Assert.assertEquals(1, collector.getValidationFailures().get(0).getCauses().size()); Cause expectedCause = new Cause(); expectedCause.addAttribute(stage, mockStage); expectedCause.addAttribute(CauseAttributes.STAGE_CONFIG, "fieldTypeMapping"); expectedCause.addAttribute(CauseAttributes.CONFIG_ELEMENT, "category:"); Assert.assertEquals(expectedCause, collector.getValidationFailures().get(0).getCauses().get(0)); }

Target:
public void testInvalidConfig() throws Exception { XMLParser.Config config = new XMLParser.Config("body", "UTF-8", "category://book/@category,title://book/title," + "year:/bookstore/book[price>35.00]/year,price:/bookstore/book[price>35.00]/price,subcategory://book/subcategory", "category:,title:string,price:double,year:int,subcategory:string", "Exit on error"); MockPipelineConfigurer configurer = new MockPipelineConfigurer(INPUT); try { new XMLParser(config).configurePipeline(configurer); Assert.fail(); } catch (ValidationException e) { Assert.assertEquals(1, e.getFailures().size()); Assert.assertEquals(1, e.getFailures().get(0).getCauses().size()); Cause expectedCause = new Cause(); expectedCause.addAttribute("stage", "mockstage"); expectedCause.addAttribute(CauseAttributes.STAGE_CONFIG, XMLParser.Config.FIELD_TYPE_MAPPING); expectedCause.addAttribute(CauseAttributes.CONFIG_ELEMENT, "category:"); Assert.assertEquals(expectedCause, e.getFailures().get(0).getCauses().get(0)); } }
Source:
private void handleEditorImage(Intent data) { String newFilePath = data.getStringExtra(EditImageActivity.EXTRA_OUTPUT); boolean isImageEdit = data.getBooleanExtra(EditImageActivity.IMAGE_IS_EDIT, false); if (isImageEdit) { } else { newFilePath = data.getStringExtra(EditImageActivity.FILE_PATH); ; } Log.d("image is edit", isImageEdit + ""); LoadImageTask loadTask = new LoadImageTask(); loadTask.execute(newFilePath); }

Target:
private void handleEditorImage(Intent data) { String newFilePath = data.getStringExtra(EditImageActivity.EXTRA_OUTPUT); boolean isImageEdit = data.getBooleanExtra(EditImageActivity.IMAGE_IS_EDIT, false); if (isImageEdit) { } else { newFilePath = data.getStringExtra(EditImageActivity.FILE_PATH); } Log.d("image is edit", isImageEdit + ""); LoadImageTask loadTask = new LoadImageTask(); loadTask.execute(newFilePath); }
Source:
private void checkOffsetIsCorrect( final int offset, final boolean isVerticalOffset, final boolean isRtl) { final int spinnerId = R.id.spinner_dropdown_popup_small; final AppCompatSpinner spinner = mContainer.findViewById(spinnerId); mInstrumentation.runOnMainSync(new Runnable() { @Override public void run() { if (isVerticalOffset) { spinner.setDropDownVerticalOffset(offset); } else { spinner.setDropDownHorizontalOffset(offset); } } }); onView(withId(spinnerId)).perform(click()); SystemClock.sleep(250); waitUntilPopupIsShown(spinner); int computedOffset; if (isVerticalOffset) { int[] location = new int[2]; spinner.getLocationOnScreen(location); computedOffset = location[1] + offset; } else { if (isRtl) { int[] location = new int[2]; spinner.getLocationOnScreen(location); final AppCompatSpinner.SpinnerPopup spinnerPopup = spinner.getInternalPopup(); AppCompatSpinner.DropdownPopup dropdownPopup = (AppCompatSpinner.DropdownPopup) (spinnerPopup); final int popupWidth = dropdownPopup.getWidth(); final int spinnerWidth = spinner.getWidth(); computedOffset = location[0] + (spinnerWidth - popupWidth - offset); } else { computedOffset = offset; } } onView(withText(ONE)).check(matches( hasOffset( computedOffset, isVerticalOffset ? "has vertical offset" : "has horizontal offset", isVerticalOffset) )); }

Target:
private void checkOffsetIsCorrect( final int offset, final boolean isVerticalOffset, final boolean isRtl) { final int spinnerId = R.id.spinner_dropdown_popup_small; final AppCompatSpinner spinner = mContainer.findViewById(spinnerId); mInstrumentation.runOnMainSync(new Runnable() { @Override public void run() { if (isVerticalOffset) { spinner.setDropDownVerticalOffset(offset); } else { spinner.setDropDownHorizontalOffset(offset); } } }); onView(withId(spinnerId)).perform(click()); waitUntilPopupIsShown(spinner); int computedOffset; if (isVerticalOffset) { int[] location = new int[2]; spinner.getLocationOnScreen(location); computedOffset = location[1] + offset; } else { if (isRtl) { int[] location = new int[2]; spinner.getLocationOnScreen(location); final AppCompatSpinner.SpinnerPopup spinnerPopup = spinner.getInternalPopup(); AppCompatSpinner.DropdownPopup dropdownPopup = (AppCompatSpinner.DropdownPopup) (spinnerPopup); final int popupWidth = dropdownPopup.getWidth(); final int spinnerWidth = spinner.getWidth(); computedOffset = location[0] + (spinnerWidth - popupWidth - offset); } else { computedOffset = offset; } } onView(withText(ONE)).check(matches( hasOffset( computedOffset, isVerticalOffset ? "has vertical offset" : "has horizontal offset", isVerticalOffset) )); }
Source:
public RegisterResponse register(Identity sender, RegisterRequest registerRequest, InetSocketAddress serverEndpoint) { if (sender == null) { return RegisterResponse.badRequest(null); } Registration.Builder builder = new Registration.Builder(RegistrationHandler.createRegistrationId(), registerRequest.getEndpointName(), sender.getPeerAddress().getAddress(), sender.getPeerAddress() .getPort(), serverEndpoint); builder.lwM2mVersion(registerRequest.getLwVersion()).lifeTimeInSec(registerRequest.getLifetime()) .bindingMode(registerRequest.getBindingMode()).objectLinks(registerRequest.getObjectLinks()) .smsNumber(registerRequest.getSmsNumber()).registrationDate(new Date()).lastUpdate(new Date()) .additionalRegistrationAttributes(registerRequest.getAdditionalAttributes()); Registration registration = builder.build(); if (!authorizer.isAuthorized(registerRequest, registration, sender)) { return RegisterResponse.forbidden(null); } if (registrationService.registerClient(registration)) { LOG.debug("New registered client: {}", registration); return RegisterResponse.success(registration.getId()); } else { return RegisterResponse.forbidden(null); } }

Target:
public RegisterResponse register(Identity sender, RegisterRequest registerRequest, InetSocketAddress serverEndpoint) { Registration.Builder builder = new Registration.Builder(RegistrationHandler.createRegistrationId(), registerRequest.getEndpointName(), sender.getPeerAddress().getAddress(), sender.getPeerAddress() .getPort(), serverEndpoint); builder.lwM2mVersion(registerRequest.getLwVersion()).lifeTimeInSec(registerRequest.getLifetime()) .bindingMode(registerRequest.getBindingMode()).objectLinks(registerRequest.getObjectLinks()) .smsNumber(registerRequest.getSmsNumber()).registrationDate(new Date()).lastUpdate(new Date()) .additionalRegistrationAttributes(registerRequest.getAdditionalAttributes()); Registration registration = builder.build(); if (!authorizer.isAuthorized(registerRequest, registration, sender)) { return RegisterResponse.forbidden(null); } if (registrationService.registerClient(registration)) { LOG.debug("New registered client: {}", registration); return RegisterResponse.success(registration.getId()); } else { return RegisterResponse.forbidden(null); } }
Source:
public void processBindingConfiguration(final String context, final Item item, final String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); ISYBindingConfig config = parseConfig(item, bindingConfig); addBindingConfig(item, config); if (this.logger.isDebugEnabled()) { this.logger.debug("added item [{}]", item, config); } }

Target:
public void processBindingConfiguration(final String context, final Item item, final String bindingConfig) throws BindingConfigParseException { ISYBindingConfig config = parseConfig(item, bindingConfig); addBindingConfig(item, config); this.logger.debug("added item [{}]", item, config); super.processBindingConfiguration(context, item, bindingConfig); }
Source:
private String getTestJavaCommandPath() { return new File(testJDKHome, "bin/java").getAbsolutePath(); }

Target:
private String getTestJavaCommandPath() { if(testJDKHome==null) { return null; } return new File(testJDKHome, "bin/java").getAbsolutePath(); }
Source:
public static void onUpdate(SQLiteDatabase db, int from, int to) { if (from == to) { return; } if (from < 4) { from++; onUpdate(db, from, to); return; } if (from == 4) { onCreate(db); from++; onUpdate(db, from, to); return; } if (from == 5) { from++; onUpdate(db, from, to); return; } }

Target:
public static void onUpdate(SQLiteDatabase db, int from, int to) { if (from == to) { return; } }
Source:
SshFetchConnection() throws TransportException { super(TransportGitSsh.this); try { process = getSession().exec(commandFor(getOptionUploadPack()), getTimeout()); final MessageWriter msg = new MessageWriter(); setMessageWriter(msg); final InputStream upErr = process.getErrorStream(); errorThread = new StreamCopyThread(upErr, msg.getRawStream()); errorThread.start(); init(process.getInputStream(), process.getOutputStream()); } catch (TransportException err) { close(); throw err; } catch (IOException err) { close(); throw new TransportException(uri, JGitText.get().remoteHungUpUnexpectedly, err); } catch (Throwable err) { close(); throw new TransportException(uri, JGitText.get().remoteHungUpUnexpectedly, err); } try { readAdvertisedRefs(); } catch (NoRemoteRepositoryException notFound) { final String msgs = getMessages(); checkExecFailure(process.exitValue(), getOptionUploadPack(), msgs); throw cleanNotFound(notFound, msgs); } }

Target:
SshFetchConnection() throws TransportException { super(TransportGitSsh.this); try { process = getSession().exec(commandFor(getOptionUploadPack()), getTimeout()); final MessageWriter msg = new MessageWriter(); setMessageWriter(msg); final InputStream upErr = process.getErrorStream(); errorThread = new StreamCopyThread(upErr, msg.getRawStream()); errorThread.start(); init(process.getInputStream(), process.getOutputStream()); } catch (TransportException err) { close(); throw err; } catch (Throwable err) { close(); throw new TransportException(uri, JGitText.get().remoteHungUpUnexpectedly, err); } try { readAdvertisedRefs(); } catch (NoRemoteRepositoryException notFound) { final String msgs = getMessages(); checkExecFailure(process.exitValue(), getOptionUploadPack(), msgs); throw cleanNotFound(notFound, msgs); } }
Source:
private CurrencyManager() { this.currencies = new ArrayList<>(); this.currencyCodeToNameMap = new HashMap<>(); this.currencyCodeToSymbolMap = new HashMap<>(); this.backupCurrency = new Currency( "CSB", -1, 0, "ComStart bill", "C-Bill", 2835, 999999, true, true); this.createFormatters(); }

Target:
private CurrencyManager() { this.currencies = new ArrayList<>(); this.currencyCodeToNameMap = new HashMap<>(); this.currencyCodeToSymbolMap = new HashMap<>(); this.backupCurrency = new Currency( "CSB", -1, 0, "ComStar bill", "C-Bill", 2835, 999999, true, true); this.createFormatters(); }
Source:
protected boolean set(TileEntityFurnace tileEntity, Map<Key<?>, Object> keyValues) { final int passedBurnTime = (Integer) keyValues.get(Keys.PASSED_BURN_TIME); final int maxBurnTime = (Integer) keyValues.get(Keys.MAX_BURN_TIME); final int passedCookTime = (Integer) keyValues.get(Keys.PASSED_COOK_TIME); final int maxCookTime = (Integer) keyValues.get(Keys.MAX_COOK_TIME); final boolean needsUpdate = !tileEntity.isBurning() && maxBurnTime > 0; if(needsUpdate){ World world = (World) tileEntity.getWorld(); world.setBlockType(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), BlockTypes.LIT_FURNACE); tileEntity = (TileEntityFurnace) tileEntity.getWorld().getTileEntity(tileEntity.getPos()); } tileEntity.setField(0, maxBurnTime - passedBurnTime); tileEntity.setField(1, maxBurnTime); tileEntity.setField(2, passedCookTime); tileEntity.setField(3, maxCookTime); return true; }

Target:
protected boolean set(TileEntityFurnace tileEntity, Map<Key<?>, Object> keyValues) { final int passedBurnTime = (Integer) keyValues.get(Keys.PASSED_BURN_TIME); final int maxBurnTime = (Integer) keyValues.get(Keys.MAX_BURN_TIME); final int passedCookTime = (Integer) keyValues.get(Keys.PASSED_COOK_TIME); final int maxCookTime = (Integer) keyValues.get(Keys.MAX_COOK_TIME); if (passedBurnTime > maxBurnTime || passedCookTime > maxCookTime) { return false; } final boolean needsUpdate = !tileEntity.isBurning() && maxBurnTime > 0 || tileEntity.isBurning() && maxBurnTime == 0; if (needsUpdate) { final World world = (World) tileEntity.getWorld(); world.setBlockType(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), maxBurnTime > 0 ? BlockTypes.LIT_FURNACE : BlockTypes.FURNACE); tileEntity = (TileEntityFurnace) tileEntity.getWorld().getTileEntity(tileEntity.getPos()); } tileEntity.setField(0, maxBurnTime - passedBurnTime); tileEntity.setField(1, maxBurnTime); tileEntity.setField(2, passedCookTime); tileEntity.setField(3, maxCookTime); return true; }
Source:
public boolean isIntersectionType() { return typeList.size() == 1; }

Target:
public boolean isIntersectionType() { return typeList.size() != 1; }
Source:
private String[] splitLayerName (String layerName) { String[] splitArray = new String[2]; if(layerName.contains(":") ) { splitArray[0] = layerName.split(":", 2)[0]; splitArray[1] = layerName.split(":", 2)[1]; } else { splitArray = new String[] {null,layerName}; } return splitArray; }

Target:
private String[] splitLayerName (String layerName) { String[] splitArray = new String[2]; if(layerName.contains(":") ) { splitArray = layerName.split(":", 2); } else { splitArray = new String[] {null,layerName}; } return splitArray; }
Source:
public int getNumAgents() { if (numAgents > 0) { return numAgents; } else { ClusterConfig clusterConfig = readClusterConfigFromMinimesosFile(); if ((clusterConfig != null) && (clusterConfig.getAgents() != null) && (clusterConfig.getAgents().size() > 0)) { return clusterConfig.getAgents().size(); } else { return 1; } } }

Target:
public int getNumAgents() { int numAgents; if (this.numAgents > 0) { numAgents = this.numAgents; } else { ClusterConfig clusterConfig = readClusterConfigFromMinimesosFile(); if ((clusterConfig != null) && (clusterConfig.getAgents() != null) && (clusterConfig.getAgents().size() > 0)) { numAgents = clusterConfig.getAgents().size(); } else { numAgents = 1; } } return numAgents; }
Source:
public BaselineTarget(Parameters p, String modelPath, String lexiconPath) { super(p); try { lcFilePath = new java.net.URL("file:" + modelPath); lexFilePath = new java.net.URL("file:" + lexiconPath); } catch (Exception e) { logger.error("ERROR: Can't create model or lexicon URL: " + e); e.printStackTrace(); System.exit(1); } if (new java.io.File(modelPath).exists()) { readModel(lcFilePath); readLexiconOnDemand(lexFilePath); } else if (IOUtilities.existsInClasspath(BaselineTarget.class, modelPath)) { readModel(IOUtilities.loadFromClasspath(BaselineTarget.class, modelPath)); readLexiconOnDemand(IOUtilities.loadFromClasspath(BaselineTarget.class, lexiconPath)); } containingPackage = "edu.illinois.cs.cogcomp.pos.lbjava"; name = "BaselineTarget"; setLabeler(new POSLabel()); setExtractor(new WordForm()); }

Target:
public BaselineTarget(Parameters p, String modelPath, String lexiconPath) { super(p); try { lcFilePath = new java.net.URL("file:" + modelPath); lexFilePath = new java.net.URL("file:" + lexiconPath); } catch (Exception e) { System.err.println("ERROR: Can't create model or lexicon URL: " + e); e.printStackTrace(); System.exit(1); } if (new java.io.File(modelPath).exists()) { readModel(lcFilePath); readLexiconOnDemand(lexFilePath); } else if (IOUtilities.existsInClasspath(BaselineTarget.class, modelPath)) { readModel(IOUtilities.loadFromClasspath(BaselineTarget.class, modelPath)); readLexiconOnDemand(IOUtilities.loadFromClasspath(BaselineTarget.class, lexiconPath)); } containingPackage = "edu.illinois.cs.cogcomp.pos.lbjava"; name = "BaselineTarget"; setLabeler(new POSLabel()); setExtractor(new WordForm()); }
Source:
public void snapshotReadBeforeCompactionMark() { final int entryNum = RECORDS_PER_SEGMENT; t(1, () -> put("k" , "v0")); t(1, () -> put("k" , "v1")); t(1, () -> put("k" , "v2")); t(2, () -> get("k")); t(2, this::TXBegin); final int timestamp = 3; for (int i = timestamp; i <= entryNum; ++i) { AtomicInteger version = new AtomicInteger(i); t(1, () -> put("k" , "v" + version.get())); } t(1, () -> getRuntime().getGarbageInformer().gcUnsafe()); t(1, () -> getLogUnit(SERVERS.PORT_0).runCompaction()); getRuntime().getAddressSpaceView().resetCaches(); getRuntime().getAddressSpaceView().invalidateServerCaches(); t(2, () -> get("k")) .assertResult().isEqualTo("v" + entryNum); t(2, this::TXEnd); }

Target:
public void snapshotReadBeforeCompactionMark() { final int entryNum = RECORDS_PER_SEGMENT; t(1, () -> put("k" , "v0")); t(1, () -> put("k" , "v1")); t(1, () -> put("k" , "v2")); t(2, this::TXBegin); t(2, () -> get("k")); final int timestamp = 3; for (int i = timestamp; i <= entryNum; ++i) { AtomicInteger version = new AtomicInteger(i); t(1, () -> put("k" , "v" + version.get())); } t(1, () -> getRuntime().getGarbageInformer().gcUnsafe()); t(1, () -> getLogUnit(SERVERS.PORT_0).runCompaction()); getRuntime().getAddressSpaceView().resetCaches(); getRuntime().getAddressSpaceView().invalidateServerCaches(); t(2, () -> get("k")) .assertThrows().hasCauseInstanceOf(TrimmedException.class); t(2, this::TXEnd); }
Source:
private Pair<Vector[], Vector> convertDataInFeatureOrder(final List<LassoData> instances) { final Vector[] vecXArray = new Vector[numFeatures]; for (int i = 0; i < numFeatures; i++) { vecXArray[i] = vectorFactory.createDenseZeros(instances.size()); } final Vector vecY = vectorFactory.createDenseZeros(instances.size()); for (int i = 0; i < instances.size(); i++) { final Vector feature = instances.get(i).getFeature(); final double value = instances.get(i).getValue(); for (int j = 0; j < numFeatures; j++) { vecXArray[j].set(i, feature.get(j)); } vecY.set(i, value); } return new Pair<Vector[], Vector>(vecXArray, vecY); }

Target:
private Pair<Vector[], Vector> convertDataInFeatureOrder(final List<LassoData> instances) { final Vector[] vecXArray = new Vector[numFeatures]; for (int i = 0; i < numFeatures; i++) { vecXArray[i] = vectorFactory.createDenseZeros(instances.size()); } final Vector vecY = vectorFactory.createDenseZeros(instances.size()); for (int i = 0; i < instances.size(); i++) { final Vector feature = instances.get(i).getFeature(); final double value = instances.get(i).getValue(); for (int j = 0; j < numFeatures; j++) { vecXArray[j].set(i, feature.get(j)); } vecY.set(i, value); } return new Pair<>(vecXArray, vecY); }
Source:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.TIME) { if (isRunning() && isSyncTime()) { if (flag == Flag.CHANGE) { value = (Long)last + ((((Long)value - (Long)last) / 1000L) * 1000L); } else if (flag != Flag.INTERNAL) { value = (((Long)value / 1000L) * 1000L) + (Long)last % 1000L; } } if ((flag == Flag.RESET && isCountDirectionDown()) || (Long)value > getMaximumTime() + 500 && !isCountDirectionDown()) { return getMaximumTime(); } if ((flag == Flag.RESET && !isCountDirectionDown()) || (Long)value < getMinimumTime() - 500) { return getMinimumTime(); } } if (prop == Value.INVERTED_TIME) { return getMaximumTime() - getTime(); } if (prop == Value.MAXIMUM_TIME && (Long)value < getMinimumTime()) { return getMinimumTime(); } if ((prop == Value.MAXIMUM_NUMBER || prop == Value.NUMBER) && (Integer)value < getMinimumNumber()) { return getMinimumNumber(); } if (prop == Value.NUMBER && (Integer)value > getMaximumNumber()) { return getMaximumNumber(); } return value; }

Target:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.TIME) { if (isRunning() && isSyncTime()) { if (flag == Flag.CHANGE) { value = (Long)last + ((((Long)value - (Long)last) / 1000L) * 1000L); } else if (flag != Flag.INTERNAL) { value = (((Long)value / 1000L) * 1000L) + (Long)last % 1000L; } } if ((flag == Flag.RESET && isCountDirectionDown()) || (Long)value > getMaximumTime() + 500 && (!isCountDirectionDown() || flag != Flag.RECALCULATE)) { return getMaximumTime(); } if ((flag == Flag.RESET && !isCountDirectionDown()) || (Long)value < getMinimumTime() - 500) { return getMinimumTime(); } } if (prop == Value.INVERTED_TIME) { return getMaximumTime() - getTime(); } if (prop == Value.MAXIMUM_TIME && (Long)value < getMinimumTime()) { return getMinimumTime(); } if ((prop == Value.MAXIMUM_NUMBER || prop == Value.NUMBER) && (Integer)value < getMinimumNumber()) { return getMinimumNumber(); } if (prop == Value.NUMBER && (Integer)value > getMaximumNumber()) { return getMaximumNumber(); } return value; }
Source:
public void testConcurrentUnsubscribe3000Iterations() throws InterruptedException, BrokenBarrierException, ExecutionException{ for (int i = 0; i < 3000; i++) { testUnsubscribeConcurrently(); } }

Target:
public void testConcurrentUnsubscribe3000Iterations() throws InterruptedException, BrokenBarrierException, ExecutionException{ ExecutorService exec = null; try { exec = Executors.newSingleThreadExecutor(); for (int i = 0; i < 3000; i++) { final AtomicInteger wip = new AtomicInteger(); Func0<AtomicInteger> func0 = new Func0<AtomicInteger>() { @Override public AtomicInteger call() { return wip; } }; Func2<AtomicInteger, Observer<? super Integer>, AtomicInteger> func2 = new Func2<AtomicInteger, Observer<? super Integer>, AtomicInteger>() { @Override public AtomicInteger call(AtomicInteger s, Observer<? super Integer> o) { o.onNext(1); return s; } }; Action1<? super AtomicInteger> action1 = new Action1<AtomicInteger>() { @Override public void call(AtomicInteger s) { s.getAndIncrement(); } }; Observable<Integer> source = Observable.create( SyncOnSubscribe.createStateful( func0, func2, action1 )); final TestSubscriber<Integer> ts = TestSubscriber.create(0); source.subscribe(ts); final CyclicBarrier cb = new CyclicBarrier(2); Future<?> f = exec.submit(new Callable<Object>() { @Override public Object call() throws Exception { cb.await(); ts.requestMore(1); return null; } }); cb.await(); ts.unsubscribe(); f.get(); assertEquals("Unsubscribe supposed to be called once", 1, wip.get()); } } finally { if (exec != null) exec.shutdownNow(); } }
Source:
public MetadataRestore getOSSpecificMetadataRestore(final Metadata metadata, final String filePath) { final String localOS = MetaDataUtil.getOS(); if (localOS.contains("Windows")) { return new WindowsMetadataRestore(metadata, filePath, localOS); } else if (localOS.contains("Mac")) { return new MACMetadataRestore(metadata, filePath, localOS); } else { return new PosixMetadataRestore(metadata, filePath, localOS); } }

Target:
public MetadataRestore getOSSpecificMetadataRestore(final Metadata metadata, final String filePath) { final String localOS = MetaDataUtil.getOS(); if (Platform.isWindows()) { return new WindowsMetadataRestore(metadata, filePath, localOS); } else if (Platform.isMac()) { return new MACMetadataRestore(metadata, filePath, localOS); } else { return new PosixMetadataRestore(metadata, filePath, localOS); } }
Source:
public static void loadAdapterType(final AdapterTypePaletteEntry entry) { if (entry.getType() == null && ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(entry.getFile().getFileExtension())) { try { entry.setType(new ADPImporter(entry.getFile()).importType()); } catch (XMLStreamException | TypeImportException | CoreException e) { Activator.getDefault().logError("Could not load adapter: " + entry.getLabel(), e); } } }

Target:
public static void loadAdapterType(final AdapterTypePaletteEntry entry) { if (entry.getType() == null && ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(entry.getFile().getFileExtension())) { try { entry.setType(new ADPImporter(entry.getFile()).importType()); } catch (XMLStreamException | TypeImportException | CoreException e) { Activator.getDefault().logError("Could not load Adapter: " + entry.getLabel(), e); } } }
Source:
public static Set<String> getNamedCaptureGroupsFromPattern(String pattern) { final Set<String> namedGroups = Sets.newHashSet(); final Matcher m = NAMED_CAPTURE_GROUPS_REGEX.matcher(pattern); while (m.find()) { namedGroups.add(m.group(1)); } return namedGroups; }

Target:
public static Set<String> getNamedCaptureGroupsFromPattern(String pattern) { final Set<String> namedGroups = Sets.newLinkedHashSet(); final Matcher m = NAMED_CAPTURE_GROUPS_REGEX.matcher(pattern); while (m.find()) { namedGroups.add(m.group(1)); } return namedGroups; }
Source:
public void handleAction(ActionParameters params) throws ActionException { final HttpServletRequest request = params.getRequest(); try { final int groupId = params.getHttpParam(PARAM_ID, -1); final DataProvider group = new DataProvider(); group.setId(groupId); handleLocalizations(group, PARAM_NAME_PREFIX, request); if (group.getLocale() == null) { throw new ActionParamsException("Missing names for group!"); } if (groupId != -1) { if (!dataProviderService.hasPermissionToUpdate(params.getUser(), groupId)) { throw new ActionDeniedException("Unauthorized user tried to update layer group - id=" + groupId); } dataProviderService.update(group); ResponseHelper.writeResponse(params, group.getAsJSON()); } else if (params.getUser().isAdmin()) { final int id = dataProviderService.insert(group); group.setId(id); ResponseHelper.writeResponse(params, group.getAsJSON()); } else { throw new ActionDeniedException("Unauthorized user tried to update layer group - id=" + groupId); } } catch (Exception e) { throw new ActionException("Couldn't update/insert map layer group", e); } }

Target:
public void handleAction(ActionParameters params) throws ActionException { final HttpServletRequest request = params.getRequest(); try { final int dataProviderId = params.getHttpParam(PARAM_ID, -1); final DataProvider dataProvider = new DataProvider(); dataProvider.setId(dataProviderId); handleLocalizations(dataProvider, PARAM_NAME_PREFIX, request); if (dataProvider.getLocale() == null) { throw new ActionParamsException("Missing names for layer dataprovider group!"); } if (dataProviderId != -1) { if (!dataProviderService.hasPermissionToUpdate(params.getUser(), dataProviderId)) { throw new ActionDeniedException("Unauthorized user tried to update layer dataprovider group - id=" + dataProviderId); } dataProviderService.update(dataProvider); ResponseHelper.writeResponse(params, dataProvider.getAsJSON()); } else if (params.getUser().isAdmin()) { final int id = dataProviderService.insert(dataProvider); dataProvider.setId(id); ResponseHelper.writeResponse(params, dataProvider.getAsJSON()); } else { throw new ActionDeniedException("Unauthorized user tried to update layer dataprovider group - id=" + dataProviderId); } } catch (Exception e) { throw new ActionException("Couldn't update/insert map layer dataprovider group", e); } }
Source:
public static Object coerceEvalToSelectorObject(ExprEval eval) { if (eval.isArray()) { return Arrays.stream(eval.asStringArray()) .map(NullHandling::emptyToNullIfNeeded) .collect(Collectors.toList()); } return eval.value(); }

Target:
public static Object coerceEvalToSelectorObject(ExprEval eval) { switch (eval.type()) { case STRING_ARRAY: return Arrays.stream(eval.asStringArray()).collect(Collectors.toList()); case DOUBLE_ARRAY: return Arrays.stream(eval.asDoubleArray()).collect(Collectors.toList()); case LONG_ARRAY: return Arrays.stream(eval.asLongArray()).collect(Collectors.toList()); default: return eval.value(); } }
Source:
public List<DataNode> getIndependentDataNodes(int dataNodeCountPerDc) { List<DataNode> dataNodesToReturn = new ArrayList<DataNode>(); for (Datacenter datacenter : hardwareLayout.getDatacenters()) { List<DataNode> dataNodesInThisDc = new ArrayList<>(); dataNodesInThisDc.addAll(datacenter.getDataNodes()); if (dataNodesInThisDc.size() < dataNodeCountPerDc || dataNodeCountPerDc < 0) { throw new IndexOutOfBoundsException("dataNodeCount out of bounds:" + dataNodeCountPerDc); } Collections.shuffle(dataNodesInThisDc); dataNodesToReturn.addAll(dataNodesInThisDc.subList(0, dataNodeCountPerDc)); } return dataNodesToReturn; }

Target:
List<DataNode> getIndependentDataNodes(int dataNodeCountPerDc) { List<DataNode> dataNodesToReturn = new ArrayList<DataNode>(); for (Datacenter datacenter : hardwareLayout.getDatacenters()) { List<DataNode> dataNodesInThisDc = new ArrayList<>(); dataNodesInThisDc.addAll(datacenter.getDataNodes()); if (dataNodeCountPerDc < 0 || dataNodeCountPerDc > dataNodesInThisDc.size()) { throw new IndexOutOfBoundsException("dataNodeCount out of bounds:" + dataNodeCountPerDc); } Collections.shuffle(dataNodesInThisDc); dataNodesToReturn.addAll(dataNodesInThisDc.subList(0, dataNodeCountPerDc)); } return dataNodesToReturn; }
Source:
public static void refreshIfNeeded() { for (IWorkbenchWindow window : PlatformUI.getWorkbench() .getWorkbenchWindows()) for (IWorkbenchPage page : window.getPages()) for (IViewReference vr : page.getViewReferences()) { if (vr.getId().equals(VIEW_ID)) { IViewPart vp = vr.getView(false); if (vp != null) { RepositoriesView rv = (RepositoriesView) vp; rv.scheduleRefresh(); } } } }

Target:
public static void refreshIfNeeded() { for (IWorkbenchWindow window : PlatformUI.getWorkbench() .getWorkbenchWindows()) for (IWorkbenchPage page : window.getPages()) { IViewReference ref = page.findViewReference(VIEW_ID); if (ref != null) { IViewPart vp = ref.getView(false); if (vp != null) { RepositoriesView rv = (RepositoriesView) vp; rv.scheduleRefresh(); } } } }
Source:
public static Integer findWeeksPregnant(IRepository<IPatientEncounterVital> patientEncounterVitalRepository, int encounterId){ Integer weeks_pregnant = null; Query<PatientEncounterVital> query2 = QueryProvider.getPatientEncounterVitalQuery() .fetch("vital") .where() .eq("patient_encounter_id", encounterId) .eq("vital.name", "weeks_pregnant") .order().desc("date_taken"); List<? extends IPatientEncounterVital> patientEncounterVitals = patientEncounterVitalRepository.find(query2); if (patientEncounterVitals.size() > 0) { weeks_pregnant = Math.round(patientEncounterVitals.get(0).getVitalValue()); } return weeks_pregnant; }

Target:
public static Integer findWeeksPregnant(IRepository<IPatientEncounterVital> patientEncounterVitalRepository, int encounterId){ Integer weeks_pregnant = null; Query<PatientEncounterVital> query2 = QueryProvider.getPatientEncounterVitalQuery() .fetch("vital") .where() .eq("patient_encounter_id", encounterId) .eq("vital.name", "weeksPregnant") .order().desc("date_taken"); List<? extends IPatientEncounterVital> patientEncounterVitals = patientEncounterVitalRepository.find(query2); if (patientEncounterVitals.size() > 0) { weeks_pregnant = Math.round(patientEncounterVitals.get(0).getVitalValue()); } return weeks_pregnant; }
Source:
public GroovyScriptNamesDto getGroovyScriptsName() { GroovyScriptNamesDto groovyScriptNames = new GroovyScriptNamesDto(); Set<JobKey> jobKeySet; try { jobKeySet = scheduler.getJobKeys(GroupMatcher.anyJobGroup()); } catch (SchedulerException e) { return groovyScriptNames; } for (JobKey jobKey : jobKeySet) { JobDetail jobDetail; try { jobDetail = scheduler.getJobDetail(jobKey); } catch (SchedulerException e) { continue; } JobDataMap jobDataMap = jobDetail.getJobDataMap(); CronTaskConfigurationDto configuration = (CronTaskConfigurationDto) jobDataMap.get("config"); if (!GroovyCronJob.class.equals(configuration.getJobClass())) { continue; } String groovyScriptName = configuration.getProperties().get("fileName"); groovyScriptNames.addName(groovyScriptName); } return groovyScriptNames; }

Target:
public GroovyScriptNamesDto getGroovyScriptsName() { GroovyScriptNamesDto groovyScriptNames = new GroovyScriptNamesDto(); Set<JobKey> jobKeySet; try { jobKeySet = scheduler.getJobKeys(GroupMatcher.anyJobGroup()); } catch (SchedulerException e) { return groovyScriptNames; } for (JobKey jobKey : jobKeySet) { JobDetail jobDetail; try { jobDetail = scheduler.getJobDetail(jobKey); } catch (SchedulerException e) { continue; } JobDataMap jobDataMap = jobDetail.getJobDataMap(); CronTaskConfigurationDto configuration = (CronTaskConfigurationDto) jobDataMap.get("config"); if (!GroovyCronJob.class.getName().equals(configuration.getJobClass())) { continue; } String groovyScriptName = configuration.getProperties().get("fileName"); groovyScriptNames.addName(groovyScriptName); } return groovyScriptNames; }
Source:
public static String getJarPluginName(File srcFile) throws IOException { JarFile jarFile = new JarFile(srcFile); try { return jarFile.getManifest().getMainAttributes() .getValue("Gerrit-PluginName"); } finally { jarFile.close(); } }

Target:
public static String getJarPluginName(File srcFile) throws IOException { try (JarFile jarFile = new JarFile(srcFile)) { return jarFile.getManifest().getMainAttributes() .getValue("Gerrit-PluginName"); } }
Source:
public double parRate(SwapProduct product, RatesProvider provider) { ExpandedSwap swap = product.expand(); ExpandedSwapLeg fixedLeg = fixedLeg(swap); Currency ccyFixedLeg = fixedLeg.getCurrency(); double otherLegsConvertedPv = 0.0; for (ExpandedSwapLeg leg : swap.getLegs()) { if (leg != fixedLeg) { if (leg.getType().equals(SwapLegType.INFLATION)) { double fvInf = legPricer.futureValuePeriodsInternal(leg.expand(), provider); RatePaymentPeriod payment = (RatePaymentPeriod) fixedLeg.getPaymentPeriods().get(0); double notional = payment.getNotional(); double years = payment.getAccrualPeriods().size(); return Math.pow(-fvInf / notional + 1.0d, 1.0d / years) - 1.0d; } double pvLocal = legPricer.presentValueInternal(leg, provider); otherLegsConvertedPv += (pvLocal * provider.fxRate(leg.getCurrency(), ccyFixedLeg)); } } double fixedLegEventsPv = legPricer.presentValueEventsInternal(fixedLeg, provider); double pvbpFixedLeg = legPricer.pvbp(fixedLeg, provider); return -(otherLegsConvertedPv + fixedLegEventsPv) / pvbpFixedLeg; }

Target:
public double parRate(SwapProduct product, RatesProvider provider) { ExpandedSwap swap = product.expand(); ExpandedSwapLeg fixedLeg = fixedLeg(swap); Currency ccyFixedLeg = fixedLeg.getCurrency(); double otherLegsConvertedPv = 0.0; for (ExpandedSwapLeg leg : swap.getLegs()) { if (leg != fixedLeg) { double pvLocal = legPricer.presentValueInternal(leg, provider); otherLegsConvertedPv += (pvLocal * provider.fxRate(leg.getCurrency(), ccyFixedLeg)); } } double fixedLegEventsPv = legPricer.presentValueEventsInternal(fixedLeg, provider); if (fixedLeg.getPaymentPeriods().size() > 1) { double pvbpFixedLeg = legPricer.pvbp(fixedLeg, provider); return -(otherLegsConvertedPv + fixedLegEventsPv) / pvbpFixedLeg; } else { RatePaymentPeriod payment = (RatePaymentPeriod) fixedLeg.getPaymentPeriods().get(0); if (payment.getAccrualPeriods().size() == 1) { double pvbpFixedLeg = legPricer.pvbp(fixedLeg, provider); return -(otherLegsConvertedPv + fixedLegEventsPv) / pvbpFixedLeg; } ImmutableList<RateAccrualPeriod> ap = payment.getAccrualPeriods(); ArgChecker.isFalse(payment.getCompoundingMethod().equals(CompoundingMethod.NONE), "should be compounding"); for (RateAccrualPeriod p : ap) { ArgChecker.isTrue(p.getYearFraction() == 1.0, "accrual factor should be 1"); ArgChecker.isTrue(p.getSpread() == 0.0, "no spread"); } double nbAp = ap.size(); double notional = payment.getNotional(); double df = provider.discountFactor(ccyFixedLeg, payment.getPaymentDate()); return Math.pow(-(otherLegsConvertedPv + fixedLegEventsPv) / notional / df + 1.0d, 1 / nbAp) - 1.0d; } }
Source:
public synchronized void deleteRule(int ruleid) { Iterator<FirewallRule> iter = this.rules.iterator(); while (iter.hasNext()) { FirewallRule r = iter.next(); if (r.ruleid == ruleid) { iter.remove(); break; } } storageSource.deleteRow(TABLE_NAME, Integer.toString(ruleid)); Masked<U64> delDescriptor = Masked.of( AppCookie.makeCookie(APP_ID, ruleid), AppCookie.getAppFieldMask().or(AppCookie.getUserFieldMask())); List<Masked<U64>> changes = new ArrayList<Masked<U64>>(); changes.add(delDescriptor); routingService.handleRoutingDecisionChange(changes); }

Target:
public synchronized void deleteRule(int ruleid) { Iterator<FirewallRule> iter = this.rules.iterator(); while (iter.hasNext()) { FirewallRule r = iter.next(); if (r.ruleid == ruleid) { iter.remove(); break; } } storageSource.deleteRow(TABLE_NAME, Integer.toString(ruleid)); Masked<U64> delDescriptor = Masked.of( AppCookie.makeCookie(APP_ID, ruleid), AppCookie.getAppFieldMask().or(AppCookie.getUserFieldMask())); List<Masked<U64>> changes = ImmutableList.of(delDescriptor); routingService.handleRoutingDecisionChange(changes); }
Source:
public void processAllAttributesRemoved(String msg, MessageBeans beans) { Perun perun = ldapcManager.getPerunBl(); if (beans.getUser() == null) { return; } try { log.debug("Getting resources assigned to facility {}", beans.getFacility().getId()); List<Resource> resources = perun.getFacilitiesManager().getAssignedResources(ldapcManager.getPerunSession(), beans.getFacility()); for (Resource resource : resources) { log.debug("Removing all attributes from resource {}", resource); perunResource.removeAllAttributes(resource); } } catch (NamingException | FacilityNotExistsException | InternalErrorException | PrivilegeException e) { log.error("Error removing attributes:", e); } }

Target:
public void processAllAttributesRemoved(String msg, MessageBeans beans) { PerunBl perun = (PerunBl) ldapcManager.getPerunBl(); if (beans.getFacility() == null) { return; } try { log.debug("Removing all attributes from facility {}", beans.getFacility()); perunFacility.removeAllAttributes(beans.getFacility()); log.debug("Getting resources assigned to facility {}", beans.getFacility().getId()); List<Resource> resources = perun.getFacilitiesManagerBl().getAssignedResources(ldapcManager.getPerunSession(), beans.getFacility()); for (Resource resource : resources) { log.debug("Removing all attributes from resource {}", resource); perunResource.removeAllAttributes(resource); } } catch (NamingException | InternalErrorException e) { log.error("Error removing attributes:", e); } }
Source:
public Boolean areColumnsUnique(Aggregate rel, RelMetadataQuery mq, ImmutableBitSet columns, boolean ignoreNulls) { if (Aggregate.isSimple(rel) || ignoreNulls) { columns = decorateWithConstantColumnsFromPredicates(columns, rel, mq); ImmutableBitSet groupKey = ImmutableBitSet.range(rel.getGroupCount()); return columns.contains(groupKey); } return false; }

Target:
public Boolean areColumnsUnique(Aggregate rel, RelMetadataQuery mq, ImmutableBitSet columns, boolean ignoreNulls) { if (Aggregate.isSimple(rel) || ignoreNulls) { columns = decorateWithConstantColumnsFromPredicates(columns, rel, mq); ImmutableBitSet groupKey = ImmutableBitSet.range(rel.getGroupCount()); return columns.contains(groupKey); } return null; }
Source:
private String getJoinClause() { return getClause(joinConditions, "", " "); }

Target:
private String getJoinClause() { return getClauseFromQueryConditions(joinConditions, "", " "); }
Source:
public Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId) throws MailboxException { Preconditions.checkArgument(attachmentId != null); JPAAttachment attachment = getEntityManager().find(JPAAttachment.class, attachmentId.getId()); if(attachment!=null && attachment.getMessageIds() != null) { return ImmutableList.<MessageId>builder() .addAll( attachment.getMessageIds().stream(). map(messageId -> new JPAMessageId.Factory().fromString(messageId)).collect(Collectors.toList()) ).build(); } else { return new ArrayList<>(); } }

Target:
public Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId) throws MailboxException { Preconditions.checkArgument(attachmentId != null, "AttachmentId can't be null when trying to get related message Ids!"); JPAAttachment attachment = getEntityManager().find(JPAAttachment.class, attachmentId.getId()); if(attachment != null && attachment.getMessageIds() != null) { return attachment.getMessageIds() .stream() .map(messageId -> new JPAMessageId.Factory().fromString(messageId)) .collect(Guavate.toImmutableList()); } else { return new ArrayList<>(); } }
Source:
public void loadVersion(IHTMLLibraryVersion version){ group.setSelectedVersion(version); List list = new ArrayList(getChildren()); for (Object o : list) remove((PaletteEntry)o); IPaletteVersionGroup versionGroup = group.getSelectedVersionGroup(); for(IPaletteCategory category : versionGroup.getCategories()){ for(IPaletteItem item : category.getItems()){ PaletteTool tool = new PaletteTool(item); add(tool); } add(new PaletteSeparator()); } }

Target:
public void loadVersion(IHTMLLibraryVersion version){ group.setSelectedVersion(version); setChildren(new ArrayList()); IPaletteVersionGroup versionGroup = group.getSelectedVersionGroup(); for(IPaletteCategory category : versionGroup.getCategories()){ for(IPaletteItem item : category.getItems()){ PaletteTool tool = new PaletteTool(item); add(tool); } add(new PaletteSeparator()); } }