auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public KeyParts visitLeave(InListExpression node, List<KeyParts> childKeyExprs) { if (childKeyExprs.isEmpty()) { return null; } List<byte[]> keys = node.getKeys(); List<KeyRange> ranges = KeyRange.of(keys); KeyPart colKeyExpr = childKeyExprs.get(0).iterator().next().getKeyPart(); return newKeyExpression(colKeyExpr.getDatum(), colKeyExpr.getPosition(), Collections.<Expression>emptyList(), false, ranges, node.getChildren().get(0)); }

Target:
public KeyParts visitLeave(InListExpression node, List<KeyParts> childKeyExprs) { if (childKeyExprs.isEmpty()) { return null; } List<byte[]> keys = node.getKeys(); List<KeyRange> ranges = KeyRange.of(keys); KeyPart colKeyExpr = childKeyExprs.get(0).iterator().next().getKeyPart(); if (ranges.size() > 0) { if (ranges.get(0).lowerUnbound() || ranges.get(ranges.size() - 1).upperUnbound()) { ImmutableBytesWritable minKey = node.getMinKey(); ImmutableBytesWritable maxKey = node.getMaxKey(); KeyRange keyRange = KeyRange.getKeyRange(minKey.copyBytes(), true, maxKey.copyBytes(), true); return newKeyExpression(colKeyExpr.getDatum(), colKeyExpr.getPosition(), Collections.<Expression>emptyList(), false, keyRange, node.getChildren().get(0)); } } return newKeyExpression(colKeyExpr.getDatum(), colKeyExpr.getPosition(), Collections.<Expression>singletonList(node), false, ranges, node.getChildren().get(0)); }
Source:
public int getLast() { if (last < first) throw new IllegalStateException("last cannot be smaller than first"); return last; }

Target:
public int getLast() { checkOne(); return last; }
Source:
public CopybookSourceConfig() { super(String.format("CopybookReader")); this.maxSplitSize = DEFAULT_MAX_SPLIT_SIZE; }

Target:
public CopybookSourceConfig() { super(String.format("CopybookReader")); this.maxSplitSize = DEFAULT_MAX_SPLIT_SIZE_IN_MB * CONVERT_TO_BYTES; }
Source:
public void receiveResponse(Exchange exchange, Response response) { Request request = exchange.getCurrentRequest(); if(request == null){ LOGGER.severe("No request tied to this response"); return; } try { if (responseShouldBeProtected(exchange, response)) { if (!isProtected(response)){ LOGGER.severe("Unprotected OSCore response received" + " for OSCore request"); LOGGER.severe("Response: " + response.toString()); return; } response = prepareReceive(response); } } catch (OSException e) { LOGGER.severe("Error while receiving OSCore response: " + e.getMessage()); EmptyMessage error = OSExceptionHandler.manageError(e, response); if(error != null){ sendEmptyMessage(exchange, error); } return; } super.receiveResponse(exchange,response); }

Target:
public void receiveResponse(Exchange exchange, Response response) { Request request = exchange.getCurrentRequest(); if (request == null) { LOGGER.error("No request tied to this response"); return; } try { if (responseShouldBeProtected(exchange, response)) { if (!isProtected(response)) { LOGGER.error("Unprotected OSCore response received" + " for OSCore request"); LOGGER.error("Response: " + response.toString()); return; } response = prepareReceive(response); } } catch (OSException e) { LOGGER.error("Error while receiving OSCore response: " + e.getMessage()); EmptyMessage error = CoapOSExceptionHandler.manageError(e, response); if (error != null) { sendEmptyMessage(exchange, error); } return; } super.receiveResponse(exchange, response); }
Source:
public static Long estimateLibrarySize(final long readPairs, final long uniqueReadPairs) { final long readPairDuplicates = readPairs - uniqueReadPairs; if (readPairs > 0 && readPairDuplicates > 0) { double m = 1.0; double M = 100.0; if (uniqueReadPairs >= readPairs || f(m * uniqueReadPairs, uniqueReadPairs, readPairs) < 0) { throw new IllegalStateException("Invalid values for pairs and unique pairs: " + readPairs + ", " + uniqueReadPairs); } while (f(M * uniqueReadPairs, uniqueReadPairs, readPairs) > 0){ M *= 10.0; } for (int i = 0; i < 40; i++) { double r = (m + M) / 2.0; double u = f(r * uniqueReadPairs, uniqueReadPairs, readPairs); if (u == 0) break; else if (u > 0) m = r; else if (u < 0) M = r; } return (long) (uniqueReadPairs * (m + M) / 2.0); } else { return null; } }

Target:
public static Long estimateLibrarySize(final long readPairs, final long uniqueReadPairs) { final long readPairDuplicates = readPairs - uniqueReadPairs; if (readPairs > 0 && readPairDuplicates > 0) { double m = 1.0; double M = 100.0; if (uniqueReadPairs >= readPairs || f(m * uniqueReadPairs, uniqueReadPairs, readPairs) < 0) { throw new IllegalStateException("Invalid values for pairs and unique pairs: " + readPairs + ", " + uniqueReadPairs); } while (f(M * uniqueReadPairs, uniqueReadPairs, readPairs) > 0) { M *= 10.0; } for (int i = 0; i < 40; i++) { double r = (m + M) / 2.0; double u = f(r * uniqueReadPairs, uniqueReadPairs, readPairs); if (u == 0) { break; } else if (u > 0) { m = r; } else if (u < 0) { M = r; } } return (long) (uniqueReadPairs * (m + M) / 2.0); } else { return null; } }
Source:
public static RelOptRuleOperand traitPropagationOperand(Class<? extends RelNode> clazz) { return operand(clazz, null, some(operand(RelSubset.class, any()))); }

