auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private RepeatingTrigger(Long interval, Long delay, Integer repeatCount) { if (interval == null && delay == null) { throw new IllegalArgumentException("Both [interval] and [delay] cannot be null"); } this.interval = interval; this.delay = delay == null ? 0 : delay; this.repeatCount = repeatCount; this.executionCount = 1; triggerTime = getTimeSlice(now.get().getMillis() + this.delay, standardMinutes(1)); }

Target:
private RepeatingTrigger(Long interval, Long delay, Integer repeatCount) { if (interval == null && delay == null) { this.triggerTime = currentMinute().plusMinutes(1).getMillis(); } this.interval = interval; this.delay = delay == null ? 0 : delay; this.repeatCount = repeatCount; this.executionCount = 1; triggerTime = getTimeSlice(now.get().getMillis() + this.delay, standardMinutes(1)); }
Source:
public APIResult suspend(@PathParam("job-name") String jobName, @Context HttpServletRequest request, @DefaultValue("") @QueryParam("doAs") String doAsUser, @QueryParam("colo") final String coloExpr) { checkIfExtensionServiceIsEnabled(); ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean extensionJobsBean = metaStore.getExtensionJobDetails(jobName); if (extensionJobsBean == null) { LOG.error("Extension Job not found:" + jobName); throw FalconWebException.newAPIException("ExtensionJob not found:" + jobName, Response.Status.NOT_FOUND); } try { suspendEntities(extensionJobsBean, coloExpr, request); } catch (FalconException e) { LOG.error("Error while suspending entities of the extension: " + jobName + ": ", e); throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } return new APIResult(APIResult.Status.SUCCEEDED, "Extension job " + jobName + " suspended successfully"); }

Target:
public APIResult suspend(@PathParam("job-name") String jobName, @Context HttpServletRequest request, @DefaultValue("") @QueryParam("doAs") String doAsUser, @QueryParam("colo") final String coloExpr) { checkIfExtensionServiceIsEnabled(); ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean extensionJobsBean = metaStore.getExtensionJobDetails(jobName); if (extensionJobsBean == null) { LOG.error("Extension Job not found:" + jobName); throw FalconWebException.newAPIException("ExtensionJob not found:" + jobName, Response.Status.NOT_FOUND); } try { SortedMap<EntityType, List<String>> entityNameMap = getJobEntities(extensionJobsBean); suspendEntities(entityNameMap, coloExpr, request); } catch (FalconException e) { LOG.error("Error while suspending entities of the extension: " + jobName + ": ", e); throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } return new APIResult(APIResult.Status.SUCCEEDED, "Extension job " + jobName + " suspended successfully"); }
Source:
private String getDiskIsBeingMigratedMessage() { if (cachedDiskIsBeingMigratedMessage == null) { StringBuilder builder = new StringBuilder(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED.name()); if (getImage() != null) { builder.append(String.format("$DiskName %1$s", getDiskAlias())); } builder.append(String.format("$OperationType %1$s", ImageOperation.Move == getParameters().getOperation() ? "moved" : "copied")); cachedDiskIsBeingMigratedMessage = builder.toString(); } return cachedDiskIsBeingMigratedMessage; }

Target:
private String getDiskIsBeingMigratedMessage() { if (cachedDiskIsBeingMigratedMessage == null) { StringBuilder builder = new StringBuilder(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED.name()); if (getImage() != null) { builder.append(String.format("$DiskName %1$s", getDiskAlias())); } cachedDiskIsBeingMigratedMessage = builder.toString(); } return cachedDiskIsBeingMigratedMessage; }
Source:
private void getLazyRoutingConfig() { ImportHelper.loadRoutingFiles(app, new ImportHelper.LoadRoutingFilesCallback() { @Override public void onRoutingFilesLoaded() { notifyEvent(InitEvents.ROUTING_CONFIG_INITIALIZED); } }); }

Target:
private void getLazyRoutingConfig() { loadRoutingFiles(app, new LoadRoutingFilesCallback() { @Override public void onRoutingFilesLoaded() { notifyEvent(InitEvents.ROUTING_CONFIG_INITIALIZED); } }); }
Source:
public void eventMessageLogger(GlusterAsyncTask task, JobExecutionStatus oldStatus, VDSGroup cluster) { GlusterVolumeEntity volume; if ( getVolumeDao().getVolumeByGlusterTask(task.getTaskId()) != null) { volume = getVolumeDao().getVolumeByGlusterTask(task.getTaskId()); } else { String vol = task.getTaskParameters().getVolumeName(); volume = getVolumeDao().getByName(cluster.getId(), vol); } if (JobExecutionStatus.ABORTED == task.getStatus() || JobExecutionStatus.FINISHED == task.getStatus() || JobExecutionStatus.FAILED == task.getStatus()){ if(oldStatus != task.getStatus()){ logMessage(cluster.getId(), volume , taskTypeStrMap.get(task.getType()), task.getStatus().name().toLowerCase(), taskTypeAuditMsg.get(task.getType())); } } }

Target:
public void eventMessageLogger(GlusterAsyncTask task, JobExecutionStatus oldStatus, VDSGroup cluster) { GlusterVolumeEntity volume = getVolumeDao().getVolumeByGlusterTask(task.getTaskId()); if ( volume == null){ if(task.getTaskParameters() != null) { String vol = task.getTaskParameters().getVolumeName(); volume = getVolumeDao().getByName(cluster.getId(), vol); } else { return; } } if (JobExecutionStatus.ABORTED == task.getStatus() || JobExecutionStatus.FINISHED == task.getStatus() || JobExecutionStatus.FAILED == task.getStatus()){ if(oldStatus != task.getStatus()){ logMessage(cluster.getId(), volume , taskTypeStrMap.get(task.getType()), task.getStatus().name().toLowerCase(), taskTypeAuditMsg.get(task.getType())); } } }
Source:
public void testBasicSyntaxError() { assertEquals(InterpreterResult.Code.ERROR, repl.interpret("val a:Int = 'ds'", context).code()); }

