auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onPreExecute() { System.out.println("onPreExecute"); Toast.makeText(EncryptedSharedHealthRecordSyncTask.context, "Uploading SHR Data", Toast.LENGTH_SHORT).show(); }

Target:
protected void onPreExecute() { Toast.makeText(EncryptedSharedHealthRecordSyncTask.context, "Uploading SHR Data", Toast.LENGTH_SHORT).show(); }
Source:
public void setBaseGenerationPopulator(GenerationPopulator generator) { this.baseGenerator = checkNotNull(generator); if (this.baseGenerator instanceof IChunkProviderOverworld) { ((IChunkProviderOverworld) this.baseGenerator).setBiomeGenerator(this.biomeGenerator); } }

Target:
public void setBaseGenerationPopulator(GenerationPopulator generator) { this.baseGenerator = checkNotNull(generator, "generator"); if (this.baseGenerator instanceof IChunkProviderOverworld) { ((IChunkProviderOverworld) this.baseGenerator).setBiomeGenerator(this.biomeGenerator); } }
Source:
public TopologyInfo getInfo(TopologySummary topologySummary) throws TException { return client.getTopologyInfoByName(topologySummary.get_id()); }

Target:
public TopologyInfo getInfo(TopologySummary topologySummary) throws TException { return client.getTopologyInfo(topologySummary.get_id()); }
Source:
private String parseParams(ParameterSet params, JSONObject obj) throws Exception { if (params.size() < 2) { return "@SnapshotDelete expects 2 arguments, received " + params.size(); } String[] paths = null; try { paths = (String[])(ParameterConverter.tryToMakeCompatible( String[].class, params.toArray()[0])); } catch (Exception e) { return e.getMessage(); } if (paths == null || paths.length == 0) { return "No paths supplied"; } for (String path : paths) { if (path == null || path.trim().isEmpty()) { return "A path was null or the empty string"; } } String[] nonces = null; try { nonces = (String[])(ParameterConverter.tryToMakeCompatible( String[].class, params.toArray()[1])); } catch (Exception e) { return e.getMessage(); } if (nonces == null || nonces.length == 0) { return "No nonces supplied"; } for (String nonce : nonces) { if (nonce == null || nonce.trim().isEmpty()) { return "A nonce was null or the empty string"; } } if (paths.length != nonces.length) { return "A path must be provided for every nonce"; } String stype = SnapthotPathType.SNAP_PATH.toString(); if (params.size() > 2) { stype = (String )(ParameterConverter.tryToMakeCompatible( String.class, params.toArray()[2])); } obj.put("subselector", "SNAPSHOTDELETE"); obj.put("interval", false); obj.put("paths", paths); obj.put(SnapshotUtil.JSON_PATH_TYPE, stype); obj.put("nonces", nonces); return null; }

Target:
private String parseParams(ParameterSet params, JSONObject obj) throws Exception { if (params.size() < 2) { return "@SnapshotDelete expects 2 or 3 arguments, received " + params.size(); } String[] paths = null; Object paramList[] = params.toArray(); try { paths = (String[])(ParameterConverter.tryToMakeCompatible( String[].class, paramList[0])); } catch (Exception e) { return e.getMessage(); } if (paths == null || paths.length == 0) { return "No paths supplied"; } for (String path : paths) { if (path == null || path.trim().isEmpty()) { return "A path was null or the empty string"; } } String[] nonces = null; try { nonces = (String[])(ParameterConverter.tryToMakeCompatible( String[].class, paramList[1])); } catch (Exception e) { return e.getMessage(); } if (nonces == null || nonces.length == 0) { return "No nonces supplied"; } for (String nonce : nonces) { if (nonce == null || nonce.trim().isEmpty()) { return "A nonce was null or the empty string"; } } if (paths.length != nonces.length) { return "A path must be provided for every nonce"; } String stype = SnapshotPathType.SNAP_PATH.toString(); if (params.size() > 2) { stype = (String )(ParameterConverter.tryToMakeCompatible( String.class, paramList[2])); } obj.put("subselector", "SNAPSHOTDELETE"); obj.put("interval", false); obj.put("paths", paths); obj.put(SnapshotUtil.JSON_PATH_TYPE, stype); obj.put("nonces", nonces); return null; }
Source:
private Double interpretOperatorEqual(Object left, Object right) { if (left instanceof String && right instanceof String) { try { return (Double.valueOf((String) left).compareTo(Double.valueOf((String) right))) == 0 ? 1d : 0; } catch (NumberFormatException numberFormatException) { int compareResult = ((String) left).compareTo((String) right); if (compareResult == 0) { return 1d; } } } if (left instanceof Double && right instanceof String) { try { Double tempLeft = (Double) left; Double tempRight = Double.valueOf((String) right); int compareResult; if (tempLeft == 0 || tempRight == 0) { compareResult = ((Double) Math.abs(tempLeft)).compareTo(Math.abs(tempRight)); } else { compareResult = tempLeft.compareTo(tempRight); } if (compareResult == 0) { return 1d; } } catch (NumberFormatException numberFormatException) { return 0d; } } if (left instanceof String && right instanceof Double) { try { Double tempLeft = Double.parseDouble((String) left); Double tempRight = (Double) right; int compareResult; if (tempLeft == 0 || tempRight == 0) { compareResult = ((Double) Math.abs(tempLeft)).compareTo(Math.abs(tempRight)); } else { compareResult = tempLeft.compareTo(tempRight); } if (compareResult == 0) { return 1d; } } catch (NumberFormatException numberFormatException) { return 0d; } } if (left instanceof Double && right instanceof Double) { return (((Double) left).compareTo((Double) right) == 0) ? 1d : 0d; } return 0d; }

Target:
private Double interpretOperatorEqual(Object left, Object right) { try { Double tempLeft = Double.valueOf(String.valueOf(left)); Double tempRight = Double.valueOf(String.valueOf(right)); int compareResult = getCompareResult(tempLeft, tempRight); if (compareResult == 0) { return 1d; } return 0d; } catch (NumberFormatException numberFormatException) { int compareResult = String.valueOf(left).compareTo(String.valueOf(right)); if (compareResult == 0) { return 1d; } return 0d; } }
Source:
public File tryFindHook(Repository repository, final Hook hook) { final File gitDir = repository.getDirectory(); final File[] hookDirCandidates = gitDir.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.isDirectory() && pathname.getName().equals("hooks"); } }); if (hookDirCandidates == null || hookDirCandidates.length < 1) return null; final File[] matchingHooks = hookDirCandidates[0] .listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().equals(hook.getName()); } }); if (matchingHooks == null || matchingHooks.length < 1) return null; return matchingHooks[0]; }