Target:
public static RelOptRuleOperand traitPropagationOperand(Class<? extends RelNode> clazz) { return operand(clazz, IgniteDistributions.any(), some(operand(RelSubset.class, any()))); }
Source:
public boolean deleteTransaction(Patient patient) { LOG.trace("PatientDAO.deleteTransaction() -- begin"); Session session = null; Transaction tx = null; boolean result = true; try { LOG.info("Read patient-records for delete"); Patient deletePatient = readTransaction(patient.getPatientId(), true); if (deletePatient != null) { session = hibernateUtil.getSessionFactory().openSession(); tx = session.beginTransaction(); LOG.info("Deleting Records..."); for (Address addressRec : deletePatient.getAddresses()) { session.delete(addressRec); } for (Phonenumber phonenumberRec : deletePatient.getPhonenumbers()) { session.delete(phonenumberRec); } for (Identifier identifierRec : deletePatient.getIdentifiers()) { session.delete(identifierRec); } for (Personname personnameRec : deletePatient.getPersonnames()) { session.delete(personnameRec); } session.delete(deletePatient); tx.commit(); LOG.debug("Patient had been deleted: {}", deletePatient.getPatientId()); } else { result = false; } } catch (HibernateException | NullPointerException e) { result = false; LOG.error("Exception during delete occured due to : {}", e.getMessage(), e); } finally { if (session != null) { try { session.flush(); session.close(); } catch (HibernateException e) { LOG.error("Exception while closing the session after a delete: {}", e.getMessage(), e); } } } LOG.trace("PatientDAO.deleteTransaction() - End"); return result; }

Target:
public boolean deleteTransaction(Patient patient) { LOG.trace("PatientDAO.deleteTransaction() -- begin"); Session session = null; Transaction tx = null; boolean result = true; try { LOG.info("Read patient-records for delete"); Patient deletePatient = readTransaction(patient.getPatientId(), true); if (deletePatient != null) { session = getSessionFactory().openSession(); tx = session.beginTransaction(); LOG.info("Deleting Records..."); for (Address addressRec : deletePatient.getAddresses()) { session.delete(addressRec); } for (Phonenumber phonenumberRec : deletePatient.getPhonenumbers()) { session.delete(phonenumberRec); } for (Identifier identifierRec : deletePatient.getIdentifiers()) { session.delete(identifierRec); } for (Personname personnameRec : deletePatient.getPersonnames()) { session.delete(personnameRec); } session.delete(deletePatient); tx.commit(); LOG.debug("Patient had been deleted: {}", deletePatient.getPatientId()); } else { result = false; } } catch (HibernateException | NullPointerException e) { result = false; LOG.error("Exception during delete occured due to : {}", e.getMessage(), e); } finally { HibernateUtil.closeSession(session, true); } LOG.trace("PatientDAO.deleteTransaction() - End"); return result; }
Source:
public void getActionsHasPermission() throws Exception { when(view.hasPermission(any())).thenReturn(true); final List<Action> actions = newViewLink.createFor(view); assertEquals(1, actions.size()); final Action action = actions.get(0); assertEquals(Messages.NewViewLink_NewView(), action.getDisplayName()); assertEquals(NewViewLink.ICON_FILE_NAME, action.getIconFileName()); }

Target:
public void getActionsHasPermission() throws Exception { when(view.hasPermission(any())).thenReturn(true); final List<Action> actions = newViewLink.createFor(view); assertEquals(1, actions.size()); final Action action = actions.get(0); assertEquals(Messages.NewViewLink_NewView(), action.getDisplayName()); assertEquals(NewViewLink.ICON_FILE_NAME, action.getIconFileName()); assertEquals(rootUrl + NewViewLink.URL_NAME, action.getUrlName()); }
Source:
public void init(ServletConfig config) throws ServletException { super.init(config); final String cacheString = config.getInitParameter(CACHE); if (cacheString == null) { cache = true; } else { cache = Boolean.parseBoolean(cacheString); } type = config.getInitParameter(TYPE); final String name = config.getInitParameter(FILE); if (name == null) { final String message = "Can't get base name from parameter \"" + FILE + "\"."; log.error(message); throw new ServletException(message); } final String expanded = EngineLocalConfig.getInstance().expandString(name.replaceAll("%\\{", "\\${")); if (StringUtils.isEmpty(expanded)) { final String message = "Refusing to serve empty location"; log.debug(message); throw new ServletException(message); } base = new File(expanded); final String isBaseRequired = config.getInitParameter(REQUIRED); if (isBaseRequired != null) { required = Boolean.parseBoolean(isBaseRequired); } }

Target:
public void init(ServletConfig config) throws ServletException { super.init(config); final String cacheString = config.getInitParameter(CACHE); if (cacheString == null) { cache = true; } else { cache = Boolean.parseBoolean(cacheString); } type = config.getInitParameter(TYPE); final String name = config.getInitParameter(FILE); if (name == null) { final String message = "Can't get base name from parameter \"" + FILE + "\"."; log.error(message); throw new ServletException(message); } final String expanded = EngineLocalConfig.getInstance().expandString(name.replaceAll("%\\{", "\\${")); if (StringUtils.isEmpty(expanded)) { final String message = "Refusing to serve empty location"; log.debug(message); throw new ServletException(message); } final String isBaseRequired = config.getInitParameter(REQUIRED); if (isBaseRequired != null) { required = Boolean.parseBoolean(isBaseRequired); } base = new File(expanded); }
Source:
public void setShippingMethod() throws Exception { withShippingMethodForGermany(client(), shippingMethod -> { withCart(client(), createCartWithShippingAddress(client()), cart -> { assertThat(cart.getShippingInfo()).isNull(); final CartUpdateCommand updateCommand = CartUpdateCommand.of(cart, SetShippingMethod.of(shippingMethod)) .plusExpansionPaths(m -> m.shippingInfo().shippingMethod().taxCategory()) .plusExpansionPaths(m -> m.shippingInfo().taxCategory()); final Cart cartWithShippingMethod = client().executeBlocking(updateCommand); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethodState()).isEqualTo(ShippingMethodState.MATCHES_CART); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod()).isEqualTo(shippingMethod.toReference()); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod().getObj()) .as("reference expansion shippingMethod") .isEqualTo(shippingMethod); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod().getObj().getTaxCategory().getObj()) .as("reference expansion taxCategory") .isNotNull(); final Cart cartWithoutShippingMethod = client().executeBlocking(CartUpdateCommand.of(cartWithShippingMethod, SetShippingMethod.ofRemove())); assertThat(cartWithoutShippingMethod.getShippingInfo()).isNull(); return cartWithoutShippingMethod; }); }); }

