auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected List<BakedQuad> modelToQuads(Model modelIn) { return modelIn .flatten() .stream() .flatMap( model -> { if (model instanceof MeshModel) { MeshModel meshModel = (MeshModel) model; return meshModel.faces .stream() .map( face -> { List<int[]> vertexData = face.vertices .stream() <START> .map(v -> vertexToInts(v, face.texture.map(RenderUtility.instance::getTexture) <END> .orElse(Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite()))) .collect(Collectors.toList()); int[] data = Ints.concat(vertexData.toArray(new int[][] {})); return new BakedQuad(data, -1, EnumFacing.values()[Direction.fromVector(face.normal).ordinal()]); } ); } return Stream.empty(); } ) .collect(Collectors.toList()); }</code><technical_language>refactor out face.texture.map(...).orElse(...) bit a standalone variable</technical_language>

Target:
protected List<BakedQuad> modelToQuads(Model modelIn) { return modelIn .flatten() .stream() .flatMap( model -> { if (model instanceof MeshModel) { MeshModel meshModel = (MeshModel) model; return meshModel.faces .stream() .map( face -> { TextureAtlasSprite texture = face.texture.map(RenderUtility.instance::getTexture) .orElse(Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite()); List<int[]> vertexData = face.vertices .stream() .map(v -> vertexToInts(v, texture)) .collect(Collectors.toList()); int[] data = Ints.concat(vertexData.toArray(new int[][] {})); return new BakedQuad(data, -1, EnumFacing.values()[Direction.fromVector(face.normal).ordinal()]); } ); } return Stream.empty(); } ) .collect(Collectors.toList()); }
Source:
<code>public void testValueShouldBeNullWhenSetToNull() throws Exception { Session session = sessions.openSession(); String uuid = null; { Helicopter entity = helicopter( "Honey Bee CP3" ); Transaction tx = session.beginTransaction(); session.persist( entity ); uuid = entity.getUUID(); <START> tx.commit(); <END> } { Transaction tx = session.beginTransaction(); Helicopter entity = (Helicopter) session.get( Helicopter.class, uuid ); entity.setName( null ); tx.commit(); session.flush(); session.clear(); } { Transaction tx = session.beginTransaction(); Helicopter entity = (Helicopter) session.get( Helicopter.class, uuid ); session.delete( entity ); tx.commit(); assertThat( entity.getName(), is( nullValue() ) ); } session.clear(); session.close(); }</code><technical_language>clearing session</technical_language>

Target:
public void testValueShouldBeNullWhenSetToNull() throws Exception { Session session = sessions.openSession(); String uuid = null; { Helicopter entity = helicopter( "Honey Bee CP3" ); Transaction tx = session.beginTransaction(); session.persist( entity ); uuid = entity.getUUID(); tx.commit(); session.clear(); } { Transaction tx = session.beginTransaction(); Helicopter entity = (Helicopter) session.get( Helicopter.class, uuid ); entity.setName( null ); tx.commit(); session.clear(); } { Transaction tx = session.beginTransaction(); Helicopter entity = (Helicopter) session.get( Helicopter.class, uuid ); session.delete( entity ); tx.commit(); assertThat( entity.getName(), is( nullValue() ) ); } session.close(); }
Source:
<code>public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Log.e("Surface","Change"); Camera.Parameters parameters = mCamera.getParameters(); int state = Camera2.getState(); if(state == 1 ){ parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF); } else if(state == 2) <START> { <END> parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO); } else{ parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON); } try{ mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, w, h); if (mSupportFocus.contains(Camera.Parameters.FOCUS_MODE_AUTO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); } parameters.setSceneMode(Camera.Parameters.SCENE_MODE_AUTO); parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height); }catch(Exception e){} requestLayout(); mCamera.setParameters(parameters); mCamera.startPreview(); }</code><technical_language>Please put { (bracket) in line</technical_language>

Target:
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Log.e("Surface","Change"); Camera.Parameters parameters = mCamera.getParameters(); int state = Camera2.getState(); if(state == 1 ) parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF); else if(state == 2) parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO); else parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON); try{ mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, w, h); if (mSupportFocus.contains(Camera.Parameters.FOCUS_MODE_AUTO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); } parameters.setSceneMode(Camera.Parameters.SCENE_MODE_AUTO); parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height); }catch(Exception e){} requestLayout(); mCamera.setParameters(parameters); mCamera.startPreview(); }
Source:
<code>public synchronized long getLatestSegmentMemoryConsumed() { if (isEmpty()) { <START> return 0; <END> } int latestSegmentIndex = (_cursor + _arraySize - 1) % _arraySize; SegmentStats stats = getSegmentStatsAt(latestSegmentIndex); return stats._memUsedBytes; }</code><technical_language>Return -1 unavailable</technical_language>

Target:
public synchronized long getLatestSegmentMemoryConsumed() { if (isEmpty()) { return -1; } int latestSegmentIndex = (_cursor + _arraySize - 1) % _arraySize; SegmentStats stats = getSegmentStatsAt(latestSegmentIndex); return stats._memUsedBytes; }
Source:
<code>public synchronized void unsubscribe() { if (sub == null) { <START> return; <END> } try { sub.unsubscribe(); } catch (IOException e) { LOGGER.warn("could not unsubscribe from subscription. " + e.getMessage()); } sub = null; }</code><technical_language>honestly sure, do worth logging some level consumer is unsub a null sub</technical_language>

Target:
public synchronized void unsubscribe() { if (sub == null) { LOGGER.warn("attempted to unsubscribe with a null internal " + "subscription - possibly unsubscribing more than once - subject: " + subject); return; } try { sub.unsubscribe(); } catch (IOException e) { LOGGER.warn("could not unsubscribe from subscription. " + e.getMessage()); } sub = null; }
Source:
<code>private static void irq(TmfGraph graph, LttngEventLayout eventLayout, long ts, LttngWorker target, LttngInterruptContext context) { <START> TmfEdge l3 = graph.append(target, new TmfVertex(ts)); <END> if (l3 != null) { int vec = EventField.getLong(context.getEvent(), eventLayout.fieldIrq()).intValue(); l3.setType(resolveIRQ(vec)); } }</code><technical_language>renamed generic variable name "link"</technical_language>