Target:
public File tryFindHook(Repository repository, final Hook hook) { final File hookFile = new File(new File(repository.getDirectory(), "hooks"), hook.getName()); return hookFile.isFile() ? hookFile : null; }
Source:
public ImageButtonCell(ImageResource image) { super("click"); this.imageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(image).getHTML()); }

Target:
public ImageButtonCell(ImageResource image) { super(BrowserEvents.CLICK); this.imageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(image).getHTML()); }
Source:
protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); lblSelect.setText("Select " + getTypeString() + ":"); List<String> columnNames = Arrays.asList("Name", "Description"); items = createTable(container, SWT.BORDER | SWT.V_SCROLL | extraListOptions, columnNames); List<String> names; List<String> descriptions; if (includeCurrent) { names = (List<String>) ConfigInfo.names(available); descriptions = (List<String>) ConfigInfo.descriptions(available); } else { names = (List<String>) ConfigInfo.namesWithoutCurrent(available); descriptions = (List<String>) ConfigInfo.descriptionsWithoutCurrent(available); } names.sort(String.CASE_INSENSITIVE_ORDER); setMultipleColumnItems(names, descriptions, compOrConfigNamesWithFlags); Group group = new Group(container, SWT.SHADOW_IN); group.setLayout(new RowLayout(SWT.HORIZONTAL)); Label messageImageLabel = new Label(group, SWT.NONE); messageImageLabel.setImage(JFaceResources. getImage(DLG_IMG_MESSAGE_WARNING)); Label messageLabel = new Label(group, SWT.NONE); messageLabel.setFont(JFaceResources.getDialogFont()); messageLabel.setText("Represents Protected " + getTypeString()); }

Target:
protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); lblSelect.setText("Select " + getTypeString() + ":"); List<String> columnNames = Arrays.asList("Name", "Description"); items = createTable(container, SWT.BORDER | SWT.V_SCROLL | extraListOptions, columnNames); SortedMap<String, String> namesAndDescriptions = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); if (includeCurrent) { namesAndDescriptions = ConfigInfo.namesAndDescriptions(available); } else { namesAndDescriptions = ConfigInfo.namesAndDescriptionsWithoutCurrent(available); } setMultipleColumnItems(namesAndDescriptions, compOrConfigNamesWithFlags); Boolean hasProtectedConfigs = ConfigInfo.hasProtectedElement(available); if (hasProtectedConfigs) { Group group = new Group(container, SWT.SHADOW_IN); group.setLayout(new RowLayout(SWT.HORIZONTAL)); Label messageImageLabel = new Label(group, SWT.NONE); messageImageLabel.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING)); Label messageLabel = new Label(group, SWT.NONE); messageLabel.setFont(JFaceResources.getDialogFont()); messageLabel.setText("Represents Protected " + getTypeString()); } }
Source:
public void prepareRun(BatchJoinerContext context) { if (conf.getNumPartitions() != null) { context.setNumPartitions(conf.getNumPartitions()); } FailureCollector collector = context.getFailureCollector(); init(context.getInputSchemas(), collector); Collection<OutputFieldInfo> outputFieldInfos = createOutputFieldInfos(context.getInputSchemas(), collector); context.record(createFieldOperations(outputFieldInfos, perStageJoinKeys)); }

Target:
public void prepareRun(BatchJoinerContext context) { if (conf.getNumPartitions() != null) { context.setNumPartitions(conf.getNumPartitions()); } FailureCollector collector = context.getFailureCollector(); init(context.getInputSchemas(), collector); collector.getOrThrowException(); Collection<OutputFieldInfo> outputFieldInfos = createOutputFieldInfos(context.getInputSchemas(), collector); collector.getOrThrowException(); context.record(createFieldOperations(outputFieldInfos, perStageJoinKeys)); }
Source:
public <T extends Enum<T>> T getEnum(Class<T> enumClass, String path) { ConfigValue v = find(path, ConfigValueType.STRING); String enumName = (String) v.unwrapped(); try { return Enum.valueOf(enumClass, enumName); } catch (IllegalArgumentException e) { throw new ConfigException.BadValue( v.origin(), path, "The enum class %s has no constant of the name %s".format(enumClass.getSimpleName(), enumName)); } }

Target:
public <T extends Enum<T>> T getEnum(Class<T> enumClass, String path) { ConfigValue v = find(path, ConfigValueType.STRING); return getEnumValue(path, enumClass, v); }
Source:
public void testSessionAttemptStatusKilled() throws Exception { RestSessionAttempt attempt = RestSessionAttempt.builder() .id(Id.of("1")) .index(3) .project(IdAndName.of(Id.of("1"), "p")) .workflow(NameOptionalId.of("w", Optional.of(Id.of("1")))) .sessionId(Id.of("1")) .sessionUuid(UUID.randomUUID()) .sessionTime(OffsetDateTime.now(ZoneId.of("UTC"))) .retryAttemptName(Optional.absent()) .done(false) .success(false) .cancelRequested(true) .params(newConfig()) .createdAt(Instant.now()) .finishedAt(Optional.absent()) .build(); assertThat(attempt.getStatus(), is("killed")); }

