auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
ReflogEntry readLogEntry() { if ((valueType & VALUE_TYPE_MASK) == LOG_NONE) { return null; } ObjectId oldId; ObjectId newId; PersonIdent who; String msg; if ((valueType & VALUE_TYPE_MASK) == LOG_DATA) { logNewIdPtr = ptr; oldId = readValueId(); newId = readValueId(); long timeSecs = readVarint64(); logCommitterPtr = ptr; who = readPersonIdent(timeSecs); logMessagePtr = ptr; msg = readValueString(); } else if ((valueType & LOG_CHAINED) == LOG_CHAINED) { newId = ObjectId.fromRaw(buf, logNewIdPtr); logNewIdPtr = ptr; oldId = readValueId(); long timeSecs = readVarint64(); if ((valueType & LOG_SAME_IDENT) == LOG_SAME_IDENT) { int savePtr = ptr; ptr = logCommitterPtr; who = readPersonIdent(timeSecs); ptr = savePtr; } else { who = readPersonIdent(timeSecs); } if ((valueType & LOG_SAME_MESSAGE) == LOG_SAME_MESSAGE) { int savePtr = ptr; ptr = logMessagePtr; msg = readValueString(); ptr = savePtr; } else { msg = readValueString(); } } else { throw new IllegalStateException(); } return new ReflogEntry() { @Override public ObjectId getOldId() { return oldId; } @Override public ObjectId getNewId() { return newId; } @Override public PersonIdent getWho() { return who; } @Override public String getComment() { return msg; } @Override public CheckoutEntry parseCheckout() { return null; } }; }

Target:
ReflogEntry readLogEntry() { if ((valueType & VALUE_TYPE_MASK) == LOG_NONE) { return null; } ObjectId oldId = readValueId(); ObjectId newId = readValueId(); PersonIdent who = readPersonIdent(); String msg = readValueString(); return new ReflogEntry() { @Override public ObjectId getOldId() { return oldId; } @Override public ObjectId getNewId() { return newId; } @Override public PersonIdent getWho() { return who; } @Override public String getComment() { return msg; } @Override public CheckoutEntry parseCheckout() { return null; } }; }
Source:
private static void processDilutions(String dilutionMolarity, Library library, Pool p, User u) throws Exception { if (!isStringEmptyOrNull(dilutionMolarity)) { try { LibraryDilution ldi = new LibraryDilution(); ldi.setLibrary(library); ldi.setSecurityProfile(library.getSecurityProfile()); ldi.setConcentration(Double.valueOf(dilutionMolarity)); ldi.setCreationDate(new Date()); ldi.setDilutionCreator(u.getLoginName()); if (!library.getLibraryDilutions().contains(ldi)) { library.addDilution(ldi); log.info("Added library dilution: {}", ldi.toString()); } if (p != null) { p.getPoolDilutions().add(new PoolDilution(p, PoolableElementView.fromDilution(ldi))); log.info("Added library dilution to pool: {}", p.toString()); } } catch (NumberFormatException nfe) { throw new InputFormException("Supplied LibraryDilution concentration for library '" + library.getAlias() + "' (" + library.getSample().getAlias() + ") is invalid", nfe); } } }

Target:
private static void processDilutions(String dilutionMolarity, Library library, Pool p, User u) throws Exception { if (!isStringEmptyOrNull(dilutionMolarity)) { try { LibraryDilution ldi = new LibraryDilution(); ldi.setLibrary(library); ldi.setSecurityProfile(library.getSecurityProfile()); ldi.setConcentration(Double.valueOf(dilutionMolarity)); ldi.setCreationDate(new Date()); ldi.setDilutionCreator(u.getLoginName()); if (!library.getLibraryDilutions().contains(ldi)) { library.addDilution(ldi); log.info("Added library dilution: {}", ldi); } if (p != null) { p.getPoolDilutions().add(new PoolDilution(p, PoolableElementView.fromDilution(ldi))); log.info("Added library dilution to pool: {}", p); } } catch (NumberFormatException nfe) { throw new InputFormException("Supplied LibraryDilution concentration for library '" + library.getAlias() + "' (" + library.getSample().getAlias() + ") is invalid", nfe); } } }
Source:
public BeanCollection<E> getShallowCopy() { BeanList<E> copy = new BeanList<>(new CopyOnFirstWriteList<>(list)); copy.setFromOriginal(copy); return copy; }

Target:
public BeanCollection<E> getShallowCopy() { BeanList<E> copy = new BeanList<>(new CopyOnFirstWriteList<>(list)); copy.setFromOriginal(this); return copy; }
Source:
public static StubCalculation ofIborInterpolatedRate(IborIndex index1, IborIndex index2) { ArgChecker.notNull(index1, "startIndex"); ArgChecker.notNull(index2, "endIndex"); return new StubCalculation(null, index1, index2); }

Target:
public static StubCalculation ofIborInterpolatedRate(IborIndex index1, IborIndex index2) { ArgChecker.notNull(index1, "index1"); ArgChecker.notNull(index2, "index2"); return new StubCalculation(null, index1, index2); }
Source:
@Test public void testDateCanCompare() { final String sql = "select a.v1, a.v2, a.v3\n" + "from (select \"sqlDate\" v1, \"sqlTime\" v2, \"sqlTimestamp\" v3\n" + " from \"s\".\"everyTypes\" " + " group by \"sqlDate\", \"sqlTime\", \"sqlTimestamp\") a," + " (select \"sqlDate\" v1, \"sqlTime\" v2, \"sqlTimestamp\" v3\n" + " from \"s\".\"everyTypes\"\n" + " group by \"sqlDate\", \"sqlTime\", \"sqlTimestamp\") b\n" + "where a.v1 >= b.v1 and a.v2 >= b.v2 and a.v3 >= b.v3\n" + "group by a.v1, a.v2, a.v3"; CalciteAssert.that() .withSchema("s", CATCHALL) .query(sql) .returnsUnordered("V1=1970-01-01; V2=00:00:00; V3=1970-01-01 00:00:00"); }

Target:
@Test public void testDateCanCompare() { final String sql = "select a.v\n" + "from (select \"sqlDate\" v\n" + " from \"s\".\"everyTypes\" " + " group by \"sqlDate\") a," + " (select \"sqlDate\" v\n" + " from \"s\".\"everyTypes\"\n" + " group by \"sqlDate\") b\n" + "where a.v >= b.v\n" + "group by a.v"; CalciteAssert.that() .withSchema("s", CATCHALL) .query(sql) .returnsUnordered("V=1970-01-01"); }
Source:
private void handleNotificationData(Intent intent) { JSONObject json = new JSONObject(); Bundle extras = intent.getExtras(); if (extras != null) { Set<String> keys = extras.keySet(); for (String key : keys) { try { json.put(key, JSONObject.wrap(extras.get(key))); } catch (JSONException e) { } } } this.webView.getEngine().evaluateJavascript("window.dispatchEvent(new CustomEvent('CDVnotificationClicked', { detail: "+ json +"}));", null); }