Target:
public void testBasicSyntaxError() { InterpreterResult error = repl.interpret("val a:Int = 'ds'", context); assertEquals(InterpreterResult.Code.ERROR, error.code()); assertEquals("Interpreter error", error.message()); }
Source:
public void shouldGoThroughRebalancingCorrectly() throws ExecutionException, InterruptedException { final String repartitionName = "rebalancing-test"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); final Repartitioned<String, String> repartitioned = Repartitioned.<String, String>as(repartitionName) .withKeySerde(Serdes.String()) .withValueSerde(Serdes.String()) .withNumberOfPartitions(2); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .selectKey((key, value) -> key.toString()) .repartition(repartitioned) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); final KafkaStreams kafkaStreamsToClose = startStreams(builder); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 1L), new KeyValue<>("2", 1L) ) ); kafkaStreamsToClose.close(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "C"), new KeyValue<>(2, "D") ) ); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 2L), new KeyValue<>("2", 2L) ) ); final String repartitionTopicName = toRepartitionTopicName(repartitionName); assertTrue(topicExists(repartitionTopicName)); assertEquals(2, getNumberOfPartitionsForTopic(repartitionTopicName)); }

Target:
public void shouldGoThroughRebalancingCorrectly() throws Exception { final String repartitionName = "rebalancing-test"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); final Repartitioned<String, String> repartitioned = Repartitioned.<String, String>as(repartitionName) .withKeySerde(Serdes.String()) .withValueSerde(Serdes.String()) .withNumberOfPartitions(2); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .selectKey((key, value) -> key.toString()) .repartition(repartitioned) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); final KafkaStreams kafkaStreamsToClose = startStreams(builder); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 1L), new KeyValue<>("2", 1L) ) ); kafkaStreamsToClose.close(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "C"), new KeyValue<>(2, "D") ) ); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 2L), new KeyValue<>("2", 2L) ) ); final String repartitionTopicName = toRepartitionTopicName(repartitionName); assertTrue(topicExists(repartitionTopicName)); assertEquals(2, getNumberOfPartitionsForTopic(repartitionTopicName)); }
Source:
public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); if (getImage().getQuotaId() != null && getImage().getQuotaId().equals(getDestinationQuotaId())) { return list; } list.add(new QuotaStorageConsumptionParameter( getDestinationQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, getParameters().getStorageDomainId(), (double)getImage().getSizeInGigabytes())); if (ImageOperation.Move.equals(getParameters().getOperation())) { if (getImage().getQuotaId() != null && !Guid.Empty.equals(getImage().getQuotaId())) { list.add(new QuotaStorageConsumptionParameter( getImage().getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.RELEASE, getParameters().getSourceDomainId().getValue(), (double)getImage().getSizeInGigabytes())); } } return list; }

Target:
public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); if (getImage().getQuotaId() != null && getImage().getQuotaId().equals(getDestinationQuotaId())) { return list; } list.add(new QuotaStorageConsumptionParameter( getDestinationQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, getParameters().getStorageDomainId(), (double)getImage().getSizeInGigabytes())); if (ImageOperation.Move == getParameters().getOperation()) { if (getImage().getQuotaId() != null && !Guid.Empty.equals(getImage().getQuotaId())) { list.add(new QuotaStorageConsumptionParameter( getImage().getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.RELEASE, getParameters().getSourceDomainId().getValue(), (double)getImage().getSizeInGigabytes())); } } return list; }
Source:
public PcapNgBlock(SeekableByteChannel fileChannel, ByteOrder byteOrder) throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; if (fileChannel.size() - fileChannel.position() == 0) { throw new BadPcapFileException("Reaching end of file, cannot read the block."); } pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketHeader.order(byteOrder); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); int blockType = pcapPacketHeader.getInt(); setBlockType(blockType); int blockLength = pcapPacketHeader.getInt(); setBlockLength(blockLength); fBody = (ByteBuffer) pcapPacketHeader.position(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); setBody(fBody); }

Target:
public PcapNgBlock(SeekableByteChannel fileChannel, ByteOrder byteOrder) throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); pcapPacketHeader.order(byteOrder); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); int blockType = pcapPacketHeader.getInt(); fBlockType = blockType; int blockLength = pcapPacketHeader.getInt(); fBlockLength = blockLength; fBody = ByteBuffer.allocate(blockLength - PcapFileValues.PCAPNG_BLOCK_HEADER_SIZE); fBody.order(byteOrder); fileChannel.read(fBody); fBody.flip(); fBody.position(0); }
Source:
public void secureGet() throws Exception { server.useHttps(handshakeCertificates.sslSocketFactory(), false); url = server.url("/"); server.enqueue(new MockResponse()); Response response = client.newCall(request().build()).execute(); assertNotNull(response.body()); response.body().bytes(); logRecorder .assertLogMatch("callStart: Request\\{method=GET, url=" + url + ", tags=\\{\\}\\}") .assertLogMatch("dnsStart: " + url.host()) .assertLogMatch("dnsEnd: \\[.+\\]") .assertLogMatch("connectStart: " + url.host() + "/.+ DIRECT") .assertLogMatch("secureConnectStart") .assertLogMatch("secureConnectEnd: Handshake\\{" + "tlsVersion=TLS_1_[23] " + "cipherSuite=(?:TLS_(?:ECDHE_ECDSA_WITH_|)AES_(?:256_GCM_SHA384|128_GCM_SHA256)) " + "peerCertificates=\\[CN=localhost\\] " + "localCertificates=\\[\\]}") .assertLogMatch("connectEnd: h2") .assertLogMatch( "connectionAcquired: Connection\\{" + url.host() + ":\\d+, proxy=DIRECT hostAddress=" + url.host() + "/.+ cipherSuite=.+ protocol=h2}") .assertLogMatch("requestHeadersStart") .assertLogMatch("requestHeadersEnd") .assertLogMatch("responseHeadersStart") .assertLogMatch( "responseHeadersEnd: Response\\{protocol=h2, code=200, message=, url=" + url + "}") .assertLogMatch("responseBodyStart") .assertLogMatch("responseBodyEnd: byteCount=0") .assertLogMatch("connectionReleased") .assertLogMatch("callEnd") .assertNoMoreLogs(); }