Target:
public void testSessionAttemptStatusKilled() throws Exception { RestSessionAttempt attempt = RestSessionAttempt.builder() .id(Id.of("1")) .index(3) .project(IdAndName.of(Id.of("1"), "p")) .workflow(NameOptionalId.of("w", Optional.of(Id.of("1")))) .sessionId(Id.of("1")) .sessionUuid(UUID.randomUUID()) .sessionTime(OffsetDateTime.now(ZoneId.of("UTC"))) .retryAttemptName(Optional.absent()) .done(true) .success(false) .cancelRequested(true) .params(newConfig()) .createdAt(Instant.now()) .finishedAt(Optional.absent()) .build(); assertThat(attempt.getStatus(), is("killed")); }
Source:
@Test public void requestThrowingBeforeEnqueueFailsEnqueue() throws IOException, InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); try { call.request(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); final CountDownLatch latch = new CountDownLatch(1); call.enqueue(new Callback<String>() { @Override public void onResponse(Call<String> call, Response<String> response) { } @Override public void onFailure(Call<String> call, Throwable t) { assertThat(t).isExactlyInstanceOf(RuntimeException.class).hasMessage("Broken!"); assertThat(writeCount.get()).isEqualTo(1); latch.countDown(); } }); assertTrue(latch.await(1, SECONDS)); }

Target:
@Test public void requestThrowingBeforeEnqueueFailsEnqueue() throws IOException, InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); try { call.request(); fail(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); final CountDownLatch latch = new CountDownLatch(1); call.enqueue(new Callback<String>() { @Override public void onResponse(Call<String> call, Response<String> response) { } @Override public void onFailure(Call<String> call, Throwable t) { assertThat(t).isExactlyInstanceOf(RuntimeException.class).hasMessage("Broken!"); assertThat(writeCount.get()).isEqualTo(1); latch.countDown(); } }); assertTrue(latch.await(1, SECONDS)); }
Source:
protected void onStop() { super.onStop(); Log.d(TAG, "Player Activity Stopped"); if (player != null) { player.suspend(); } }

Target:
protected void onStop() { super.onStop(); Log.d(TAG, "Player Activity Stopped"); if (null != player) { player.suspend(); } }
Source:
public void populateSparkWebUrl(InterpreterContext ctx) { sparkUrl = getSparkUIUrl(); Map<String, String> infos = new java.util.HashMap<>(); infos.put("url", sparkUrl); java.lang.Boolean uiEnabled = java.lang.Boolean.parseBoolean( property.getProperty("spark.ui.enabled", "true")); if (!uiEnabled) { infos.put("message", "Spark UI disabled"); } else { if (StringUtils.isNotBlank(sparkUrl)) { infos.put("message", "Spark UI enabled"); } else { infos.put("message", "No spark url defined"); } } if (ctx != null && ctx.getClient() != null) { logger.info("Sending metadata to Zeppelin server: {}", infos.toString()); getZeppelinContext().setEventClient(ctx.getClient()); ctx.getClient().onMetaInfosReceived(infos); } }

Target:
public void populateSparkWebUrl(InterpreterContext ctx) { sparkUrl = getSparkUIUrl(); Map<String, String> infos = new java.util.HashMap<>(); infos.put("url", sparkUrl); String uiEnabledProp = property.getProperty("spark.ui.enabled", "true"); java.lang.Boolean uiEnabled = java.lang.Boolean.parseBoolean( uiEnabledProp.trim()); if (!uiEnabled) { infos.put("message", "Spark UI disabled"); } else { if (StringUtils.isNotBlank(sparkUrl)) { infos.put("message", "Spark UI enabled"); } else { infos.put("message", "No spark url defined"); } } if (ctx != null && ctx.getClient() != null) { logger.info("Sending metadata to Zeppelin server: {}", infos.toString()); getZeppelinContext().setEventClient(ctx.getClient()); ctx.getClient().onMetaInfosReceived(infos); } }
Source:
public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof LinkedHashMultimap) { final LinkedHashMultimap<?, ?> that = (LinkedHashMultimap<?, ?>) o; return this.back.equals(that.back); } else { return false; } }

Target:
public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof LinkedHashMultimap) { final LinkedHashMultimap<?, ?> that = (LinkedHashMultimap<?, ?>) o; return this.delegate.equals(that.delegate); } else { return false; } }
Source:
GcsController createGcsController(Config configuration, String storageBucket) { final Credential credential; try { credential = createCredentials(configuration); } catch (IOException ioe) { throw new RuntimeException("Unable to create credentials", ioe); } final Storage storage; try { storage = createStorage(credential); } catch (IOException ioe) { throw new RuntimeException("Unable to create google cloud storage client", ioe); } catch (GeneralSecurityException gse) { throw new RuntimeException("Unable to create google cloud storage client", gse); } return GcsController.create(storage, storageBucket); }

Target:
GcsController createGcsController(Config configuration, String storageBucket) throws IOException, GeneralSecurityException { final Credential credential = createCredentials(configuration); final Storage storage = createStorage(credential); return GcsController.create(storage, storageBucket); }
Source:
public <T> Binding to(ObservableList<T> dolphinList, Converter<? super T, ? extends S> converter) { boundLists.forEach(addedList -> { if(addedList == list) { throw new UnsupportedOperationException("A JavaFX list can only be bound to one Dolphin Platform list!"); } }); boundLists.add(list); InternalListChangeListener listChangeListener = new InternalListChangeListener(list, converter); Subscription subscription = dolphinList.onChanged(listChangeListener); dolphinList.forEach(item -> list.add(converter.convert(item))); list.clear(); ListChangeListener readOnlyListener = c -> { if (!listChangeListener.isOnChange()) { throw new UnsupportedOperationException("A JavaFX list that is bound to a dolphin list can only be modified by the binding!"); } }; list.addListener(readOnlyListener); return () -> { subscription.unsubscribe(); list.removeListener(readOnlyListener); boundLists.remove(list); }; }

