auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void processTuple(byte[] tuple) { if (tuple == null) { if (err.isConnected()) { err.emit(new KeyValPair<String, String>(null, "null tuple")); } errorTupleCount++; return; } String incomingString = new String(tuple); try { if (schema != null) { ProcessingReport report = null; JsonNode data = JsonLoader.fromString(incomingString); report = schema.validate(data); if (report != null && !report.isSuccess()) { Iterator<ProcessingMessage> iter = report.iterator(); StringBuilder s = new StringBuilder(); while (iter.hasNext()) { ProcessingMessage pm = iter.next(); s.append(pm.asJson().get("instance").findValue("pointer")).append(":").append(pm.asJson().get("message")) .append(","); } s.setLength(s.length() - 1); errorTupleCount++; err.emit(new KeyValPair<String, String>(incomingString, s.toString())); return; } } if (parsedOutput.isConnected()) { parsedOutput.emit(new JSONObject(incomingString)); parsedOutputCount++; } if (out.isConnected()) { out.emit(objMapper.readValue(tuple, clazz)); emittedObjectCount++; } } catch (JSONException | ProcessingException | IOException e) { errorTupleCount++; err.emit(new KeyValPair<String, String>(incomingString, e.getMessage())); logger.error("Failed to parse json tuple {}, Exception = ", tuple, e); } }

Target:
public void processTuple(byte[] tuple) { if (tuple == null) { if (err.isConnected()) { err.emit(new KeyValPair<String, String>(null, "null tuple")); } errorTupleCount++; return; } String incomingString = new String(tuple); try { if (schema != null) { ProcessingReport report = null; JsonNode data = JsonLoader.fromString(incomingString); report = schema.validate(data); if (report != null && !report.isSuccess()) { Iterator<ProcessingMessage> iter = report.iterator(); StringBuilder s = new StringBuilder(); while (iter.hasNext()) { ProcessingMessage pm = iter.next(); s.append(pm.asJson().get("instance").findValue("pointer")).append(":").append(pm.asJson().get("message")) .append(","); } s.setLength(s.length() - 1); errorTupleCount++; if (err.isConnected()) { err.emit(new KeyValPair<String, String>(incomingString, s.toString())); } return; } } if (parsedOutput.isConnected()) { parsedOutput.emit(new JSONObject(incomingString)); parsedOutputCount++; } if (out.isConnected()) { out.emit(objMapper.readValue(tuple, clazz)); emittedObjectCount++; } } catch (JSONException | ProcessingException | IOException e) { errorTupleCount++; if (err.isConnected()) { err.emit(new KeyValPair<String, String>(incomingString, e.getMessage())); } logger.error("Failed to parse json tuple {}, Exception = ", tuple, e); } }
Source:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { if (showBranch != null) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(ObjectId.toString(id) + " "); } } stdout.print(p.getName()); stdout.println(); } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }

Target:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { if (showBranch != null) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(id.name() + " "); stdout.print(p.getName()); stdout.println(); } } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } } }
Source:
public void add(int[] values, int length) { for (int i = 0; i < length; i++) { addValueToBuffer(values[i]); nextDoc(); } nextDoc(); }

Target:
public void add(int[] values, int length) { for (int i = 0; i < length; i++) { _numberValueBuffer.put(_nextValueId, values[i]); _docIdBuffer.put(_nextValueId, _nextDocId); _nextValueId++; } _nextDocId++; }
Source:
public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof List == false) { return false; } final List<?> other = (List<?>) obj; if (other.size() != size()) { return false; } final ListIterator<?> it1 = listIterator(); final ListIterator<?> it2 = other.listIterator(); while (it1.hasNext() && it2.hasNext()) { final Object o1 = it1.next(); final Object o2 = it2.next(); if (!(Objects.equals(o1, o2))) { return false; } } return !(it1.hasNext() || it2.hasNext()); }

Target:
public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof List == false) { return false; } final List<?> other = (List<?>) obj; if (other.size() != size()) { return false; } final ListIterator<?> it1 = listIterator(); final ListIterator<?> it2 = other.listIterator(); while (it1.hasNext() && it2.hasNext()) { if (!(Objects.equals(it1.next(), it2.next()))) { return false; } } return !(it1.hasNext() || it2.hasNext()); }
Source:
public static IssuerFraudRecord retrieve(String id) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { String url = instanceURL(IssuerFraudRecord.class, id); return request(RequestMethod.GET, url, null, IssuerFraudRecord.class, null); }