Target:
private void handleNotificationData(Intent intent) { JSONObject json = new JSONObject(); Bundle extras = intent.getExtras(); if (extras != null) { Set<String> keys = extras.keySet(); for (String key : keys) { try { json.put(key, JSONObject.wrap(extras.get(key))); } catch (JSONException e) { } } } this.lastPushIntent = null; cordova.getActivity().runOnUiThread(new Runnable() { public void run() { webView.getEngine().evaluateJavascript("window.dispatchEvent(new CustomEvent('CDVnotificationClicked', { detail: "+ json +"}));", null); } }); }
Source:
void completePlayerSetup(boolean asked) { if(asked) { skinLayout = (OoyalaSkinLayout)findViewById(R.id.ooyalaPlayer); PlayerDomain domain1 = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, domain1, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); @SuppressWarnings("unused") OoyalaIMAManager imaManager = new OoyalaIMAManager(player, skinLayout); if (player.setEmbedCode(embedCode)) { } } }

Target:
void completePlayerSetup(boolean asked) { if(asked) { skinLayout = (OoyalaSkinLayout)findViewById(R.id.ooyalaPlayer); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); @SuppressWarnings("unused") OoyalaIMAManager imaManager = new OoyalaIMAManager(player, skinLayout); if (player.setEmbedCode(embedCode)) { } } }
Source:
public void write(JsonGenerator jg, DocumentModel document) throws IOException { if (!document.isFolder()) { jg.writeBooleanField(NAME, false); return; } try (SessionWrapper wrapper = ctx.getSession(document)) { FacetFilter facetFilter = new FacetFilter(Arrays.asList(FacetNames.FOLDERISH), Arrays.asList(FacetNames.HIDDEN_IN_NAVIGATION)); LifeCycleFilter lfFilter = new LifeCycleFilter(LifeCycleConstants.DELETED_STATE, false); Filter filters = new CompoundFilter(facetFilter, lfFilter); DocumentModelList children = wrapper.getSession().query( "SELECT * FROM Document WHERE ecm:parentId = " + NXQL.escapeString(document.getId()), filters, 1); jg.writeBooleanField(NAME, !children.isEmpty()); } }

Target:
public void write(JsonGenerator jg, DocumentModel document) throws IOException { if (!document.isFolder()) { jg.writeBooleanField(NAME, false); return; } try (SessionWrapper wrapper = ctx.getSession(document)) { String fetchFolderishChildQuery = "SELECT * FROM Document WHERE ecm:mixinType = 'Folderish'" + " AND ecm:mixinType != 'HiddenInNavigation' AND ecm:currentLifeCycleState != 'deleted'" + " AND ecm:parentId = " + NXQL.escapeString(document.getId()); DocumentModelList children = wrapper.getSession().query(fetchFolderishChildQuery, 1); jg.writeBooleanField(NAME, !children.isEmpty()); } }
Source:
public static int hashCode( AnyValue[] array ) { int len = array.length; switch ( len ) { case 0: return 42; case 1: return hashCode( array[0] ); case 2: return 31 * hashCode( array[0] ) + hashCode( array[1] ); case 3: return (31 * hashCode( array[0] ) + hashCode( array[1] )) * 31 + hashCode( array[2] ); default: return len * (31 * hashCode( array[0] ) + hashCode( array[len / 2] ) * 31 + hashCode( array[len - 1] )); } }

Target:
public static int hashCode( AnyValue[] array ) { return Arrays.hashCode( array ); }
Source:
private static void checkLengthIs2(int actualLength) { assert actualLength == 2 : "The value of a GeoPoint must be a double array with 2 items, not " + actualLength; }

Target:
private static void checkLengthIs2(int actualLength) { if (actualLength != 2) { throw new IllegalArgumentException( "The value of a GeoPoint must be a double array with 2 items, not " + actualLength); } }
Source:
public void setUp() throws Exception { super.setUp(); loadBalancer = createStockLoadBalancer(); PoolResName = FuncTest.isCompatApiEnabled() ? "Pool" : "pool"; HmResName = FuncTest.isCompatApiEnabled() ? "HealthMonitor" : "health monitor"; }

Target:
public void setUp() throws Exception { super.setUp(); loadBalancer = createStockLoadBalancer(); }
Source:
@Override public Object evaluate(List args) throws XPathFunctionException { String result = ""; if (args.size() == 1 && args.get(0) instanceof ArrayList) { ArrayList nodeList = (ArrayList) args.get(0); for (int i = 0; i < nodeList.size(); i++) { try { String item = (((Element) nodeList.get(i))).getTextContent(); result = result.concat(item); } catch (DOMException e) { throw new HumanTaskRuntimeException( "Invalid arguments:" + args.get(0) + ", for function concat()", e); } catch (ClassCastException e) { throw new HumanTaskRuntimeException( "Invalid arguments:" + args.get(0) + " , for function concat()"); } } } else { throw new HumanTaskRuntimeException("Invalid arguments:" + args + " , for function concat()"); } return result; }