Target:
public <T> Binding to(ObservableList<T> dolphinList, Converter<? super T, ? extends S> converter) { if(boundLists.containsKey(list)) { throw new UnsupportedOperationException("A JavaFX list can only be bound to one Dolphin Platform list!"); }; boundLists.put(list, list); InternalListChangeListener listChangeListener = new InternalListChangeListener(list, converter); Subscription subscription = dolphinList.onChanged(listChangeListener); list.clear(); dolphinList.forEach(item -> list.add(converter.convert(item))); ListChangeListener readOnlyListener = c -> { if (!listChangeListener.isOnChange()) { throw new UnsupportedOperationException("A JavaFX list that is bound to a dolphin list can only be modified by the binding!"); } }; list.addListener(readOnlyListener); return () -> { subscription.unsubscribe(); list.removeListener(readOnlyListener); boundLists.remove(list); }; }
Source:
private T setContentFields(T result, Description inputContent) { result.setCanonicalUri(inputContent.getUri()); result.setCurie(inputContent.getCurie()); Publisher publisher = getPublisher(inputContent.getPublisher()); result.setPublisher(publisher); result.setTitle(inputContent.getTitle()); result.setDescription(inputContent.getDescription()); result.setImage(inputContent.getImage()); result.setThumbnail(inputContent.getThumbnail()); if (inputContent.getSpecialization() != null) { result.setSpecialization(Specialization.fromKey(inputContent.getSpecialization()).valueOrNull()); } if (inputContent.getMediaType() != null) { result.setMediaType(MediaType.valueOf(inputContent.getMediaType().toUpperCase())); } result.setPeople(transformPeople(inputContent.getPeople(), publisher)); result.setEquivalentTo(resolveEquivalences(inputContent.getSameAs())); result.setTopicRefs(topicRefs(inputContent.getTopics())); if (!inputContent.getGenres().isEmpty()) { result.setGenres(inputContent.getGenres()); } return result; }

Target:
private T setContentFields(T result, Description inputContent) { result.setCanonicalUri(inputContent.getUri()); result.setCurie(inputContent.getCurie()); Publisher publisher = getPublisher(inputContent.getPublisher()); result.setPublisher(publisher); result.setTitle(inputContent.getTitle()); result.setDescription(inputContent.getDescription()); result.setImage(inputContent.getImage()); result.setThumbnail(inputContent.getThumbnail()); if (inputContent.getSpecialization() != null) { result.setSpecialization(Specialization.fromKey(inputContent.getSpecialization()).valueOrNull()); } if (inputContent.getMediaType() != null) { result.setMediaType(MediaType.valueOf(inputContent.getMediaType().toUpperCase())); } result.setPeople(transformPeople(inputContent.getPeople(), publisher)); result.setEquivalentTo(resolveEquivalences(inputContent.getSameAs())); result.setTopicRefs(topicRefs(inputContent.getTopics())); result.setGenres(inputContent.getGenres()); return result; }
Source:
private Map<TopicPartition, OffsetAndTimestamp> fetchOffsets() { Map<TopicPartition, OffsetAndTimestamp> storedOffsets; if (ignoreStoredOffsets) { storedOffsets = new HashMap<>(); } else { storedOffsets = kafkaOffsetsRepository.load(firstStartTime); } Map<TopicPartition, Long> topicParts = topicPartitions.stream() .filter(tp -> !storedOffsets.containsKey(tp)) .collect(toMap(o -> o, o -> firstStartTime.toEpochMilli())); if (topicParts.size() > 0) { storedOffsets.putAll(consumer.offsetsForTimes(topicParts)); } return storedOffsets; }

Target:
private Map<TopicPartition, OffsetAndTimestamp> fetchOffsets() { Map<TopicPartition, OffsetAndTimestamp> storedOffsets; if (ignoreStoredOffsets) { storedOffsets = ImmutableMap.of(); } else { storedOffsets = kafkaOffsetsRepository.load(firstStartTime); } Map<TopicPartition, Long> topicParts = topicPartitions.stream() .filter(tp -> !storedOffsets.containsKey(tp)) .collect(toMap(o -> o, o -> firstStartTime.toEpochMilli())); Map<TopicPartition, OffsetAndTimestamp> results = new HashMap<>(); results.putAll(storedOffsets); if (topicParts.size() > 0) { results.putAll(consumer.offsetsForTimes(topicParts)); } return results; }
Source:
public synchronized void shutdown() { if (this.isShutdown.compareAndSet(false, true)) { closeConnection(); } }

Target:
public void shutdown() { close(); }
Source:
public static String desanitizeFromNextUrl(String sanitizedUrl) { return sanitizedUrl.replace("${amp}", "&").replace("${plus}", "%2B").replace("${hash}", "%23") .replace(" ", "+"); }

Target:
public static String desanitizeFromNextUrl(String sanitizedUrl) { if (sanitizedUrl == null) { return null; } return sanitizedUrl.replace("${amp}", "&") .replace("${plus}", "%2B") .replace("${hash}", "%23") .replace(" ", "+"); }
Source:
public static Field getField(String fieldName, String obfName, Class clazz) { Field field = null; try { field = clazz.getDeclaredField(obfName); } catch (NoSuchFieldException e) { EsteemedInnovation.logger.warn("[EI] Unable to find field " + fieldName + " with its obfuscated " + "name. Trying to find it by its name " + fieldName); try { field = clazz.getDeclaredField(fieldName); } catch (NoSuchFieldException e1) { e1.printStackTrace(); boolean builderHasAField = false; StringBuilder builder = new StringBuilder(); for (Field field1 : clazz.getDeclaredFields()) { if (builderHasAField) { builder.append(", "); } builder.append(field1.getName()); builderHasAField = true; } EsteemedInnovation.logger.warn("Unable to find " + fieldName + " field in " + clazz.getName() + ".class. Available fields are: " + builder + ". Things are not going to work right."); } } return field; }

Target:
public static Field getField(String fieldName, String obfName, Class clazz) { Field field = null; try { field = clazz.getDeclaredField(obfName); } catch (NoSuchFieldException e) { EsteemedInnovation.logger.warn("Unable to find field " + fieldName + " with its obfuscated " + "name. Trying to find it by its name " + fieldName); try { field = clazz.getDeclaredField(fieldName); } catch (NoSuchFieldException e1) { e1.printStackTrace(); boolean builderHasAField = false; StringBuilder builder = new StringBuilder(); for (Field field1 : clazz.getDeclaredFields()) { if (builderHasAField) { builder.append(", "); } builder.append(field1.getName()); builderHasAField = true; } EsteemedInnovation.logger.warn("Unable to find " + fieldName + " field in " + clazz.getName() + ".class. Available fields are: " + builder + ". Things are not going to work right."); } } return field; }
Source:
private void collectVmPrestartFailureReasons(Map<String, Integer> failureReasons, List<String> messages) { if (log.isInfoEnabled()) { String reason = messages.stream() .filter(str -> { try { return EngineMessage.valueOf(str) != null; } catch(IllegalArgumentException e) { return false; } }) .collect(Collectors.joining(", ")); Integer count = failureReasons.get(reason); failureReasons.put(reason, count == null ? 1 : count + 1); } }