Target:
public static IssuerFraudRecord retrieve(String id) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return retrieve(id, null); }
Source:
public ArrayList<DiskInterface> getDiskInterfaceList() { return new ArrayList<>( Arrays.asList( DiskInterface.IDE, DiskInterface.VirtIO, DiskInterface.VirtIO_SCSI, DiskInterface.SPAPR_VSCSI, DiskInterface.SATA )); }

Target:
public ArrayList<DiskInterface> getDiskInterfaceList() { return new ArrayList<>(Arrays.asList(DiskInterface.values())); }
Source:
public void setValue(long value) { this.value = value; }

Target:
void setValue(long value) { this.value = value; }
Source:
public List<SourceWithKeys> splitIntoBundles( long desiredBundleSizeBytes, PipelineOptions options) throws Exception { Scan scan = configuration.getScan(); byte[] scanStartKey = scan.getStartRow(); byte[] scanEndKey = scan.getStopRow(); List<SourceWithKeys> splits = new ArrayList<>(); byte[] startKey = HConstants.EMPTY_START_ROW; long lastOffset = 0; for (SampleRowKeysResponse response : getSampleRowKeys()) { byte[] endKey = response.getRowKey().toByteArray(); if (Bytes.equals(startKey, endKey) && startKey.length > 0) { continue; } long offset = response.getOffsetBytes(); if (isWithinRange(scanStartKey, scanEndKey, startKey, endKey)) { byte[] splitStart = null; byte[] splitStop = null; if (scanStartKey.length == 0 || Bytes.compareTo(startKey, scanStartKey) >= 0) { splitStart = startKey; } else { splitStart = scanStartKey; } if ((scanEndKey.length == 0 || Bytes.compareTo(endKey, scanEndKey) <= 0) && endKey.length > 0) { splitStop = endKey; } else { splitStop = scanEndKey; } splits.addAll(split(offset - lastOffset, desiredBundleSizeBytes, splitStart, splitStop)); } lastOffset = offset; startKey = endKey; } byte[] endKey = HConstants.EMPTY_END_ROW; if (!Bytes.equals(startKey, endKey) && scanEndKey.length == 0) { splits.add(new SourceWithKeys(startKey, endKey, 0)); } LOG.info(String.format("Creating %d splits.", splits.size())); if (LOG.isDebugEnabled()) { for (SourceWithKeys split : splits) { LOG.debug("Created split {}", split); } } return splits; }

Target:
public List<SourceWithKeys> splitIntoBundles( long desiredBundleSizeBytes, PipelineOptions options) throws Exception { Scan scan = configuration.getScan(); byte[] scanStartKey = scan.getStartRow(); byte[] scanEndKey = scan.getStopRow(); List<SourceWithKeys> splits = new ArrayList<>(); byte[] startKey = HConstants.EMPTY_START_ROW; long lastOffset = 0; for (SampleRowKeysResponse response : getSampleRowKeys()) { byte[] endKey = response.getRowKey().toByteArray(); if (Bytes.equals(startKey, endKey) && startKey.length > 0) { continue; } long offset = response.getOffsetBytes(); if (isWithinRange(scanStartKey, scanEndKey, startKey, endKey)) { byte[] splitStart = null; byte[] splitStop = null; if (scanStartKey.length == 0 || Bytes.compareTo(startKey, scanStartKey) >= 0) { splitStart = startKey; } else { splitStart = scanStartKey; } if ((scanEndKey.length == 0 || Bytes.compareTo(endKey, scanEndKey) <= 0) && endKey.length > 0) { splitStop = endKey; } else { splitStop = scanEndKey; } splits.addAll(split(offset - lastOffset, desiredBundleSizeBytes, splitStart, splitStop)); } lastOffset = offset; startKey = endKey; } byte[] endKey = HConstants.EMPTY_END_ROW; if (!Bytes.equals(startKey, endKey) && scanEndKey.length == 0) { splits.add(new SourceWithKeys(startKey, endKey, 0)); } LOG.info("Creating splits.", splits.size()); LOG.debug("Created splits {}.", splits); return splits; }
Source:
public void configure(HttpSecurity http) throws Exception { ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = http.authorizeRequests(); for (String protectedPath : PROTECTED_PATHS) { registry = registry.antMatchers(protectedPath).hasRole(TokenAuthentication.ROLE); } for (PathMappedEndpoint actuatorEndpoint : actuatorEndpoints) { final String rootPath = actuatorEndpoint.getRootPath(); final boolean enforceTokenUsage; if (allowPrometheusUnauthenticatedAccess && "prometheus".equals(rootPath)) { enforceTokenUsage = false; LOGGER.info("======= ALLOW UNAUTHENTICATED ACCESS TO PROMETHEUS (DEV MODE ONLY!) ======="); } else { enforceTokenUsage = true; } final ExpressionUrlAuthorizationConfigurer<HttpSecurity>.AuthorizedUrl matcher = registry.antMatchers(webEndpointProperties.getBasePath() + "/" + rootPath + "**"); if (enforceTokenUsage) { registry = matcher.hasRole(TokenAuthentication.ROLE); } else { registry = matcher.permitAll(); } } registry.and().addFilterAfter(tokenAuthenticationFilter, BasicAuthenticationFilter.class); }

