auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Consumer<OutputLinkWriter> links(String fingerprint) { return outputLinkWriter -> outputLinkWriter.addLink("self", Routes.Materials.modification(fingerprint)) .addAbsoluteLink("doc", Routes.Materials.DOC) <START> .addLink("find", Routes.Materials.FIND_MODIFICATIONS); <END> }</code><technical_language>Find link offset specified. Need verify other entity offset</technical_language>

Target:
private static Consumer<OutputLinkWriter> links(String fingerprint) { return outputLinkWriter -> outputLinkWriter.addLink("self", Routes.MaterialModifications.modification(fingerprint)) .addAbsoluteLink("doc", Routes.MaterialConfig.DOC) .addLink("find", Routes.MaterialModifications.FIND); }
Source:
<code>public void forceSnapshotSync(String clusterId) { <START> if (localClusterDescriptor.getRole() == ClusterRole.STANDBY) { <END> String errorStr = "The forceSnapshotSync command is not supported on standby cluster: " + localNodeDescriptor; log.error(errorStr); throw new RuntimeException(errorStr); } log.info("Received the forceSnapshotSync command at node and will write to the replicationTable.", localNodeDescriptor); ReplicationEventKey key = ReplicationEventKey.newBuilder().setKey(System.currentTimeMillis() + " "+ clusterId).build(); ReplicationEvent event = ReplicationEvent.newBuilder().setClusterId(clusterId).setType(LogReplicationMetadata.ReplicationEventType.FORCE_SNAPSHOT_SYNC).build(); getLogReplicationMetadataManager().updateLogReplicationEventTable(key, event); }</code><technical_language>call getLocalClusterRoleType</technical_language>

Target:
public void forceSnapshotSync(String clusterId) throws LogReplicationDiscoveryServiceException { if (localClusterDescriptor.getRole() == ClusterRole.STANDBY) { String errorStr = "The forceSnapshotSync command is not supported on standby cluster."; log.error(errorStr); throw new LogReplicationDiscoveryServiceException(errorStr); } log.info("Received the forceSnapshotSync command."); ReplicationEventKey key = ReplicationEventKey.newBuilder().setKey(System.currentTimeMillis() + " "+ clusterId).build(); ReplicationEvent event = ReplicationEvent.newBuilder().setClusterId(clusterId).setType(LogReplicationMetadata.ReplicationEventType.FORCE_SNAPSHOT_SYNC).build(); getLogReplicationMetadataManager().updateLogReplicationEventTable(key, event); }
Source:
<code>public static void skipOnOS(OS... oses) { OS currentOs = SkipUtil.getOs(); <START> if (Arrays.asList(oses).indexOf(currentOs) >= 0) { <END> throw new SkipException("Skipping test on " + currentOs); } }</code><technical_language>indexof -> contains</technical_language>

Target:
public static void skipOnOS(OS... oses) { OS currentOs = OS.getCurrentOs(); if (Arrays.asList(oses).contains(currentOs)) { throw new SkipException("Skipping test on " + currentOs); } }
Source:
<code>public boolean accept(final File file, final String name) { <START> if (name.toLowerCase().endsWith(".xml") || name.toLowerCase().endsWith(".json")) { <END> return true; } return false; }</code><technical_language>Again, pull name.toLowerCase() a variable</technical_language>

Target:
public boolean accept(final File file, final String name) { String fileName = name.toLowerCase(); if (fileName.endsWith(".xml") || fileName.endsWith(".json")) { return true; } return false; }
Source:
<code>public synchronized boolean removeScanner(WebSocketPassiveScanner passiveScanner) { <START> return getPassiveScannersSet().remove(passiveScanner); <END> }</code><technical_language>work properly passiveScanner wrapped in a WebSocketPassiveScannerDecorator</technical_language>

Target:
public synchronized boolean removeScanner(WebSocketPassiveScanner passiveScanner) { return getPassiveScannersSet().remove(new WebSocketPassiveScannerDecorator(passiveScanner)); }
Source:
<code>public static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); FileOutputStream rawChannel = new FileOutputStream(tmpFile); OutputStream channel; if (opt.getAutoCRLF() == AutoCRLF.TRUE) channel = new AutoCRLFOutputStream(rawChannel); else <START> channel = rawChannel; <END> try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { FileUtils.delete(f); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength(f.length()); }</code><technical_language>Do CRLF conversion - binary files? this corrupt checked-in jpegs? if file contains e.g. a null byte in X bytes - check for binary/non-binary files? I overlooked a check here? I felt lack of git attributes is binary is is biggest obstacle autocrlf</technical_language>

Target:
public static void checkoutEntry(final Repository repo, File f, DirCacheEntry entry, ObjectReader or) throws IOException { ObjectLoader ol = or.open(entry.getObjectId()); File parentDir = f.getParentFile(); File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY); FileOutputStream rawChannel = new FileOutputStream(tmpFile); OutputStream channel; if (opt.getAutoCRLF() == AutoCRLF.TRUE) channel = new AutoCRLFOutputStream(rawChannel); else channel = rawChannel; try { ol.copyTo(channel); } finally { channel.close(); } FS fs = repo.getFS(); if (opt.isFileMode() && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { FileUtils.delete(f); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); if (opt.getAutoCRLF() != AutoCRLF.FALSE) entry.setLength(f.length()); else entry.setLength((int) ol.getSize()); }
Source:
<code><START> protected Void copyManagedTemplateCallback(AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> callback, CreateBaseImageContext<VolumeApiResult> context) { <END> CopyCommandResult result = callback.getResult(); VolumeApiResult res = new VolumeApiResult(context.getVolume()); res.setResult(result.getResult()); AsyncCallFuture<VolumeApiResult> future = context.getFuture(); DataObject templateOnPrimaryStoreObj = context.destObj; if (!result.isSuccess()) { templateOnPrimaryStoreObj.processEvent(Event.OperationFailed); future.complete(res); return null; } templateOnPrimaryStoreObj.processEvent(Event.OperationSuccessed, result.getAnswer()); future.complete(res); return null; }</code><technical_language>here, Void returning a null? returning null is a bad smell me</technical_language>