Target:
private void collectVmPrestartFailureReasons(Map<String, Integer> failureReasons, List<String> messages) { if (log.isInfoEnabled()) { String reason = messages.stream() .filter(EngineMessage::contains) .collect(Collectors.joining(", ")); Integer count = failureReasons.get(reason); failureReasons.put(reason, count == null ? 1 : count + 1); } }
Source:
public String generateSelectAllExistingFieldsSql(Connection connection, String namespace) throws SQLException { PreparedStatement statement = connection.prepareStatement( "SELECT column_name FROM information_schema.columns WHERE table_schema = ? AND table_name = ?" ); statement.setString(1, namespace); statement.setString(2, name); ResultSet result = statement.executeQuery(); List<Field> exitingFields = new ArrayList<>(); while (result.next()) { String columnName = result.getString(1); for (Field f : fields) { if (f.name.equals(columnName)) { exitingFields.add(f); break; } } } String tableName = String.join(".", namespace, name); String fieldPrefix = tableName + "."; return String.format( "select %s from %s", commaSeparatedNames(exitingFields, fieldPrefix, true), tableName ); }

Target:
public String generateSelectAllExistingFieldsSql(Connection connection, String namespace) throws SQLException { PreparedStatement statement = connection.prepareStatement( "SELECT column_name FROM information_schema.columns WHERE table_schema = ? AND table_name = ?" ); statement.setString(1, namespace); statement.setString(2, name); ResultSet result = statement.executeQuery(); List<Field> existingFields = new ArrayList<>(); while (result.next()) { String columnName = result.getString(1); existingFields.add(getFieldForName(columnName)); } String tableName = String.join(".", namespace, name); String fieldPrefix = tableName + "."; return String.format( "select %s from %s", commaSeparatedNames(existingFields, fieldPrefix, true), tableName ); }
Source:
public String exportAsPMML(MLModel model) throws MLPmmlExportException { Externalizable extModel = model.getModel(); try { if (extModel instanceof PMMLModelContainer) { PMMLExportable pmmlExportableModel = ((PMMLModelContainer) extModel).getPMMLExportable(); String pmmlString = pmmlExportableModel.toPMML(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(pmmlString))); Element root = document.getDocumentElement(); root.setAttribute("version", "4.2"); StringWriter stringWriter = new StringWriter(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.transform(new DOMSource(document), new StreamResult(stringWriter)); return stringWriter.toString(); } catch (Exception e) { String msg = "Error while appending version attribute to pmml"; log.error(msg, e); throw new MLPmmlExportException(msg); } } else { throw new MLPmmlExportException("PMML export not supported for model type"); } } catch (MLPmmlExportException e) { throw new MLPmmlExportException("PMML export not supported for model type"); } }

Target:
public String exportAsPMML(MLModel model) throws MLPmmlExportException { Externalizable extModel = model.getModel(); try { if (extModel instanceof PMMLModelContainer) { PMMLExportable pmmlExportableModel = ((PMMLModelContainer) extModel).getPMMLExportable(); String pmmlString = pmmlExportableModel.toPMML(); try { String pmmlWithVersion = appendVersionToPMML(pmmlString); log.info(pmmlWithVersion); return pmmlWithVersion; } catch (Exception e) { String msg = "Error while appending version attribute to pmml"; log.error(msg, e); throw new MLPmmlExportException(msg); } } else { throw new MLPmmlExportException("PMML export not supported for model type"); } } catch (MLPmmlExportException e) { throw new MLPmmlExportException("PMML export not supported for model type"); } }
Source:
private void setSkipNullPredicate(boolean isReverseScan) { int nextKeyIndex = -1; if (isReverseScan) { if (m_searchkeyExpressions.size() < m_endkeyExpressions.size()) { assert(m_endType == IndexLookupType.LT || m_endType == IndexLookupType.LTE); assert( m_endkeyExpressions.size() - m_searchkeyExpressions.size() == 1); nextKeyIndex = m_searchkeyExpressions.size(); } else { return; } } else { if (m_searchkeyExpressions.size() >= m_endkeyExpressions.size()) { if (m_lookupType == IndexLookupType.GT || m_lookupType == IndexLookupType.GTE) { assert(m_searchkeyExpressions.size() > 0); nextKeyIndex = m_searchkeyExpressions.size() - 1; } } else { return; } } m_skip_null_predicate = IndexScanPlanNode.buildSkipNullPredicate(nextKeyIndex, m_catalogIndex, m_tableScan, m_searchkeyExpressions); if (m_skip_null_predicate != null) { m_skip_null_predicate.resolveForTable((Table)m_catalogIndex.getParent()); } }

Target:
private void setSkipNullPredicate(boolean isReverseScan) { int nextKeyIndex; if (isReverseScan) { if (m_searchkeyExpressions.size() >= m_endkeyExpressions.size()) { return; } assert(m_endType == IndexLookupType.LT || m_endType == IndexLookupType.LTE); assert(m_endkeyExpressions.size() - m_searchkeyExpressions.size() == 1); nextKeyIndex = m_searchkeyExpressions.size(); } else { if (m_searchkeyExpressions.size() < m_endkeyExpressions.size() || (m_lookupType != IndexLookupType.GT && m_lookupType != IndexLookupType.GTE)) { return; } assert(m_searchkeyExpressions.size() > 0); nextKeyIndex = m_searchkeyExpressions.size() - 1; } m_skip_null_predicate = IndexScanPlanNode.buildSkipNullPredicate( nextKeyIndex, m_catalogIndex, m_tableScan, m_searchkeyExpressions); if (m_skip_null_predicate != null) { m_skip_null_predicate.resolveForTable((Table)m_catalogIndex.getParent()); } }
Source:
private String evaluateDefaultContext(String url) { HttpURLConnection connection = null; try { connection = (HttpURLConnection) new URL(url).openConnection(); connection.setRequestMethod("GET"); connection.setInstanceFollowRedirects(false); connection.getResponseCode(); String location = connection.getHeaderField("Location"); String defaultContext = StringUtils.removeEnd(location, "/sys/info.xhtml"); return StringUtils.isBlank(defaultContext) ? defaultContext : defaultContext + "/"; } catch (IOException ex) { context.log.info("Couldn't evaluate default context of engine > use 'ivy/'"); return "ivy/"; } finally { if (connection != null) { connection.disconnect(); } } }