Target:
public Object evaluate(List args) throws XPathFunctionException { String result = ""; if (args.size() == 1 && args.get(0) instanceof ArrayList) { ArrayList nodeList = (ArrayList) args.get(0); for (int i = 0; i < nodeList.size(); i++) { try { String item = (((Element) nodeList.get(i))).getTextContent(); result = result.concat(item); } catch (DOMException e) { throw new HumanTaskRuntimeException( "Invalid arguments:" + args.get(0) + ", for function concat()", e); } catch (ClassCastException e) { throw new HumanTaskRuntimeException( "Invalid arguments:" + args.get(0) + " , for function concat()",e); } } } else { throw new HumanTaskRuntimeException("Invalid arguments:" + args + " , for function concat()"); } return result; }
Source:
void verifySubObservationsInputVariablesInAggregateFunction(final int variableId, final int studyId, final int datasetId, final Map<Integer, Integer> inputVariableDatasetMap) { Integer plotDatasetId = this.datasetService.getDatasets(studyId, new HashSet<>(Arrays.asList(DatasetTypeEnum.PLOT_DATA.getId()))).get(0).getDatasetId(); if(!plotDatasetId.equals(datasetId)) { return; } final Optional<FormulaDto> formulaOptional = this.formulaService.getByTargetId(variableId); if (formulaOptional.isPresent()) { final List<DatasetDTO> subobsDatasets = this.datasetService.getDatasets(studyId, new HashSet<>(Arrays.asList(DatasetTypeEnum.PLANT_SUBOBSERVATIONS.getId(), DatasetTypeEnum.QUADRAT_SUBOBSERVATIONS.getId(), DatasetTypeEnum.TIME_SERIES_SUBOBSERVATIONS.getId(), DatasetTypeEnum.CUSTOM_SUBOBSERVATIONS.getId()))); final List<Integer> subobservationIds = new ArrayList<>(); for(DatasetDTO dataset: subobsDatasets) { subobservationIds.add(dataset.getDatasetId()); } for (final FormulaVariable formulaVariable : formulaOptional.get().getInputs()) { if(subobservationIds.contains(inputVariableDatasetMap.get(formulaVariable.getId()))) { validateSubobservationInputVariable(formulaOptional, formulaVariable); } } } }

Target:
void verifySubObservationsInputVariablesInAggregateFunction(final int variableId, final int studyId, final int datasetId, final Map<Integer, Integer> inputVariableDatasetMap) { final Integer plotDatasetId = this.datasetService.getDatasets(studyId, new HashSet<>(Arrays.asList(DatasetTypeEnum.PLOT_DATA.getId()))).get(0).getDatasetId(); if (!plotDatasetId.equals(datasetId)) { return; } final Optional<FormulaDto> formulaOptional = this.formulaService.getByTargetId(variableId); if (formulaOptional.isPresent()) { final List<DatasetDTO> subobsDatasets = this.datasetService.getDatasets(studyId, new HashSet<>(this.datasetTypeService.getSubObservationDatasetTypeIds())); final List<Integer> subobservationIds = subobsDatasets.stream().map(DatasetDTO::getDatasetId).collect(Collectors.toList()); for (final FormulaVariable formulaVariable : formulaOptional.get().getInputs()) { if (subobservationIds.contains(inputVariableDatasetMap.get(formulaVariable.getId()))) { this.validateSubobservationInputVariable(formulaOptional, formulaVariable); } } } }
Source:
private void limitEntriesCount() { int limit = Integer.MAX_VALUE; if (fMemento.getString(LogView.P_USE_LIMIT).equals("true")) { limit = fMemento.getInteger(LogView.P_LOG_LIMIT).intValue(); } int entriesCount = getEntriesCount(); if (entriesCount <= limit) { return; } Comparator<AbstractEntry> dateComparator = (o1, o2) -> { if (o1 instanceof LogEntry && o2 instanceof LogEntry) { Date l1 = ((LogEntry)o1).getDate(); Date l2 = ((LogEntry)o2).getDate(); if ((l1 != null) && (l2 != null)) { return l1.before(l2) ? -1 : 1; } else if ((l1 == null) && (l2 == null)) { return 0; } else return (l1 == null) ? -1 : 1; } return 0; }; synchronized (elements) { if (fMemento.getInteger(P_GROUP_BY).intValue() == GROUP_BY_NONE) { elements.subList(0, elements.size() - limit).clear(); } else { List<AbstractEntry> copy = new ArrayList<>(entriesCount); for (AbstractEntry group : elements) { List<AbstractEntry> children = Arrays.asList(group.getChildren(group)); copy.addAll(children); } Collections.sort(copy, dateComparator); List<AbstractEntry> toRemove = copy.subList(0, copy.size() - limit); for (AbstractEntry group : elements) { group.removeChildren(toRemove); } } } }

Target:
private void limitEntriesCount() { int limit = Integer.MAX_VALUE; if (fMemento.getString(LogView.P_USE_LIMIT).equals("true")) { limit = fMemento.getInteger(LogView.P_LOG_LIMIT).intValue(); } int entriesCount = getEntriesCount(); if (entriesCount <= limit) { return; } Comparator<AbstractEntry> dateComparator = Comparator.comparing( entry -> entry instanceof LogEntry ? ((LogEntry) entry).getDate() : null, Comparator.nullsLast((d1, d2) -> d1.before(d2) ? -1 : 1)); synchronized (elements) { if (fMemento.getInteger(P_GROUP_BY).intValue() == GROUP_BY_NONE) { elements.subList(0, elements.size() - limit).clear(); } else { List<AbstractEntry> copy = new ArrayList<>(entriesCount); for (AbstractEntry group : elements) { List<AbstractEntry> children = Arrays.asList(group.getChildren(group)); copy.addAll(children); } Collections.sort(copy, dateComparator); List<AbstractEntry> toRemove = copy.subList(0, copy.size() - limit); for (AbstractEntry group : elements) { group.removeChildren(toRemove); } } } }
Source:
protected void finalize() throws Throwable { super.finalize(); if (managementRealm != null || permissionRealm != null) { RealmLog.error("PermissionManager was not correctly closed before being finalized."); close(); } }

Target:
protected void finalize() throws Throwable { if (!closed) { RealmLog.warn("PermissionManager was not correctly closed before being finalized."); } super.finalize(); }
Source:
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { if (obj == null) { throw new NamingException("Invalid JNDI object reference"); } Class<ConfigurationObject> clazz = ConfigurationObject.class; ConfigurationObject config = clazz.newInstance(); Reference ref = (Reference) obj; Enumeration<RefAddr> props = ref.getAll(); while (props.hasMoreElements()) { RefAddr addr = props.nextElement(); String propName = addr.getType(); String propValue = addr.getContent().toString(); Field[] fields = ConfigurationObject.class.getFields(); for (Field field : fields) { if (propName.equals(field.getName())) { Class<?> type = field.getType(); if (mapper.containsKey(type)) { type = mapper.get(type); } Object value = null; if (type.isAssignableFrom(Long.class)) { try { value = Long.valueOf(propValue); } catch (NumberFormatException e) { throw new NamingException(field.getName() + " is not an long value"); } } else if (type.isAssignableFrom(Integer.class)) { try { value = Integer.parseInt(propValue); } catch (NumberFormatException e) { throw new NamingException(field.getName() + " is not an integer value"); } } else if (type.isAssignableFrom(Boolean.class)) { if ("true".equalsIgnoreCase(propValue)) { value = true; } else if ("false".equalsIgnoreCase(propValue)) { value = false; } else { throw new NamingException(field.getName() + " is not a boolean value"); } } else if (type.isAssignableFrom(String.class)) { value = propValue; } if (value != null) { field.set(config, value); } } } } return config; }