Target:
protected Void copyManagedTemplateCallback(AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> callback, CreateBaseImageContext<VolumeApiResult> context) { CopyCommandResult result = callback.getResult(); VolumeApiResult res = new VolumeApiResult(context.getVolume()); res.setResult(result.getResult()); AsyncCallFuture<VolumeApiResult> future = context.getFuture(); DataObject templateOnPrimaryStoreObj = context.destObj; if (result.isSuccess()) { templateOnPrimaryStoreObj.processEvent(Event.OperationSuccessed, result.getAnswer()); } else { templateOnPrimaryStoreObj.processEvent(Event.OperationFailed); } future.complete(res); return null; }
Source:
<code>protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { Date start = new Date(System.currentTimeMillis()); ContentCachingRequestWrapper wrappedRequest = getWrappedRequest(request); ContentCachingResponseWrapper wrappedResponse = getWrappedResponse(response); filterChain.doFilter(wrappedRequest, wrappedResponse); <START> if (restLoggerEnabled) { <END> Date end = new Date(System.currentTimeMillis()); String log = new StringBuilder() .append(appendLine(RestLoggerField.START_TIME, formatter.format(start))) .append(appendLine(RestLoggerField.END_TIME, formatter.format(end))) .append(appendLine(RestLoggerField.DURATION, Math.abs(end.getTime() - start.getTime()) + " ms")) .append(appendLine(RestLoggerField.HTTP_METHOD, request.getMethod())) .append(appendLine(RestLoggerField.PATH, request.getRequestURI())) .append(appendLine(RestLoggerField.QUERY_STRING, request.getQueryString())) .append(appendLine(RestLoggerField.CLIENT_IP, request.getRemoteAddr())) .append(appendLine(RestLoggerField.REQUEST, logContent(wrappedRequest.getContentAsByteArray(), request.getCharacterEncoding()))) .append(appendLine(RestLoggerField.RESPONSE_STATUS, String.valueOf(response.getStatus()))) .append(appendLine(RestLoggerField.RESPONSE, logContent(wrappedResponse.getContentAsByteArray(), request.getCharacterEncoding()))) .toString(); logger.debug(log); } wrappedResponse.copyBodyToResponse(); }</code><technical_language>Log pushed anonymization</technical_language>

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { Date start = new Date(System.currentTimeMillis()); ContentCachingRequestWrapper wrappedRequest = getWrappedRequest(request); ContentCachingResponseWrapper wrappedResponse = getWrappedResponse(response); filterChain.doFilter(wrappedRequest, wrappedResponse); if (restLoggerEnabled) { DateFormat formatter = new SimpleDateFormat("HH:mm:ss.SSS"); formatter.setTimeZone(TimeZone.getTimeZone("UTC")); Date end = new Date(System.currentTimeMillis()); String log = new StringBuilder() .append(appendLine(RestLoggerField.START_TIME, formatter.format(start))) .append(appendLine(RestLoggerField.END_TIME, formatter.format(end))) .append(appendLine(RestLoggerField.DURATION, Math.abs(end.getTime() - start.getTime()) + " ms")) .append(appendLine(RestLoggerField.HTTP_METHOD, request.getMethod())) .append(appendLine(RestLoggerField.PATH, request.getRequestURI())) .append(appendLine(RestLoggerField.QUERY_STRING, request.getQueryString())) .append(appendLine(RestLoggerField.CLIENT_IP, request.getRemoteAddr())) .append(appendLine(RestLoggerField.REQUEST, logContent(wrappedRequest.getContentAsByteArray(), request.getCharacterEncoding()))) .append(appendLine(RestLoggerField.RESPONSE_STATUS, String.valueOf(response.getStatus()))) .append(appendLine(RestLoggerField.RESPONSE, logContent(wrappedResponse.getContentAsByteArray(), request.getCharacterEncoding()))) .toString(); LOGGER.debug(log); } wrappedResponse.copyBodyToResponse(); }
Source:
<code>private XmlObject extractChildElement(XmlInputStream in, TypeMapper typeMapper) throws ConnectionException { XmlObject child; QName xsiType = typeMapper.getXsiType(in); if (xsiType == null) { child = new XmlObject(); } else if (xsiType.getLocalPart().equals("QueryResult") && !in.getName().equals("QueryResult")) { child = new XmlObject(); } else { Class<?> childClass = typeMapper.getJavaType(xsiType); if (childClass == null || !XMLizable.class.isAssignableFrom(childClass)) { child = new XmlObject(); } else { XMLizable xmlizable; try { xmlizable = (XMLizable)childClass.newInstance(); if (xmlizable instanceof XmlObject) { child = (XmlObject) xmlizable; } else { child = new XmlObjectWrapper(xmlizable); } } catch (InstantiationException e) { throw new ConnectionException("Failed to create object", e); } catch (IllegalAccessException e) { <START> throw new ConnectionException("Failed to create object", e); <END> } catch (ClassCastException e) { child = new XmlObject(); } } } return child; }</code><technical_language>This catch combined in a multi-catch</technical_language>