Target:
public void secureGet() throws Exception { server.useHttps(handshakeCertificates.sslSocketFactory(), false); url = server.url("/"); server.enqueue(new MockResponse()); Response response = client.newCall(request().build()).execute(); assertNotNull(response.body()); response.body().bytes(); logRecorder .assertLogMatch("callStart: Request\\{method=GET, url=" + url + ", tags=\\{\\}\\}") .assertLogMatch("dnsStart: " + url.host()) .assertLogMatch("dnsEnd: \\[.+\\]") .assertLogMatch("connectStart: " + url.host() + "/.+ DIRECT") .assertLogMatch("secureConnectStart") .assertLogMatch("secureConnectEnd: Handshake\\{" + "tlsVersion=TLS_1_[23] " + "cipherSuite=TLS_.* " + "peerCertificates=\\[CN=localhost\\] " + "localCertificates=\\[\\]}") .assertLogMatch("connectEnd: h2") .assertLogMatch( "connectionAcquired: Connection\\{" + url.host() + ":\\d+, proxy=DIRECT hostAddress=" + url.host() + "/.+ cipherSuite=.+ protocol=h2}") .assertLogMatch("requestHeadersStart") .assertLogMatch("requestHeadersEnd") .assertLogMatch("responseHeadersStart") .assertLogMatch( "responseHeadersEnd: Response\\{protocol=h2, code=200, message=, url=" + url + "}") .assertLogMatch("responseBodyStart") .assertLogMatch("responseBodyEnd: byteCount=0") .assertLogMatch("connectionReleased") .assertLogMatch("callEnd") .assertNoMoreLogs(); }
Source:
private void notifyAsyncAckReceived(long sendTime, String siteName, Throwable throwable) { log.debugf("Async ack received from %s. Throwable=%s", siteName, throwable); OfflineStatus status = offlineStatus.get(siteName); if (status == null) { return; } if (throwable == null) { if (!status.isOffline()) { status.reset(); } return; } if (isCommunicationError(throwable)) { status.updateOnCommunicationFailure(sendTime); } else if (throwable instanceof ExecutionException && isCommunicationError(throwable.getCause())) { status.updateOnCommunicationFailure(sendTime); } }

Target:
private void notifyAsyncAckReceived(long sendTime, String siteName, Throwable throwable) { log.debugf("Async ack received from %s. Throwable=%s", siteName, throwable); OfflineStatus status = offlineStatus.get(siteName); if (status == null) { return; } if (throwable == null) { if (!status.isOffline()) { status.reset(); } return; } if (isCommunicationError(throwable)) { status.updateOnCommunicationFailure(sendTime); } }
Source:
public <U> List<U> sort(Collection<U> children) { if (children == null || children.isEmpty()) { return Collections.emptyList(); } AvroSchemaFactory<U> factory = getFactory(children.iterator().next()); if (factory == null) { return Collections.emptyList(); } List<U> sortedChildren = new ArrayList<>(children); Collections.sort(sortedChildren, (o1, o2) -> Objects.compare( factory.getQualifiedName(o1), factory.getQualifiedName(o2), String::compareTo)); return sortedChildren; }

Target:
public <U> List<U> sort(Collection<U> children) { if (children == null || children.isEmpty()) { return Collections.emptyList(); } AvroSchemaFactory<U> factory = getFactory(children.iterator().next()); if (factory == null) { return Collections.emptyList(); } List<U> sortedChildren = new ArrayList<>(children); sortedChildren.sort((o1, o2) -> Objects.compare( factory.getQualifiedName(o1), factory.getQualifiedName(o2), String::compareTo)); return sortedChildren; }
Source:
protected Object createTest() throws Exception { try { checkSupportedVersion(); final TestConfiguration testConfiguration = createTestConfiguration(); weld = new Weld() { protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) { try { return new Weld11TestUrlDeployment(resourceLoader, bootstrap, testConfiguration); } catch (IOException e) { startupException = e; throw new RuntimeException(e); } } protected Deployment createDeployment(ResourceLoader resourceLoader, Bootstrap bootstrap) { try { return new WeldTestUrlDeployment(resourceLoader, bootstrap, testConfiguration); } catch (IOException e) { startupException = e; throw new RuntimeException(e); } }; }; try { container = weld.initialize(); } catch (Throwable e) { if (startupException == null) { startupException = e; } if (e instanceof ClassFormatError) { throw e; } } } catch (ClassFormatError e) { startupException = parseClassFormatError(e); } catch (Throwable e) { startupException = new Exception("Unable to start weld", e); } return createTest(clazz); }