Target:
private static void irq(TmfGraph graph, LttngEventLayout eventLayout, long ts, LttngWorker target, LttngInterruptContext context) { TmfEdge link = graph.append(target, new TmfVertex(ts)); if (link != null) { int vec = EventField.getLong(context.getEvent(), eventLayout.fieldIrq()).intValue(); link.setType(resolveIRQ(vec)); } }
Source:
<code>public static Task<String> fetchTopProvider(FirebaseAuth auth, @NonNull String email) { if (TextUtils.isEmpty(email)) { return Tasks.forException(new NullPointerException("Email cannot be empty")); } return auth.fetchProvidersForEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error fetching providers for email")) .continueWith(new Continuation<ProviderQueryResult, String>() { @Override public String then(@NonNull Task<ProviderQueryResult> task) throws Exception { if (!task.isSuccessful()) return null; List<String> providers = task.getResult().getProviders(); return providers == null || providers.isEmpty() <START> ? null : providers.get(providers.size() - 1); <END> } }); }</code><technical_language>stick providers(0) if a sneaky (but important) change more. Fine ternary! opposition no-braces if statements is easy try modify forgot add braces</technical_language>

Target:
public static Task<String> fetchTopProvider(FirebaseAuth auth, @NonNull String email) { if (TextUtils.isEmpty(email)) { return Tasks.forException(new NullPointerException("Email cannot be empty")); } return auth.fetchProvidersForEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error fetching providers for email")) .continueWith(new Continuation<ProviderQueryResult, String>() { @Override public String then(@NonNull Task<ProviderQueryResult> task) throws Exception { if (!task.isSuccessful()) return null; List<String> providers = task.getResult().getProviders(); return providers == null || providers.isEmpty() ? null : providers.get(0); } }); }
Source:
<code>public void addTradeOffers(final Career career, final int level, final TradeOfferGenerator... generators) throws IllegalArgumentException { checkNotNull(career, "career"); checkArgument(career instanceof SpongeCareer, "Unsupported Career: %s (%s)", career.getClass().getName()); final Profession profession = checkNotNull(career.getProfession(), "profession"); checkArgument(profession instanceof SpongeProfession, "Unsupported Profession: %s (%s)", profession.getName(), profession.getClass() .getName()); final SpongeCareer spongeCareer = (SpongeCareer) career; final SpongeProfession spongeProfession = (SpongeProfession) profession; final int careerType = spongeCareer.type; final int professionType = spongeProfession.type; <START> checkArgument(careerType > 0, "CareerType cannot be zero or negative"); <END> checkArgument(professionType > 0, "ProfessionType cannot be zero or negative"); checkArgument(level > 0, "Level cannot be zero or negative"); checkArgument(level <= 100, "Level cannot be bigger than 100"); if (checkNotNull(generators, "generators").length == 0) { return; } final ITradeList[][][][] defaultTrades = EntityVillager.DEFAULT_TRADE_LIST_MAP; if (defaultTrades == null || defaultTrades.length < professionType) { throw new IllegalStateException("Could not find valid entry in default trade offer generators"); } final ITradeList[][][] professionTrades = defaultTrades[professionType]; if (professionTrades == null || professionTrades.length < careerType) { throw new IllegalStateException("Could not find valid entry in profession trade offer generators " + profession.getName()); } final ITradeList[][] careerTrades = professionTrades[careerType - 1]; if (careerTrades == null) { throw new IllegalStateException("Could not find valid entry in career trade offer generators " + career.getName()); } professionTrades[careerType - 1] = modify(careerTrades, level, Arrays.asList(generators), false); }</code><technical_language>repeated, identical checks</technical_language>

Target:
public void addTradeOffers(final Career career, final int level, final TradeOfferGenerator... generators) throws IllegalArgumentException { validateLevel(level); checkNotNull(generators, "generators"); final ITradeList[][][] professionTrades = getForProfession(career); final ITradeList[][] careerTrades = getFor(career, professionTrades); int careerType = ((SpongeCareer) career).type; professionTrades[careerType] = modify(careerTrades, level, Arrays.asList(generators), false); }
Source:
<code>public static String convertFromIpsecString(String str) { <START> if (str == null) return null; <END> try { str = str.replace('-', '_'); return str.toUpperCase(); } catch (IllegalArgumentException ex) { return null; } }</code><technical_language>nit: style wants newline</technical_language>

Target:
public static String convertFromIpsecString(String str) { if (str == null) return null; try { return str.replace('-', '_').toUpperCase(); } catch (IllegalArgumentException ex) { return null; } }
Source:
<code>private Map<String, Integer> readOutput(Location outputLocation) throws IOException { org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(SCHEMA.toString()); Map<String, Integer> contents = new HashMap<>(); for (Location file : outputLocation.list()) { String fileName = file.getName(); if (fileName.endsWith(".avro")) { DatumReader<GenericRecord> datumReader = new GenericDatumReader<>(avroSchema); DataFileStream<GenericRecord> fileStream = new DataFileStream<>(file.getInputStream(), datumReader); for (GenericRecord record : fileStream) { contents.put(record.get("id").toString(), (Integer) record.get("price")); } fileStream.close(); } else if (fileName.endsWith(".parquet")) { Path parquetFile = new Path(file.toString()); AvroParquetReader.Builder<GenericRecord> genericRecordBuilder = AvroParquetReader.builder(parquetFile); <START> org.apache.parquet.hadoop.ParquetReader<GenericRecord> reader = genericRecordBuilder.build(); <END> GenericRecord record = reader.read(); while (record != null) { contents.put(record.get("id").toString(), (Integer) record.get("price")); record = reader.read(); } } } return contents; }</code><technical_language>question full class name</technical_language>

Target:
private Map<String, Integer> readOutput(Location outputLocation) throws IOException { org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(SCHEMA.toString()); Map<String, Integer> contents = new HashMap<>(); for (Location file : outputLocation.list()) { String fileName = file.getName(); if (fileName.endsWith(".avro")) { DatumReader<GenericRecord> datumReader = new GenericDatumReader<>(avroSchema); DataFileStream<GenericRecord> fileStream = new DataFileStream<>(file.getInputStream(), datumReader); for (GenericRecord record : fileStream) { contents.put(record.get("id").toString(), (Integer) record.get("price")); } fileStream.close(); } else if (fileName.endsWith(".parquet")) { Path parquetFile = new Path(file.toString()); AvroParquetReader.Builder<GenericRecord> genericRecordBuilder = AvroParquetReader.builder(parquetFile); ParquetReader<GenericRecord> reader = genericRecordBuilder.build(); GenericRecord record = reader.read(); while (record != null) { contents.put(record.get("id").toString(), (Integer) record.get("price")); record = reader.read(); } } } return contents; }
Source:
<code>public Response createResponse(HTTPResponse response) throws ServiceException, IOException { Map<String, Object> hints = getRequestHints(); EntityResolver resolver = null; if(hints != null) { <START> GeoTools.getEntityResolver( <END> resolver = GeoTools.getEntityResolver(hints); } return new GetCapabilitiesResponse(response, resolver); }</code><technical_language>typo</technical_language>

Target:
public Response createResponse(HTTPResponse response) throws ServiceException, IOException { Map<String, Object> hints = getRequestHints(); EntityResolver resolver = null; if (hints != null) { resolver = XMLHandlerHints.toEntityResolver(hints); } return new GetCapabilitiesResponse(response, resolver); }
Source:
<code>public void onDeleteSelectedColumns() { if (isReadOnly()) { return; } final Set<Integer> selectedColumnIndexes = getSelectedColumnIndexes(); final Set<BaseColumn> columnsToDelete = new HashSet<>(); for (int selectedColumnIndex : selectedColumnIndexes) { final int columnIndex = findUiColumnIndex(selectedColumnIndex); final BaseColumn column = model.getExpandedColumns().get(columnIndex); if (!(column instanceof RowNumberCol52 || column instanceof DescriptionCol52)) { columnsToDelete.add(column); } } for (BaseColumn columnToDelete : columnsToDelete) { try { if (columnToDelete instanceof AttributeCol52) { deleteColumn((AttributeCol52) columnToDelete); } else if (columnToDelete instanceof MetadataCol52) { deleteColumn((MetadataCol52) columnToDelete); } else if (columnToDelete instanceof ConditionCol52) { deleteColumn((ConditionCol52) columnToDelete); } else if (columnToDelete instanceof ActionCol52) { deleteColumn((ActionCol52) columnToDelete); } } catch (VetoException veto) { <START> Window.alert("Could not delete!"); <END> } } }</code><technical_language>I worth I18n. more question, is Window.alert consistent other decision table popups</technical_language>

Target:
public void onDeleteSelectedColumns() { if (isReadOnly()) { return; } final Set<Integer> selectedColumnIndexes = getSelectedColumnIndexes(); final Set<BaseColumn> columnsToDelete = new HashSet<>(); for (int selectedColumnIndex : selectedColumnIndexes) { final int columnIndex = findUiColumnIndex(selectedColumnIndex); final BaseColumn column = model.getExpandedColumns().get(columnIndex); if (!(column instanceof RowNumberCol52 || column instanceof DescriptionCol52)) { columnsToDelete.add(column); } } for (BaseColumn columnToDelete : columnsToDelete) { if (columnToDelete instanceof AttributeCol52) { try { deleteColumn((AttributeCol52) columnToDelete); } catch (VetoException veto) { getModellerPresenter().getView().showGenericVetoMessage(); } } else if (columnToDelete instanceof MetadataCol52) { try { deleteColumn((MetadataCol52) columnToDelete); } catch (VetoException veto) { getModellerPresenter().getView().showGenericVetoMessage(); } } else if (columnToDelete instanceof ConditionCol52) { try { deleteColumn((ConditionCol52) columnToDelete); } catch (VetoException veto) { getModellerPresenter().getView().showUnableToDeleteColumnMessage((ConditionCol52) columnsToDelete); } } else if (columnToDelete instanceof ActionCol52) { try { deleteColumn((ActionCol52) columnToDelete); } catch (VetoException veto) { getModellerPresenter().getView().showUnableToDeleteColumnMessage((ActionCol52) columnsToDelete); } } } }
Source:
<code>public void review(CertifiedProductSearchDetails listing) { if (ff4j.check(FeatureList.EFFECTIVE_RULE_DATE)) { checkForInvalidCriteriaCombination(listing, criteriaB6Id, criteriaB10Id); checkForInvalidCriteriaCombination(listing, criteriaG8Id, criteriaG10Id); initializeOldAndNewCriteria(); Iterator<Integer> oldCriteriaIdsIter = oldCriteriaIds.iterator(); Iterator<Integer> newCriteriaIdsIter = newCriteriaIds.iterator(); <START> while (oldCriteriaIdsIter.hasNext() && newCriteriaIdsIter.hasNext()) { <END> checkForInvalidCriteriaCombination(listing, oldCriteriaIdsIter.next(), newCriteriaIdsIter.next()); } } }</code><technical_language>of number work, roll existing "can't b6 b10" "g8 g10" philosophy. _need_ do that, if a tuple _could_</technical_language>

Target:
public void review(CertifiedProductSearchDetails listing) { if (ff4j.check(FeatureList.EFFECTIVE_RULE_DATE)) { checkForInvalidCriteriaCombination(listing, criteriaB6Id, criteriaB10Id); checkForInvalidCriteriaCombination(listing, criteriaG8Id, criteriaG10Id); initializeOldAndNewCriteriaPairs(); for (Pair<Integer, Integer> pair : oldAndNewcriteriaIdPairs) { final Integer oldCriteriaId = pair.getLeft(); final Integer newCriteriaId = pair.getRight(); checkForInvalidCriteriaCombination(listing, oldCriteriaId, newCriteriaId); } } }
Source:
<code>public final DeliveryAnnotations getDeliveryAnnotations() { <START> if (deliveryAnnotations != null) { return deliveryAnnotations; <END> } else { ensureScanning(); return scanForMessageSection(deliveryAnnotationsPosition, DeliveryAnnotations.class); } }</code><technical_language>This breaks interface/prior behaviour of method return a copy</technical_language>

Target:
public final DeliveryAnnotations getDeliveryAnnotations() { ensureScanning(); return scanForMessageSection(deliveryAnnotationsPosition, DeliveryAnnotations.class); }
Source:
<code>public WordUpdateChange updateWordArtifacts(WordUpdateData data) { WordUpdateArtifact updateArt = new WordUpdateArtifact(logger, orcsApi); WordUpdateChange change = null; try { validate(data); change = updateArt.updateArtifacts(data, atsServer); <START> } catch (Exception ex) { <END> throw new OseeWebApplicationException(Status.INTERNAL_SERVER_ERROR, "Exception in updateWordArtifacts", ex); } return change; }</code><technical_language>catch, instead allow ExceptionMapper handle</technical_language>

Target:
public WordUpdateChange updateWordArtifacts(WordUpdateData data) { WordUpdateArtifact updateArt = new WordUpdateArtifact(logger, orcsApi); validate(data); return updateArt.updateArtifacts(data, atsServer); }
Source:
<code>public String getProfileBanner300x100URL() { <START> return profileBannerImageUrl != null ? profileBannerImageUrl + "300x100" : null; <END> }</code><technical_language>missing "/"</technical_language>

Target:
public String getProfileBanner300x100URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "/300x100" : null; }
Source:
<code>public VanillaCubicProvider(ICubicWorld world, WorldProvider provider, @Nullable IChunkGenerator reUse) { this.wp = provider; this.worldObj = (World) world; <START> boolean flag = false; <END> if(worldObj.getWorldType() instanceof ICubicWorldType){ ReflectionUtil.setFieldValueSrg(wp, "field_76577_b", HEURISTIC_WORLDTYPE); IChunkGenerator pro_or_null = wp.createChunkGenerator(); ReflectionUtil.setFieldValueSrg(provider, "field_76577_b", worldObj.getWorldType()); if(pro_or_null != null){ cubeGen = new VanillaCompatibilityGenerator( reUse == null ? pro_or_null : reUse, world); }else{ cubeGen = ((ICubicWorldType)worldObj.getWorldType()).createCubeGenerator(getCubicWorld()); if(cubeGen == null){ flag = true; } } }else{ flag = true; } if(flag){ cubeGen = new VanillaCompatibilityGenerator( reUse == null ? wp.createChunkGenerator() : reUse, world); } }</code><technical_language>flag mean</technical_language>

Target:
public VanillaCubicProvider(ICubicWorld world, WorldProvider provider, @Nullable IChunkGenerator reUse) { this.provider = provider; this.worldObj = (World) world; boolean useProvider = false; if(worldObj.getWorldType() instanceof ICubicWorldType) { provider.terrainType = HEURISTIC_WORLDTYPE; IChunkGenerator pro_or_null = provider.createChunkGenerator(); provider.terrainType = worldObj.getWorldType(); if(pro_or_null != null) { cubeGen = new VanillaCompatibilityGenerator( reUse == null ? pro_or_null : reUse, world); }else{ cubeGen = ((ICubicWorldType)worldObj.getWorldType()).createCubeGenerator(getCubicWorld()); if(cubeGen == null) { useProvider = true; } } }else{ useProvider = true; } if(useProvider) { cubeGen = new VanillaCompatibilityGenerator( reUse == null ? provider.createChunkGenerator() : reUse, world); } }
Source:
<code>public boolean checkValue(Object value, Object key, int expectedSize) { boolean ret; if (value instanceof byte[]) { <START> RandomStream rand = new RandomStream(key.hashCode(), expectedSize); <END> ret = rand.validate((byte[]) value); rand.close(); } else ret = false; return ret; }</code><technical_language>try resources? is a reason create a new instance, check in this method? check happen anyway? I RandomStreamGenerator accept validate InputStream, checking length</technical_language>

Target:
public boolean checkValue(Object value, Object key, int expectedSize) { int count = 0; try (InputStream is = (InputStream) value) { while (is.read() != -1) count++; } catch (IOException e) { return false; } return count == expectedSize; }
Source:
<code>public void addRequestCleanupHandler(HttpServletRequest request) { RequestContext.getActiveContext(request).addRequestCleanupHandler(new RequestCleanupHandler() { @Override public void cleanup(HttpServletRequest req) { try { close(); } catch (OperationException cause) { <START> throw new NuxeoException(cause); <END> } } }); }</code><technical_language>> e please</technical_language>

Target:
public void addRequestCleanupHandler(HttpServletRequest request) { RequestContext.getActiveContext(request).addRequestCleanupHandler(new RequestCleanupHandler() { @Override public void cleanup(HttpServletRequest req) { try { close(); } catch (OperationException e) { throw new NuxeoException(e); } } }); }
Source:
<code>private String handleColumnCreationSection(Map<String, ColumnMetadata> columns) { List<String> lines = new ArrayList<String>(); <START> Set<String> keys = columns.keySet(); <END> for (String key : keys) { Map<ColumnFields, String> column = columns.get(key).getColumnFields(); lines.add(columnDataToSQL(column)); } String toExecute = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", lines); return toExecute; }</code><technical_language>This variable is needed in a scope needed. Iterate return of method directly</technical_language>

Target:
private String handleColumnCreationSection(Map<String, ColumnMetadata> columns) { List<String> lines = new ArrayList<String>(); for (String key : columns.keySet()) { Map<ColumnFields, String> column = columns.get(key).getColumnFields(); lines.add(columnDataToSQL(column)); } return org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", lines); }
Source:
<code>private List<Job> createAmountOfJobs(int amount, boolean isBuilt) { List<Job> jobs = new ArrayList<>(); if (isBuilt) { <START> for (int i = 0; i < amount; i++) { <END> jobs.add(createJobAndBuild()); } } else { for (int i = 0; i < amount; i++) { jobs.add(jenkins.jobs.create(FreeStyleJob.class)); } } return jobs; }</code><technical_language>for (int i = 0; i < amount; i++) { Job job; if (isBuild) { job = createJobAndBuild(); } else { job = jenkins.jobs.create(FreeStyleJob.class) } jobs.add(job); }</technical_language>

Target:
private List<Job> createAmountOfJobs(int amount, boolean isBuilt) { List<Job> jobs = new ArrayList<>(); for (int i = 0; i < amount; i++) { Job job; if (isBuilt) { job = createJobAndBuild(); } else { job = jenkins.jobs.create(FreeStyleJob.class); } jobs.add(job); } return jobs; }
Source:
<code>public BusinessServiceGraph getGraph() { m_rwLock.readLock().lock(); try { <START> return m_g; <END> } finally { m_rwLock.readLock().unlock(); } }</code><technical_language>return a copy of graph instead of a reference? point in a read lock returning reference. worried callers alter graph in some way</technical_language>

Target:
public BusinessServiceGraph getGraph() { return m_g; }
Source:
<code>public VerificationMessage validate(MavenProject project) { MavenProject jenkinsParent = findJenkinsParentPom(project); if (jenkinsParent == null) { return new VerificationMessage( "Your plugin doesn't seem to have the Jenkins parent pom in its POM hierarchy, " + "it's generally not a normal situation", Severity.WARNING); } if (jenkinsParent.getVersion().split("\\.").length != 3) { <START> return new VerificationMessage("Your plugin does not seem to have a LTS Jenkins release, in general ", <END> Severity.INFO); } return null; }</code><technical_language>Incomplete error message is</technical_language>

Target:
public VerificationMessage validate(MavenProject project) { MavenProject jenkinsParent = findPluginParentPom(project); if (jenkinsParent == null) { return new VerificationMessage( "Your plugin doesn't seem to have the Jenkins parent pom in its POM hierarchy. " + "Jenkins plugins generally inherit from the Jenkins parent POM.", Severity.WARNING); } String jenkinsVersion = jenkinsParent.getVersion(); if(jenkinsVersion.startsWith("2.")) { jenkinsVersion = (String) project.getProperties().get("jenkins.version"); } if (jenkinsVersion.split("\\.").length != 3) { return new VerificationMessage("Your plugin does not seem to have a LTS Jenkins release. In general, " + "it's preferable to use an LTS version as parent version.", Severity.INFO); } return null; }
Source:
<code>public void deleteResourcesAndHandleConflicts(List<Long> theLongs) { DeleteConflictList deleteConflictList = new DeleteConflictList(); theLongs.stream().forEach(pid -> deleteCascade(pid, deleteConflictList)); IFhirResourceDao personDao = myDaoRegistry.getResourceDao("Person"); <START> while (!deleteConflictList.isEmpty()) { <END> deleteConflictBatch(deleteConflictList, personDao); } }</code><technical_language>infinite loop. Add a counter (can big, 100,000) if this loop iterates more number of times, throw exception</technical_language>

Target:
public void deleteResourcesAndHandleConflicts(List<Long> theLongs) { DeleteConflictList deleteConflictList = new DeleteConflictList(); theLongs.stream().forEach(pid -> deleteCascade(pid, deleteConflictList)); IFhirResourceDao personDao = myDaoRegistry.getResourceDao("Person"); int batchCount = 0; while (!deleteConflictList.isEmpty()) { deleteConflictBatch(deleteConflictList, personDao); batchCount += 1; if (batchCount > MAXIMUM_DELETE_ATTEMPTS) { throw new IllegalStateException("Person deletion seems to have entered an infinite loop. Aborting"); } } }
Source:
<code>protected void createFieldEditors() { FieldEditor edit = new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, <START> "Show Error Dialog when Reverse Trace Method not available", END> getFieldEditorParent() ); edit.fillIntoGrid( getFieldEditorParent(), 2 ); getPreferenceStore().setDefault(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, true); addField( edit ); edit = new RadioGroupFieldEditor( ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE , "Select Hardware Tracing Method" ,1 , new String[][] { {"Use GDB preference", "UseGdbTrace"}, {"Use Branch Trace", "UseBranchTrace"}, {"Use Processor Trace", "UseProcessorTrace"} } , getFieldEditorParent() ); edit.fillIntoGrid( getFieldEditorParent(), 1 ); getPreferenceStore().setDefault(ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE, "UseGdbTrace"); addField( edit ); }</code><technical_language>string needs translatable in a messages.properties file</technical_language>

Target:
protected void createFieldEditors() { FieldEditor edit = new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, Messages.ReverseDebugPreferencePage_2, getFieldEditorParent() ); edit.fillIntoGrid( getFieldEditorParent(), 2 ); getPreferenceStore().setDefault(ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, true); addField( edit ); edit = new RadioGroupFieldEditor( ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE , Messages.ReverseDebugPreferencePage_3 ,1 , new String[][] { {Messages.ReverseDebugPreferencePage_4, ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE}, {Messages.ReverseDebugPreferencePage_6, ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_BRANCH_TRACE}, {Messages.ReverseDebugPreferencePage_8, ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_PROCESSOR_TRACE} } , getFieldEditorParent() ); edit.fillIntoGrid( getFieldEditorParent(), 1 ); getPreferenceStore().setDefault(ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_HARDWARE, ICDebugPreferenceConstants.PREF_REVERSE_TRACE_METHOD_GDB_TRACE); addField( edit ); }
Source:
<code>private void scrubSweepableTimestamps(ShardAndStrategy shardStrategy, long oldProgress, long newProgress) { if (oldProgress < 0) { <START> return; <END> } long oldLastSweptPartition = SweepQueueUtils.tsPartitionCoarse(oldProgress); long newMinSweepPartition = SweepQueueUtils.tsPartitionCoarse(newProgress + 1); if (newMinSweepPartition > oldLastSweptPartition) { sweepableTimestamps.deleteRow(shardStrategy, oldLastSweptPartition); } }</code><technical_language>this case? Do want log this happens? ("no" is acceptable answer, especially if this is expected behaviour in some legitimate cases)</technical_language>

Target:
private void scrubSweepableTimestamps(ShardAndStrategy shardStrategy, long oldProgress, long newProgress) { if (firstIterationOfSweep(oldProgress)) { return; } long lastSweptPartitionPreviously = SweepQueueUtils.tsPartitionCoarse(oldProgress); long minimumSweepPartitionNextIteration = SweepQueueUtils.tsPartitionCoarse(newProgress + 1); if (minimumSweepPartitionNextIteration > lastSweptPartitionPreviously) { sweepableTimestamps.deleteRow(shardStrategy, lastSweptPartitionPreviously); } }
Source:
<code>public TaskResult validate(Map<String, String> optionsMap) { if (ShellUtils.isAlluxioRunning(mOwner)) { System.out.format("%s is already running. Skip validation.%n", mOwner); return TaskResult.SKIPPED; } <START> int port = NetworkAddressUtils.getPort(mServiceType, InstancedConfiguration.defaults()); <END> if (!isLocalPortAvailable(port)) { System.err.format("%s port %d is not available.%n", mServiceType.getServiceName(), port); return TaskResult.FAILED; } return TaskResult.OK; }</code><technical_language>configuration</technical_language>

Target:
public TaskResult validate(Map<String, String> optionsMap) { if (ShellUtils.isAlluxioRunning(mOwner)) { System.out.format("%s is already running. Skip validation.%n", mOwner); return TaskResult.SKIPPED; } int port = NetworkAddressUtils.getPort(mServiceType, mConf); if (!isLocalPortAvailable(port)) { System.err.format("%s port %d is not available.%n", mServiceType.getServiceName(), port); return TaskResult.FAILED; } return TaskResult.OK; }
Source:
<code>public VdsStaticDAO getVdsStaticDao() { <START> return DbFacade.getInstance().getVdsStaticDAO(); <END> }</code><technical_language>getDbFacade.getVdsStaticDAO(), I guess biggie</technical_language>

Target:
public VdsStaticDAO getVdsStaticDao() { return getDbFacade().getVdsStaticDAO(); }
Source:
<code>public void testEmailSubject() { String requestingUserName = "John"; String result = buildEmailSubject(Optional.empty(), requestingUserName); <START> String expectedResult = MessageFormat.format("Become my friend on Yona!", requestingUserName); <END> assertThat(result, equalTo(expectedResult)); }</code><technical_language>requestingUserName is anymore. Applies Dutch test too</technical_language>

Target:
public void testEmailSubject() { String requestingUserName = "John"; String result = buildEmailSubject(Optional.empty(), requestingUserName); String expectedResult = "Become my friend on Yona!"; assertThat(result, equalTo(expectedResult)); }
Source:
<code>private void awaitStopTask(ConnectorTaskId taskId, long timeout) { try (LoggingContext loggingContext = LoggingContext.forTask(taskId)) { WorkerTask task = tasks.remove(taskId); if (task == null) { log.warn("Ignoring await stop request for non-present task {}", taskId); return; } if (connectorStatusMetricsGroup != null) { connectorStatusMetricsGroup.recordTaskRemoved(taskId); <START> } <END> if (!task.awaitStop(timeout)) { log.error("Graceful stop of task failed.", task.id()); task.cancel(); } else { log.debug("Graceful stop of task succeeded.", task.id()); } } }</code><technical_language>initialize this in constructor (and set herder in Worker#start() a setter method in connectorStatusMetricsGroup)</technical_language>

Target:
private void awaitStopTask(ConnectorTaskId taskId, long timeout) { try (LoggingContext loggingContext = LoggingContext.forTask(taskId)) { WorkerTask task = tasks.remove(taskId); if (task == null) { log.warn("Ignoring await stop request for non-present task {}", taskId); return; } connectorStatusMetricsGroup.recordTaskRemoved(taskId); if (!task.awaitStop(timeout)) { log.error("Graceful stop of task failed.", task.id()); task.cancel(); } else { log.debug("Graceful stop of task succeeded.", task.id()); } } }
Source:
<code><START> public static int calcCrc(CRC32 crcAlgo, ByteBuffer buf, int len) { <END> int initLimit = buf.limit(); buf.limit(buf.position() + len); crcAlgo.update(buf); buf.limit(initLimit); return ~(int)crcAlgo.getValue(); }</code><technical_language>need this method public, another public calcCrc instead</technical_language>

Target:
private static int calcCrc(CRC32 crcAlgo, ByteBuffer buf, int len) { int initLimit = buf.limit(); buf.limit(buf.position() + len); crcAlgo.update(buf); buf.limit(initLimit); return ~(int)crcAlgo.getValue(); }
Source:
<code>public void select(final int... indices) { waitForEnabled(); if (indices.length > 1) assertMultiSelect(); setFocus(); log.debug(MessageFormat.format("Selecting rows {0} in table {1}", StringUtils.join(indices, ", "), this)); for (int i = 0; i < indices.length; i++) { assertIsLegalRowIndex(indices[i]); } asyncExec(new VoidResult() { public void run() { <START> widget.setSelection(indices); <END> for (int i = 0; i < indices.length; i++) { lastSelectionItem = widget.getItem(indices[i]); notifySelect(); } } }); }</code><technical_language>accurately reflect selection step (if user code reads handling selection events), incrementally add selection, loop. For index (i == 0), call setSelection(int), replace previous selection, for next iterations call select(int). If want totally accurate, SelectionEvent a stateMask of 0 subsequent a stateMask of SWT.CTRL</technical_language>

Target:
public void select(final int... indices) { waitForEnabled(); if (indices.length > 1) assertMultiSelect(); setFocus(); log.debug(MessageFormat.format("Selecting rows {0} in table {1}", StringUtils.join(indices, ", "), this)); for (int i = 0; i < indices.length; i++) { assertIsLegalRowIndex(indices[i]); } asyncExec(new VoidResult() { public void run() { for (int i = 0; i < indices.length; i++) { lastSelectionItem = widget.getItem(indices[i]); if (i == 0) { widget.setSelection(indices[0]); notifySelect(false); } else { widget.select(indices[i]); notifySelect(true); } } } }); }
Source:
<code>public PasswordPolicy setResetSuccessEmailStatus(EmailStatus status) { <START> setProperty(RESET_SUCCESS_EMAIL_STATUS, status.name()); <END> return this; }</code><technical_language>this method is missing assert for case "status" object is null</technical_language>

Target:
public PasswordPolicy setResetSuccessEmailStatus(EmailStatus status) { Assert.notNull(status, "status cannot be null."); setProperty(RESET_SUCCESS_EMAIL_STATUS, status.name()); return this; }
Source:
<code>public static boolean shouldShowSearchTabTooltip() { <START> return getBoolean(R.string.preference_key_pulsating_icon_event_sent, true); <END> }</code><technical_language>this in developer_preferences.xml</technical_language>

Target:
public static boolean shouldShowSearchTabTooltip() { return getBoolean(R.string.preference_key_show_search_tab_tooltip, true); }
Source:
<code>public ModelAndView bannerList(@RequestParam(value = "isBank", defaultValue = "true") Boolean isBank) { ModelAndView modelAndView = new ModelAndView(); List<BankDto> bankModelList = null; if (isBank) { bankModelList = bankService.findBankList(null, null); modelAndView.setViewName("/bank-list"); } else { bankModelList = bankService.findUmpBankList(null, null); modelAndView.setViewName("/ump-bank-list"); <START> } <END> modelAndView.addObject("bankList", bankModelList); return modelAndView; }</code><technical_language>List<BankDto> bankModelList = isBank ? bankService.findBankList(null, null) : bankService.findUmpBankList(null, null)</technical_language>

Target:
public ModelAndView bannerList(@RequestParam(value = "isBank", defaultValue = "true") Boolean isBank) { ModelAndView modelAndView = null; List<BankDto> bankModelList = null; bankModelList = isBank ? bankService.findBankList(null, null) : bankService.findUmpBankList(null, null); modelAndView = isBank ? new ModelAndView("/bank-list") : new ModelAndView("/ump-bank-list"); modelAndView.addObject("bankList", bankModelList); return modelAndView; }
Source:
<code>public ResultSummary consume() { while ( !done ) { connection.receiveOne(); <START> recordBuffer.clear(); <END> } recordBuffer.clear(); return summary; }</code><technical_language>do need clear queue multiple times</technical_language>

Target:
public ResultSummary consume() { if ( done ) { recordBuffer.clear(); } else { do { connection.receiveOne(); recordBuffer.clear(); } while ( !done ); } return summary; }
Source:
<code>private void processRunProperties( boolean isInsidePPr, boolean bold, boolean italics, boolean underline, boolean strike, boolean subscript, boolean superscript, Color color ) throws IOException { if ( bold || italics || underline || strike || subscript || superscript || color != null ) { if ( isInsidePPr ) { startPPrIfNeeded(); } super.write( "<w:rPr>" ); if ( bold ) { super.write( "<w:b />" ); } if ( italics ) { super.write( "<w:i />" ); } if ( underline ) { super.write( "<w:u w:val=\"single\" />" ); } if ( strike ) { super.write( "<w:strike />" ); } if ( subscript ) { super.write( "<w:vertAlign w:val=\"subscript\"/>" ); } if ( superscript ) { super.write( "<w:vertAlign w:val=\"superscript\"/>" ); } if ( color != null ) { <START> super.write( "<w:color w:val=\"" + DocxColorGenerator.parse( color ) + "\"/>" ); <END> } super.write( "</w:rPr>" ); } }</code><technical_language>Method called parse parsing</technical_language>

Target:
private void processRunProperties( boolean isInsidePPr, boolean bold, boolean italics, boolean underline, boolean strike, boolean subscript, boolean superscript, Color color ) throws IOException { if ( bold || italics || underline || strike || subscript || superscript || color != null ) { if ( isInsidePPr ) { startPPrIfNeeded(); } super.write( "<w:rPr>" ); if ( bold ) { super.write( "<w:b />" ); } if ( italics ) { super.write( "<w:i />" ); } if ( underline ) { super.write( "<w:u w:val=\"single\" />" ); } if ( strike ) { super.write( "<w:strike />" ); } if ( subscript ) { super.write( "<w:vertAlign w:val=\"subscript\"/>" ); } if ( superscript ) { super.write( "<w:vertAlign w:val=\"superscript\"/>" ); } if ( color != null ) { super.write( "<w:color w:val=\"" + DocxColorGenerator.generate( color ) + "\"/>" ); } super.write( "</w:rPr>" ); } }
Source:
<code>VoltTable getFunctions() { VoltTable results = new VoltTable(FUNCTIONS_SCHEMA); for (Function func : m_database.getFunctions()) { <START> String function_type = func.getMethodname() == null ? "aggregate" : "scalar"; <END> results.addRow( function_type, func.getFunctionname(), func.getClassname(), func.getMethodname()); } return results; }</code><technical_language>function_type functionType match style</technical_language>

Target:
VoltTable getFunctions() { VoltTable results = new VoltTable(FUNCTIONS_SCHEMA); for (Function func : m_database.getFunctions()) { String functionType = func.getMethodname() == null ? "aggregate" : "scalar"; results.addRow( functionType, func.getFunctionname(), func.getClassname(), func.getMethodname()); } return results; }
Source:
<code>private long doForceInsertExistingDocumentWithHistory(BasicDocumentRevision newRevision, List<String> revisions, Map<String, Object> attachments) { Log.v(LOG_TAG, "doForceInsertExistingDocumentWithHistory(): Revisions: " + revisions); Preconditions.checkNotNull(newRevision, "New document revision must not be null."); Preconditions.checkArgument(this.containsDocument(newRevision.getId()), "DocumentRevisionTree must exist."); Preconditions.checkNotNull(revisions, "Revision history should not be null."); Preconditions.checkArgument(revisions.size() > 0, "Revision history should have at least one revision." ); DocumentRevisionTree localRevs = getAllRevisionsOfDocument(newRevision.getId()); assert localRevs != null; long sequence; BasicDocumentRevision parent = localRevs.lookup(newRevision.getId(), revisions.get(0)); if(parent == null) { <START> sequence = insertDocumentHistoryToNewTree(newRevision, revisions, localRevs.getCurrentRevision().getInternalNumericId(), localRevs); <END> } else { sequence = insertDocumentHistoryIntoExistingTree(newRevision, revisions, parent.getInternalNumericId(), localRevs, attachments); } return sequence; }</code><technical_language>I this is fetching internal numeric ID correctly. I need admit defeat finding id long docNumericID = this.getDocNumericId(newRevision.getId()); result here</technical_language>

Target:
private long doForceInsertExistingDocumentWithHistory(BasicDocumentRevision newRevision, List<String> revisions, Map<String, Object> attachments) { logger.entering("BasicDatastore", "doForceInsertExistingDocumentWithHistory", new Object[]{newRevision, revisions, attachments}); Preconditions.checkNotNull(newRevision, "New document revision must not be null."); Preconditions.checkArgument(this.containsDocument(newRevision.getId()), "DocumentRevisionTree must exist."); Preconditions.checkNotNull(revisions, "Revision history should not be null."); Preconditions.checkArgument(revisions.size() > 0, "Revision history should have at least one revision." ); DocumentRevisionTree localRevs = getAllRevisionsOfDocument(newRevision.getId()); assert localRevs != null; long sequence; BasicDocumentRevision parent = localRevs.lookup(newRevision.getId(), revisions.get(0)); if(parent == null) { sequence = insertDocumentHistoryToNewTree(newRevision, revisions, localRevs.getDocumentNumericId(), localRevs); } else { sequence = insertDocumentHistoryIntoExistingTree(newRevision, revisions, localRevs.getDocumentNumericId(), localRevs, attachments); } return sequence; }
Source:
<code>public static void executeHelp(String[] args, PrintStream stream) throws Exception { String subCmd = (args.length > 0) ? args[0] : ""; args = AdminUtils.copyArrayCutFirst(args); if(subCmd.equals("async-job")) { AdminCommandAsyncJob.executeHelp(args, stream); } else if(subCmd.equals("cleanup")) { AdminCommandCleanup.executeHelp(args, stream); } else if(subCmd.equals("debug")) { AdminCommandDebug.executeHelp(args, stream); } else if(subCmd.equals("meta")) { AdminCommandMeta.executeHelp(args, stream); } else if(subCmd.equals("quota")) { AdminCommandQuota.executeHelp(args, stream); } else if(subCmd.equals("store")) { AdminCommandStore.executeHelp(args, stream); } else if(subCmd.equals("stream")) { AdminCommandStream.executeHelp(args, stream); } else if(subCmd.equals("native-backup")) { <START> SubCommandNativeBackup.printHelp(stream); <END> } else if(subCmd.equals("restore-from-replica")) { SubCommandRestoreFromReplica.printHelp(stream); } else { printHelp(stream); } }</code><technical_language>is this in a signature</technical_language>

Target:
public static void executeHelp(String[] args, PrintStream stream) throws Exception { String subCmd = (args.length > 0) ? args[0] : ""; args = AdminUtils.copyArrayCutFirst(args); if(subCmd.equals("async-job")) { AdminCommandAsyncJob.executeHelp(args, stream); } else if(subCmd.equals("cleanup")) { AdminCommandCleanup.executeHelp(args, stream); } else if(subCmd.equals("debug")) { AdminCommandDebug.executeHelp(args, stream); } else if(subCmd.equals("meta")) { AdminCommandMeta.executeHelp(args, stream); } else if(subCmd.equals("quota")) { AdminCommandQuota.executeHelp(args, stream); } else if(subCmd.equals("store")) { AdminCommandStore.executeHelp(args, stream); } else if(subCmd.equals("stream")) { AdminCommandStream.executeHelp(args, stream); } else { args = AdminUtils.copyArrayAddFirst(args, subCmd); AdminCommandOther.executeHelp(args, stream); } }
Source:
<code>public void testSimple() { final Id id1 = new Id("some_scheme", "id1"); final Id id2 = new Id("some_scheme", "id2"); final RuleBasedZooKeeperAclProvider aclProvider = RuleBasedZooKeeperAclProvider.builder() .rule("/foo/baz", DELETE, id1) .rule("/foo/bar", CREATE, id1) .rule("/foo/qux", READ | WRITE, id2) .build(); assertEquals( Arrays.asList(new ACL(DELETE, id1)), <START> aclProvider.getAclForPath("/foo/baz")); <END> assertEquals( Arrays.asList(new ACL(CREATE, id1)), aclProvider.getAclForPath("/foo/bar")); assertEquals( Arrays.asList(new ACL(READ | WRITE, id2)), aclProvider.getAclForPath("/foo/qux")); }</code><technical_language>pretty minor assertThat(aclProvider.getAclForPath("/foo/baz"), contains(new ACL(DELETE, id1))) verbose</technical_language>

Target:
public void testSimple() { final Id id1 = new Id("some_scheme", "id1"); final Id id2 = new Id("some_scheme", "id2"); final RuleBasedZooKeeperAclProvider aclProvider = RuleBasedZooKeeperAclProvider.builder() .rule("/foo/baz", DELETE, id1) .rule("/foo/bar", CREATE, id1) .rule("/foo/qux", READ | WRITE, id2) .build(); assertThat(aclProvider.getAclForPath("/foo/baz"), contains(new ACL(DELETE, id1))); assertThat(aclProvider.getAclForPath("/foo/bar"), contains(new ACL(CREATE, id1))); assertThat(aclProvider.getAclForPath("/foo/qux"), contains(new ACL(READ | WRITE, id2))); }
Source:
<code>private Union getUnion(ByteBuffer buf, int position) { <START> Union union = unions.get(buf) != null ? unions.get(buf).get(position) : null; <END> if (union == null) { union = createNewUnion(buf, position, true); } return union; }</code><technical_language>In common case (union exists) this unnecessarily call unions.get(buf) twice</technical_language>

Target:
private Union getUnion(ByteBuffer buf, int position) { Int2ObjectMap<Union> unionMap = unions.get(buf); Union union = unionMap != null ? unionMap.get(position) : null; if (union != null) { return union; } return createNewUnion(buf, position, true); }