Target:
private XmlObject extractChildElement(XmlInputStream in, TypeMapper typeMapper) throws ConnectionException { XmlObject child; QName xsiType = typeMapper.getXsiType(in); if (xsiType == null) { child = new XmlObject(); } else if (xsiType.getLocalPart().equals("QueryResult") && !in.getName().equals("QueryResult")) { child = new XmlObject(); } else { Class<?> childClass = typeMapper.getJavaType(xsiType); if (childClass == null || !XMLizable.class.isAssignableFrom(childClass)) { child = new XmlObject(); } else { XMLizable xmlizable; try { xmlizable = (XMLizable)childClass.newInstance(); if (xmlizable instanceof XmlObject) { child = (XmlObject) xmlizable; } else { child = new XmlObjectWrapper(xmlizable); } } catch (InstantiationException e) { throw new ConnectionException("Failed to create object", e); } catch (IllegalAccessException e) { throw new ConnectionException("Failed to create object", e); } } } return child; }
Source:
<code>public int getScorerPriority() { <START> return 2; <END> }</code><technical_language>I space out, allow monarch omimInformationContent. 50 for this one, 10 for omimInformationContent</technical_language>

Target:
public int getScorerPriority() { return 50; }
Source:
<code>public void testDataStreamNotRestoredWhenIndexRequested() throws Exception { Client client = client(); Path location = randomRepoPath(); createRepository("repo", "fs", location); DataStreamIT.createIndexTemplate("t1", "@timestamp", "ds", "other-ds"); CreateDataStreamAction.Request request = new CreateDataStreamAction.Request("ds"); AcknowledgedResponse response = client.admin().indices().createDataStream(request).get(); assertTrue(response.isAcknowledged()); CreateSnapshotResponse createSnapshotResponse = client.admin().cluster() .prepareCreateSnapshot("repo", "snap2") .setWaitForCompletion(true) .setIndices("ds") .setIncludeGlobalState(false) .get(); RestStatus status = createSnapshotResponse.getSnapshotInfo().status(); assertEquals(RestStatus.OK, status); assertTrue(client.admin().indices().deleteDataStream(new DeleteDataStreamAction.Request("ds")).get().isAcknowledged()); RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster() .prepareRestoreSnapshot("repo", "snap2") .setWaitForCompletion(true) .setIndices(".ds-ds-*") .get(); assertEquals(RestStatus.OK, restoreSnapshotResponse.status()); GetDataStreamAction.Request getRequest = new GetDataStreamAction.Request("ds"); <START> Throwable e = expectThrows(ExecutionException.class, () -> client.admin().indices().getDataStreams(getRequest).get()).getCause(); <END> if (e instanceof RemoteTransportException) { e = e.getCause(); } assertEquals(ResourceNotFoundException.class, e.getClass()); }</code><technical_language>iirc if actionGet() is invoked real exception is thrown instead of ExecutionException. do instead of invoked get()</technical_language>

Target:
public void testDataStreamNotRestoredWhenIndexRequested() throws Exception { CreateSnapshotResponse createSnapshotResponse = client.admin().cluster() .prepareCreateSnapshot(REPO, "snap2") .setWaitForCompletion(true) .setIndices("ds") .setIncludeGlobalState(false) .get(); RestStatus status = createSnapshotResponse.getSnapshotInfo().status(); assertEquals(RestStatus.OK, status); assertTrue(client.admin().indices().deleteDataStream(new DeleteDataStreamAction.Request("ds")).get().isAcknowledged()); RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster() .prepareRestoreSnapshot(REPO, "snap2") .setWaitForCompletion(true) .setIndices(".ds-ds-*") .get(); assertEquals(RestStatus.OK, restoreSnapshotResponse.status()); GetDataStreamAction.Request getRequest = new GetDataStreamAction.Request("ds"); expectThrows(ResourceNotFoundException.class, () -> client.admin().indices().getDataStreams(getRequest).actionGet()); }
Source:
<code>public void onDestroy() { <START> db.close(); <END> }</code><technical_language>NoteSQLiteOpenHelper is currently a singleton, dangerous close database here. Theoretically, another objects wants database. Hence, I suggest remove this</technical_language>

Target:
public void onDestroy() { }
Source:
<code>private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar.addAction(PlaylistService.ACTION_PLAYLIST_UPDATED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { updatePlaylist(); } }) .addAction(PlaylistService.ACTION_SONG_REMOVED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { SongMetadata entry = intent.getParcelableExtra(PlaylistService.EXTRA_SONG); <START> Toaster.iToast(getActivity(), "\"" + entry.getTitle() + "\" has been removed."); <END> } }) .register(this.getActivity()); }</code><technical_language>planning telling user in some removed a song put this in strings.xml? "Removed: " string</technical_language>

Target:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar.addAction(PlaylistService.ACTION_PLAYLIST_UPDATED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { updatePlaylist(); } }) .addAction(PlaylistService.ACTION_SONG_REMOVED, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { SongMetadata entry = intent.getParcelableExtra(PlaylistService.EXTRA_SONG); Toaster.iToast(getActivity(), getString(R.string.removed_label) + "\"" + entry.getTitle() + "\""); } }) .register(this.getActivity()); }
Source:
<code>public void zkConnectionPolicy_Standard() throws Exception { mCluster = MultiProcessCluster.newBuilder(PortCoordination.ZOOKEEPER_CONNECTION_POLICY_STANDARD) .setClusterName("ZookeeperConnectionPolicy_Standard") .setNumMasters(2) <START> .setNumWorkers(1) <END> .addProperty(PropertyKey.ZOOKEEPER_LEADER_CONNECTION_ERROR_POLICY, "STANDARD") .addProperty(PropertyKey.MASTER_JOURNAL_TYPE, JournalType.UFS.toString()) .build(); mCluster.start(); int leaderIdx = getPrimaryMasterIndex(); mCluster.restartZk(); int leaderIdx2 = getPrimaryMasterIndex(); assertNotEquals(leaderIdx, leaderIdx2); mCluster.notifySuccess(); }</code><technical_language>do need workers</technical_language>