Target:
public void configure(HttpSecurity http) throws Exception { ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = http.authorizeRequests(); for (String protectedPath : PROTECTED_PATHS) { registry = registry.antMatchers(protectedPath).hasRole(TokenAuthentication.ROLE); } final PathMappedEndpoint prometheus = actuatorEndpoints.getEndpoint(EndpointId.of("prometheus")); for (PathMappedEndpoint actuatorEndpoint : actuatorEndpoints) { final String rootPath = actuatorEndpoint.getRootPath(); final boolean enforceTokenUsage; if (allowPrometheusUnauthenticatedAccess && actuatorEndpoint.equals(prometheus)) { enforceTokenUsage = false; LOGGER.info("======= ALLOW UNAUTHENTICATED ACCESS TO PROMETHEUS (DEV MODE ONLY!) ======="); } else { enforceTokenUsage = true; } final ExpressionUrlAuthorizationConfigurer<HttpSecurity>.AuthorizedUrl matcher = registry .antMatchers(webEndpointProperties.getBasePath() + "/" + rootPath + "**"); if (enforceTokenUsage) { registry = matcher.hasRole(TokenAuthentication.ROLE); } else { registry = matcher.permitAll(); } } registry.and().addFilterAfter(tokenAuthenticationFilter, BasicAuthenticationFilter.class); }
Source:
public void testUpsertingDeletedRowWithNullCoveredColumn(boolean multiCf) throws Exception { String tableName = "TBL_" + generateUniqueName(); String indexName = "IDX_" + generateUniqueName(); String columnFamily1 = "cf1"; String columnFamily2 = "cf2"; String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = getConnection()) { conn.createStatement() .execute("create table " + fullTableName + " (id integer primary key, " + (multiCf ? columnFamily1 : "") + "f varchar, " + (multiCf ? columnFamily2 : "") + "s varchar)" + tableDDLOptions); conn.createStatement() .execute("create " + (localIndex ? "LOCAL" : "") + " index " + indexName + " on " + fullTableName + " (" + (multiCf ? columnFamily1 : "") + "f) include (" + (multiCf ? columnFamily2 : "") + "s)"); conn.createStatement() .execute("upsert into " + fullTableName + " values (1, 'foo', 'bar')"); conn.commit(); conn.createStatement().execute("delete from " + fullTableName + " where id = 1"); conn.commit(); conn.createStatement() .execute("upsert into " + fullTableName + " values (1, null, 'bar')"); conn.commit(); ResultSet rs = conn.createStatement().executeQuery("select * from " + fullIndexName); assertTrue(rs.next()); assertEquals(1, rs.getInt(2)); assertEquals(null, rs.getString(1)); assertEquals("bar", rs.getString(3)); } }