Target:
public void setShippingMethod() throws Exception { withShippingMethodForGermany(client(), shippingMethod -> { withCart(client(), createCartWithShippingAddress(client()), cart -> { assertThat(cart.getShippingInfo()).isNull(); final CartUpdateCommand updateCommand = CartUpdateCommand.of(cart, SetShippingMethod.of(shippingMethod)) .plusExpansionPaths(m -> m.shippingInfo().shippingMethod().taxCategory()) .plusExpansionPaths(m -> m.shippingInfo().taxCategory()); final Cart cartWithShippingMethod = client().executeBlocking(updateCommand); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethodState()).isEqualTo(ShippingMethodState.MATCHES_CART); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod()).isEqualTo(shippingMethod.toReference()); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod().getObj()) .as("reference expansion shippingMethod") .isEqualTo(shippingMethod); assertThat(cartWithShippingMethod.getShippingInfo().getShippingMethod().getObj().getTaxCategory().getObj()) .as("reference expansion taxCategory") .isEqualTo(cartWithShippingMethod.getShippingInfo().getTaxCategory().getObj()) .isNotNull(); final Cart cartWithoutShippingMethod = client().executeBlocking(CartUpdateCommand.of(cartWithShippingMethod, SetShippingMethod.ofRemove())); assertThat(cartWithoutShippingMethod.getShippingInfo()).isNull(); return cartWithoutShippingMethod; }); }); }
Source:
public UsernamePasswordAuthenticationFilter(AuthenticationManager authenticationManager) { super(new AntPathRequestMatcher("/login", "POST"), authenticationManager); }

Target:
public UsernamePasswordAuthenticationFilter(AuthenticationManager authenticationManager) { super(DEFAULT_ANT_PATH_REQUEST_MATCHER, authenticationManager); }
Source:
public void send(byte[] payload) throws TTransportException { if (!isOpen()) { throw new TTransportException(TTransportException.NOT_OPEN); } transport.write(payload); transport.flush(); }

Target:
public synchronized void send(byte[] payload) throws TTransportException { if (!isOpen()) { throw new TTransportException(TTransportException.NOT_OPEN); } transport.write(payload); transport.flush(); }
Source:
public String getReplicationId() { HashMap<String, String> dict = new HashMap<String, String>(); dict.put("source", this.sourceDb.getIdentifier()); try { dict.put("target", this.targetDb.getIdentifier()); } catch (DatastoreException e){ logger.log(Level.WARNING,"Failed to get public id using default",e); dict.put("target","touchdb_defaultUUID"); } if(filter != null) { dict.put("filter", this.filter.toQueryString()); } byte[] sha1Bytes = Misc.getSha1(new ByteArrayInputStream(JSONUtils.serializeAsBytes(dict))); byte[] sha1Hex = new Hex().encode(sha1Bytes); return new String(sha1Hex); }

Target:
public String getReplicationId() throws DatastoreException { HashMap<String, String> dict = new HashMap<String, String>(); dict.put("source", this.sourceDb.getIdentifier()); dict.put("target", this.targetDb.getIdentifier()); if(filter != null) { dict.put("filter", this.filter.toQueryString()); } byte[] sha1Bytes = Misc.getSha1(new ByteArrayInputStream(JSONUtils.serializeAsBytes(dict))); byte[] sha1Hex = new Hex().encode(sha1Bytes); return new String(sha1Hex); }
Source:
public DataFlagEncoderTest() { encoder = new DataFlagEncoder(); encodingManager = new EncodingManager(Arrays.asList(encoder), 8); motorVehicleInt = encoder.getAccessType("motor_vehicle"); }

Target:
public DataFlagEncoderTest() { properties = new PMap(); properties.put("store_height", true); properties.put("store_weight", true); properties.put("store_width", true); encoder = new DataFlagEncoder(properties); encodingManager = new EncodingManager(Arrays.asList(encoder), 8); motorVehicleInt = encoder.getAccessType("motor_vehicle"); }
Source:
private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(); engineSession.setEngineSessionId(sessionId); DbUser user = getUser(sessionId, false); engineSession.setUserId(user.getId()); engineSession.setUserName(user.getLoginName()); engineSession.setGroupIds(user.getGroupIds()); sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, getDbFacade().getEngineSessionDao().save(engineSession)); } }

Target:
private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(getUser(sessionId, false)); engineSession.setEngineSessionId(sessionId); sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, getDbFacade().getEngineSessionDao().save(engineSession)); } }
Source:
public String convertStreamToString(InputStream is) throws IOException { if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } } finally { is.close(); } return writer.toString(); } else { return ""; } }

Target:
public String convertStreamToString(InputStream is) throws IOException { if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } reader.close(); } finally { is.close(); } return writer.toString(); } else { return ""; } }
Source:
public PeriodicQueryMetadata readPeriodicQueryMetadata(SnapshotBase tx, String nodeId) { Optional<NodeType> type = NodeType.fromNodeId(nodeId); try { checkArgument(type.isPresent() && type.get() == NodeType.PERIODIC_QUERY); LOG.debug("Retrieving Metadata from Cache: {}", nodeId); return (PeriodicQueryMetadata) commonNodeMetadataCache.get(nodeId, new Callable<CommonNodeMetadata>() { @Override public CommonNodeMetadata call() throws Exception { LOG.debug("Seeking Metadata from Fluo Table: {}.", nodeId); return dao.readPeriodicQueryMetadata(tx, nodeId); } }); } catch (Exception e) { throw new RuntimeException("Unable to access PeriodicQueryMetadata for nodeId: " + nodeId, e); } }