Target:
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { if (obj == null) { throw new NamingException("Invalid JNDI object reference"); } Class<ConfigurationObject> clazz = ConfigurationObject.class; ConfigurationObject config = clazz.newInstance(); Reference ref = (Reference) obj; Enumeration<RefAddr> props = ref.getAll(); while (props.hasMoreElements()) { RefAddr addr = props.nextElement(); String propName = addr.getType(); String propValue = addr.getContent().toString(); Field[] fields = ConfigurationObject.class.getFields(); for (Field field : fields) { checkForValue(config, propName, propValue, field); } } return config; }
Source:
private static ImmutableSet<Flavor> getInvalidFlavors(Flavored flavored, BuildTarget target) { ImmutableSet.Builder<Flavor> builder = ImmutableSet.builder(); for (Flavor flavor : target.getFlavors()) { if (!flavored.hasFlavors(ImmutableSet.of(flavor))) { builder.add(flavor); } } return builder.build(); }

Target:
private static ImmutableSet<Flavor> getInvalidFlavors(Flavored flavored, BuildTarget target) { return target .getFlavors() .stream() .filter(flavor -> !flavored.hasFlavors(ImmutableSet.of(flavor))) .collect(ImmutableSet.toImmutableSet()); }
Source:
public static ArrayList<Guid> getGuidListFromStringArray(List<String> strings) { ArrayList<Guid> guidList = new ArrayList<Guid>(); if (strings != null && !strings.isEmpty()) { for (String guidString : strings) { guidList.add(Guid.createGuidFromString(guidString)); } } return guidList; }

Target:
public static ArrayList<Guid> getGuidListFromStringArray(List<String> strings) { ArrayList<Guid> guidList = new ArrayList<Guid>(); if (CollectionUtils.isEmpty(strings)) { for (String guidString : strings) { guidList.add(Guid.createGuidFromString(guidString)); } } return guidList; }
Source:
private static SampleTissueDto asTissueSampleDto(SampleTissue from) { SampleTissueDto dto = new SampleTissueDto(); dto.setPassageNumber(from.getPassageNumber()); dto.setTimesReceived(from.getTimesReceived()); dto.setExternalInstituteIdentifier(from.getExternalInstituteIdentifier()); dto.setRegion(from.getRegion()); dto.setTubeNumber(from.getTubeNumber()); if (from.getLab() != null) { dto.setLabId(from.getLab().getId()); } if (from.getTissueOrigin() != null) { dto.setTissueOriginId(from.getTissueOrigin().getId()); } if (from.getTissueType() != null) { dto.setTissueTypeId(from.getTissueType().getId()); } return dto; }

Target:
private static SampleTissueDto asTissueSampleDto(SampleTissue from) { SampleTissueDto dto = new SampleTissueDto(); dto.setPassageNumber(from.getPassageNumber()); dto.setTimesReceived(from.getTimesReceived()); dto.setExternalInstituteIdentifier(from.getExternalInstituteIdentifier()); dto.setRegion(from.getRegion()); dto.setTubeNumber(from.getTubeNumber()); if (from.getLab() != null) { dto.setLabId(from.getLab().getId()); } if (from.getTissueOrigin() != null) { dto.setTissueOriginId(from.getTissueOrigin().getId()); } if (from.getTissueType() != null) { dto.setTissueTypeId(from.getTissueType().getId()); } if (from.getTissueMaterial() != null) { dto.setTissueMaterialId(from.getTissueMaterial().getId()); } return dto; }
Source:
private String getSenderConfiguration() { try { Field reporterField = this.tracer.getClass().getDeclaredField("reporter"); reporterField.setAccessible(true); Object reporter = reporterField.get(this.tracer); if ("RemoteReporter".equals(reporter.getClass().getSimpleName())) { Field senderField = reporter.getClass().getDeclaredField("sender"); senderField.setAccessible(true); Object sender = senderField.get(reporter); if ("UdpSender".equals(sender.getClass().getSimpleName())) { Field transportField = sender.getClass().getDeclaredField("udpTransport"); transportField.setAccessible(true); Object transport = transportField.get(sender); if ("ThriftUdpTransport".equals(transport.getClass().getSimpleName())) { Field socketField = transport.getClass().getDeclaredField("socket"); socketField.setAccessible(true); DatagramSocket socket = (DatagramSocket) socketField.get(transport); return "sender-binding=" + NetworkUtils.formatIPAddressForURI(socket.getInetAddress()) + ":" + socket.getPort(); } } } } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) { ex.printStackTrace(); } return ""; }

Target:
private String getSenderConfiguration() { try { Field reporterField = this.tracer.getClass().getDeclaredField("reporter"); reporterField.setAccessible(true); Object reporter = reporterField.get(this.tracer); if (checkClass(reporter, "RemoteReporter")) { Field senderField = reporter.getClass().getDeclaredField("sender"); senderField.setAccessible(true); Object sender = senderField.get(reporter); if (checkClass(sender, "UdpSender")) { Field transportField = sender.getClass().getDeclaredField("udpTransport"); transportField.setAccessible(true); Object transport = transportField.get(sender); if (checkClass(transport, "ThriftUdpTransport")) { Field socketField = transport.getClass().getDeclaredField("socket"); socketField.setAccessible(true); DatagramSocket socket = (DatagramSocket) socketField.get(transport); return "sender-binding=" + NetworkUtils.formatIPAddressForURI(socket.getInetAddress()) + ":" + socket.getPort(); } } } } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) { throw new RuntimeException("Error getting network configuration details", ex); } return ""; }
Source:
protected final String doIt() throws Exception { final I_M_ReceiptSchedule receiptSchedule = getM_ReceiptSchedule(); final IMutableHUContext huContextInitial = Services.get(IHUContextFactory.class).createMutableHUContextForProcessing(getCtx(), ClientAndOrgId.ofClientAndOrg(receiptSchedule.getAD_Client_ID(), receiptSchedule.getAD_Org_ID())); final ReceiptScheduleHUGenerator huGenerator = ReceiptScheduleHUGenerator.newInstance(huContextInitial) .addM_ReceiptSchedule(receiptSchedule) .setUpdateReceiptScheduleDefaultConfiguration(isUpdateReceiptScheduleDefaultConfiguration()); final I_M_HU_LUTU_Configuration lutuConfigurationOrig = getCurrentLUTUConfiguration(receiptSchedule); final I_M_HU_LUTU_Configuration lutuConfiguration = createM_HU_LUTU_Configuration(lutuConfigurationOrig); Services.get(ILUTUConfigurationFactory.class).save(lutuConfiguration); huGenerator.setM_HU_LUTU_Configuration(lutuConfiguration); final ILUTUProducerAllocationDestination lutuProducer = huGenerator.getLUTUProducerAllocationDestination(); final Quantity qtyCUsTotal = lutuProducer.calculateTotalQtyCU(); if (qtyCUsTotal.isInfinite()) { throw new TerminalException("LU/TU configuration is resulting to infinite quantity: " + lutuConfiguration); } huGenerator.setQtyToAllocateTarget(qtyCUsTotal); final List<I_M_HU> hus = huGenerator.generateWithinOwnTransaction(); hus.forEach(hu -> { setAttributeBBD(hu, receiptSchedule); setAttributeLotNumber(hu); }); openHUsToReceive(hus); return MSG_OK; }