Target:
public void zkConnectionPolicy_Standard() throws Exception { mCluster = MultiProcessCluster.newBuilder(PortCoordination.ZOOKEEPER_CONNECTION_POLICY_STANDARD) .setClusterName("ZookeeperConnectionPolicy_Standard") .setNumMasters(2) .setNumWorkers(0) .addProperty(PropertyKey.ZOOKEEPER_LEADER_CONNECTION_ERROR_POLICY, "STANDARD") .addProperty(PropertyKey.MASTER_JOURNAL_TYPE, JournalType.UFS.toString()) .build(); mCluster.start(); int leaderIdx = getPrimaryMasterIndex(); mCluster.restartZk(); int leaderIdx2 = getPrimaryMasterIndex(); assertNotEquals(leaderIdx, leaderIdx2); mCluster.notifySuccess(); }
Source:
<code>public void putStack(@Nonnull ItemStack stack) { if (stack.isEmpty()) { return; } super.putStack(stack); if (stack.getItem() instanceof IItemEmc) { IItemEmc itemEmc = ((IItemEmc) stack.getItem()); <START> long remainingEmc = itemEmc.getMaximumEmc(stack) - (int) Math.ceil(itemEmc.getStoredEmc(stack)); <END> if (inv.provider.getEmc() >= remainingEmc) { itemEmc.addEmc(stack, remainingEmc); inv.removeEmc(remainingEmc); } else { itemEmc.addEmc(stack, inv.provider.getEmc()); inv.removeEmc(inv.provider.getEmc()); } } if (EMCHelper.doesItemHaveEmc(stack)) { inv.handleKnowledge(stack.copy()); } }</code><technical_language>casting int feels wrong</technical_language>

Target:
public void putStack(@Nonnull ItemStack stack) { if (stack.isEmpty()) { return; } super.putStack(stack); if (stack.getItem() instanceof IItemEmc) { IItemEmc itemEmc = ((IItemEmc) stack.getItem()); long remainingEmc = itemEmc.getMaximumEmc(stack) - (long) Math.ceil(itemEmc.getStoredEmc(stack)); if (inv.provider.getEmc() >= remainingEmc) { itemEmc.addEmc(stack, remainingEmc); inv.removeEmc(remainingEmc); } else { itemEmc.addEmc(stack, inv.provider.getEmc()); inv.removeEmc(inv.provider.getEmc()); } } if (EMCHelper.doesItemHaveEmc(stack)) { inv.handleKnowledge(stack.copy()); } }
Source:
<code>public MiniSet(Collection<T> entries) { int size = entries.size(); if (size == 0) { } else if (size == 1) { holder = entries.iterator().next(); if (holder == null) throw new IllegalArgumentException(); type = Type.SINGLE; } else if (size < ARRAY_SIZE) { Object[] array = new Object[ARRAY_SIZE]; Iterator<T> iterator = entries.iterator(); for (int i = 0; i < ARRAY_SIZE && iterator.hasNext(); ++i) { T entry = iterator.next(); if (entry == null) throw new IllegalArgumentException(); <START> array[i] = entry; <END> } holder = array; type = Type.ARRAY; } else { Map<T, Object> map = new HashMap<>(); for (T entry : entries) { if (entry == null) throw new IllegalArgumentException(); map.put(entry, DUMMY); } holder = map; type = Type.MAP; } }</code><technical_language>removing duplicated entries..</technical_language>

Target:
public MiniSet(Collection<T> entries) { int size = entries.size(); if (size == 0) { } else if (size == 1) { holder = entries.iterator().next(); if (holder == null) throw new IllegalArgumentException(); type = Type.SINGLE; } else if (size < ARRAY_SIZE) { holder = new Object[ARRAY_SIZE]; type = Type.ARRAY; addAll(entries); } else { Map<T, Object> map = new HashMap<>(); for (T entry : entries) { if (entry == null) throw new IllegalArgumentException(); map.put(entry, DUMMY); } holder = map; type = Type.MAP; } }
Source:
<code><START> public FileText getFileText() { <END> FileText result = null; if (fileText != null) { result = new FileText(fileText); } return result; }</code><technical_language>do need a new instance? FileText is immutable for lineBreaks, is populated demand. return field is</technical_language>

Target:
public FileText getFileText() { return fileText; }
Source:
<code>public void run() { if (!_active) { _active = true; _activityHandler.activated(); } final Runnable runnable = _queue.poll(); _pendingCount.get(); try { runnable.run(); } finally { if (_pendingCount.get() == 1) { _active = false; _activityHandler.deactivated(); <START> } <END> if (_pendingCount.decrementAndGet() > 0) { tryExecuteLoop(); } } }</code><technical_language>This is thread-safe, right? increment _pendingCount this block tryExecuteLoop() again</technical_language>

Target:
public void run() { final Runnable runnable = _queue.poll(); try { runnable.run(); if (_pendingCount.get() == 1) { _deactivationListener.deactivated(); } } finally { if (_pendingCount.decrementAndGet() > 0) { tryExecuteLoop(); } } }
Source:
<code>private ControlPointControlImpl.StunnerControlPointsAcceptor createStunnerControlPointsAcceptor(ControlPointControl controlPointControl) { Function<String, Edge> connectorSupplier = uuid -> uuid.equals(EDGE_UUID) ? edge : null; <START> ; <END> return new ControlPointControlImpl.StunnerControlPointsAcceptor(controlPointControl, connectorSupplier); }</code><technical_language>useless comma</technical_language>