Target:
public PeriodicQueryMetadata readPeriodicQueryMetadata(SnapshotBase tx, String nodeId) { checkNotNull(nodeId); checkNotNull(tx); Optional<NodeType> type = NodeType.fromNodeId(nodeId); checkArgument(type.isPresent() && type.get() == NodeType.PERIODIC_QUERY); try { LOG.debug("Retrieving Metadata from Cache: {}", nodeId); return (PeriodicQueryMetadata) commonNodeMetadataCache.get(nodeId, () -> { LOG.debug("Seeking Metadata from Fluo Table: {}.", nodeId); return dao.readPeriodicQueryMetadata(tx, nodeId); }); } catch (Exception e) { throw new RuntimeException("Unable to access PeriodicQueryMetadata for nodeId: " + nodeId, e); } }
Source:
private BuildCommand isRepoUrlChanged(String workDir) { return test("-neq", new MaterialUrl(material.getUrlArgument().forCommandline()).toString(), exec("hg", "showconfig", "paths.default").setWorkingDirectory(workDir)); }

Target:
private BuildCommand isRepoUrlChanged(String workDir) { return test("-neq", new MaterialUrl(material.getHgUrlArgument().defaultRemoteUrl()).getUrl(), exec("hg", "showconfig", "paths.default").setWorkingDirectory(workDir)); }
Source:
public Object deserialize(Object object) { if (object instanceof String) { return Long.parseLong((String) object); } return object; }

Target:
public Object deserialize(Object object) { return object; }
Source:
public int hashCode() { int result = Objects.hash(entity); result = 31 * result + Arrays.hashCode(values); return result; }

Target:
public int hashCode() { return Objects.hash(entity, Arrays.hashCode(values)); }
Source:
private void removeNonExistingDecorators() { Set<String> nonExistingDecorators = getNonExistingDecorators(); updateDecoratorConfigurations(nonExistingDecorators); dataService.deleteAll(DYNAMIC_DECORATOR, nonExistingDecorators.stream().map(id -> (Object) id)); }

Target:
private void removeNonExistingDecorators() { Set<String> nonExistingDecorators = getNonExistingDecorators(); updateDecoratorConfigurations(nonExistingDecorators); dataService.deleteAll(DYNAMIC_DECORATOR, (Stream<Object>) (Stream<?>) nonExistingDecorators.stream()); }
Source:
public void testTransformWhenFileIsNotNew() { final String fileName = "file.dmn"; final String xml = "xml"; final ServiceCallback<Diagram> callback = mock(ServiceCallback.class); final String title = "title"; doReturn(title).when(service).getDiagramTitle(fileName); doNothing().when(service).doNewDiagram(title, callback); service.transform(fileName, xml, callback); verify(service, never()).doNewDiagram(title, callback); verify(service).doTransformation(xml, callback); }

Target:
public void testTransformWhenFileIsNotNew() { final String fileName = "file.dmn"; final String xml = "xml"; final ServiceCallback<Diagram> callback = mock(ServiceCallback.class); final String title = "title"; doNothing().when(service).doNewDiagram(title, callback); service.transform(fileName, xml, callback); verify(service, never()).doNewDiagram(title, callback); verify(service).doTransformation(xml, callback); }
Source:
public void insert(DbSession dbSession, WebhookDto dto) { checkState(dto.getOrganizationUuid() != null || dto.getProjectUuid() != null, "A webhook can not be created if not linked to an organization or a project."); checkState(dto.getOrganizationUuid() == null || dto.getProjectUuid() == null, "A webhook can not be linked to both an organization and a project."); mapper(dbSession).insert(dto.setCreatedAt(system2.now())); }

Target:
public void insert(DbSession dbSession, WebhookDto dto) { checkState(dto.getOrganizationUuid() != null || dto.getProjectUuid() != null, "A webhook can not be created if not linked to an organization or a project."); checkState(dto.getOrganizationUuid() == null || dto.getProjectUuid() == null, "A webhook can not be linked to both an organization and a project."); mapper(dbSession).insert(dto.setCreatedAt(system2.now()).setUpdatedAt(system2.now())); }
Source:
private Thing addThing(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID, String label, List<String> groupNames, boolean enableChannels, Map<String, String> properties) { Thing thing = ThingFactory.createThing(thingUID, configuration, properties, bridgeUID, thingTypeUID, this.thingHandlerFactories); if (thing == null) { logger.warn("Cannot create thing. No binding found that supports creating a thing" + " of type {}.", thingTypeUID); return null; } if (properties != null) { for (String key : properties.keySet()) { thing.setProperty(key, properties.get(key)); } } addThingSafely(thing); addItems(label, groupNames, thing, thingTypeUID); if (enableChannels) { enableChannels(thing, thingTypeUID); } return thing; }

Target:
private Thing addThing(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID, String label, List<String> groupNames, boolean enableChannels, Map<String, String> properties) { Thing thing = ThingFactory.createThing(thingUID, configuration, properties, bridgeUID, thingTypeUID, this.thingHandlerFactories); if (thing == null) { logger.warn("Cannot create thing. No binding found that supports creating a thing" + " of type {}.", thingTypeUID); return null; } if (properties != null) { for (String key : properties.keySet()) { thing.setProperty(key, properties.get(key)); } } addThingSafely(thing); createGroupItems(label, groupNames, thing, thingTypeUID); if (enableChannels) { enableChannels(thing, thingTypeUID); } return thing; }
Source:
private void writeValue(Object value, ObjectOutputStream out) throws IOException{ if(value instanceof Serializable){ out.writeBoolean(false); out.writeObject(value); }else{ out.writeBoolean(true); out.writeUTF(value.getClass().getName()); IndexedRecord record = (IndexedRecord)value; out.writeUTF(record.getSchema().toString()); ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream(); Encoder encoder = EncoderFactory.get().binaryEncoder(byteOutStream, null); DatumWriter writer = new GenericDatumWriter(record.getSchema()); writer.write(value, encoder); byte[] bytes = byteOutStream.toByteArray(); out.writeInt(bytes.length); out.write(bytes); } }