Target:
private String evaluateDefaultContext(String url) { context.log.debug("Call '" + url + "' to evaluate the default context"); var client = HttpClient.newBuilder().followRedirects(Redirect.NEVER).build(); var request = HttpRequest.newBuilder().uri(URI.create(url)).GET().build(); var result = "ivy/"; try { HttpResponse<String> response = client.send(request, BodyHandlers.ofString()); result = response.headers().firstValue("Location").map(location -> { context.log.debug("'" + url + "' returns location header: " + location); String defaultContext = evaluateIvyContextFromUrl(location); context.log.debug("Evalutate '" + defaultContext + "' as default context"); return defaultContext; }).orElse(result); } catch (IOException | InterruptedException ex) { context.log.warn("Couldn't evaluate default context of engine > use 'ivy/'"); } return result; }
Source:
public List<ExtensionProxy> getExtensionsByService(String provides) { List<ExtensionProxy> results = new ArrayList<>(); for (ExtensionEntry entry : initializedEntries.values()) { if (entry.initialized && entry.extension.getContext().<List> get(Base.ContextKeys.PROVIDES).contains(provides)) { results.add(entry.extension); } } return results; }

Target:
public List<ExtensionProxy> getExtensionsByService(String provides) { List<ExtensionProxy> results = new ArrayList<>(); for (ExtensionEntry entry : initializedEntries.values()) { if (entry.extension.getContext().<List> get(Base.ContextKeys.PROVIDES).contains(provides)) { results.add(entry.extension); } } return results; }
Source:
public Map<String, String> highlights( @ApiParam(value = "internal id of the anomaly") @QueryParam("anomalyId") long anomalyId, @Auth ThirdEyePrincipal principal) { Map<String, String> responseMessage = new HashMap<>(); ThirdEyeRcaRestClient rcaClient = new ThirdEyeRcaRestClient(principal, dashboardHost); Map<String, Object> eventHighlights = new HashMap<>(); try { eventHighlights = rcaClient.getRelatedEventHighlights(anomalyId); } catch (IOException e) { LOG.error("Failed to retrieve the RCA Event Highlights", e); } responseMessage.put("relatedEvents", new Gson().toJson(eventHighlights)); Map<String, Object> relatedMetricHighlights = new HashMap<>(); try { relatedMetricHighlights = rcaClient.getRelatedMetricHighlights(anomalyId); } catch (IOException e) { LOG.error("Failed to retrieve the RCA Metric Highlights", e); } responseMessage.put("relatedMetrics", new Gson().toJson(relatedMetricHighlights)); Map<String, Object> cubeHighlights = new HashMap<>(); try { cubeHighlights = rcaClient.getCubeHighlights(anomalyId); } catch (IOException e) { LOG.error("Failed to retrieve the RCA Cube Highlights", e); } responseMessage.put("cubeResults", new Gson().toJson(cubeHighlights)); return responseMessage; }

Target:
public Map<String, Object> highlights( @ApiParam(value = "internal id of the anomaly") @QueryParam("anomalyId") long anomalyId, @Auth ThirdEyePrincipal principal) throws Exception { Map<String, Object> responseMessage = new HashMap<>(); MergedAnomalyResultDTO anomalyDTO = DAORegistry.getInstance().getMergedAnomalyResultDAO().findById(anomalyId); Preconditions.checkNotNull(anomalyDTO, "Anomaly doesn't exist in ThirdEye's repository"); String cubeHighlights = this.summaryResource.buildSummary( anomalyDTO.getMetricUrn(), anomalyDTO.getCollection(), anomalyDTO.getMetric(), anomalyDTO.getStartTime(), anomalyDTO.getEndTime(), anomalyDTO.getStartTime() - TimeUnit.DAYS.toMillis(7), anomalyDTO.getEndTime() - TimeUnit.DAYS.toMillis(7), Strings.EMPTY, Strings.EMPTY, DEFAULT_HIGHLIGHT_CUBE_SUMMARY_SIZE, DEFAULT_HIGHLIGHT_CUBE_DEPTH, SummaryResource.DEFAULT_HIERARCHIES, false, DEFAULT_EXCLUDED_DIMENSIONS, SummaryResource.DEFAULT_TIMEZONE_ID); responseMessage.put("cubeResults", cubeHighlights); return responseMessage; }
Source:
public List<WorkspaceMetacardImpl> getWorkspaceMetacards(Set<String> workspaceIds) { if (!workspaceIds.isEmpty()) { final Filter filter = workspaceQueryBuilder.createFilter(workspaceIds); final QueryRequest queryRequest = createQueryRequest(filter); try { return createWorkspaceMetacards(catalogFramework.query(queryRequest)); } catch (UnsupportedQueryException | FederationException | SourceUnavailableException e) { LOGGER.warn("Error querying for workspaces: queryRequest={}", queryRequest, e); } } return Collections.emptyList(); }

Target:
public List<WorkspaceMetacardImpl> getWorkspaceMetacards(Set<String> workspaceIds) { if (workspaceIds.isEmpty()) { return Collections.emptyList(); } final Filter filter = workspaceQueryBuilder.createFilter(workspaceIds); final QueryRequest queryRequest = createQueryRequest(filter); try { return createWorkspaceMetacards(query(queryRequest)); } catch (CatalogQueryException e) { LOGGER.info("Error querying for workspaces: queryRequest={}", queryRequest, e); } return Collections.emptyList(); }
Source:
public void close() throws IOException { if (selectObjectContentResult != null) { selectObjectContentResult.close(); selectObjectContentResult = null; selectObjectRequest = null; } }

Target:
public void close() throws IOException { selectObjectContentResult.close(); }
Source:
public List<String> getSeedNodeIps(final boolean addExternal) { final List<String> seeds = CassandraFrameworkProtosUtils.getSeedNodeIps(clusterState.nodes()); if (addExternal) seeds.addAll(clusterState.getExternalSeeds()); return seeds; }