Target:
public void testUpsertingDeletedRowWithNullCoveredColumn(boolean multiCf) throws Exception { String tableName = "TBL_" + generateUniqueName(); String indexName = "IDX_" + generateUniqueName(); String columnFamily1 = "cf1"; String columnFamily2 = "cf2"; String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = getConnection()) { conn.createStatement() .execute("create table " + fullTableName + " (id integer primary key, " + (multiCf ? columnFamily1 + "." : "") + "f varchar, " + (multiCf ? columnFamily2 + "." : "") + "s varchar)" + tableDDLOptions); conn.createStatement() .execute("create " + (localIndex ? "LOCAL" : "") + " index " + indexName + " on " + fullTableName + " (" + (multiCf ? columnFamily1 + "." : "") + "f) include (" + (multiCf ? columnFamily2 + "." : "") + "s)"); conn.createStatement() .execute("upsert into " + fullTableName + " values (1, 'foo', 'bar')"); conn.commit(); conn.createStatement().execute("delete from " + fullTableName + " where id = 1"); conn.commit(); conn.createStatement() .execute("upsert into " + fullTableName + " values (1, null, 'bar')"); conn.commit(); ResultSet rs = conn.createStatement().executeQuery("select * from " + fullIndexName); assertTrue(rs.next()); assertEquals(1, rs.getInt(2)); assertEquals(null, rs.getString(1)); assertEquals("bar", rs.getString(3)); } }
Source:
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() .map(v -> vertexToInts(v, face.texture.map(RenderUtility.instance::getTexture) .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()); }

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:
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(); } { 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(); }

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:
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(); }

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:
public synchronized long getLatestSegmentMemoryConsumed() { if (isEmpty()) { return 0; } int latestSegmentIndex = (_cursor + _arraySize - 1) % _arraySize; SegmentStats stats = getSegmentStatsAt(latestSegmentIndex); return stats._memUsedBytes; }

Target:
public synchronized long getLatestSegmentMemoryConsumed() { if (isEmpty()) { return -1; } int latestSegmentIndex = (_cursor + _arraySize - 1) % _arraySize; SegmentStats stats = getSegmentStatsAt(latestSegmentIndex); return stats._memUsedBytes; }
Source:
public synchronized void unsubscribe() { if (sub == null) { return; } try { sub.unsubscribe(); } catch (IOException e) { LOGGER.warn("could not unsubscribe from subscription. " + e.getMessage()); } sub = null; }

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:
private static void irq(TmfGraph graph, LttngEventLayout eventLayout, long ts, LttngWorker target, LttngInterruptContext context) { TmfEdge l3 = graph.append(target, new TmfVertex(ts)); if (l3 != null) { int vec = EventField.getLong(context.getEvent(), eventLayout.fieldIrq()).intValue(); l3.setType(resolveIRQ(vec)); } }

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:
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(providers.size() - 1); } }); }

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:
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; checkArgument(careerType > 0, "CareerType cannot be zero or negative"); 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); }

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:
public static String convertFromIpsecString(String str) { if (str == null) return null; try { str = str.replace('-', '_'); return str.toUpperCase(); } catch (IllegalArgumentException ex) { return null; } }

Target:
public static String convertFromIpsecString(String str) { if (str == null) return null; try { return str.replace('-', '_').toUpperCase(); } catch (IllegalArgumentException ex) { return null; } }
Source:
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); org.apache.parquet.hadoop.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; }

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:
public Response createResponse(HTTPResponse response) throws ServiceException, IOException { Map<String, Object> hints = getRequestHints(); EntityResolver resolver = null; if(hints != null) { GeoTools.getEntityResolver( resolver = GeoTools.getEntityResolver(hints); } return new GetCapabilitiesResponse(response, resolver); }

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:
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) { Window.alert("Could not delete!"); } } }

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:
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(); while (oldCriteriaIdsIter.hasNext() && newCriteriaIdsIter.hasNext()) { checkForInvalidCriteriaCombination(listing, oldCriteriaIdsIter.next(), newCriteriaIdsIter.next()); } } }

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:
public final DeliveryAnnotations getDeliveryAnnotations() { if (deliveryAnnotations != null) { return deliveryAnnotations; } else { ensureScanning(); return scanForMessageSection(deliveryAnnotationsPosition, DeliveryAnnotations.class); } }

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