Target:
private void writeValue(Object value, ObjectOutputStream out) throws IOException{ if (value instanceof Serializable) { out.writeBoolean(false); out.writeObject(value); } else { out.writeBoolean(true); out.writeUTF(value.getClass().getName()); DatumWriter writer = null; if (value instanceof IndexedRecord) { out.writeBoolean(false); IndexedRecord record = (IndexedRecord)value; Schema schema = record.getSchema(); writer = new GenericDatumWriter(schema); } else { out.writeBoolean(true); writer = new ReflectDatumWriter(value.getClass()); } ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream(); Encoder encoder = EncoderFactory.get().binaryEncoder(byteOutStream, null); writer.write(value, encoder); byte[] bytes = byteOutStream.toByteArray(); out.writeInt(bytes.length); out.write(bytes); } }
Source:
public void visitMemberAccess(MemberAccessTree tree) { if (tree.is(Tree.Kind.CLASS_MEMBER_ACCESS) && "self".equals(tree.object().toString()) && !isException(tree) && !isPrivate(tree.member())) { context().newIssue(this, MESSAGE).tree(tree); } super.visitMemberAccess(tree); }

Target:
public void visitMemberAccess(MemberAccessTree tree) { if (tree.is(Tree.Kind.CLASS_MEMBER_ACCESS) && "self".equals(tree.object().toString()) && !isException(tree)) { context().newIssue(this, tree.object(), MESSAGE); } super.visitMemberAccess(tree); }
Source:
public IndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") IndexIOConfig ioConfig, @JsonProperty("tuningConfig") IndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { throw new IAE("Cannot use parser and inputSource together. Try use inputFormat instead of parser."); } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? new IndexTuningConfig() : tuningConfig; }

Target:
public IndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") IndexIOConfig ioConfig, @JsonProperty("tuningConfig") IndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { throw new IAE("Cannot use parser and inputSource together. Try using inputFormat instead of parser."); } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? new IndexTuningConfig() : tuningConfig; }
Source:
public void scheduleWithFixedDelay() { executor.scheduleWithFixedDelay(() -> { try { ConjureTimeLockClientFeedback feedbackReport = ConjureTimeLockClientFeedback .builder() .stats(ImmutableMap.of("conjureTimelockServiceBlocking.startTransactions", getEndpointStatsForStartTxn())) .atlasVersion(versionSupplier.get()) .nodeId(nodeId) .serviceName(serviceName) .build(); timeLockClientFeedbackServices .get() .forEach(service -> service.reportFeedback(AUTH_HEADER, feedbackReport)); log.info("The TimeLock client metrics for startTransaction endpoint aggregated " + "over the last 1 minute - {}", SafeArg.of("startTxnStats", feedbackReport)); } catch (Exception e) { log.warn("A problem occurred while reporting client feedback for timeLock adjudication.", e); } }, timeLockClientFeedbackReportInterval.getSeconds(), timeLockClientFeedbackReportInterval.getSeconds(), TimeUnit.SECONDS); }

Target:
public void scheduleWithFixedDelay() { executor.scheduleWithFixedDelay(() -> { try { ConjureTimeLockClientFeedback feedbackReport = ConjureTimeLockClientFeedback .builder() .startTransaction(getEndpointStatsForStartTxn()) .leaderTime(getEndpointStatsForLeaderTime()) .atlasVersion(versionSupplier.get()) .nodeId(nodeId) .serviceName(serviceName) .build(); timeLockClientFeedbackServices .current() .forEach(service -> reportClientFeedbackToService(feedbackReport, service)); } catch (Exception e) { log.warn("A problem occurred while reporting client feedback for timeLock adjudication.", e); } }, TIMELOCK_CLIENT_FEEDBACK_REPORT_INTERVAL.getSeconds(), TIMELOCK_CLIENT_FEEDBACK_REPORT_INTERVAL.getSeconds(), TimeUnit.SECONDS); }
Source:
public byte[] getContent() { return content.getBytes(); }

Target:
public byte[] getContent() { return content.getBytes(Charset.forName("UTF-8")); }
Source:
private static boolean isInCompactConstructor(DetailAST ast) { boolean isInCompactCtor = false; if (ast.getParent() != null) { isInCompactCtor = ast.getParent().getType() == TokenTypes.COMPACT_CTOR_DEF || isInCompactConstructor(ast.getParent()); } return isInCompactCtor; }

Target:
private static boolean isInCompactConstructor(DetailAST ast) { boolean isInCompactCtor = false; DetailAST parent = ast.getParent(); while (parent != null) { if (parent.getType() == TokenTypes.COMPACT_CTOR_DEF) { isInCompactCtor = true; break; } parent = parent.getParent(); } return isInCompactCtor; }
Source:
protected void createDefaultEditPolicies() { super.createDefaultEditPolicies(); this.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new SiriusPopupBarEditPolicy()); removeEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE); installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new SiriusSnapFeedbackPolicy()); }

Target:
protected void createDefaultEditPolicies() { super.createDefaultEditPolicies(); this.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new SiriusPopupBarEditPolicy()); installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new SiriusSnapFeedbackPolicy()); }
Source:
public List<Pair<VDS, VdsNumaNode>> getAllHostsWithVdsNumaNodeByVdsIdList(List<Guid> hostIdList) { List<Pair<VDS, VdsNumaNode>> vdsNumaNodes = getCallsHandler().executeReadList("GetNumaNodeByVdsIdList", hostWithVdsNumaNodeRowMapper, getCustomMapSqlParameterSource().addValue("host_ids", StringUtils.join(hostIdList, ','))); return vdsNumaNodes; }