Target:
protected Object createTest() throws Exception { try { checkSupportedVersion(); final TestConfiguration testConfig = createTestConfiguration(); weld = new Weld() { protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) { try { return new Weld11TestUrlDeployment(resourceLoader, bootstrap, testConfig); } catch (IOException e) { startupException = e; throw new RuntimeException(e); } } protected Deployment createDeployment(ResourceLoader resourceLoader, Bootstrap bootstrap) { try { return new WeldTestUrlDeployment(resourceLoader, bootstrap, testConfig); } catch (IOException e) { startupException = e; throw new RuntimeException(e); } }; }; try { container = weld.initialize(); } catch (Throwable e) { if (startupException == null) { startupException = e; } if (e instanceof ClassFormatError) { throw e; } } } catch (ClassFormatError e) { startupException = parseClassFormatError(e); } catch (Throwable e) { startupException = new Exception("Unable to start weld", e); } return createTest(clazz); }
Source:
public Collection<CollectionElementVariable2> createElemConstraintVariables() { Collection<CollectionElementVariable2> newVars= new HashSet<>(); computeContainerStructure(); if (DEBUG_INITIALIZATION) System.out.println("\n*** Creating Element Variables: ***\n"); for (ConstraintVariable2 fAllConstraintVariable : fAllConstraintVariables) { newVars.addAll(createVariablesFor(fAllConstraintVariable)); } return newVars; }

Target:
public Collection<CollectionElementVariable2> createElemConstraintVariables() { Collection<CollectionElementVariable2> newVars= new HashSet<>(); computeContainerStructure(); if (DEBUG_INITIALIZATION) System.out.println("\n*** Creating Element Variables: ***\n"); for (ConstraintVariable2 constraintVariable : fAllConstraintVariables) { newVars.addAll(createVariablesFor(constraintVariable)); } return newVars; }
Source:
private ObjectId createTree(String... paths) throws IOException { final ObjectInserter odi = db.newObjectInserter(); final DirCache dc = db.readDirCache(); final DirCacheBuilder builder = dc.builder(); for (String path : paths) { DirCacheEntry entry = createEntry(path, FileMode.REGULAR_FILE); builder.add(entry); } builder.finish(); final ObjectId treeId = dc.writeTree(odi); odi.flush(); return treeId; }

Target:
private ObjectId createTree(String... paths) throws IOException { final ObjectInserter odi = db.newObjectInserter(); final DirCache dc = db.readDirCache(); final DirCacheBuilder builder = dc.builder(); for (String path : paths) { DirCacheEntry entry = createEntry(path, FileMode.REGULAR_FILE); builder.add(entry); } builder.finish(); final ObjectId objId = dc.writeTree(odi); odi.flush(); return objId; }
Source:
public static String getHashString(final String s) { String output = ""; try { MessageDigest digest = MessageDigest.getInstance(MD5); digest.update(s.getBytes()); byte messageDigest[] = digest.digest(); StringBuilder hexString = new StringBuilder(); for (byte aMessageDigest : messageDigest) { String h = Integer.toHexString(0xFF & aMessageDigest); while (h.length() < 2) { h = "0" + h; } hexString.append(h); } output = hexString.toString(); } catch (NoSuchAlgorithmException e) { Log.e(TAG, e.getMessage()); } return output; }

Target:
public static String getHashString(final String s) { try { MessageDigest digest = MessageDigest.getInstance(MD5); digest.update(s.getBytes()); byte messageDigest[] = digest.digest(); StringBuilder hexString = new StringBuilder(); for (byte aMessageDigest : messageDigest) { String h = Integer.toHexString(0xFF & aMessageDigest); while (h.length() < 2) { h = "0" + h; } hexString.append(h); } return hexString.toString(); } catch (NoSuchAlgorithmException e) { Log.e(TAG, e.getMessage()); throw new RuntimeException("MD5 message digest not available", e); } }
Source:
public void acquireLock() throws IOException { try { m_currentPath = m_zk.create(m_lockPath, null, Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); synchronized(lock) { while(true) { List<String> nodes = getAllLockingNodes(); Collections.sort(nodes); if (nodes.isEmpty() || m_currentPath.endsWith(nodes.get(0))) { return; } else { lock.wait(); } } } } catch (KeeperException | InterruptedException e) { throw new IOException(e); } }

Target:
public boolean acquireLock() { return acquireLockWithTimeout(0); }
Source:
public boolean hasUseBackgroundNetworksPermission(int uid) { return mApps.containsKey(uid); }

Target:
public synchronized boolean hasUseBackgroundNetworksPermission(int uid) { return mApps.containsKey(uid); }
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return super.getExclusiveLocks(); }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return singletonMap(getParameters().getVdsId().toString(), makeLockingPair(VDS_FENCE, SAME_ACTION_ON_ENTITY_ALREADY_IN_PROGRESS)); }
Source:
private static Boolean isNewStitchPoint(PointF point) { if (point.x != stitchPoints.get(lastIndex).x || point.y != stitchPoints.get(lastIndex).y) { return true; } return false; }

Target:
private Boolean isNewStitchPoint(PointF point) { return !stitchPoints.get(stitchPoints.size() - 1).equals(point); }
Source:
public void initMap(MapFragment newMapFragment) { map = newMapFragment; findViewById(R.id.zoom_to_location).setOnClickListener(v -> map.zoomToPoint(map.getGpsLocation(), true)); findViewById(R.id.zoom_to_bounds).setOnClickListener(v -> map.zoomToBoundingBox(points, 0.8, false)); findViewById(R.id.layer_menu).setOnClickListener(v -> { MapsPreferences.showReferenceLayerDialog(this); }); findViewById(R.id.new_instance).setOnClickListener(v -> { startActivity(new Intent(Intent.ACTION_EDIT, getIntent().getData())); }); map.setGpsLocationEnabled(true); map.setGpsLocationListener(this::onLocationChanged); if (previousState != null) { restoreFromInstanceState(previousState); } map.setFeatureClickListener(this::onFeatureClicked); updateInstanceGeometry(); new Handler().postDelayed(() -> { if (selectedSubmissionId != -1) { onFeatureClicked(selectedSubmissionId); } }, 500); }