Target:
protected final String doIt() throws Exception { final I_M_ReceiptSchedule receiptSchedule = getM_ReceiptSchedule(); final IMutableHUContext huContextInitial = Services.get(IHUContextFactory.class).createMutableHUContextForProcessing(getCtx(), ClientAndOrgId.ofClientAndOrg(receiptSchedule.getAD_Client_ID(), receiptSchedule.getAD_Org_ID())); final ReceiptScheduleHUGenerator huGenerator = ReceiptScheduleHUGenerator.newInstance(huContextInitial) .addM_ReceiptSchedule(receiptSchedule) .setUpdateReceiptScheduleDefaultConfiguration(isUpdateReceiptScheduleDefaultConfiguration()); final I_M_HU_LUTU_Configuration lutuConfigurationOrig = getCurrentLUTUConfiguration(receiptSchedule); final I_M_HU_LUTU_Configuration lutuConfiguration = createM_HU_LUTU_Configuration(lutuConfigurationOrig); Services.get(ILUTUConfigurationFactory.class).save(lutuConfiguration); huGenerator.setM_HU_LUTU_Configuration(lutuConfiguration); final ILUTUProducerAllocationDestination lutuProducer = huGenerator.getLUTUProducerAllocationDestination(); final Quantity qtyCUsTotal = lutuProducer.calculateTotalQtyCU(); if (qtyCUsTotal.isInfinite()) { throw new TerminalException("LU/TU configuration is resulting to infinite quantity: " + lutuConfiguration); } huGenerator.setQtyToAllocateTarget(qtyCUsTotal); final List<I_M_HU> hus = huGenerator.generateWithinOwnTransaction(); hus.forEach(hu -> { updateAttributes(hu, receiptSchedule); }); openHUsToReceive(hus); return MSG_OK; }
Source:
public void dispose() { super.dispose(); if (this.tabFolder != null) { this.tabFolder.dispose(); this.tabFolder = null; } tabItems.clear(); for (ModelExplorerTabDescriptor tabDescriptor : ModelExplorerTabRegistry.getRegisteredExtensions()) { IModelExplorerTabExtension tab = tabDescriptor.getTabExtension(); if (tab != null) { tab.dispose(); } } if (permissionAuthoritySessionManagerListener != null) { SessionManager.INSTANCE.removeSessionsListener(permissionAuthoritySessionManagerListener); permissionAuthoritySessionManagerListener = null; } }

Target:
public void dispose() { super.dispose(); if (this.tabFolder != null) { this.tabFolder.dispose(); this.tabFolder = null; } tabItems.clear(); for (ModelExplorerTabDescriptor tabDescriptor : ModelExplorerTabRegistry.getRegisteredExtensions()) { IModelExplorerTabExtension tab = tabDescriptor.getTabExtension(); if (tab != null) { tab.dispose(); } } lockDecorationUpdater.unregister(); }
Source:
public Analyzer wrapNormalizer(String name, Analyzer normalizer) { return new HibernateSearchNormalizerWrapper( normalizer, name ); }

Target:
public Analyzer wrapNormalizer(String name, Analyzer normalizer) { return new HibernateSearchNormalizerWrapper( name, normalizer ); }
Source:
public void unmarksResidueIfClientGoesAway() { List<Integer> firstResponse = allocator.getRelevantModuli(KEY); time.addAndGet(5_000_000L); allocator.loadingCache.cleanUp(); allocator.getRelevantModuli(KEY); verify(generator, times(2)).getAndMarkResidue(); verify(generator, times(1)).unmarkResidue(Iterables.getOnlyElement(firstResponse)); verifyNoMoreInteractions(generator); }

Target:
public void unmarksResidueIfClientGoesAway() { List<Integer> firstResponse = allocator.getRelevantModuli(KEY); time.addAndGet(5_000_000L); allocator.getRelevantModuli(KEY); scheduler.runUntilIdle(); verify(generator, times(2)).getAndMarkResidue(); verify(generator, times(1)).unmarkResidue(Iterables.getOnlyElement(firstResponse)); verifyNoMoreInteractions(generator); }
Source:
public Object returnValue() { throw new SlimError(SlimError.extractSlimMessage(conversionException.getMessage())+ "\nTryed to invoke: " + methodName, conversionException, "", true); }

Target:
public Object returnValue() { throw new SlimError(SlimError.extractSlimMessage(conversionException.getMessage())+ "\nTried to invoke: " + methodName, conversionException, "", true); }
Source:
private static boolean publishFiles(Collection collection, CollectionReader collectionReader, String encryptionPassword, String userEmail) throws IOException { boolean filesPublished = false; try { collection.description.publishStartDate = new Date(); SendFilteredCollectionFiles(collection, collectionReader, encryptionPassword); filesPublished = CommitPublish(collection, userEmail, encryptionPassword); } catch (IOException e) { SlackNotification.alarm(String.format("Exception publishing collection: %s: %s", collection.description.name, e.getMessage())); logError(e, "exception publishing collection").collectionName(collection).log(); Map<String, String> publishTransactionIds = collection.description.publishTransactionIds; if (publishTransactionIds != null && publishTransactionIds.size() > 0) { logInfo("attempting rollback of collection publishing transaction").collectionName(collection).log(); rollbackPublish(publishTransactionIds, encryptionPassword); } } finally { collection.save(); } return filesPublished; }