Target:
public List<Pair<VDS, VdsNumaNode>> getAllHostsWithVdsNumaNodeByVdsIdList(List<Guid> hostIdList) { List<Pair<VDS, VdsNumaNode>> vdsNumaNodes = getCallsHandler().executeReadList("GetNumaNodeByVdsIdsList", hostWithVdsNumaNodeRowMapper, getCustomMapSqlParameterSource().addValue("host_ids", StringUtils.join(hostIdList, ','))); return vdsNumaNodes; }
Source:
private ProductProjection productWithNoCategories() { return new ProductProjection() { @Override public Boolean hasStagedChanges() { return null; } @Override public Boolean isPublished() { return null; } @Override public Set<Reference<Category>> getCategories() { return emptySet(); } @Nullable @Override public LocalizedString getDescription() { return null; } @Override public ProductVariant getMasterVariant() { return null; } @Nullable @Override public LocalizedString getMetaDescription() { return null; } @Nullable @Override public LocalizedString getMetaKeywords() { return null; } @Nullable @Override public LocalizedString getMetaTitle() { return null; } @Override public LocalizedString getName() { return null; } @Override public LocalizedString getSlug() { return null; } @Override public List<ProductVariant> getVariants() { return null; } @Override public SearchKeywords getSearchKeywords() { return null; } @Nullable @Override public CategoryOrderHints getCategoryOrderHints() { return null; } @Nullable @Override public ReviewRatingStatistics getReviewRatingStatistics() { return null; } @Nullable @Override public Reference<State> getState() { return null; } @Nullable @Override public String getKey() { return null; } @Override public Reference<ProductType> getProductType() { return null; } @Nullable @Override public Reference<TaxCategory> getTaxCategory() { return null; } @Override public String getId() { return null; } @Override public Long getVersion() { return null; } @Override public ZonedDateTime getCreatedAt() { return null; } @Override public ZonedDateTime getLastModifiedAt() { return null; } }; }

Target:
private ProductProjection productWithNoCategories() { return SphereJsonUtils.readObject("{\"categories\": [], \"variants\": []}", ProductProjection.class); }
Source:
public static int findFreePort() { ServerSocket socket = null; try { socket = new ServerSocket(0); socket.setReuseAddress(true); int port = socket.getLocalPort(); try { socket.close(); } catch (IOException e) { } logger.debug("Found free port {}", port); return port; } catch (IOException e) { } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { } } } throw new IllegalStateException("Could not find a free TCP/IP port to start git-daemon."); }

Target:
public static int findFreePort() { try (ServerSocket socket = new ServerSocket(SELECT_RANDOM_PORT_OPTION)) { socket.setReuseAddress(true); int port = socket.getLocalPort(); logger.debug("Found free port {}", port); return port; } catch (IOException e) { } throw new IllegalStateException("Could not find a free TCP/IP port to start git-daemon."); }
Source:
public int getMaximumSize() { int maxSize = 0; for (IDeclaration field : fFields) { maxSize += field.getMaximumSize(); } return Math.min(maxSize, Integer.MAX_VALUE); }

Target:
public int getMaximumSize() { long maxSize = 0; for (IDeclaration field : fFields) { maxSize += field.getMaximumSize(); } return (int) Math.min(maxSize, Integer.MAX_VALUE); }
Source:
public String login(@FormParam("username") String username, @FormParam("password") String password) { try { if ((username == null || username == "") || (password == null || password == "")) { throw new LoginException("Empty login/password"); } Session session; if (IAMSessionUtil.IAM_IS_USED) { session = IAMSessionUtil.createNewSessionToken(username, password, sessionStore); } else { session = sessionStore.create(username); } session.connectToScheduler(new CredData(username, password)); logger.info("Binding user " + username + " to session " + session.getSessionId()); return session.getSessionId(); } catch (Exception e) { return "[Error] " + e.getClass() + ": " + e.getMessage(); } }

Target:
public String login(@FormParam("username") String username, @FormParam("password") String password) throws LoginException, SchedulerRestException { try { if ((username == null || username.trim().isEmpty()) || (password == null || password.trim().isEmpty())) { throw new LoginException("Empty login/password"); } Session session; if (IAMSessionUtil.IAM_IS_USED) { session = sessionStore.create(username, password.toCharArray()); } else { session = sessionStore.create(username); } session.connectToScheduler(new CredData(username, password)); logger.info("Binding user " + username + " to session " + session.getSessionId()); return session.getSessionId(); } catch (ActiveObjectCreationException | SchedulerException | NodeException e) { throw new SchedulerRestException(e); } }
Source:
public ChunkedTileEntityList(ChunkedTileEntityList list) { this(); for (Iterator<Entry<ChunkPos, List<TileEntity>>> iterator = list.entrySet().iterator(); iterator.hasNext();) { Entry<ChunkPos, List<TileEntity>> entry = iterator.next(); content.put(entry.getKey(), new ArrayList<>(entry.getValue())); } }

Target:
public ChunkedTileEntityList(ChunkedTileEntityList list) { this(); for (Entry<ChunkPos, List<TileEntity>> entry : list.content.entrySet()) { content.put(entry.getKey(), new ArrayList<>(entry.getValue())); } updateTotalCount(); }
Source:
public List<String> unapply(@Nullable final String value) { String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); if (valueEquivalent == null) { return Collections.EMPTY_LIST; } CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get(); if (cacheRefKeeper == null) { throw new ISE("pollingLookup id [%s] is closed", id); } PollingCache cache = cacheRefKeeper.getAndIncrementRef(); try { if (cache == null) { return this.unapply(valueEquivalent); } return cache.getKeys(valueEquivalent); } finally { if (cacheRefKeeper != null && cache != null) { cacheRefKeeper.doneWithIt(); } } }