Target:
private ControlPointControlImpl.StunnerControlPointsAcceptor createStunnerControlPointsAcceptor(ControlPointControl controlPointControl) { Function<String, Edge> connectorSupplier = uuid -> uuid.equals(EDGE_UUID) ? edge : null; return new ControlPointControlImpl.StunnerControlPointsAcceptor(controlPointControl, connectorSupplier); }
Source:
<code>public void onSensorChanged(SensorEvent sensorEvent) { <START> if (sensorEvent.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { <END> accelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); accelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); accelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_LINEAR_ACCELERATION) { linAccelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); linAccelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); linAccelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_GYROSCOPE) { gyroscopeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); gyroscopeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); gyroscopeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { magneticJsonObject.addProperty(X_KEY, sensorEvent.values[0]); magneticJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); magneticJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); } else if (sensorEvent.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { attitudeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); attitudeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); attitudeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); if (sensorEvent.values.length > 3) { attitudeJsonObject.addProperty(W_KEY, sensorEvent.values[3]); } } }</code><technical_language>A switch statement here</technical_language>

Target:
public void onSensorChanged(SensorEvent sensorEvent) { switch (sensorEvent.sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: accelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); accelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); accelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_LINEAR_ACCELERATION: linAccelJsonObject.addProperty(X_KEY, sensorEvent.values[0]); linAccelJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); linAccelJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_GYROSCOPE: gyroscopeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); gyroscopeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); gyroscopeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_MAGNETIC_FIELD: magneticJsonObject.addProperty(X_KEY, sensorEvent.values[0]); magneticJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); magneticJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); break; case Sensor.TYPE_ROTATION_VECTOR: attitudeJsonObject.addProperty(X_KEY, sensorEvent.values[0]); attitudeJsonObject.addProperty(Y_KEY, sensorEvent.values[1]); attitudeJsonObject.addProperty(Z_KEY, sensorEvent.values[2]); if (sensorEvent.values.length > 3) { attitudeJsonObject.addProperty(W_KEY, sensorEvent.values[3]); } break; } }
Source:
<code>public OrderedListAssert containsExactly(Object... expected) { if ( ignoringNullPosition ) { Assertions.assertThat( actual ).hasSize( expected.length ); List<Object> actualWithoutNull = removeNulls( actual ); <START> List<Object> excpectedWithoutNull = removeNulls( Arrays.asList( expected ) ); <END> Assertions.assertThat( actualWithoutNull ).isEqualTo( excpectedWithoutNull ); } else { super.containsExactly( expected ); } return this; }</code><technical_language>typo in excpectedWithoutNull</technical_language>