Target:
private static boolean publishFiles(Collection collection, CollectionReader collectionReader, String encryptionPassword, String userEmail) throws IOException { boolean filesPublished = false; try { collection.getDescription().publishStartDate = new Date(); SendFilteredCollectionFiles(collection, collectionReader, encryptionPassword); filesPublished = CommitPublish(collection, userEmail, encryptionPassword); } catch (IOException e) { SlackNotification.alarm(String.format("Exception publishing collection: %s: %s", collection.getDescription().getName(), e.getMessage())); logError(e, "exception publishing collection").collectionName(collection).log(); Map<String, String> publishTransactionIds = collection.getDescription().publishTransactionIds; if (publishTransactionIds != null && publishTransactionIds.size() > 0) { logInfo("attempting rollback of collection publishing transaction") .collectionName(collection) .addParameter("transaction_ids", publishTransactionIds) .log(); rollbackPublish(publishTransactionIds, encryptionPassword); } } finally { collection.save(); } return filesPublished; }
Source:
private PopupContextTreeMenu getPopupContextTreeMenuDelete() { if (popupContextTreeMenuDelete == null) { popupContextTreeMenuDelete = new PopupContextTreeMenu(); popupContextTreeMenuDelete.setAction( new DeleteContextAction() { private static final long serialVersionUID = 1L; @Override protected ArrayList<Context> getContexts() { ArrayList<Context> contexts = new ArrayList<Context>(); for (Integer id : popupContextTreeMenuDelete.getContextIds()) { contexts.add(Model.getSingleton().getSession().getContext(id)); } return contexts; } }); popupContextTreeMenuDelete.setText(Constant.messages.getString("context.delete.popup")); } return popupContextTreeMenuDelete; }

Target:
private PopupContextTreeMenu getPopupContextTreeMenuDelete() { if (popupContextTreeMenuDelete == null) { popupContextTreeMenuDelete = new PopupContextTreeMenu(); popupContextTreeMenuDelete.setAction( new DeleteContextAction() { private static final long serialVersionUID = 1L; @Override protected List<Context> getContexts() { List<Context> contexts = new ArrayList<Context>(); for (Integer id : popupContextTreeMenuDelete.getContextIds()) { contexts.add(Model.getSingleton().getSession().getContext(id)); } return contexts; } @Override protected Context getContext() { return Model.getSingleton() .getSession() .getContext(popupContextTreeMenuDelete.getContextId()); } }); popupContextTreeMenuDelete.setText(Constant.messages.getString("context.delete.popup")); } return popupContextTreeMenuDelete; }
Source:
private void proceedGuaranteedMemoryCheck() { for (VmInternalData vmInternalData : _runningVms.values()) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); VmStatistics vmStatistics = vmInternalData.getVmStatistics(); if (vmStatistics.getCurrentMemory() != null && vmStatistics.getCurrentMemory() > 0 && savedVm.getMinAllocatedMem() > vmStatistics.getCurrentMemory() / TO_MEGA_BYTES) { AuditLogableBase auditLogable = new AuditLogableBase(); auditLogable.addCustomValue("VmName", savedVm.getName()); auditLogable.addCustomValue("VdsName", this._vds.getName()); auditLogable.addCustomValue("MemGuaranteed", String.valueOf(savedVm.getMinAllocatedMem())); auditLogable.addCustomValue("MemActual", vmStatistics.getCurrentMemory().toString()); auditLog(auditLogable, AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE); } } }

Target:
private void proceedGuaranteedMemoryCheck() { for (VmInternalData vmInternalData : _runningVms.values()) { VM savedVm = _vmDict.get(vmInternalData.getVmDynamic().getId()); VmStatistics vmStatistics = vmInternalData.getVmStatistics(); if (vmStatistics.getCurrentMemory() != null && vmStatistics.getCurrentMemory() > 0 && savedVm.getMinAllocatedMem() > vmStatistics.getCurrentMemory() / TO_MEGA_BYTES) { AuditLogableBase auditLogable = new AuditLogableBase(); auditLogable.addCustomValue("VmName", savedVm.getName()); auditLogable.addCustomValue("VdsName", this._vds.getName()); auditLogable.addCustomValue("MemGuaranteed", String.valueOf(savedVm.getMinAllocatedMem())); auditLogable.addCustomValue("MemActual", Long.toString((vmStatistics.getCurrentMemory() / TO_MEGA_BYTES))); auditLog(auditLogable, AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE); } } }
Source:
public String createMachine( TargetHandlerParameters parameters ) throws TargetException { if(ipTable == null && parameters != null && parameters.getTargetProperties() != null) { String ips = parameters.getTargetProperties().get(IP_ADDRESSES); if(ips != null) { String iplist[] = ips.trim().split("\\s*,\\s*"); for(String ip : iplist) { if(ipTable == null) ipTable = new HashMap<>(); ipTable.put(ip, false); } } } String machineId = parameters.getScopedInstancePath() + " (" + TARGET_ID + ")"; this.machineIdToRunning.put( machineId, "" ); return machineId; }

Target:
public String createMachine( TargetHandlerParameters parameters ) throws TargetException { if(parameters != null && parameters.getTargetProperties() != null) { String ips = parameters.getTargetProperties().get(IP_ADDRESSES); if(ips != null) { String iplist[] = ips.trim().split("\\s*,\\s*"); for(String ip : iplist) ipTable.put(ip, false); } } String machineId = parameters.getScopedInstancePath() + " (" + TARGET_ID + ")"; this.machineIdToIp.put( machineId, "" ); return machineId; }
Source:
public void shouldCallHtmlEscape() throws OperationException { Map<String, Object> params = new HashMap<>(); params.put("script", "Context.htmlEscape = Fn.htmlEscape(\" cou&cou \");"); try (OperationContext ctx = new OperationContext()) { automationService.run(ctx, "RunScript", params); assertEquals(" cou&amp;cou ", ctx.get("htmlEscape")); } }

Target:
public void shouldCallHtmlEscape() throws OperationException { Map<String, Object> params = Map.of("script", "Context.htmlEscape = Fn.htmlEscape(\" cou&cou \");"); try (OperationContext ctx = new OperationContext()) { automationService.run(ctx, "RunScript", params); assertEquals(" cou&amp;cou ", ctx.get("htmlEscape")); } }
Source:
public IOWorkers.Selector getWorkerSelector() { return workerSelector; }

Target:
IOWorkers.Selector getWorkerSelector() { return workerSelector; }
Source:
public void tradePerformed(Order order, double matchPrice) throws StockMarketExpection { if (order instanceof BuyOrder) { this.cashInHand -= matchPrice * order.getSize(); position.add(order); ordersPlaced.remove(order); } else { for (int i = 0; i < position.size(); i++){ if (order == ordersPlaced.get(i)){ if(order.getSize() != position.get(i).getSize() ){ this.cashInHand += matchPrice * order.getSize(); ordersPlaced.remove(order); return; } } } this.cashInHand += matchPrice * order.getSize(); position.remove(order); ordersPlaced.remove(order); } }