Target:
public List<String> unapply(@Nullable final String value) { String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); if (valueEquivalent == null) { return Collections.emptyList(); } CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get(); if (cacheRefKeeper == null) { throw new ISE("pollingLookup id [%s] is closed", id); } PollingCache cache = cacheRefKeeper.getAndIncrementRef(); try { if (cache == null) { return this.unapply(valueEquivalent); } return cache.getKeys(valueEquivalent); } finally { if (cacheRefKeeper != null && cache != null) { cacheRefKeeper.doneWithIt(); } } }
Source:
public void run(TaskRequest request) { long taskId = request.getTaskId(); tm.begin(() -> { try (SetThreadName threadName = new SetThreadName(request.getTaskName())) { try (TaskLogger taskLogger = callback.newTaskLogger(request)) { TaskContextLogging.enter(LogLevel.DEBUG, taskLogger); try { runningTaskMap.put(taskId, request); try { runWithHeartbeat(request); } finally { runningTaskMap.remove(taskId); } } finally { TaskContextLogging.leave(); } } } return null; }); }

Target:
public void run(TaskRequest request) { long taskId = request.getTaskId(); try (SetThreadName threadName = new SetThreadName(request.getTaskName())) { try (TaskLogger taskLogger = callback.newTaskLogger(request)) { TaskContextLogging.enter(LogLevel.DEBUG, taskLogger); try { runningTaskMap.put(taskId, request); try { runWithHeartbeat(request); } finally { runningTaskMap.remove(taskId); } } finally { TaskContextLogging.leave(); } } } }
Source:
public static boolean contains(Element a, Element b) { maybeInitializeSelectorEngine(); return engine.contains(a, b); }

Target:
public static boolean contains(Element a, Element b) { return getSelectorEngine().contains(a, b); }
Source:
public void close() throws IOException { try { release(resourceId); } catch (LightblueException e) { throw new IOException("Unable to release lock: " + resourceId, e); } }

Target:
public void close() throws IOException { try { release(); } catch (LightblueException e) { throw new IOException("Unable to release lock: " + resourceId, e); } }
Source:
public void autoAllocateArmor() { for (int loc = 0; loc < getJumpship().locations() - 1; loc++) { getJumpship().initializeArmor(0, loc); } int bonusPerFacing = (int) Math.floor(UnitUtil.getSIBonusArmorPoints(getJumpship()) / 6.0); int points = UnitUtil.getArmorPoints(getJumpship(), getJumpship().getLabArmorTonnage()) - bonusPerFacing * 6; int nose = (int)Math.floor(points * 0.22); int foresides = (int)Math.floor(points * 0.18); int aftsides = (int) Math.floor(points * 0.16); int aft = (int)Math.floor(points * 0.10); int remainder = points - nose - foresides * 2 - aftsides * 2 - aft; switch(remainder % 6) { case 1: nose++; break; case 2: foresides++; break; case 3: nose++; foresides++; break; case 4: nose += 2; foresides++; break; case 5: nose += 3; foresides++; break; } getJumpship().initializeArmor(nose + bonusPerFacing, Jumpship.LOC_NOSE); getJumpship().initializeArmor(foresides + bonusPerFacing, Jumpship.LOC_FRS); getJumpship().initializeArmor(foresides + bonusPerFacing, Jumpship.LOC_FLS); getJumpship().initializeArmor(aftsides + bonusPerFacing, Jumpship.LOC_ARS); getJumpship().initializeArmor(aftsides + bonusPerFacing, Jumpship.LOC_ALS); getJumpship().initializeArmor(aft + bonusPerFacing, Jumpship.LOC_AFT); getJumpship().autoSetThresh(); panArmorAllocation.setFromEntity(getJumpship()); refresh.refreshPreview(); refresh.refreshSummary(); refresh.refreshStatus(); }

Target:
public void autoAllocateArmor() { final int ARMOR_FACINGS = getJumpship() instanceof Warship ? getJumpship().locations() - 3 : getJumpship().locations() - 1; for (int loc = 0; loc < ARMOR_FACINGS; loc++) { getJumpship().initializeArmor(0, loc); } int bonusPerFacing = (int) Math.floor(UnitUtil.getSIBonusArmorPoints(getJumpship()) / ARMOR_FACINGS); int points = UnitUtil.getArmorPoints(getJumpship(), getJumpship().getLabArmorTonnage()) - bonusPerFacing * 6; int nose = (int)Math.floor(points * 0.22); int foresides = (int)Math.floor(points * 0.18); int aftsides = (int) Math.floor(points * 0.16); int aft = (int)Math.floor(points * 0.10); int remainder = points - nose - foresides * 2 - aftsides * 2 - aft; switch(remainder % 6) { case 1: nose++; break; case 2: foresides++; break; case 3: nose++; foresides++; break; case 4: nose += 2; foresides++; break; case 5: nose += 3; foresides++; break; } getJumpship().initializeArmor(nose + bonusPerFacing, Jumpship.LOC_NOSE); getJumpship().initializeArmor(foresides + bonusPerFacing, Jumpship.LOC_FRS); getJumpship().initializeArmor(foresides + bonusPerFacing, Jumpship.LOC_FLS); getJumpship().initializeArmor(aftsides + bonusPerFacing, Jumpship.LOC_ARS); getJumpship().initializeArmor(aftsides + bonusPerFacing, Jumpship.LOC_ALS); getJumpship().initializeArmor(aft + bonusPerFacing, Jumpship.LOC_AFT); getJumpship().autoSetThresh(); panArmorAllocation.setFromEntity(getJumpship()); refresh.refreshPreview(); refresh.refreshSummary(); refresh.refreshStatus(); }
Source:
private ValidationResult validateSlaveHasNoNetworks(String slaveName) { for (NetworkAttachment attachment : getAttachmentsToConfigure()) { if (Objects.equals(attachment.getNicName(), slaveName)) { if (attachment.getId() == null) { EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ADDED_TO_BOND_AND_NETWORK_IS_ATTACHED_TO_IT_AT_THE_SAME_TIME; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, slaveName), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, attachment.getNetworkName())); } else { EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, slaveName), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, attachment.getNetworkName())); } } VdsNetworkInterface slaveInterface = existingInterfacesMap.get(slaveName); if ( slaveInterface != null && slaveInterface.getNetworkImplementationDetails() != null && !slaveInterface.getNetworkImplementationDetails().isManaged()) { return new ValidationResult(EngineMessage.NETWORK_INTERFACE_WITH_UNMANAGED_NETWORK_CANNOT_BE_SLAVE, ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, slaveInterface.getNetworkName()), ReplacementUtils.createSetVariableString(VAR_NIC_NAME, slaveName)); } } return ValidationResult.VALID; }