Target:
public void initMap(MapFragment newMapFragment) { map = newMapFragment; findViewById(R.id.zoom_to_location).setOnClickListener(v -> map.zoomToPoint(map.getGpsLocation(), true)); findViewById(R.id.zoom_to_bounds).setOnClickListener(v -> map.zoomToBoundingBox(points, 0.8, false)); findViewById(R.id.layer_menu).setOnClickListener(v -> { MapsPreferences.showReferenceLayerDialog(this); }); findViewById(R.id.new_instance).setOnClickListener(v -> { startActivity(new Intent(Intent.ACTION_EDIT, getIntent().getData())); }); map.setGpsLocationEnabled(true); map.setGpsLocationListener(this::onLocationChanged); if (previousState != null) { restoreFromInstanceState(previousState); } map.setFeatureClickListener(this::onFeatureClicked); map.setClickListener(this::onClick); updateInstanceGeometry(); if (viewModel.getSelectedSubmissionId() != -1) { onFeatureClicked(viewModel.getSelectedSubmissionId()); } }
Source:
protected boolean shouldProcessItemType(Item item) { if (trackerType != null && trackerValues != null) { List<MetadataValue> types = itemService .getMetadata(item, trackerType.split("\\.")[0], trackerType.split("\\.")[1], trackerType.split("\\.").length == 2 ? null : trackerType.split("\\.")[2], Item.ANY); if (!types.isEmpty()) { for (MetadataValue type : types) { if (trackerValues.contains(type.getValue().toLowerCase())) { return false; } } return true; } else { return true; } } else { return true; } }

Target:
protected boolean shouldProcessItemType(Item item) { if (trackerTypeMetadataField != null && trackerTypeMetadataValues != null) { String[] metadataFieldSplit = trackerTypeMetadataField.split("\\."); List<MetadataValue> types = itemService .getMetadata(item, metadataFieldSplit[0], metadataFieldSplit[1], metadataFieldSplit.length == 2 ? null : metadataFieldSplit[2], Item.ANY); if (!types.isEmpty()) { for (MetadataValue type : types) { if (trackerTypeMetadataValues.contains(type.getValue().toLowerCase())) { return false; } } return true; } else { return true; } } else { return true; } }
Source:
public void testCacheManager() { GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder(); gcb.globalJmxStatistics().allowDuplicateDomains(true); String tmpDirectory = tmpDirectory(this.getClass()); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.persistence() .addStore(RocksDBStoreConfigurationBuilder.class) .location(tmpDirectory) .expiredLocation(tmpDirectory + "-expired"); EmbeddedCacheManager cm = new DefaultCacheManager(gcb.build(), builder.build()); Cache<String, String> cache = cm.getCache(); cache.put("a", "a"); assertEquals("a", cache.get("a")); cm.stop(); }

Target:
public void testCacheManager() { GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder(); gcb.globalJmxStatistics().allowDuplicateDomains(true); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.persistence() .addStore(RocksDBStoreConfigurationBuilder.class) .location(dataDir) .expiredLocation(expiredDir); EmbeddedCacheManager cm = new DefaultCacheManager(gcb.build(), builder.build()); Cache<String, String> cache = cm.getCache(); cache.put("a", "a"); assertEquals("a", cache.get("a")); cm.stop(); }
Source:
public static List<String> operatorSymbols() { return Lists2.map(Arrays.asList(values()), t -> t.name); }

Target:
public static List<String> operatorSymbols() { return Lists2.map(Arrays.asList(values()), t -> t.opSymbol); }
Source:
public long getCurrentNanoTime() { return System.nanoTime(); }

Target:
protected long getCurrentNanoTime() { return System.nanoTime(); }
Source:
private void prepareBrowserStackLocal() { String platformBinaryNameUrl = getPlatformBinaryNameUrl(); File browserStackLocalZipFile = new File(browserStackLocalDirectory.getPath() + File.separator + platformBinaryNameUrl); String url = basicUrl + platformBinaryNameUrl; log.info("Creating directory: " + browserStackLocalDirectory); browserStackLocalDirectory.mkdir(); log.info("downloading zip file from: " + url + " to " + browserStackLocalZipFile.getPath()); Spacelift.task(DownloadTool.class).from(url).to(browserStackLocalZipFile.getPath()).execute().await(); log.info("extracting zip file: " + browserStackLocalZipFile + " to " + browserStackLocalDirectory.getPath()); Spacelift.task(browserStackLocalZipFile, UnzipTool.class).toDir(browserStackLocalDirectory.getPath()).execute() .await(); log.info("marking binary file: " + browserStackLocalFile.getPath() + " as executable"); browserStackLocalFile.setExecutable(true); }

Target:
private void prepareBrowserStackLocal() { String platformBinaryNameUrl = getPlatformBinaryNameUrl(); File browserStackLocalZipFile = new File(browserStackLocalDirectory.getPath() + File.separator + platformBinaryNameUrl); String url = basicUrl + platformBinaryNameUrl; log.info("Creating directory: " + browserStackLocalDirectory); browserStackLocalDirectory.mkdir(); log.info("downloading zip file from: " + url + " to " + browserStackLocalZipFile.getPath()); Spacelift.task(DownloadTool.class) .from(url) .to(browserStackLocalZipFile.getPath()) .execute().await(); log.info("extracting zip file: " + browserStackLocalZipFile + " to " + browserStackLocalDirectory.getPath()); Spacelift.task(browserStackLocalZipFile, UnzipTool.class) .toDir(browserStackLocalDirectory.getPath()) .execute().await(); log.info("marking binary file: " + browserStackLocalFile.getPath() + " as executable"); try { browserStackLocalFile.setExecutable(true); } catch (SecurityException se) { log.severe("The downloaded BrowserStackLocal binary: " + browserStackLocalFile + " could not be set as executable. This may cause additional problems."); } }
Source:
public TapePersistenceStrategy(String filePath, final SerializationStrategy<E, ? extends Batch> serializationStrategy) { this.filePath = filePath; this.converter = new FileObjectQueue.Converter<E>() { @Override public E from(byte[] bytes) throws IOException { return serializationStrategy.deserializeData(bytes); } @Override public void toStream(E data, OutputStream bytes) throws IOException { bytes.write(serializationStrategy.serializeData(data)); } }; }