Target:
public void tradePerformed(Order order, double matchPrice) throws StockMarketExpection { if (order instanceof BuyOrder) { this.cashInHand -= matchPrice * order.getSize(); position.add(order); ordersPlaced.remove(order); } else { for (int i = 0; i < position.size(); i++){ int place = ordersPlaced.get(i); if (order == place){ if(order.getSize() != position.get(i).getSize() ){ this.cashInHand += matchPrice * order.getSize(); ordersPlaced.remove(order); return; } } } this.cashInHand += matchPrice * order.getSize(); position.remove(order); ordersPlaced.remove(order); } }
Source:
public OpenTSDBRateOption(RateOptions rateOptions) { if (null != rateOptions) { if (null != rateOptions.getCounter()) { counter = rateOptions.getCounter(); } if (null != rateOptions.getCounterMax()) { counterMax = rateOptions.getCounterMax(); } if (null != rateOptions.getResetThreshold()) { resetValue = rateOptions.getResetThreshold(); } if (null != rateOptions.getDropResets()) { dropResets = rateOptions.getDropResets(); } else if ((counterMax == Long.MAX_VALUE) && (resetValue == 0)) { dropResets = true; } } }

Target:
public OpenTSDBRateOption(RateOptions rateOptions) { if (null != rateOptions) { if (null != rateOptions.getCounter()) { counter = rateOptions.getCounter(); } if (null != rateOptions.getCounterMax()) { counterMax = rateOptions.getCounterMax(); } if (null != rateOptions.getResetThreshold()) { resetValue = rateOptions.getResetThreshold(); } if (null != rateOptions.getDropResets()) { dropResets = rateOptions.getDropResets(); } else if ((null != rateOptions.getCounterMax()) && (null != rateOptions.getResetThreshold())) { dropResets = false; } else if ((counterMax == Long.MAX_VALUE) && (resetValue == 0)) { dropResets = true; } } }
Source:
public void registerErrorPages(ErrorPageRegistry registry) { registry.addErrorPages( new ErrorPage(HttpStatus.FORBIDDEN, "/error/status-code"), new ErrorPage(HttpStatus.NOT_FOUND, SiteUrl.NOT_FOUND_PAGE), new ErrorPage(RequestRejectedException.class, SiteUrl.NOT_FOUND_PAGE), new ErrorPage(Exception.class, SiteUrl.INTERNAL_ERROR_PAGE) ); }

Target:
public void registerErrorPages(ErrorPageRegistry registry) { registry.addErrorPages( new ErrorPage(HttpStatus.FORBIDDEN, SiteUrl.FORBIDDEN_PAGE), new ErrorPage(HttpStatus.NOT_FOUND, SiteUrl.NOT_FOUND_PAGE), new ErrorPage(RequestRejectedException.class, SiteUrl.NOT_FOUND_PAGE), new ErrorPage(Exception.class, SiteUrl.INTERNAL_ERROR_PAGE) ); }
Source:
public boolean write(int addr, WR3223Commands command, String data) throws IOException { if (data == null || data.length() > 6 || data.length() == 0) { throw new IllegalArgumentException("Not valid data format."); } if (inputStream.available() > 0) { inputStream.skipBytes(inputStream.available()); } byte[] message = new byte[10 + data.length()]; message[0] = EOT; setControllerAddressToMessage(message, addr, 1); message[5] = STX; setCommandToMessage(message, command, 6); byte[] d = data.getBytes(); for (int ii = 0; ii < data.length(); ii++) { message[8 + ii] = d[ii]; } message[message.length - 2] = ETX; byte chkSum = (byte) buildCheckSum(message, 6, message.length - 2); message[message.length - 1] = chkSum; outputStream.write(message); outputStream.flush(); if (logger.isDebugEnabled()) { logger.debug("Write data: {}", bytesToHexString(message)); } if (waitUntilDataAvailable(1, 5000l)) { int answer = inputStream.readByte(); if (logger.isDebugEnabled()) { logger.debug("Answer from WR3223 {}.", Integer.toHexString(answer)); } if (answer == ACK) { return true; } logger.error("Command with data not accepted.", command.name(), data); } else { logger.error("Timout. No answer for command with data {}.", command.name(), data); } return false; }

Target:
public boolean write(int addr, WR3223Commands command, String data) throws IOException { if (data == null || data.length() > 6 || data.length() == 0) { throw new IllegalArgumentException("Not valid data format."); } if (inputStream.available() > 0) { inputStream.skipBytes(inputStream.available()); } byte[] message = new byte[10 + data.length()]; message[0] = EOT; setControllerAddressToMessage(message, addr, 1); message[5] = STX; setCommandToMessage(message, command, 6); byte[] d = data.getBytes(); for (int ii = 0; ii < data.length(); ii++) { message[8 + ii] = d[ii]; } message[message.length - 2] = ETX; byte chkSum = (byte) buildCheckSum(message, 6, message.length - 2); message[message.length - 1] = chkSum; outputStream.write(message); outputStream.flush(); if (logger.isDebugEnabled()) { logger.debug("Write data: {}", bytesToHexString(message)); } if (waitUntilDataAvailable(1, 5000l)) { int answer = inputStream.readByte(); if (logger.isDebugEnabled()) { logger.debug("Answer from WR3223 {}.", Integer.toHexString(answer)); } if (answer == ACK) { return true; } logger.error("Command with data not accepted.", command.name(), data); } else { logger.error("Timeout. No answer for command with data {}.", command.name(), data); } return false; }
Source:
private String constructGroupId(KafkaConnectionString srcConnString, String dstConnString) { String groupId = srcConnString + "-to-" + dstConnString; return _isGroupIdHashingEnabled ? AbstractKafkaConnector.hashGroupId(groupId) : groupId; }

Target:
private String constructGroupId(KafkaConnectionString srcConnString, String dstConnString) { return srcConnString + "-to-" + dstConnString; }
Source:
public ItemEventFactory() { super(Sets.newHashSet(ItemCommandEvent.TYPE, ItemStateEvent.TYPE, ItemStateChangedEvent.TYPE, ItemAddedEvent.TYPE, ItemUpdatedEvent.TYPE, ItemRemovedEvent.TYPE, GroupItemStateChangedEvent.TYPE, ItemTriggerEvent.TYPE)); }