Target:
private ValidationResult validateSlaveHasNoNetworks(String slaveName) { for (NetworkAttachment attachment : getAttachmentsToConfigure()) { if (Objects.equals(attachment.getNicName(), slaveName)) { if (attachment.getId() == null) { EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ADDED_TO_BOND_AND_NETWORK_IS_ATTACHED_TO_IT_AT_THE_SAME_TIME; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, slaveName), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, attachment.getNetworkName())); } else { EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, slaveName), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, attachment.getNetworkName())); } } } for (VdsNetworkInterface iface : existingInterfaces) { if (slaveName.equals(NetworkUtils.stripVlan(iface))) { if (iface.getNetworkImplementationDetails() != null && !iface.getNetworkImplementationDetails().isManaged()) { return new ValidationResult(EngineMessage.NETWORK_INTERFACE_WITH_UNMANAGED_NETWORK_CANNOT_BE_SLAVE, ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, iface.getNetworkName()), ReplacementUtils.createSetVariableString(VAR_NIC_NAME, slaveName)); } } } return ValidationResult.VALID; }
Source:
public synchronized void unregister(PathMatcher path, HttpHandler handler) { mPathMatchers.remove(path); mHttpHandlers.remove(handler); }

Target:
public synchronized boolean unregister(PathMatcher path, HttpHandler handler) { int index = mPathMatchers.indexOf(path); if (index >= 0) { if (handler == mHttpHandlers.get(index)) { mPathMatchers.remove(index); mHttpHandlers.remove(index); return true; } } return false; }
Source:
public static boolean openTask(TaskRepository repository, String taskId, TaskOpenListener listener) { Assert.isNotNull(repository); Assert.isNotNull(taskId); AbstractTask task = (AbstractTask) TasksUiInternal.getTaskList().getTask(repository.getRepositoryUrl(), taskId); if (task == null) { task = TasksUiPlugin.getTaskList().getTaskByKey(repository.getRepositoryUrl(), taskId); } if (task != null) { TaskOpenEvent event = TasksUiInternal.openTask(task, taskId); if (listener != null && event != null) { listener.taskOpened(event); } return event != null; } else { AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind()); if (connectorUi != null) { try { return openRepositoryTaskForId(connectorUi.getConnectorKind(), repository.getRepositoryUrl(), taskId, listener) || openRepositoryTaskForKey(repository, taskId, listener); } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Internal error while opening repository task", e)); } } } return false; }

Target:
public static boolean openTask(TaskRepository repository, String taskId, TaskOpenListener listener) { AbstractTask task = openTaskFromTaskList(repository, taskId, listener); if (task != null) { return openKnownTaskInEditor(task, taskId, listener); } else { AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind()); if (connectorUi != null) { try { return openRepositoryTask(connectorUi.getConnectorKind(), repository.getRepositoryUrl(), taskId, listener); } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Internal error while opening repository task", e)); } } } return false; }
Source:
protected Optional<Boolean> resolveFromString(@Nonnull Value input) { if (nullable && !("true".equalsIgnoreCase(input.asString()) || "false".equalsIgnoreCase(input.asString()))) { return Optional.empty(); } return Optional.of(input.asBoolean()); }

Target:
protected Optional<Boolean> resolveFromString(@Nonnull Value input) { if (nullable && !input.isFilled()) { return Optional.empty(); } return Optional.of(input.asBoolean()); }
Source:
public void loadTrace(ITmfTrace trace) { cancelUpdate(); super.loadTrace(trace); initializeDataProvider(); }

Target:
public void loadTrace(ITmfTrace trace) { super.loadTrace(trace); initializeDataProvider(); }
Source:
private static AuditSourceIdentificationType createAuditSourceIdentification(String communityId, String communityName) { AuditSourceIdentificationType auditSrcId = new AuditSourceIdentificationType(); if (communityId != null) { if (communityId.startsWith(AuditTransformsConstants.HOME_COMMUNITY_ID_PREFIX)) { auditSrcId.setAuditSourceID(communityId); } else { auditSrcId.setAuditSourceID(AuditTransformsConstants.HOME_COMMUNITY_ID_PREFIX + communityId); } } if (communityName != null) { auditSrcId.setAuditEnterpriseSiteID(communityName); } return auditSrcId; }

Target:
private static AuditSourceIdentificationType createAuditSourceIdentification(String communityId, String communityName) { AuditSourceIdentificationType auditSrcId = new AuditSourceIdentificationType(); if (communityId != null) { auditSrcId.setAuditSourceID(HomeCommunityMap.getHomeCommunityIdWithPrefix(communityId)); } if (communityName != null) { auditSrcId.setAuditEnterpriseSiteID(communityName); } return auditSrcId; }
Source:
public void step(int step, Closure closure) { if (compareEqual(step, 0)) { if (compareNotEqual(from, to)) { throw new GroovyRuntimeException("Infinite loop detected due to step size of 0"); } return; } final Iterator<Comparable> iter = new StepIterator(this, step); while (iter.hasNext()) { closure.call(iter.next()); } }

Target:
public void step(int step, Closure closure) { if (step == 0 && compareEqual(from, to)) { return; } for (Iterator<Comparable> iter = new LazySteppingIterator(this, step); iter.hasNext(); ) { closure.call(iter.next()); } }