Target:
public WordUpdateChange updateWordArtifacts(WordUpdateData data) { WordUpdateArtifact updateArt = new WordUpdateArtifact(logger, orcsApi); validate(data); return updateArt.updateArtifacts(data, atsServer); }
Source:
private boolean doWeHandle(SubqueryNode subqueryNode) throws StandardException { boolean existsSubquery = subqueryNode.isEXISTS(); boolean notExistsSubquery = subqueryNode.isNOT_EXISTS(); ResultSetNode subqueryResultSet = subqueryNode.getResultSet(); if (!(existsSubquery || notExistsSubquery)) { return false; } if (!(subqueryResultSet instanceof SelectNode)) { return false; } SelectNode subquerySelectNode = (SelectNode) subqueryResultSet; if (notExistsSubquery && outerSelectNode.getFromList().size() > 1) { return false; } if (!subqueryNode.getUnderTopAndNode()) { return false; } if ((subqueryNode.getOffset() != null || subqueryNode.getFetchFirst() != null)) { return false; } if (!ColumnUtils.isSubtreeCorrelated(subqueryNode)) { return true; } FromList fromList = subqueryResultSet.getFromList(); if (subqueryNode.singleFromBaseTable(fromList) != null) { boolean hasAggregation = subquerySelectNode.hasAggregatesInSelectList() || subquerySelectNode.hasHavingClause(); if (!hasAggregation && !subquerySelectNode.getOriginalWhereClauseHadSubqueries()) return false; } if (subqueryResultSet.getFromList().containsNode(UnionNode.class)) { return isUnionSubqueryOk(subqueryNode, subquerySelectNode.getNestingLevel(), notExistsSubquery); } ValueNode whereClause = subquerySelectNode.getWhereClause(); return whereClause == null || isWhereClauseOk(whereClause, notExistsSubquery, subquerySelectNode.getNestingLevel()); }

Target:
private boolean doWeHandle(SubqueryNode subqueryNode) throws StandardException { boolean existsSubquery = subqueryNode.isEXISTS(); boolean notExistsSubquery = subqueryNode.isNOT_EXISTS(); ResultSetNode subqueryResultSet = subqueryNode.getResultSet(); if (!(existsSubquery || notExistsSubquery)) { return false; } if (!(subqueryResultSet instanceof SelectNode)) { return false; } SelectNode subquerySelectNode = (SelectNode) subqueryResultSet; if (notExistsSubquery && outerSelectNode.getFromList().size() > 1) { return false; } if (!subqueryNode.getUnderTopAndNode()) { return false; } if ((subqueryNode.getOffset() != null || subqueryNode.getFetchFirst() != null)) { return false; } if (!ColumnUtils.isSubtreeCorrelated(subqueryNode)) { return true; } FromList fromList = subqueryResultSet.getFromList(); if (subqueryNode.singleFromBaseTable(fromList) != null) { boolean hasAggregation = subquerySelectNode.hasAggregatesInSelectList() || subquerySelectNode.hasHavingClause() || (subquerySelectNode.getGroupByList()!= null && subquerySelectNode.getGroupByList().isRollup()); if (!hasAggregation && !subquerySelectNode.getOriginalWhereClauseHadSubqueries()) return false; } if (subqueryResultSet.getFromList().containsNode(UnionNode.class)) { return isUnionSubqueryOk(subqueryNode, subquerySelectNode.getNestingLevel(), notExistsSubquery); } ValueNode whereClause = subquerySelectNode.getWhereClause(); return whereClause == null || isWhereClauseOk(whereClause, notExistsSubquery, subquerySelectNode.getNestingLevel()); }
Source:
public String getProfileBanner300x100URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "300x100" : null; }

Target:
public String getProfileBanner300x100URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "/300x100" : null; }
Source:
public VanillaCubicProvider(ICubicWorld world, WorldProvider provider, @Nullable IChunkGenerator reUse) { this.wp = provider; this.worldObj = (World) world; boolean flag = false; 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); } }

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:
public boolean checkValue(Object value, Object key, int expectedSize) { boolean ret; if (value instanceof byte[]) { RandomStream rand = new RandomStream(key.hashCode(), expectedSize); ret = rand.validate((byte[]) value); rand.close(); } else ret = false; return ret; }

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:
public void addRequestCleanupHandler(HttpServletRequest request) { RequestContext.getActiveContext(request).addRequestCleanupHandler(new RequestCleanupHandler() { @Override public void cleanup(HttpServletRequest req) { try { close(); } catch (OperationException cause) { throw new NuxeoException(cause); } } }); }

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:
private String handleColumnCreationSection(Map<String, ColumnMetadata> columns) { List<String> lines = new ArrayList<String>(); Set<String> keys = columns.keySet(); 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; }

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:
private List<Job> createAmountOfJobs(int amount, boolean isBuilt) { List<Job> jobs = new ArrayList<>(); if (isBuilt) { for (int i = 0; i < amount; i++) { jobs.add(createJobAndBuild()); } } else { for (int i = 0; i < amount; i++) { jobs.add(jenkins.jobs.create(FreeStyleJob.class)); } } return jobs; }

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:
public BusinessServiceGraph getGraph() { m_rwLock.readLock().lock(); try { return m_g; } finally { m_rwLock.readLock().unlock(); } }