Target:
public ItemEventFactory() { super(Sets.newHashSet(ItemCommandEvent.TYPE, ItemStateEvent.TYPE, ItemStateChangedEvent.TYPE, ItemAddedEvent.TYPE, ItemUpdatedEvent.TYPE, ItemRemovedEvent.TYPE, GroupItemStateChangedEvent.TYPE)); }
Source:
private void createRoutingDataPath(HelixZkClient zkClient, String zkAddress) { try { zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, true); } catch (ZkNodeExistsException e) { } ZNRecord znRecord = new ZNRecord(MetadataStoreRoutingConstants.ROUTING_DATA_PATH); znRecord.setListField(MetadataStoreRoutingConstants.ROUTING_ZK_ADDRESS_KEY, Collections.singletonList(zkAddress)); zkClient.writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, znRecord); }

Target:
public static void createRoutingDataPath(HelixZkClient zkClient, String zkAddress) { try { zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, true); } catch (ZkNodeExistsException e) { } ZNRecord znRecord = new ZNRecord(MetadataStoreRoutingConstants.ROUTING_DATA_PATH.substring(1)); znRecord.setListField(MetadataStoreRoutingConstants.ROUTING_ZK_ADDRESS_KEY, Collections.singletonList(zkAddress)); zkClient.writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, znRecord); }
Source:
public void message(DCCppReply l) { if (l.isTurnoutReply()) { log.debug("received Turnout Reply message: {}", l.toString()); int addr = l.getTOIDInt(); if (addr >= 0) { log.debug("message has address: {}", addr); String s = getSystemNamePrefix() + addr; DCCppTurnout found = (DCCppTurnout) getBySystemName(s); if ( found == null) { ((DCCppTurnout) provideTurnout(s)).setFeedbackMode(Turnout.MONITORING); ((DCCppTurnout) provideTurnout(s)).initmessage(l); } else { found.message(l); } } } else if (l.isOutputCmdReply()) { log.debug("received Output Cmd Reply message: {}", l.toString()); int addr = l.getOutputNumInt(); if (addr >= 0) { log.debug("message has address: {}", addr); String s = getSystemNamePrefix() + addr; DCCppTurnout found = (DCCppTurnout) getBySystemName(s); if (found == null) { ((DCCppTurnout) provideTurnout(s)).setFeedbackMode(Turnout.EXACT); ((DCCppTurnout) provideTurnout(s)).initmessage(l); } else { found.message(l); } } } }

Target:
public void message(DCCppReply l) { if (l.isTurnoutReply()) { log.debug("received Turnout Reply message: '{}'", l); int addr = l.getTOIDInt(); if (addr >= 0) { log.debug("message has address: {}", addr); String s = getSystemNamePrefix() + addr; DCCppTurnout found = (DCCppTurnout) getBySystemName(s); if ( found == null) { ((DCCppTurnout) provideTurnout(s)).setFeedbackMode(Turnout.MONITORING); ((DCCppTurnout) provideTurnout(s)).initmessage(l); } else { found.message(l); } } } else if (l.isOutputCmdReply()) { log.debug("received Output Cmd Reply message: '{}'", l); int addr = l.getOutputNumInt(); if (addr >= 0) { log.debug("message has address: {}", addr); String s = getSystemNamePrefix() + addr; DCCppTurnout found = (DCCppTurnout) getBySystemName(s); if (found == null) { ((DCCppTurnout) provideTurnout(s)).setFeedbackMode(Turnout.EXACT); ((DCCppTurnout) provideTurnout(s)).initmessage(l); } else { found.message(l); } } } }
Source:
public static SessionFactory<FTPFile> ftpSessionFactory() { return FtpStreamingMessageSourceTests.sessionFactory(); }

Target:
public SessionFactory<FTPFile> ftpSessionFactory() { return FtpStreamingMessageSourceTests.sessionFactory(); }
Source:
private void applyTriallelicFilter(final VariantContext vc, final Collection<String> filters) { if (vc.hasAttribute(GATKVCFConstants.TUMOR_LOD_KEY)) { final double[] tumorLods = getArrayAttribute(vc, GATKVCFConstants.TUMOR_LOD_KEY); final long numPassingAltAlleles = Arrays.stream(tumorLods).filter(x -> x > MTFAC.TUMOR_LOD_THRESHOLD).count(); if (numPassingAltAlleles > (MTFAC.numAltAllelesThreshold + 1)) { filters.add(GATKVCFConstants.TRIALLELIC_SITE_FILTER_NAME); } } }

Target:
private void applyTriallelicFilter(final VariantContext vc, final Collection<String> filters) { if (vc.hasAttribute(GATKVCFConstants.TUMOR_LOD_KEY)) { final double[] tumorLods = getArrayAttribute(vc, GATKVCFConstants.TUMOR_LOD_KEY); final long numPassingAltAlleles = Arrays.stream(tumorLods).filter(x -> x > MTFAC.TUMOR_LOD_THRESHOLD).count(); if (numPassingAltAlleles > MTFAC.numAltAllelesThreshold) { filters.add(GATKVCFConstants.TRIALLELIC_SITE_FILTER_NAME); } } }
Source:
private MetadataInterface createMetadataForPhysicalPageNumber(int currentPhysicalOrder) throws MetadataTypeNotAllowedException { MetadataTypeInterface metadataTypeInterface = this.myPrefs.getMetadataTypeByName("physPageNumber"); MetadataInterface metadataInterface = UghImplementation.INSTANCE.createMetadata(metadataTypeInterface); metadataInterface.setStringValue(String.valueOf(++currentPhysicalOrder)); return metadataInterface; }

Target:
private MetadataInterface createMetadataForPhysicalPageNumber(int currentPhysicalOrder) throws MetadataTypeNotAllowedException { MetadataTypeInterface metadataType = this.myPrefs.getMetadataTypeByName("physPageNumber"); MetadataInterface metadata = UghImplementation.INSTANCE.createMetadata(metadataType); metadata.setStringValue(String.valueOf(++currentPhysicalOrder)); return metadata; }
Source:
private boolean distributionNotUniform() { List<Long> values = writesPerRange.asMapOfRanges().values().stream().map(AtomicLong::get) .collect(Collectors.toList()); return MathUtils.confidenceDistributionIsNotUniform(values) > CONFIDENCE_FOR_LOGGING; }

Target:
private boolean distributionNotUniform() { List<Long> values = writesPerRange.asMapOfRanges().values().stream().map(AtomicLong::get) .collect(Collectors.toList()); return MathUtils.calculateConfidenceThatDistributionIsNotUniform(values) > CONFIDENCE_FOR_LOGGING; }