Target:
public TapePersistenceStrategy(String filePath, final SerializationStrategy<E, ? extends Batch> serializationStrategy) { this.filePath = filePath; this.converter = new DataObjectConverter<>(serializationStrategy); }
Source:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { for (GlusterBrickEntity brick : searchBricks) { if (paramBrick.getId() == brick.getId() || (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId() == brick.getServerId())) { found = true; break; } if (!found) { return found; } } } return found; }

Target:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { for (GlusterBrickEntity brick : searchBricks) { if (paramBrick.getId().equals(brick.getId()) || (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId().equals(brick.getServerId()))) { found = true; break; } if (!found) { return found; } found = false; } } return found; }
Source:
public Calendar getCurrentTimeCalendar() { BroadleafRequestContext brc = BroadleafRequestContext.getBroadleafRequestContext(); WebRequest webRequest = brc.getWebRequest(); if(BLCRequestUtils.isOKtoUseSession(webRequest)) { HttpSession session = brc.getRequest().getSession(); TimeZone timeZone = (TimeZone) session.getAttribute(CLIENT_TIMEZONE); int n = 0; if(timeZone != null) { return SystemTime.asCalendar(Locale.getDefault(), timeZone, true); } } return SystemTime.asCalendar(true); }

Target:
public Calendar getCurrentTimeCalendar() { BroadleafRequestContext brc = BroadleafRequestContext.getBroadleafRequestContext(); WebRequest webRequest = brc.getWebRequest(); if(BLCRequestUtils.isOKtoUseSession(webRequest)) { HttpSession session = brc.getRequest().getSession(); TimeZone timeZone = (TimeZone) session.getAttribute(CLIENT_TIMEZONE); if(timeZone != null) { return SystemTime.asCalendar(Locale.getDefault(), timeZone, true); } } return SystemTime.asCalendar(true); }
Source:
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) { assertRemoteCacheManagerIsStarted(); ReplaceOperation<V> op = operationsFactory.newReplaceOperation(compatKeyIfNeeded(key), keyToBytes(key), valueToBytes(value), lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit, dataFormat); CompletableFuture<V> result = op.execute(); if (statistics) { result.thenRun(() -> clientStatistics.incrementRemoteStores()); } return result; }

Target:
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) { assertRemoteCacheManagerIsStarted(); ReplaceOperation<V> op = operationsFactory.newReplaceOperation(keyAsObjectIfNeeded(key), keyToBytes(key), valueToBytes(value), lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit, dataFormat); return op.execute(); }
Source:
synchronized public void send(Collection<PlainCommand> commands) { if (autoflush) { for (PlainCommand command : commands) { send(command); } return; } StringBuilder builder = new StringBuilder(); for (PlainCommand command : commands) { builder.append(command.compose()); builder.append("\n"); } send(builder.toString()); }

Target:
synchronized public void send(Collection<PlainCommand> commands) { if (autoflush) { for (PlainCommand command : commands) { send(command); } return; } StringBuilder builder = new StringBuilder(); for (PlainCommand command : commands) { String rawCommand = command.compose(); builder.append(rawCommand); if (!rawCommand.endsWith("\n")) { builder.append("\n"); } } send(builder.toString()); }
Source:
public CompletableFuture<DnsLookupResponseDTO> execute(DnsLookupRequestDTO request) { String ipAddr = request.getHostRequest(); String queryType = request.getQueryType(); DnsLookupResponseDTO dto = new DnsLookupResponseDTO(); InetAddress addr = InetAddressUtils.addr(ipAddr); if (queryType.equals(QueryType.LOOKUP.toString())) { dto.setHostResponse(addr.getHostAddress()); } else if (queryType.equals(QueryType.REVERSE_LOOKUP.toString())) { dto.setHostResponse(addr.getCanonicalHostName()); } CompletableFuture<DnsLookupResponseDTO> response = new CompletableFuture<DnsLookupResponseDTO>(); response.complete(dto); return response; }

Target:
public CompletableFuture<DnsLookupResponseDTO> execute(DnsLookupRequestDTO request) { String hostRequest = request.getHostRequest(); QueryType queryType = request.getQueryType(); DnsLookupResponseDTO dto = new DnsLookupResponseDTO(); try { InetAddress addr = InetAddressUtils.addr(hostRequest); if (queryType.equals(QueryType.LOOKUP)) { dto.setHostResponse(addr.getHostAddress()); } else if (queryType.equals(QueryType.REVERSE_LOOKUP)) { dto.setHostResponse(addr.getCanonicalHostName()); } } catch (Exception e) { dto.setFailureMessage(e.getMessage()); } CompletableFuture<DnsLookupResponseDTO> response = new CompletableFuture<DnsLookupResponseDTO>(); response.complete(dto); return response; }
Source:
public boolean rejoinNeededOrPending() { if (!subscriptions.partitionsAutoAssigned()) return false; if (assignmentSnapshot != null && !assignmentSnapshot.matches(metadataSnapshot)) { maybeLosePartitions("topic metadata has changed and therefore some topics may not exist any moreq"); return true; } if (joinedSubscription != null && !joinedSubscription.equals(subscriptions.subscription())) { maybeLosePartitions("consumer subscription has changed since last joined generation"); return true; } return super.rejoinNeededOrPending(); }