Target:
public List<String> getSeedNodeIps(final boolean addExternal) { final List<String> seeds = CassandraFrameworkProtosUtils.getSeedNodeIps(clusterState.nodes()); if (addExternal) { seeds.addAll(seedManager.getSeeds()); } return seeds; }
Source:
private Timeout scheduleTimeout(Duration timeoutDuration) { if (timeoutDuration.toNanos() > 0) { try { return this.timer.newTimeout( (Timeout timeout1) -> setFinalError( new DriverTimeoutException("Query timed out after " + timeoutDuration), null, -1), timeoutDuration.toNanos(), TimeUnit.NANOSECONDS); } catch (IllegalStateException e) { throw ("cannot be started once stopped".equals(e.getMessage())) ? new IllegalStateException("Session is closed") : e; } } else { return null; } }

Target:
private Timeout scheduleTimeout(Duration timeoutDuration) { if (timeoutDuration.toNanos() > 0) { try { return this.timer.newTimeout( (Timeout timeout1) -> setFinalError( new DriverTimeoutException("Query timed out after " + timeoutDuration), null, -1), timeoutDuration.toNanos(), TimeUnit.NANOSECONDS); } catch (IllegalStateException e) { result.completeExceptionally( ("cannot be started once stopped".equals(e.getMessage())) ? new IllegalStateException("Session is closed") : e); } } return null; }
Source:
protected static void cleanUpResources(String testName) { TestResources resources = testResources.remove(testName); if (resources != null) { for (Cleaner<?> cleaner : resources.getCleaners()) { try { cleaner.close(); } catch (Throwable t) { log.errorf(t, "Error cleaning resource %s", cleaner.ref); } } } }

Target:
protected static void cleanUpResources(String testName) { TestResources resources = testResources.remove(testName); if (resources != null) { for (Cleaner<?> cleaner : resources.getCleaners()) { try { cleaner.close(); } catch (Throwable t) { log.fatalf(t, "Error cleaning resource %s for test %s", cleaner.ref, testName); throw new IllegalStateException("Error cleaning resource " + cleaner.ref + " for test " + testName); } } } }
Source:
private void sizeCheck() { if(!parquetProperties.isEstimateNextSizeCheck()) { rowCountForNextSizeCheck = rowCount + parquetProperties.getMinRowCountForPageSizeCheck(); return; } long minRecordToWait = Long.MAX_VALUE; for (ColumnWriterV2 writer : writers) { long usedMem = writer.getCurrentPageBufferedSize(); long rows = rowCount - writer.getRowsWrittenSoFar(); long remainingMem = pageSizeThreshold - usedMem; if (remainingMem <= thresholdTolerance) { writer.writePage(rowCount); remainingMem = pageSizeThreshold; } long rowsToFillPage = usedMem == 0 ? parquetProperties.getMaxRowCountForPageSizeCheck() : (long)((float)rows) / usedMem * remainingMem; if (rowsToFillPage < minRecordToWait) { minRecordToWait = rowsToFillPage; } } if (minRecordToWait == Long.MAX_VALUE) { minRecordToWait = parquetProperties.getMinRowCountForPageSizeCheck(); } rowCountForNextSizeCheck = rowCount + min( max(minRecordToWait / 2, parquetProperties.getMinRowCountForPageSizeCheck()), parquetProperties.getMaxRowCountForPageSizeCheck()); }

Target:
private void sizeCheck() { long minRecordToWait = Long.MAX_VALUE; for (ColumnWriterV2 writer : writers) { long usedMem = writer.getCurrentPageBufferedSize(); long rows = rowCount - writer.getRowsWrittenSoFar(); long remainingMem = pageSizeThreshold - usedMem; if (remainingMem <= thresholdTolerance) { writer.writePage(rowCount); remainingMem = pageSizeThreshold; } long rowsToFillPage = usedMem == 0 ? parquetProperties.getMaxRowCountForPageSizeCheck() : (long)((float)rows) / usedMem * remainingMem; if (rowsToFillPage < minRecordToWait) { minRecordToWait = rowsToFillPage; } } if (minRecordToWait == Long.MAX_VALUE) { minRecordToWait = parquetProperties.getMinRowCountForPageSizeCheck(); } if(parquetProperties.isEstimateNextSizeCheck()) { rowCountForNextSizeCheck = rowCount + min( max(minRecordToWait / 2, parquetProperties.getMinRowCountForPageSizeCheck()), parquetProperties.getMaxRowCountForPageSizeCheck()); } else { rowCountForNextSizeCheck = rowCount + parquetProperties.getMinRowCountForPageSizeCheck(); } }
Source:
public void clone(String srcTableName, String newTableName, CloneConfiguration config) throws AccumuloSecurityException, TableNotFoundException, AccumuloException, TableExistsException { checkArgument(srcTableName != null, "srcTableName is null"); checkArgument(newTableName != null, "newTableName is null"); checkArgument(newTableName.length() <= MAX_TABLE_NAME_LEN, "Table name is longer than 1024 characters"); TableId srcTableId = Tables.getTableId(context, srcTableName); if (config.isFlush()) _flush(srcTableId, null, null, true); Set<String> propertiesToExclude = config.getPropertiesToExclude(); if (propertiesToExclude == null) propertiesToExclude = Collections.emptySet(); Map<String,String> propertiesToSet = config.getPropertiesToSet(); if (propertiesToSet == null) propertiesToSet = Collections.emptyMap(); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(srcTableId.canonical().getBytes(UTF_8)), ByteBuffer.wrap(newTableName.getBytes(UTF_8)), ByteBuffer.wrap(Boolean.toString(config.isKeepOffline()).getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); for (Entry<String,String> entry : propertiesToSet.entrySet()) { if (entry.getKey().startsWith(CLONE_EXCLUDE_PREFIX)) throw new IllegalArgumentException("Property can not start with " + CLONE_EXCLUDE_PREFIX); opts.put(entry.getKey(), entry.getValue()); } for (String prop : propertiesToExclude) { opts.put(CLONE_EXCLUDE_PREFIX + prop, ""); } doTableFateOperation(newTableName, AccumuloException.class, FateOperation.TABLE_CLONE, args, opts); }