Target:
public OrderedListAssert containsExactly(Object... expected) { if ( ignoringNullPosition ) { Assertions.assertThat( actual ).hasSize( expected.length ); List<Object> actualWithoutNull = trimNull( actual ); List<Object> expectedWithoutNull = trimNull( Arrays.asList( expected ) ); Assertions.assertThat( actualWithoutNull ).isEqualTo( expectedWithoutNull ); if ( actual.size() > 1 && actualWithoutNull.size() > 0 ) { if ( actual.get( 0 ) == null && actual.get( actual.size() - 1 ) == null ) { throw failure( "Null order should be consistent: " + actual ); } } } else { super.containsExactly( expected ); } return this; }
Source:
<code>private Account.Id getSubmitter(Change c) { ChangeApproval submitter = null; try { final List<ChangeApproval> approvals = schema.changeApprovals().byChange(c.getId()).toList(); <START> final FunctionState fs = new FunctionState(c, approvals); <END> for (ChangeApproval a : approvals) { if (a.getValue() > 0 && ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { if (submitter == null || a.getGranted().compareTo(submitter.getGranted()) > 0) { submitter = a; } } } } catch (OrmException e) { } return submitter != null ? submitter.getAccountId() : null; }</code><technical_language>This appears unused in method</technical_language>

Target:
private Account.Id getSubmitter(Change c) { ChangeApproval submitter = null; try { final List<ChangeApproval> approvals = schema.changeApprovals().byChange(c.getId()).toList(); for (ChangeApproval a : approvals) { if (a.getValue() > 0 && ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { if (submitter == null || a.getGranted().compareTo(submitter.getGranted()) > 0) { submitter = a; } } } } catch (OrmException e) { } return submitter != null ? submitter.getAccountId() : null; }
Source:
<code>public void testFileWithEmptyDirectory() throws Exception { Path tempDir = Files.createTempDirectory("dockerDirectoryEmptySubdirectory"); tempDir.toFile().deleteOnExit(); assertThat(new File(tempDir.toFile(), "emptySubDir").mkdir(), is(true)); try (CompressedDirectory dir = CompressedDirectory.create(tempDir); BufferedInputStream fileIn = new BufferedInputStream(Files.newInputStream(dir.file())); GzipCompressorInputStream gzipIn = new GzipCompressorInputStream(fileIn); TarArchiveInputStream tarIn = new TarArchiveInputStream(gzipIn)) { final List<String> names = new ArrayList<>(); TarArchiveEntry entry; while ((entry = tarIn.getNextTarEntry()) != null) { final String name = entry.getName(); names.add(name); } assertThat(names, <START> containsInAnyOrder("emptySubDir/")); <END> } }</code><technical_language>contains()</technical_language>

Target:
public void testFileWithEmptyDirectory() throws Exception { Path tempDir = Files.createTempDirectory("dockerDirectoryEmptySubdirectory"); tempDir.toFile().deleteOnExit(); assertThat(new File(tempDir.toFile(), "emptySubDir").mkdir(), is(true)); try (CompressedDirectory dir = CompressedDirectory.create(tempDir); BufferedInputStream fileIn = new BufferedInputStream(Files.newInputStream(dir.file())); GzipCompressorInputStream gzipIn = new GzipCompressorInputStream(fileIn); TarArchiveInputStream tarIn = new TarArchiveInputStream(gzipIn)) { final List<String> names = new ArrayList<>(); TarArchiveEntry entry; while ((entry = tarIn.getNextTarEntry()) != null) { final String name = entry.getName(); names.add(name); } assertThat(names, contains("emptySubDir/")); } }
Source:
<code>public void testCRAMRecordWriter() throws Exception { <START> final String cramOutFileName = "/tmp/cramout.cram"; <END> final Path out = new Path("file://" + cramOutFileName); final SamReader samReader = SamReaderFactory.makeDefault().referenceSequence(new File(reference)).open(new File(input)); final SAMFileHeader header = samReader.getFileHeader(); final KeyIgnoringCRAMOutputFormat<NullWritable> cramOut = new KeyIgnoringCRAMOutputFormat<NullWritable>(); cramOut.setWriteHeader(false); cramOut.setSAMHeader(header); RecordWriter<NullWritable, SAMRecordWritable> rw = cramOut.getRecordWriter(taskAttemptContext, out); int expectedCount = 0; for (final SAMRecord r : samReader) { final SAMRecordWritable samRW = new SAMRecordWritable(); samRW.set(r); rw.write(null, samRW); expectedCount++; } samReader.close(); rw.close(taskAttemptContext); final ReferenceSource refSource = new ReferenceSource(Paths.get(reference)); final int actualCount = verifyContainerStream(new File(cramOutFileName), header, refSource); assertEquals(expectedCount, actualCount); }</code><technical_language>create a temporary file a unique name is deleted test runs (or VM exits)</technical_language>

Target:
public void testCRAMRecordWriter() throws Exception { final File outFile = File.createTempFile("testCRAMWriter", ".cram"); outFile.deleteOnExit(); final Path outPath = new Path(outFile.toURI()); final KeyIgnoringCRAMOutputFormat<NullWritable> cramOut = new KeyIgnoringCRAMOutputFormat<NullWritable>(); cramOut.setWriteHeader(false); RecordWriter<NullWritable, SAMRecordWritable> rw = cramOut.getRecordWriter(taskAttemptContext, outPath); final SamReader samReader = SamReaderFactory.makeDefault() .referenceSequence(new File(testReferenceFileName)) .open(new File(testCRAMFileName)); for (final SAMRecord r : samReader) { final SAMRecordWritable samRW = new SAMRecordWritable(); samRW.set(r); rw.write(null, samRW); } samReader.close(); rw.close(taskAttemptContext); final int actualCount = verifyCRAMContainerStream( new File(outFile.getAbsolutePath()), samFileHeader, testReferenceSource); assertEquals(expectedRecordCount, actualCount); }
Source:
<code>protected PluginConfiguration(Path location) { if(Files.exists(location)) { try { this.prefs = new PreferencesHandler(location.toString()) {}; } catch (ConfigurationException e) { throw Throwables.propagate(e); } } else { this.prefs = null; } addDefault(SystemPreference.HEAP_SIZE, DEFAULT_HEAP_SIZE_IN_BYTES); addDefault(SystemPreference.LOG_LEVEL, Level.INFO.levelStr); <START> addDefault(SystemPreference.ALIASES, Lists.newLinkedList()); <END> }</code><technical_language>@RaghavBabu a LinkedList</technical_language>

Target:
protected PluginConfiguration(Path location) { if(Files.exists(location)) { try { this.prefs = new PreferencesHandler(location.toString()) {}; } catch (ConfigurationException e) { throw Throwables.propagate(e); } } else { this.prefs = null; } addDefault(SystemPreference.HEAP_SIZE, DEFAULT_HEAP_SIZE_IN_BYTES); addDefault(SystemPreference.LOG_LEVEL, Level.INFO.levelStr); }
Source:
<code><START> public Map<String, MetricPlotDTOs> createTaskPlots() { <END> sessionId = getSessionIdProvider().getSessionId(); List<MetricPointEntity> metricDetails = getHibernateTemplate().find( "select m from MetricPointEntity m where m.metricDescription.taskData.sessionId=?", sessionId); if (metricDetails == null || metricDetails.isEmpty()) { return oldWay(); } else { return newWay(metricDetails); } }</code><technical_language>is public</technical_language>

Target:
private Map<String, MetricPlotDTOs> createTaskPlots() { List<MetricPointEntity> metricDetails = getHibernateTemplate().find( "select m from MetricPointEntity m where m.metricDescription.taskData.sessionId=?", sessionId); if (metricDetails == null || metricDetails.isEmpty()) { return oldWay(); } else { return newWay(metricDetails); } }
Source:
<code><START> @Override void addHostData(VoltTableRow row) throws IOException { <END> assert(row.getString("TABLE").equals(getTableName())); checkSiteConsistency(row); m_hostsWithThisTable.add((int) row.getLong("CURRENT_HOST_ID")); }</code><technical_language>putting annotation line method name. annotations line</technical_language>

Target:
void addHostData(VoltTableRow row) throws IOException { assert(row.getString("TABLE").equals(getTableName())); checkSiteConsistency(row); m_hostsWithThisTable.add((int) row.getLong("CURRENT_HOST_ID")); }
Source:
<code>public Response getRegistryEntryByUuid(String registryId, String entryId, MessageContext messageContext) { EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry endpointRegistryEntry = null; try { <START> endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(entryId); <END> if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while fetching endpoint registry entry: " + registryId, e, log); } return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(endpointRegistryEntry)) .build(); }</code><technical_language>verify existence of registry entry? Otherwise, this work querying wrong registry id correct entry id. else, change resource requiring registry id right</technical_language>

Target:
public Response getRegistryEntryByUuid(String registryId, String entryId, MessageContext messageContext) { EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry endpointRegistryEntry = null; try { endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while fetching endpoint registry entry: " + entryId, e, log); } return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(endpointRegistryEntry)) .build(); }
Source:
<code><START> public static RemoteTimelockServiceAdapter create(TimelockRpcClient rpcClient, String timelockNamespace) { <END> return create(new NamespaceAwareTimelockRpcClient(rpcClient, timelockNamespace)); }</code><technical_language>pick other especially if test convenience</technical_language>

Target:
public static RemoteTimelockServiceAdapter create(TimelockRpcClient rpcClient, String timelockNamespace) { return create(new NamespacedTimelockRpcClient(rpcClient, timelockNamespace)); }
Source:
<code><START> @Test public void testSelectNullWithInsert() { <END> String query = "insert into " + "\"account\"(\"account_id\",\"account_parent\",\"account_type\",\"account_rollup\")" + " select 1, cast(NULL AS INT), cast(123 as varchar), cast(123 as varchar)"; final String expected = "INSERT INTO \"foodmart\".\"account\" (\"account_id\", \"account_parent\", \"account_description\", " + "\"account_type\", \"account_rollup\", \"Custom_Members\")\n" + "(SELECT 1 AS \"account_id\", CAST(NULL AS INTEGER) AS \"account_parent\", CAST(NULL AS VARCHAR(30) CHARACTER SET " + "\"ISO-8859-1\") AS \"account_description\", '123' AS \"account_type\", '123' AS \"account_rollup\", CAST(NULL AS VARCHAR" + "(255) CHARACTER SET \"ISO-8859-1\") AS \"Custom_Members\"\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\"))"; sql(query).ok(expected); sql(expected).exec(); }</code><technical_language>Thanks, give a test case for Join relational expression</technical_language>

Target:
@Test public void testSelectNullWithInsert() { String query = "insert into " + "\"account\"(\"account_id\",\"account_parent\",\"account_type\",\"account_rollup\")" + " select 1, cast(NULL AS INT), cast(123 as varchar), cast(123 as varchar)"; final String expected = "INSERT INTO \"foodmart\".\"account\" (" + "\"account_id\", \"account_parent\", \"account_description\", " + "\"account_type\", \"account_rollup\", \"Custom_Members\")\n" + "(SELECT 1 AS \"account_id\", CAST(NULL AS INTEGER) AS \"account_parent\"," + " CAST(NULL AS VARCHAR(30) CHARACTER SET " + "\"ISO-8859-1\") AS \"account_description\", '123' AS \"account_type\", " + "" + "'123' AS \"account_rollup\", CAST(NULL AS VARCHAR" + "(255) CHARACTER SET \"ISO-8859-1\") AS \"Custom_Members\"\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\"))"; sql(query).ok(expected); sql(expected).exec(); }
Source:
<code><START> public Set<String> getExchangeBoundQueueNames(String exchangeName) throws JMSException { <END> List<Map<String, Object>> mm = runQuery("_schema_id", singularMap("_class_name", "binding")); Set<String> result = new HashSet<String>(); for (Map<String, Object> res : mm) { if (extractValue(res, "_values", "exchangeRef", "_object_name") .equals("org.apache.qpid.broker:exchange:" + exchangeName)) { result.add(QpidQmf.<String>extractValue(res, "_values", "queueRef", "_object_name")); } } return result; }</code><technical_language>This method private plans elsewhere</technical_language>

Target:
private Set<String> getExchangeBoundQueueNames(String exchangeName) throws JMSException { List<Map<String, Object>> mm = runQuery("_schema_id", singularMap("_class_name", "binding")); Set<String> result = new HashSet<String>(); for (Map<String, Object> res : mm) { if (extractValue(res, "_values", "exchangeRef", "_object_name") .equals("org.apache.qpid.broker:exchange:" + exchangeName)) { result.add(QpidQmf.<String>extractValue(res, "_values", "queueRef", "_object_name")); } } return result; }
Source:
<code>public <T> int getStart(int pStart, int pEnd, int currentRowIdx, @Nullable Comparator<T> cmp, List<T> rows) { if (pStart == currentRowIdx) { return pStart; } else { if (cmp != null) { <START> return findFirstPreviousPeer(rows, currentRowIdx, cmp); <END> } else { return currentRowIdx; } } }</code><technical_language>this potentially partition boundary</technical_language>

Target:
public <T> int getStart(int pStart, int pEnd, int currentRowIdx, @Nullable Comparator<T> cmp, List<T> rows) { return pStart; }
Source:
<code>public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { <START> Objects.requireNonNull(buf, "bug argument was null"); this.buffer = buf; <END> this.cur = 0; this.max = maxOffset; }</code><technical_language>more readable if inline'd assignment. if this worked for Guava Preconditions, Java requireNonNull returns reference, work for that. Example: java this.buffer = Objects.requireNonNull(buf, "buf argument null"); But, stick minimal change merges master easiest</technical_language>

Target:
public SeekableByteArrayInputStream(byte[] buf, int maxOffset) { requireNonNull(buf, "bug argument was null"); this.buffer = buf; this.cur = 0; this.max = maxOffset; }
Source:
<code><START> String getValue() { <END> return value; }</code><technical_language>public access</technical_language>

Target:
public String getValue() { return value; }
Source:
<code>public static IDefaultLanguage getDefaultLanguage(Element context) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, context); <START> Element root = iterate(context, Element::getOwner).filter(e -> e.getOwner() == null).findFirst().get(); <END> language = service.getActiveDefaultLanguage(root); } catch (ServiceException e) { org.eclipse.papyrusrt.umlrt.core.Activator.log.error(e); } return language; }</code><technical_language>This deleted service.getActiveDefaultLanguage find root element. I do this is necessary get root element context I root is null for context (this method "getDefaultLanguage) is created for other context element transitions). I thnik simply find language calling this language = service.getActiveDefaultLanguage(context);</technical_language>

Target:
public static IDefaultLanguage getDefaultLanguage(Element context) { IDefaultLanguage language = null; try { IDefaultLanguageService service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, context); language = service.getActiveDefaultLanguage(context); } catch (ServiceException e) { org.eclipse.papyrusrt.umlrt.core.Activator.log.error(e); } return language; }
Source:
<code>private EObject findSemanticRoot(final Resource res) { EObject root = res.getContents().get(0); EClass eClass = root.eClass(); ExtendedMetaData extendedMetaData = <START> BasicExtendedMetaData.INSTANCE; <END> if (extendedMetaData.isDocumentRoot(eClass)) { EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eClass); EReference xsiSchemaLocationFeature = extendedMetaData.getXSISchemaLocationMapFeature(eClass); EAttribute mixedFeatureFeature = extendedMetaData.getMixedFeature(eClass); for (int featureID = 0; featureID < eClass.getFeatureCount(); featureID++) { EStructuralFeature feature = eClass.getEStructuralFeature(featureID); if (feature != mixedFeatureFeature && feature != xmlnsPrefixMapFeature && feature != xsiSchemaLocationFeature) { Object obj = root.eGet(feature); if (obj instanceof EObject) { root = (EObject) obj; break; } } } } return root; }</code><technical_language>ExtendedMetaData.INSTANCE</technical_language>

Target:
private EObject findSemanticRoot(final Resource res) { EObject root = res.getContents().get(0); EClass eClass = root.eClass(); ExtendedMetaData extendedMetaData = ExtendedMetaData.INSTANCE; if (extendedMetaData.isDocumentRoot(eClass)) { EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eClass); EReference xsiSchemaLocationFeature = extendedMetaData.getXSISchemaLocationMapFeature(eClass); EAttribute mixedFeatureFeature = extendedMetaData.getMixedFeature(eClass); for (int featureID = 0; featureID < eClass.getFeatureCount(); featureID++) { EStructuralFeature feature = eClass.getEStructuralFeature(featureID); if (feature != mixedFeatureFeature && feature != xmlnsPrefixMapFeature && feature != xsiSchemaLocationFeature) { Object obj = root.eGet(feature); if (obj instanceof EObject) { root = (EObject) obj; break; } } } } return root; }
Source:
<code>public List<Class> detectClasses(Object document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(document instanceof String || document instanceof ObjectNode); mapper = new StreamsJacksonMapper(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT)); ObjectNode objectNode; try { if( document instanceof String ) objectNode = mapper.readValue((String)document, ObjectNode.class); else objectNode = (ObjectNode) document; } catch (IOException e) { e.printStackTrace(); <START> return null; <END> } List<Class> classList = Lists.newArrayList(); if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status") != null) classList.add(Retweet.class); else if( objectNode.findValue("delete") != null ) classList.add(Delete.class); else if( objectNode.findValue("friends") != null || objectNode.findValue("friends_str") != null ) classList.add(FriendList.class); else if( objectNode.findValue("target_object") != null ) classList.add(UserstreamEvent.class); else if ( objectNode.findValue("location") != null && objectNode.findValue("user") == null) classList.add(User.class); else classList.add(Tweet.class); return classList; }</code><technical_language>This right handle a conversion failure. error empty list a bit more sense me. other places in this PR this pops too</technical_language>

Target:
public List<Class> detectClasses(Object document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(document instanceof String || document instanceof ObjectNode); mapper = new StreamsJacksonMapper(Lists.newArrayList(StreamsTwitterMapper.TWITTER_FORMAT)); ObjectNode objectNode; try { if( document instanceof String ) objectNode = mapper.readValue((String)document, ObjectNode.class); else if( document instanceof ObjectNode ) objectNode = (ObjectNode) document; else return Lists.newArrayList(); } catch (IOException e) { return Lists.newArrayList(); } List<Class> classList = Lists.newArrayList(); if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status") != null) classList.add(Retweet.class); else if( objectNode.findValue("delete") != null ) classList.add(Delete.class); else if( objectNode.findValue("friends") != null || objectNode.findValue("friends_str") != null ) classList.add(FriendList.class); else if( objectNode.findValue("target_object") != null ) classList.add(UserstreamEvent.class); else if ( objectNode.findValue("location") != null && objectNode.findValue("user") == null) classList.add(User.class); else classList.add(Tweet.class); return classList; }
Source:
<code>public final void addOp(Operation op) { try { if (!authLatch.await(1, TimeUnit.SECONDS)) { <START> op.cancel("auth has taken more than one second to complete"); <END> getLogger().warn( "Operation canceled because authentication " + "or reconnection and authentication has " + "taken more than one second to complete."); getLogger().debug("Canceled operation %s", op.toString()); return; } if(!inputQueue.offer(op, opQueueMaxBlockTime, TimeUnit.MILLISECONDS)) { throw new IllegalStateException("Timed out waiting to add " + op + "(max wait=" + opQueueMaxBlockTime + "ms)"); } addOpCount += 1; } catch(InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("Interrupted while waiting to add " + op); } }</code><technical_language>"authentication timeout"</technical_language>

Target:
public final void addOp(Operation op) { try { if (!authLatch.await(1, TimeUnit.SECONDS)) { op.cancel("authentication timeout"); getLogger().warn( "Operation canceled because authentication " + "or reconnection and authentication has " + "taken more than one second to complete."); getLogger().debug("Canceled operation %s", op.toString()); return; } if(!inputQueue.offer(op, opQueueMaxBlockTime, TimeUnit.MILLISECONDS)) { throw new IllegalStateException("Timed out waiting to add " + op + "(max wait=" + opQueueMaxBlockTime + "ms)"); } addOpCount += 1; } catch(InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("Interrupted while waiting to add " + op); } }