Target:
public BusinessServiceGraph getGraph() { return m_g; }
Source:
public void clearSPSPlans() throws StandardException{ TabInfoImpl ti=getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM); faultInTabInfo(ti); TransactionController tc=getTransactionExecute(); FormatableBitSet columnToReadSet=new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT); FormatableBitSet columnToUpdateSet=new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT); for(int i=0;i<SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT;i++){ if (i+1==SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE) { columnToUpdateSet.set(i); } else { columnToReadSet.set(i); columnToUpdateSet.set(i); } } DataValueDescriptor[] rowTemplate = new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT]; DataValueDescriptor[] replaceRow= new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT]; ScanController sc= tc.openScan( ti.getHeapConglomerate(), false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_REPEATABLE_READ, columnToReadSet, null, ScanController.NA, null, null, ScanController.NA); while(sc.fetchNext(rowTemplate)){ for (int i=0; i<rowTemplate.length; i++) { if (i == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID-1) replaceRow[i] = new SQLBoolean(false); else if (i == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE-1) replaceRow[i] = new UserType(null); else replaceRow[i] = rowTemplate[i].cloneValue(false); } sc.replace(replaceRow,columnToUpdateSet); } sc.close(); }

Target:
public void clearSPSPlans() throws StandardException{ TabInfoImpl ti=getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM); faultInTabInfo(ti); TransactionController tc=getTransactionExecute(); FormatableBitSet columnToReadSet=new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT); FormatableBitSet columnToUpdateSet=new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT); for(int i=0;i<SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT;i++){ if (i+1 != SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE) { columnToReadSet.set(i); } columnToUpdateSet.set(i); } DataValueDescriptor[] rowTemplate = new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT]; DataValueDescriptor[] replaceRow= new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT]; ScanController sc= tc.openScan( ti.getHeapConglomerate(), false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_REPEATABLE_READ, columnToReadSet, null, ScanController.NA, null, null, ScanController.NA); while(sc.fetchNext(rowTemplate)){ for (int i=0; i<rowTemplate.length; i++) { if (i+1 == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID) replaceRow[i] = new SQLBoolean(false); else if (i+1 == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE) replaceRow[i] = new UserType(null); else replaceRow[i] = rowTemplate[i].cloneValue(false); } sc.replace(replaceRow,columnToUpdateSet); } sc.close(); }
Source:
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) { return new VerificationMessage("Your plugin does not seem to have a LTS Jenkins release, in general ", Severity.INFO); } return null; }

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:
public void deleteResourcesAndHandleConflicts(List<Long> theLongs) { DeleteConflictList deleteConflictList = new DeleteConflictList(); theLongs.stream().forEach(pid -> deleteCascade(pid, deleteConflictList)); IFhirResourceDao personDao = myDaoRegistry.getResourceDao("Person"); while (!deleteConflictList.isEmpty()) { deleteConflictBatch(deleteConflictList, personDao); } }

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:
protected void createFieldEditors() { FieldEditor edit = new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_SHOW_ERROR_REVERSE_TRACE_METHOD_NOT_AVAILABLE, "Show Error Dialog when Reverse Trace Method not available", 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 ); }

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:
private void scrubSweepableTimestamps(ShardAndStrategy shardStrategy, long oldProgress, long newProgress) { if (oldProgress < 0) { return; } long oldLastSweptPartition = SweepQueueUtils.tsPartitionCoarse(oldProgress); long newMinSweepPartition = SweepQueueUtils.tsPartitionCoarse(newProgress + 1); if (newMinSweepPartition > oldLastSweptPartition) { sweepableTimestamps.deleteRow(shardStrategy, oldLastSweptPartition); } }

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); } }