Target:
public void clone(String srcTableName, String newTableName, CloneConfiguration config) throws AccumuloSecurityException, TableNotFoundException, AccumuloException, TableExistsException { checkArgument(srcTableName != null, "srcTableName is null"); checkArgument(newTableName != null, "newTableName is null"); checkArgument(newTableName.length() <= MAX_TABLE_NAME_LEN, "Table name is longer than " + MAX_TABLE_NAME_LEN + " characters"); TableId srcTableId = Tables.getTableId(context, srcTableName); if (config.isFlush()) _flush(srcTableId, null, null, true); Set<String> propertiesToExclude = config.getPropertiesToExclude(); if (propertiesToExclude == null) propertiesToExclude = Collections.emptySet(); Map<String,String> propertiesToSet = config.getPropertiesToSet(); if (propertiesToSet == null) propertiesToSet = Collections.emptyMap(); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(srcTableId.canonical().getBytes(UTF_8)), ByteBuffer.wrap(newTableName.getBytes(UTF_8)), ByteBuffer.wrap(Boolean.toString(config.isKeepOffline()).getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); for (Entry<String,String> entry : propertiesToSet.entrySet()) { if (entry.getKey().startsWith(CLONE_EXCLUDE_PREFIX)) throw new IllegalArgumentException("Property can not start with " + CLONE_EXCLUDE_PREFIX); opts.put(entry.getKey(), entry.getValue()); } for (String prop : propertiesToExclude) { opts.put(CLONE_EXCLUDE_PREFIX + prop, ""); } doTableFateOperation(newTableName, AccumuloException.class, FateOperation.TABLE_CLONE, args, opts); }
Source:
public Iterator<NeighborInfo> iterator() { return new Iterator<NeighborInfo>() { private Iterator<Entry<VKmer, ReadIdSet>> it = edges.entrySet().iterator(); private NeighborInfo info = null; @Override public boolean hasNext() { return it.hasNext(); } @Override public NeighborInfo next() { if(info == null){ info = new NeighborInfo(et, it.next()); }else{ } info.set(et, it.next()); return info; } @Override public void remove() { it.remove(); } }; }

Target:
public Iterator<NeighborInfo> iterator() { return new Iterator<NeighborInfo>() { private Iterator<Entry<VKmer, ReadIdSet>> it = edges.entrySet().iterator(); private NeighborInfo info = null; @Override public boolean hasNext() { return it.hasNext(); } @Override public NeighborInfo next() { if (info == null) { info = new NeighborInfo(et, it.next()); } info.set(et, it.next()); return info; } @Override public void remove() { it.remove(); } }; }
Source:
public void trackDelayedMetricsTenant(String tenantid, List<Metric> delayedMetrics) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s\n",tenantid); for (Metric metric : delayedMetrics) { logMessage += String.format("%s has collectionTime %d\n", metric.getLocator().toString(), metric.getCollectionTime()); } log.info(logMessage); } }

Target:
public void trackDelayedMetricsTenant(String tenantid, List<Metric> delayedMetrics) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantid); log.info(logMessage); double delayedMinutes; long nowMillis = System.currentTimeMillis(); for (Metric metric : delayedMetrics) { delayedMinutes = (double)(nowMillis - metric.getCollectionTime()) / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s has collectionTime %s which is delayed by %.2f minutes", metric.getLocator().toString(), dateFormatter.format(new Date(metric.getCollectionTime())), delayedMinutes); log.info(logMessage); } } }
Source:
private TrackGroupArray initSortedTrackGroups(TrackGroupArray trackGroups) { TrackGroupArray trackGroupArray = trackGroups; if(comparator != null) { TrackGroupArray trackGroupsArray = mappedTrackInfo.getTrackGroups(rendererIndex); for (int groupIndex = 0; groupIndex < trackGroupsArray.length; groupIndex++) { TrackGroup group = trackGroupsArray.get(groupIndex); Format[] listFormats = new Format[group.length]; for (int formatIndex = 0; formatIndex < group.length; formatIndex++) { listFormats[formatIndex] = group.getFormat(formatIndex); } Arrays.sort(listFormats, comparator); trackGroupArray = new TrackGroupArray(new TrackGroup(listFormats)); } } return trackGroupArray; }

Target:
private TrackGroupArray initSortedTrackGroups(TrackGroupArray trackGroups) { TrackGroupArray trackGroupArray = trackGroups; if(comparator != null) { TrackGroup[] tg = new TrackGroup[trackGroupArray.length]; for (int groupIndex = 0; groupIndex < trackGroupArray.length; groupIndex++) { TrackGroup group = trackGroupArray.get(groupIndex); Format[] listFormats = new Format[group.length]; for (int formatIndex = 0; formatIndex < group.length; formatIndex++) { listFormats[formatIndex] = group.getFormat(formatIndex); } Arrays.sort(listFormats, comparator); tg[groupIndex] = new TrackGroup(listFormats); } trackGroupArray = new TrackGroupArray(tg); } return trackGroupArray; }
Source:
private void initPropertiesUri(String propertiesURI) { try { if (propertiesURI == null) { this.propertiesURI = new URI(System.getProperty(VERSION_PROPERTIES_URI_KEY, DEFAULT_PROPERTIES_URI)); } else { this.propertiesURI = new URI(propertiesURI); } } catch (URISyntaxException e) { e.printStackTrace(); this.propertiesURI = URI.create(DEFAULT_PROPERTIES_URI); } }

Target:
private void initPropertiesUri(String propertiesURI) { try { if (propertiesURI == null) { this.propertiesURI = new URI(System.getProperty(VERSION_PROPERTIES_URI_KEY, DEFAULT_PROPERTIES_URI)); } else { this.propertiesURI = new URI(propertiesURI); } } catch (URISyntaxException e) { FoundationCorePlugin.pluginLog().logError( "Invalid URI format (" + propertiesURI + ") for " + VERSION_PROPERTIES_URI_KEY + ". Falling back on " + DEFAULT_PROPERTIES_URI, e); this.propertiesURI = URI.create(DEFAULT_PROPERTIES_URI); } }