Target:
public boolean rejoinNeededOrPending() { if (!subscriptions.partitionsAutoAssigned()) return false; if (assignmentSnapshot != null && !assignmentSnapshot.matches(metadataSnapshot)) return true; if (joinedSubscription != null && !joinedSubscription.equals(subscriptions.subscription())) { return true; } return super.rejoinNeededOrPending(); }
Source:
public synchronized void out(@Nullable String line) { if (Strings.isNullOrEmpty(line) || line.equals("Ready")) return; NotifierProcessOutput delegate = getNotifier(); mLogger.verbose("AAPT out(%1$s): %2$s", mProcess.hashCode(), line); if (delegate != null) { mLogger.verbose("AAPT out(%1$s): -> %2$s", mProcess.hashCode(), delegate.mJob); delegate.out(line); } else { mLogger.error(null, "AAPT out(%1$s) : No Delegate set : lost message:%2$s", mProcess.hashCode(), line); } }

Target:
public synchronized void out(@Nullable String line) { if (Strings.isNullOrEmpty(line) || line.equals("Ready")) { return; } NotifierProcessOutput delegate = getNotifier(); mLogger.verbose("AAPT out(%1$s): %2$s", mProcess.hashCode(), line); if (delegate != null) { mLogger.verbose("AAPT out(%1$s): -> %2$s", mProcess.hashCode(), delegate.mJob); delegate.out(line); } else { mLogger.error(null, "AAPT out(%1$s) : No Delegate set : lost message:%2$s", mProcess.hashCode(), line); } }
Source:
public Monitor(Map conf) { startTimestampPerId = Maps.newConcurrentMap(); if (RiemannDiscovery.isAWS()) { eventSender = RiemannEventSender.getRiemannEventsSender(); } else { eventSender = new LoggerEventSender(); } customAttributes = extractCustomEventAttributes(conf); }

Target:
public Monitor(Map conf) { startTimestampPerId = Maps.newConcurrentMap(); if (RiemannDiscovery.getInstance().isAWS()) { eventSender = RiemannEventSender.getInstance(); } else { eventSender = new LoggerEventSender(); } customAttributes = extractCustomEventAttributes(conf); }
Source:
private void setStack(DoorsTableRow current, RowType rt) { if (stack.empty()) { stack.push(current); } RowType stackTop = stack.peek().getType(); switch (stackTop) { case SINGLE: handleSingle(current, rt); break; case MULTI_START: case MULTI_MID: handleMulti(current, rt); break; case MULTI_END: break; case FIRST_ROW: break; } }

Target:
private void setStack(DoorsTableRow current, RowType rt) { if (stack.empty()) { stack.push(current); } RowType stackTop = stack.peek().getType(); switch (stackTop) { case SINGLE: handleSingle(current, rt); break; case MULTI_START: case MULTI_MID: handleMulti(current, rt); break; case MULTI_END: break; case FIRST_ROW: break; default: throw new OseeStateException("Unhandled enumeration", current); } }
Source:
private void checkResource(boolean fail, String resource) { if (fail) { LOGGER.error("No " + resource + " resources present"); } }

Target:
private void checkResource(boolean fail, String resource) { if (fail) { LOGGER.debug("No " + resource + " resources present"); } }
Source:
public void sizeBatcherTest() throws InterruptedException { TestListenter<Integer> listenter = new TestListenter<Integer>(); final Batcher<Integer> batcher = BatcherBuilder.create(100) .build(listenter); CountDownLatch start = new CountDownLatch(1); CountDownLatch done = setupProducers(batcher, start, 10, 100); start.countDown(); done.await(); sleep(20); batcher.close(); assertEquals(1000, listenter.getCount()); assertTrue(listenter.getNumBatches() >= 10); for (Collection<Integer> batch : listenter.getBatches()) { assertEquals(100, batch.size()); } }

Target:
public void sizeBatcherTest() throws InterruptedException { TestListenter<Integer> listenter = new TestListenter<Integer>(); final Batcher<Integer> batcher = BatcherBuilder.create() .sizeBound(100) .build(listenter); CountDownLatch start = new CountDownLatch(1); CountDownLatch done = setupProducers(batcher, start, 10, 100); start.countDown(); done.await(); sleep(20); batcher.close(); assertEquals(1000, listenter.getCount()); assertTrue(listenter.getNumBatches() >= 10); for (Collection<Integer> batch : listenter.getBatches()) { assertEquals(100, batch.size()); } }
Source:
public void beforeServerStopped(KieServer kieServer) { if (routerURL == null) { logger.debug("KieServer router url not given, skipping"); return; } ServiceResponse<KieContainerResourceList> containers = kieServer.listContainers(activeOnly); containers.getResult().getContainers().forEach(ci -> { routers().forEach(url -> { String alias = getContainerAlias(ci); String containerIdPayload = "{" + MessageFormat.format(CONTAINER_JSON, ci.getContainerId(), alias, serverURL, serverId, ci.getReleaseId().toExternalForm()) + "}"; boolean success = send(url + "/admin/remove", ci.getContainerId(), containerIdPayload, false, false); if (success) { logger.info("Removed '{}' as server location for container id '{}'", serverURL, ci.getContainerId()); } }); }); }

Target:
public void beforeServerStopped(KieServer kieServer) { if (routerURL == null) { logger.debug("KieServer router url not given, skipping"); return; } ServiceResponse<KieContainerResourceList> containers = kieServer.listContainers(activeOnly); containers.getResult().getContainers().forEach(ci -> { routers().forEach(url -> { String alias = getContainerAlias(ci); String containerIdPayload = "{" + MessageFormat.format(CONTAINER_JSON, ci.getContainerId(), alias, serverURL, serverId, ci.getReleaseId().toExternalForm()) + "}"; boolean success = send(url + ROUTER_REMOVE_URL, ci.getContainerId(), containerIdPayload, false, false); if (success) { logger.info("Removed '{}' as server location for container id '{}'", serverURL, ci.getContainerId()); } }); }); }
Source:
private static String getMessageToLog(String loggerString, AuditLog auditLog) { String message; if (loggerString.isEmpty()) { message = auditLog.toStringForLogging(); } else { message = MessageFormat.format(loggerString, auditLog.getMessage()); } return MessageFormat.format("EVENT_ID: {0}, {1}", auditLog.getLogType().getValue(), message); }

Target:
private static String getMessageToLog(String loggerString, AuditLog auditLog) { String message; if (loggerString.isEmpty()) { message = auditLog.toStringForLogging(); } else { message = MessageFormat.format(loggerString, auditLog.getMessage()); } return MessageFormat.format("EVENT_ID: {0}({1}), {2}", auditLog.getLogType(), auditLog.getLogType().getValue(), message); }
Source:
private void runFormatterWithPlugin() { TestHelper.builder() .withFeatures(failingFeature, successfulFeature, pendingFeature) .withRuntimeArgs("--plugin", "timeline:" + reportDir.getAbsolutePath()) .withStepsToResult(stepsToResult) .withStepsToLocation(stepsToLocation) .withTimeServiceIncrement(STEP_DURATION) .build() .run(); }

Target:
private void runFormatterWithPlugin() { TestHelper.builder() .withFeatures(failingFeature, successfulFeature, pendingFeature) .withRuntimeArgs("--plugin", "timeline:" + reportDir.getAbsolutePath()) .withStepsToResult(stepsToResult) .withStepsToLocation(stepsToLocation) .withTimeServiceIncrement(TimeUnit.MILLISECONDS.toNanos(STEP_DURATION_MS)) .build() .run(); }
Source:
public void testSelectInformationSchemaColumns() { assertQuery( "SELECT table_schema FROM information_schema.columns WHERE table_schema = 'tpch' LIMIT 1", "VALUES 'tpch'"); assertQuery( "SELECT table_name FROM information_schema.columns WHERE table_name = 'orders' LIMIT 1", "VALUES 'orders'"); }

Target:
public void testSelectInformationSchemaColumns() { assertQuery( "SELECT table_schema FROM information_schema.columns WHERE table_schema = 'tpch' ORDER BY table_schema LIMIT 1", "VALUES 'tpch'"); assertQuery( "SELECT table_name FROM information_schema.columns WHERE table_name = 'orders' ORDER BY table_name LIMIT 1", "VALUES 'orders'"); }
Source:
public void onResume() { super.onResume(); if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0 && getIntent().getAction() == DISCONNECT_ACTION) { Log.d(TAG, "Got disconnect all request"); disconnectAll(); } closeOnDisconnectAll = waitingForDisconnectAll && closeOnDisconnectAll; }

Target:
public void onResume() { super.onResume(); if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0 && DISCONNECT_ACTION.equals(getIntent().getAction())) { Log.d(TAG, "Got disconnect all request"); disconnectAll(); } closeOnDisconnectAll = waitingForDisconnectAll && closeOnDisconnectAll; }
Source:
public void handleSetConfigurationObjectResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handle SetConfigurationObject response for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSetConfigurationObjectResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handle SetConfigurationObject response for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public QueryStateTimer(Ticker ticker) { this.ticker = ticker; this.createNanos = tickerNanos(); this.lastHeartbeatNanos = new AtomicReference<>(createNanos); }

Target:
public QueryStateTimer(Ticker ticker) { this.ticker = requireNonNull(ticker, "ticker is null"); this.createNanos = tickerNanos(); this.lastHeartbeatNanos = new AtomicReference<>(createNanos); }
Source:
public void parseFiles(Collection<String> paths, Handler handler, SourceVersion sourceVersion) { List<File> files = new ArrayList<>(); for (String path : paths) { files.add(new File(path)); } try { JavacEnvironment env = createEnvironment(files, null, false, null); List<CompilationUnitTree> units = new ArrayList<>(); for (CompilationUnitTree unit : env.task().parse()) { units.add(unit); } env.task().analyze(); processDiagnostics(env.diagnostics()); if (ErrorUtil.errorCount() == 0) { for (CompilationUnitTree ast : units) { com.google.devtools.j2objc.ast.CompilationUnit unit = TreeConverter .convertCompilationUnit(options, env, (JCTree.JCCompilationUnit) ast); processDiagnostics(env.diagnostics()); handler.handleParsedUnit(unit.getSourceFilePath(), unit); } } } catch (IOException e) { ErrorUtil.fatalError(e, "javac file manager error"); } }

Target:
public void parseFiles(Collection<String> paths, Handler handler, SourceVersion sourceVersion) { List<File> files = new ArrayList<>(); for (String path : paths) { files.add(new File(path)); } try { JavacEnvironment env = createEnvironment(files, null, false); List<CompilationUnitTree> units = new ArrayList<>(); for (CompilationUnitTree unit : env.task().parse()) { units.add(unit); } env.task().analyze(); processDiagnostics(env.diagnostics()); if (ErrorUtil.errorCount() == 0) { for (CompilationUnitTree ast : units) { com.google.devtools.j2objc.ast.CompilationUnit unit = TreeConverter .convertCompilationUnit(options, env, (JCTree.JCCompilationUnit) ast); processDiagnostics(env.diagnostics()); handler.handleParsedUnit(unit.getSourceFilePath(), unit); } } } catch (IOException e) { ErrorUtil.fatalError(e, "javac file manager error"); } }