auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ByteBuf decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) { int byteCount = dataBuffer.readableByteCount(); ByteBuf copy = Unpooled.buffer(byteCount); copy.writeBytes(dataBuffer.asByteBuffer()); copy.readerIndex(0); <START> DataBufferUtils.release(dataBuffer); <END> if (logger.isDebugEnabled()) { logger.debug(Hints.getLogPrefix(hints) + "Read " + byteCount + " bytes"); } return copy; }</code><technical_language>If running Netty, copy is unnecessarily inefficient. If DataBuffer is instance of NettyDataBuffer simply return ((NettyDataBuffer) dataBuffer).getNativeBuffer()</technical_language>

Target:
public ByteBuf decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) { ByteBuf byteBuf; if (dataBuffer instanceof NettyDataBuffer) { byteBuf = ((NettyDataBuffer) dataBuffer).getNativeBuffer(); } else { byteBuf = Unpooled.wrappedBuffer(dataBuffer.asByteBuffer()); DataBufferUtils.release(dataBuffer); } if (logger.isDebugEnabled()) { logger.debug(Hints.getLogPrefix(hints) + "Read " + byteBuf.readableBytes() + " bytes"); } return byteBuf; }
Source:
<code>public void testVersionedDelete() { <START> System.out.println("*********** testing versioned delete ***********"); <END> ByteArray key = new ByteArray("keyOne".getBytes()); List<Versioned<byte[]>> conflictingVersions = generatePutWithConflictionVersions(key); if(conflictingVersions.size() == 0) { Assert.fail("Could not generate conflicting versions "); } testDelete(key, conflictingVersions.get(0).getVersion()); }</code><technical_language>get rid of s.o.plns replace logger</technical_language>

Target:
public void testVersionedDelete() { logger.info("*********** testing versioned delete ***********"); ByteArray key = new ByteArray("keyOne".getBytes()); List<Versioned<byte[]>> conflictingVersions = generatePutWithConflictionVersions(key); if(conflictingVersions.size() == 0) { Assert.fail("Could not generate conflicting versions "); } testDelete(key, conflictingVersions.get(0).getVersion()); }
Source:
<code>private void threadSummary() { List<String> prefixes = <START> Lists.newArrayList("HTTP", <END> "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); String other = "Other"; Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d CPUs available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); if (showThreads) { Table<String, Thread.State, Integer> count = HashBasedTable.create(); threadLoop: for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); Thread.State state = info.getThreadState(); for (String p : prefixes) { if (name.startsWith(p)) { Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c + 1 : 1); continue threadLoop; } } Integer c = count.get(other, state); count.put(other, info.getThreadState(), c != null ? c + 1 : 1); } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { stdout.print(String.format(" %-22s", p)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(p, s)))); } stdout.print('\n'); } stdout.print(String.format(" %-22s", other)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(other, s)))); } stdout.print('\n'); } stdout.print('\n'); }</code><technical_language>Arrays.asList() do necessarily need Guava for this :-)</technical_language>

Target:
private void threadSummary() { List<String> prefixes = Arrays.asList("HTTP", "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); String other = "Other"; Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d CPUs available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); if (showThreads) { Table<String, Thread.State, Integer> count = HashBasedTable.create(); threadLoop: for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); Thread.State state = info.getThreadState(); for (String p : prefixes) { if (name.startsWith(p)) { Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c + 1 : 1); continue threadLoop; } } Integer c = count.get(other, state); count.put(other, info.getThreadState(), c != null ? c + 1 : 1); } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { printThreadCounts(p, count.row(p)); } printThreadCounts(other, count.row(other)); } stdout.print('\n'); }
Source:
<code>public void onError(Throwable t) { <START> L.logRemoteErrorIfProd(t); <END> Toast.makeText(context, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show(); }</code><technical_language>land for expected network errors well? this in catch block itself</technical_language>

Target:
public void onError(Throwable t) { Toast.makeText(context, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show(); }
Source:
<code>protected void executeCommand() { <START> boolean isNew = false; <END> UserProfile profile = userProfileDao.getByUserId(getUserId()); if (profile == null) { isNew = true; profile = new UserProfile(Guid.newGuid(), getUserId()); } if (StringUtils.isNotEmpty(getParameters().getUserProfile().getSshPublicKey())) { profile.setSshPublicKey(getParameters().getUserProfile().getSshPublicKey()); } if (getParameters().getUserProfile().isUserPortalVmLoginAutomatically() != null) { profile.setUserPortalVmLoginAutomatically(getParameters().getUserProfile().isUserPortalVmLoginAutomatically()); } if (isNew) { userProfileDao.save(profile); } else { userProfileDao.update(profile); } setSucceeded(true); }</code><technical_language>calling AddUserProfileCommand for creating new profile</technical_language>

Target:
protected void executeCommand() { UserProfile profile = userProfileDao.getByUserId(getUserId()); if (StringUtils.isNotEmpty(getParameters().getUserProfile().getSshPublicKey())) { profile.setSshPublicKey(getParameters().getUserProfile().getSshPublicKey()); } if (getParameters().getUserProfile().isUserPortalVmLoginAutomatically() != null) { profile.setUserPortalVmLoginAutomatically(getParameters().getUserProfile().isUserPortalVmLoginAutomatically()); } userProfileDao.update(profile); setSucceeded(true); }
Source:
<code>public String getKeyStorePath() { String path = getString(ConfVars.ZEPPELIN_SSL_KEYSTORE_PATH); <START> if (path != null && path.startsWith("/")) { <END> return path; } else { return getRelativeDir( String.format("%s/%s", getConfDir(), getString(path))); } }</code><technical_language>need consider Windows</technical_language>

Target:
public String getKeyStorePath() { String path = getString(ConfVars.ZEPPELIN_SSL_KEYSTORE_PATH); if (path != null && path.startsWith("/") || isWindowsPath(path)) { return path; } else { return getRelativeDir( String.format("%s/%s", getConfDir(), getString(path))); } }
Source:
<code>private void updateAll(Config config) throws IOException, ConfigInvalidException { if (config == null) { return; } updateAll(config.getBaseConfig()); if (config instanceof FileBasedConfig) { FileBasedConfig cfg = (FileBasedConfig) config; <START> if (cfg.isOutdated()) { <END> LOG.debug("loading system config {}", cfg); cfg.load(); } } }</code><technical_language>skip this if config file exist this throws a NoSuchFIleException</technical_language>

Target:
private void updateAll(Config config) throws IOException, ConfigInvalidException { if (config == null) { return; } updateAll(config.getBaseConfig()); if (config instanceof FileBasedConfig) { FileBasedConfig cfg = (FileBasedConfig) config; if (!cfg.getFile().exists()) { return; } if (cfg.isOutdated()) { LOG.debug("loading system config {}", cfg); cfg.load(); } } }
Source:
<code>protected void onLoad() { super.onLoad(); CallbackGroup group = new CallbackGroup(); if (Gerrit.isSignedIn()) { ChangeApi.edit(changeId.get(), group.add( new GerritCallback<EditInfo>() { @Override public void onSuccess(EditInfo result) { edit = result; } <START> public void onFailure(Throwable caught) { int i = 0; i++; }; <END> })); } loadChangeInfo(true, group.addFinal( new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo info) { info.init(); loadConfigInfo(info, base); } })); }</code><technical_language>Thanks for digging in cause. I I wrote some of code, sorry. In this case I 204 is acceptable compromise</technical_language>

Target:
protected void onLoad() { super.onLoad(); CallbackGroup group = new CallbackGroup(); if (Gerrit.isSignedIn()) { ChangeApi.edit(changeId.get(), group.add( new GerritCallback<EditInfo>() { @Override public void onSuccess(EditInfo result) { edit = result; } })); } loadChangeInfo(true, group.addFinal( new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo info) { info.init(); loadConfigInfo(info, base); } })); }
Source:
<code>public void testInsert() throws Exception { <START> execute("CREATE TABLE tpch.test_insert (x bigint, y varchar(100), t_ts timestamp)"); <END> assertUpdate(getQueryRunner().getDefaultSession(), "INSERT INTO test_insert VALUES (123, 'test', date_parse('1970-12-01 00:00:01','%Y-%m-%d %H:%i:%s'))", 1); assertUpdate(getQueryRunner().getDefaultSession(), "INSERT INTO test_insert VALUES (123, 'test', date_parse('2030-01-01 23:59:59','%Y-%m-%d %H:%i:%s'))", 1); MaterializedResult actual = computeActual("SELECT * FROM test_insert"); MaterializedResult expected = MaterializedResult.resultBuilder(getSession(), BIGINT, VarcharType.createVarcharType(100), TIMESTAMP) .row((long) 123, "test", Timestamp.valueOf("1970-12-01 00:00:01")) .row((long) 123, "test", Timestamp.valueOf("2030-01-01 23:59:59")) .build(); assertEquals(actual, expected); assertUpdate("DROP TABLE test_insert"); }</code><technical_language>Do "all types" test is done for describe statement</technical_language>

Target:
public void testInsert() throws Exception { execute("CREATE TABLE tpch.test_insert (c_bigint bigint, c_varchar_100 varchar(100), c_timestamp timestamp)"); assertUpdate(getQueryRunner().getDefaultSession(), "INSERT INTO test_insert VALUES (123, 'test', date_parse('1970-12-01 00:00:01','%Y-%m-%d %H:%i:%s'))", 1); assertUpdate(getQueryRunner().getDefaultSession(), "INSERT INTO test_insert VALUES (123, 'test', date_parse('2030-01-01 23:59:59','%Y-%m-%d %H:%i:%s'))", 1); MaterializedResult actual = computeActual("SELECT * FROM test_insert"); MaterializedResult expected = MaterializedResult.resultBuilder(getSession(), BIGINT, VarcharType.createVarcharType(100), TIMESTAMP) .row((long) 123, "test", Timestamp.valueOf("1970-12-01 00:00:01")) .row((long) 123, "test", Timestamp.valueOf("2030-01-01 23:59:59")) .build(); assertEquals(actual, expected); assertUpdate("DROP TABLE test_insert"); }
Source:
<code>public DynamicTableSource createDynamicTableSource(Context context) { FactoryUtil.TableFactoryHelper helper = FactoryUtil .createTableFactoryHelper(this, context); Properties connectorProperties = KinesisOptions .getConnectorProperties(context.getCatalogTable().getOptions()); ReadableConfig tableOptions = helper.getOptions(); DecodingFormat<DeserializationSchema<RowData>> decodingFormat = helper .discoverDecodingFormat(DeserializationFormatFactory.class, FactoryUtil.FORMAT); helper.validateExcept(KinesisOptions.PROPERTIES_PREFIX); validateTableOptionsAndConnectorProperties(tableOptions, connectorProperties); return new KinesisDynamicSource( context.getCatalogTable().getSchema().toPhysicalRowDataType(), tableOptions.get(KinesisOptions.STREAM), <START> KinesisOptions.getConnectorProperties(context.getCatalogTable().getOptions()), <END> decodingFormat ); }</code><technical_language>reuse variable</technical_language>

Target:
public DynamicTableSource createDynamicTableSource(Context context) { FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context); ReadableConfig tableOptions = helper.getOptions(); CatalogTable catalogTable = context.getCatalogTable(); Properties properties = KinesisOptions.getConsumerProperties(catalogTable.getOptions()); DecodingFormat<DeserializationSchema<RowData>> decodingFormat = helper .discoverDecodingFormat(DeserializationFormatFactory.class, FactoryUtil.FORMAT); helper.validateExcept(KinesisOptions.NON_VALIDATED_PREFIXES); validateConsumerProperties(tableOptions.get(KinesisOptions.STREAM), properties); return new KinesisDynamicSource( catalogTable.getSchema().toPhysicalRowDataType(), tableOptions.get(KinesisOptions.STREAM), properties, decodingFormat ); }
Source:
<code>@Override public <R> Observable<Result<R>> adapt(Call<R> call, Retrofit retrofit) { return Observable.create(new CallOnSubscribe<>(call, retrofit)) <START> .onErrorReturn(new Func1<Throwable, Result<R>>() { <END> @Override public Result<R> call(Throwable throwable) { return Result.error(throwable); } }); }</code><technical_language>This removed now</technical_language>

Target:
@Override public <R> Observable<Result<R>> adapt(Call<R> call, Retrofit retrofit) { return Observable.create(new CallOnSubscribe<>(call, retrofit)); }
Source:
<code><START> private boolean hasNext() throws IOException { <END> return seekableStream.position() <= (end >> 16); }</code><technical_language>weird Boundary implement Iterator<Container></technical_language>

Target:
public boolean hasNext() { try { return seekableStream.position() <= (end >> 16); } catch (final IOException e) { throw new RuntimeIOException(e); } }
Source:
<code>private static String getExtension(String filename) { <START> String extension = filename.toLowerCase().substring(filename.lastIndexOf(".") + 1); <END> return extension; }</code><technical_language>toLowerCase() is applied substring(), before</technical_language>

Target:
private static String getExtension(String filename) { String extension = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase(); return extension; }
Source:
<code>public void finalizeUpload( @RequestHeader(value = HttpHeaders.AUTHORIZATION, required = true) final String accessToken, @PathVariable(value = "object-id") String objectId, @RequestParam(value = "uploadId", required = true) String uploadId ) { <START> val startMs = System.currentTimeMillis(); <END> uploadService.finalizeUpload(objectId, uploadId); val endMs = System.currentTimeMillis(); log.info("Finalize upload completed in ms", endMs - startMs); }</code><technical_language>Please Stopwatch for this is cleaner output is more readable for humans: java val watch = Stopwatch.createStarted(); //... log.info("Finished ... in {}", watch);</technical_language>

Target:
public void finalizeUpload( @RequestHeader(value = HttpHeaders.AUTHORIZATION, required = true) final String accessToken, @PathVariable(value = "object-id") String objectId, @RequestParam(value = "uploadId", required = true) String uploadId) { val watch = Stopwatch.createStarted(); uploadService.finalizeUpload(objectId, uploadId); log.info("Finalize upload completed in {}", watch); }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); String courseName = getRequestParamValue(Const.ParamsNames.COURSE_NAME); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_NAME, courseName); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); CourseAttributes courseToEdit = new CourseAttributes(); <START> courseToEdit.id = Sanitizer.sanitizeName(courseId); <END> courseToEdit.name = Sanitizer.sanitizeName(courseName); try { logic.updateCourse(courseToEdit); statusToUser.add(new StatusMessage(Const.StatusMessages.COURSE_EDITED, StatusMessageColor.SUCCESS)); statusToAdmin = "Course name for Course <span class=\"bold\">[" + courseId + "]</span> edited.<br>" + "New name: " + courseName; } catch (InvalidParametersException e) { setStatusForException(e); } RedirectResult result = createRedirectResult(Const.ActionURIs.INSTRUCTOR_COURSE_EDIT_PAGE); result.addResponseParam(Const.ParamsNames.COURSE_ID, courseId); return result; }</code><technical_language>this sanitized</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId); String courseName = getRequestParamValue(Const.ParamsNames.COURSE_NAME); Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_NAME, courseName); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); CourseAttributes courseToEdit = new CourseAttributes(); courseToEdit.id = courseId; courseToEdit.name = courseName; try { logic.updateCourse(courseToEdit); statusToUser.add(new StatusMessage(Const.StatusMessages.COURSE_EDITED, StatusMessageColor.SUCCESS)); statusToAdmin = "Course name for Course <span class=\"bold\">[" + courseId + "]</span> edited.<br>" + "New name: " + courseName; } catch (InvalidParametersException e) { setStatusForException(e); } RedirectResult result = createRedirectResult(Const.ActionURIs.INSTRUCTOR_COURSE_EDIT_PAGE); result.addResponseParam(Const.ParamsNames.COURSE_ID, courseId); return result; }
Source:
<code>public WebClientStartProperties getWebClientStartProperties() { WebClientProperties webClientProperties = databaseService.getWebClientProperties(); Map<String, Set<String>> defaultMonitoringParameters = databaseService.getDefaultMonitoringParameters(); WebClientStartProperties startProperties = new WebClientStartProperties(); <START> startProperties.setWebClientProperties(webClientProperties); <END> startProperties.setDefaultMonitoringParameters(defaultMonitoringParameters); return startProperties; }</code><technical_language>is complicated</technical_language>

Target:
public WebClientStartProperties getWebClientStartProperties() { WebClientStartProperties startProperties = new WebClientStartProperties(); startProperties.setWebClientProperties(databaseService.getWebClientProperties()); startProperties.setDefaultMonitoringParameters(databaseService.getDefaultMonitoringParameters()); return startProperties; }
Source:
<code>public void setReplyTimeout(long timeout) { <START> if (System.currentTimeMillis() + timeout > Long.MAX_VALUE) <END> throw new IllegalArgumentException("Extremely long reply timeout"); else replyTimeout = timeout; }</code><technical_language>Hehe, this is pitfall I pointed out :D If currentTimeMillis + timeout is actuall greater Long.MAX_VALUE, get a overflow sum negative. Instead test, if Long.MAX_VALUE - currentTimeMillis() < timeout if so, throw error</technical_language>

Target:
public void setReplyTimeout(long timeout) { if (Long.MAX_VALUE - System.currentTimeMillis() < timeout) { throw new IllegalArgumentException("Extremely long reply timeout"); } else { replyTimeout = timeout; } }
Source:
<code>public Deque<Transition<State, Alphabet>> getPath(State initialState, Alphabet initialLetter, State finalState) { Deque<State> toProcess = new ArrayDeque<>(); Map<State, Transition<State, Alphabet>> considered = new HashMap<>(); considered.put(initialState, null); <START> for (Transition<State, Alphabet> transition : getTransitions(initialState, initialLetter)) { <END> State endState = transition.getEnd(); if (endState.equals(finalState)) { Deque<Transition<State, Alphabet>> result = new ArrayDeque<>(); result.push(transition); return result; } if (considered.containsKey(endState)) continue; considered.put(endState, transition); toProcess.add(endState); } return getPath(finalState, toProcess, considered); }</code><technical_language>comfortable this block of code duplicated extremely similar in method this. find a this modular</technical_language>

Target:
public Deque<Transition<State, Alphabet>> getPath(State initialState, Alphabet initialLetter, State finalState) { Deque<State> toProcess = new ArrayDeque<>(); Map<State, Transition<State, Alphabet>> considered = new HashMap<>(); considered.put(initialState, null); Deque<Transition<State, Alphabet>> result = getPathBFSStep(getTransitions(initialState, initialLetter), finalState, considered, toProcess); if (result != null) return result; return getPathBFS(finalState, toProcess, considered); }
Source:
<code>public void test_SSLSocket_setSoWriteTimeout() throws Exception { if (StandardNames.IS_RI) { return; } final TestSSLContext c = TestSSLContext.create(); SSLSocket client = (SSLSocket) c.clientContext.getSocketFactory().createSocket(); int sendBufferSize = 1024; client.setSendBufferSize(sendBufferSize); sendBufferSize = client.getSendBufferSize(); final int recvBufferSize = 128; c.serverSocket.setReceiveBufferSize(recvBufferSize); client.connect(new InetSocketAddress(c.host, c.port)); final SSLSocket server = (SSLSocket) c.serverSocket.accept(); ExecutorService executor = Executors.newSingleThreadExecutor(); Future<Void> future = executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { server.startHandshake(); return null; } }); executor.shutdown(); client.startHandshake(); String expectedClassName = <START> "com.android.org.conscrypt.ConscryptFileDescriptorSocket"; <END> Class<?> actualClass = client.getClass(); assertEquals(expectedClassName, actualClass.getName()); Method setSoWriteTimeout = actualClass.getMethod("setSoWriteTimeout", new Class<?>[] { Integer.TYPE }); setSoWriteTimeout.invoke(client, 1); try { final int extra = 1; client.getOutputStream().write(new byte[sendBufferSize + extra]); fail(); } catch (SocketTimeoutException expected) { } future.get(); client.close(); server.close(); c.close(); }</code><technical_language>App compat effects? Do care? a test name avoid a future regression dropped mistake</technical_language>

Target:
public void test_SSLSocket_setSoWriteTimeout() throws Exception { if (StandardNames.IS_RI) { return; } final TestSSLContext c = TestSSLContext.create(); SSLSocket client = (SSLSocket) c.clientContext.getSocketFactory().createSocket(); int sendBufferSize = 1024; client.setSendBufferSize(sendBufferSize); sendBufferSize = client.getSendBufferSize(); final int recvBufferSize = 128; c.serverSocket.setReceiveBufferSize(recvBufferSize); client.connect(new InetSocketAddress(c.host, c.port)); final SSLSocket server = (SSLSocket) c.serverSocket.accept(); ExecutorService executor = Executors.newSingleThreadExecutor(); Future<Void> future = executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { server.startHandshake(); return null; } }); executor.shutdown(); client.startHandshake(); String expectedClassName = "com.android.org.conscrypt.ConscryptFileDescriptorSocket"; Class<?> actualClass = client.getClass(); assertEquals(expectedClassName, actualClass.getName()); Class<?> superClass = actualClass.getSuperclass(); assertEquals("com.android.org.conscrypt.OpenSSLSocketImpl", superClass.getName()); Method setSoWriteTimeout = actualClass.getMethod("setSoWriteTimeout", new Class<?>[] { Integer.TYPE }); setSoWriteTimeout.invoke(client, 1); try { final int extra = 1; client.getOutputStream().write(new byte[sendBufferSize + extra]); fail(); } catch (SocketTimeoutException expected) { } future.get(); client.close(); server.close(); c.close(); }
Source:
<code>public static ReadCountCollection removeColumnsWithBadValues(final ReadCountCollection readCounts, final Logger logger) { final List<String> columnNames = readCounts.columnNames(); final Set<String> columnsToKeep = new LinkedHashSet<>(readCounts.columnNames().size()); final Set<String> columnsToDrop = new HashSet<>(); for (int i = 0; i < columnNames.size(); i++) { <START> if (Arrays.stream(readCounts.getColumn(i)) <END> .filter(d -> Double.isNaN(d) || Double.isInfinite(d)) .count() == 0) { columnsToKeep.add(columnNames.get(i)); } else { columnsToDrop.add(columnNames.get(i)); } } if (columnsToKeep.isEmpty()) { throw new UserException.BadInput("No column count left after removing those with NaN and infinities"); } else if (columnsToKeep.size() == columnNames.size()) { logger.info("No column dropped due to bad values"); return readCounts; } else { final double droppedPercentage = ((double)(columnsToDrop.size()) / columnNames.size()) * 100; logger.info(String.format("Some columns dropped (%d out of %d, %.2f%%) as they contained bad values: %s", columnsToDrop.size(), columnNames.size(), droppedPercentage, columnsToDrop.stream().collect(Collectors.joining(", ", "[", "]")))); return readCounts.subsetColumns(columnsToKeep); } }</code><technical_language>I this a nested for loop, loop scans column breaks a bad is found</technical_language>

Target:
public static ReadCountCollection removeColumnsWithBadValues(final ReadCountCollection readCounts, final Logger logger) { final List<String> columnNames = readCounts.columnNames(); final Set<String> columnsToKeep = new LinkedHashSet<>(readCounts.columnNames().size()); final Set<String> columnsToDrop = new HashSet<>(); for (int i = 0; i < columnNames.size(); i++) { if (Arrays.stream(readCounts.getColumn(i)).noneMatch(d -> Double.isNaN(d) || Double.isInfinite(d) || d < 0)) { columnsToKeep.add(columnNames.get(i)); } else { columnsToDrop.add(columnNames.get(i)); } } if (columnsToKeep.isEmpty()) { throw new UserException.BadInput("No column count left after removing those with NaN and infinities"); } else if (columnsToKeep.size() == columnNames.size()) { logger.info("No column dropped due to bad values"); return readCounts; } else { final double droppedPercentage = ((double)(columnsToDrop.size()) / columnNames.size()) * 100; logger.info(String.format("Some columns dropped (%d out of %d, %.2f%%) as they contained bad values: %s", columnsToDrop.size(), columnNames.size(), droppedPercentage, columnsToDrop.stream().collect(Collectors.joining(", ", "[", "]")))); return readCounts.subsetColumns(columnsToKeep); } }
Source:
<code>public KeyVaultOperation( final SecretClient secretClient, final long refreshInMillis, List<String> secretKeys, boolean caseSensitive ) { this.caseSensitive = caseSensitive; this.secretClient = secretClient; this.secretKeys = secretKeys; refreshProperties(); if (refreshInMillis > 0) { final TimerTask task = new TimerTask() { @Override public void run() { refreshProperties(); } }; <START> this.timer.scheduleAtFixedRate(task, refreshInMillis, refreshInMillis); <END> } }</code><technical_language>Delete this., TIMER is bind this</technical_language>

Target:
public KeyVaultOperation( final SecretClient secretClient, final long refreshInMillis, List<String> secretKeys, boolean caseSensitive ) { this.caseSensitive = caseSensitive; this.secretClient = secretClient; this.secretKeys = secretKeys; refreshProperties(); if (refreshInMillis > 0) { final TimerTask task = new TimerTask() { @Override public void run() { refreshProperties(); } }; TIMER.scheduleAtFixedRate(task, refreshInMillis, refreshInMillis); } }
Source:
<code>LogEventHandler(final Configuration conf) { <START> namedQueueServices <END> .put(NamedQueuePayload.NamedQueueEvent.SLOW_LOG, new SlowLogQueueService(conf)); }</code><technical_language>define a String collection property for implementations of NamedQueueService? this handler load dynamically, requiring code changes new implementations added</technical_language>

Target:
LogEventHandler(final Configuration conf) { for (String implName : conf.getStringCollection(NAMED_QUEUE_PROVIDER_CLASSES)) { Class<?> clz; try { clz = Class.forName(implName); } catch (ClassNotFoundException e) { LOG.warn("Failed to find NamedQueueService implementor class {}", implName, e); continue; } if (!NamedQueueService.class.isAssignableFrom(clz)) { LOG.warn("Class is not implementor of NamedQueueService.", clz); continue; } try { NamedQueueService namedQueueService = (NamedQueueService) clz.getConstructor(Configuration.class).newInstance(conf); namedQueueServices.put(namedQueueService.getEvent(), namedQueueService); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { LOG.warn("Unable to instantiate/add NamedQueueService implementor to service map.", clz); } } }
Source:
<code>public void shouldReturnApiKeyAvailability() { when(apiKeyService.exists(anyString())).thenReturn(true); <START> Response response = envTarget("verify") <END> .queryParam("apiKey", "atLeast10CharsButLessThan64") .request() .get(); assertEquals(HttpStatusCode.OK_200, response.getStatus()); assertEquals(false, response.readEntity(Boolean.class)); }</code><technical_language>_verify</technical_language>

Target:
public void shouldReturnApiKeyAvailability() { when(apiKeyService.exists(anyString())).thenReturn(true); Response response = envTarget("_verify") .queryParam("apiKey", "atLeast10CharsButLessThan64") .request() .post(null); assertEquals(HttpStatusCode.OK_200, response.getStatus()); assertEquals(false, response.readEntity(Boolean.class)); }
Source:
<code>private IResourceVariant findFileVariant(IResource resource, Repository repository) throws TeamException { RepositoryMapping repoMapping = RepositoryMapping.getMapping(resource); <START> if (repoMapping == null) { END> return null; } String gitPath = repoMapping.getRepoRelativePath(resource); ObjectId objectId = updated.get(gitPath); if (objectId != null) { File root = repository.getWorkDir(); File file = new File(root, gitPath); if (resource.getLocation().toFile().equals(file)) { try { Tree merge = trees.get(repository); TreeEntry tree = merge.findBlobMember(gitPath); GitBlobResourceVariant variant = new GitBlobResourceVariant( resource, repository, tree.getId(), dates .get(gitPath)); return variant; } catch (IOException e) { throw new TeamException(new Status(IStatus.ERROR, Activator .getPluginId(), NLS.bind( CoreText.GitResourceVariantTree_couldNotFindBlob, gitPath), e)); } } } return null; }</code><technical_language>style nit: braces single line do put bug number here, this belongs commit message</technical_language>

Target:
private IResourceVariant findFileVariant(IResource resource, Repository repository) throws TeamException { RepositoryMapping repoMapping = RepositoryMapping.getMapping(resource); if (repoMapping == null) return null; String gitPath = repoMapping.getRepoRelativePath(resource); ObjectId objectId = updated.get(gitPath); if (objectId != null) { File root = repository.getWorkDir(); File file = new File(root, gitPath); if (resource.getLocation().toFile().equals(file)) { try { Tree merge = trees.get(repository); TreeEntry tree = merge.findBlobMember(gitPath); GitBlobResourceVariant variant = new GitBlobResourceVariant( resource, repository, tree.getId(), dates .get(gitPath)); return variant; } catch (IOException e) { throw new TeamException(new Status(IStatus.ERROR, Activator .getPluginId(), NLS.bind( CoreText.GitResourceVariantTree_couldNotFindBlob, gitPath), e)); } } } return null; }
Source:
<code>private void advance() { int totalCycleCount = 0; CbclData data = new CbclData(outputLengths, cycleData[totalCycleCount].tileInfo.tileNum); for (int read = 0; read < outputLengths.length; read++) { for (int cycle = 0; cycle < outputLengths[read]; cycle++) { CycleData currentCycleData = cycleData[totalCycleCount]; if (cachedTilePosition[totalCycleCount] >= cachedTile[totalCycleCount].length <START> || cachedTilePosition[totalCycleCount] >= cycleData[totalCycleCount].getTileInfo().getNumClustersInTile()) { <END> return; } int singleByte = cachedTile[totalCycleCount][cachedTilePosition[totalCycleCount]++]; decodeQualityBinnedBasecall(data, read, cycle, singleByte, currentCycleData); totalCycleCount++; } } data.setPositionInfo(positionInfoIterator.next()); this.queue = data; }</code><technical_language>explain this logic</technical_language>

Target:
private void advance() { int totalCycleCount = 0; final CbclData data = new CbclData(outputLengths, cycleData[totalCycleCount].tileInfo.tileNum); for (int read = 0; read < outputLengths.length; read++) { for (int cycle = 0; cycle < outputLengths[read]; cycle++) { final CycleData currentCycleData = cycleData[totalCycleCount]; if (cachedTilePosition[totalCycleCount] >= cachedTile[totalCycleCount].length || cachedTilePosition[totalCycleCount] >= cycleData[totalCycleCount].getTileInfo().getNumClustersInTile()) { return; } final int singleByte = cachedTile[totalCycleCount][cachedTilePosition[totalCycleCount]++]; decodeQualityBinnedBasecall(data, read, cycle, singleByte, currentCycleData); totalCycleCount++; } } data.setPositionInfo(positionInfoIterator.next()); this.queue = data; }
Source:
<code>public void testIgnoreLinesSorted() throws Exception { final RegexpHeaderCheck check = new RegexpHeaderCheck(); check.setMultiLines(5, 9, 9, 11, 2); <START> int[] multiLines = (int[]) Whitebox.getInternalState(check, "multiLines"); <END> assertArrayEquals(new int[]{2, 5, 9, 9, 11}, multiLines); }</code><technical_language>final</technical_language>

Target:
public void testIgnoreLinesSorted() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(RegexpHeaderCheck.class); checkConfig.addAttribute("headerFile", getPath("regexp.header5")); checkConfig.addAttribute("multiLines", "7,5,3"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputRegexpHeader8.java"), expected); }
Source:
<code>public void testEvaluateWithValidIPv4() throws URISyntaxException, HiveException { ObjectInspector value1 = PrimitiveObjectInspectorFactory.javaStringObjectInspector; ObjectInspector[] initArguments = new ObjectInspector[]{value1}; GeocodedDataUDF geocodedDataUDF = new GeocodedDataUDF( TestGeocodedDataUDF.class.getResource(defaultDatabaseFile).getFile()); try { geocodedDataUDF.initialize(initArguments); } catch (UDFArgumentLengthException lenEx) { <START> fail("UDFArgumentLengthException was thrown for valid argument"); <END> } catch (UDFArgumentTypeException typeEx) { fail("UDFArgumentTypeException was thrown for valid argument"); } catch (RuntimeException rEx) { fail("RuntimeException was thrown for valid argument"); } String ip = "81.2.69.160"; DeferredObject[] args = new DeferredObject[] { new DeferredJavaObject(ip) }; Map<String, String> result = (Map<String, String>)geocodedDataUDF.evaluate(args); assertEquals("Continent check", "Europe", result.get("continent")); assertEquals("ISO country code check", "GB", result.get("country_code")); assertEquals("Country check", "United Kingdom", result.get("country")); assertEquals("Subdivision check", "England", result.get("subdivision")); assertEquals("City check", "London", result.get("city")); assertEquals("Postal code check", "Unknown", result.get("postal_code")); assertEquals("Latitude check", "51.5142", result.get("latitude")); assertEquals("Longitude check", "-0.0931", result.get("longitude")); assertEquals("Timezone check", "Europe/London", result.get("timezone")); }</code><technical_language>catching exceptions tests I bubble fail test stack trace is printed, aid in debugging</technical_language>

Target:
public void testEvaluateWithValidIPv4() throws HiveException { String ip = "81.2.69.160"; Map<String, String> result = evaluate (ip); assertEquals("Continent check", "Europe", result.get("continent")); assertEquals("ISO country code check", "GB", result.get("country_code")); assertEquals("Country check", "United Kingdom", result.get("country")); assertEquals("Subdivision check", "England", result.get("subdivision")); assertEquals("City check", "London", result.get("city")); assertEquals("Postal code check", "Unknown", result.get("postal_code")); assertEquals("Latitude check", "51.5142", result.get("latitude")); assertEquals("Longitude check", "-0.0931", result.get("longitude")); assertEquals("Timezone check", "Europe/London", result.get("timezone")); }
Source:
<code>private void updateParents() throws OrmException, UnloggedFailure { String parentName = ""; if (newParent != null && newParent.getProject() != null) { parentName = newParent.getProject().getName(); } final List<Project.NameKey> childrenNameKey = new ArrayList<Project.NameKey>(); for (ProjectControl pc: children) { childrenNameKey.add(pc.getProject().getNameKey()); } final PerformSetParent perfSetParent = performSetParent.create(parentName, childrenNameKey); final StringBuilder err = perfSetParent.setParent(); <START> if (err.toString().endsWith("All:")) { <END> err.replace(err.length() - 4, err.length(), ""); } if (err.length() > 0) { while (err.charAt(err.length() - 1) == '\n') { err.setLength(err.length() - 1); } throw new UnloggedFailure(1, err.toString()); } }</code><technical_language>This weird me. If this 'All:' is needed in Web UI more sense append generic error message it</technical_language>

Target:
private void updateParents() throws OrmException, UnloggedFailure { NameKey parentNameKey = null; if (newParent != null && newParent.getProject() != null) { parentNameKey = newParent.getProject().getNameKey(); } final List<Project.NameKey> childrenNameKey = new ArrayList<Project.NameKey>(); for (ProjectControl pc: children) { childrenNameKey.add(pc.getProject().getNameKey()); } final PerformSetParent perfSetParent = performSetParent.create(parentNameKey, childrenNameKey); try { perfSetParent.setParent(); } catch (OperationNotExecutedException e) { throw new UnloggedFailure(1, e.getMessage()); } catch (NoSuchProjectException e){ throw new UnloggedFailure(1, e.getMessage()); } }
Source:
<code>public String apply(FileResource rsrc) throws ResourceNotFoundException, IOException { Project.NameKey project = rsrc.getRevision().getControl().getProject().getNameKey(); Repository repo = repoManager.openRepository(project); try { RevWalk rw = new RevWalk(repo); try { RevCommit commit = rw.parseCommit(ObjectId.fromString(rsrc.getRevision().getPatchSet() .getRevision().get())); TreeWalk tw = TreeWalk.forPath(rw.getObjectReader(), rsrc.getPatchKey().get(), commit.getTree().getId()); if (tw == null) { throw new ResourceNotFoundException(); } try { ObjectLoader loader = repo.open(tw.getObjectId(0)); <START> CharArrayWriter w = new CharArrayWriter(4 * (((int)loader.getSize() - 1)/3 + 1)); <END> loader.copyTo(BaseEncoding.base64().encodingStream(w)); return w.toString(); } finally { tw.release(); } } finally { rw.release(); } } finally { repo.close(); } }</code><technical_language>-( Is this want change? is client checking Content-Type header</technical_language>

Target:
public StreamingResponse apply(FileResource rsrc) throws ResourceNotFoundException, IOException { Project.NameKey project = rsrc.getRevision().getControl().getProject().getNameKey(); Repository repo = repoManager.openRepository(project); try { RevWalk rw = new RevWalk(repo); try { RevCommit commit = rw.parseCommit(ObjectId.fromString(rsrc.getRevision().getPatchSet() .getRevision().get())); TreeWalk tw = TreeWalk.forPath(rw.getObjectReader(), rsrc.getPatchKey().get(), commit.getTree().getId()); if (tw == null) { throw new ResourceNotFoundException(); } try { final ObjectLoader loader = repo.open(tw.getObjectId(0)); return new StreamingResponse() { @Override public String getContentType() { return "text/plain;charset=UTF-8"; } @Override public void stream(OutputStream out) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, Charsets.UTF_8)); try { loader.copyTo(BaseEncoding.base64().encodingStream(writer)); } finally { writer.flush(); } } }; } finally { tw.release(); } } finally { rw.release(); } } finally { repo.close(); } }
Source:
<code>public Void exec() throws NotFoundException { if (StringUtils.isNotEmpty(this.hostResource)) { if (this.tarInputStream != null) { throw new DockerClientException( "Only one of host resource or tar input stream should be defined to perform the copy, not both"); } Path toUpload = null; try { toUpload = Files.createTempFile("docker-java", ".tar.gz"); CompressArchiveUtil.tar(Paths.get(hostResource), toUpload, true, dirChildrenOnly); <START> this.tarInputStream = Files.newInputStream(toUpload); <END> return super.exec(); } catch (IOException e) { throw new DockerClientException("Unable to perform tar on host resource " + this.hostResource, e); } finally { if (toUpload != null) { toUpload.toFile().delete(); } } } else if (this.tarInputStream == null) { throw new DockerClientException( "One of host resource or tar input stream must be defined to perform the copy"); } return super.exec(); }</code><technical_language>this wrapped try-with-resources closed in else place</technical_language>

Target:
public Void exec() throws NotFoundException { if (StringUtils.isNotEmpty(this.hostResource)) { if (this.tarInputStream != null) { throw new DockerClientException( "Only one of host resource or tar input stream should be defined to perform the copy, not both"); } Path toUpload = null; try { toUpload = Files.createTempFile("docker-java", ".tar.gz"); CompressArchiveUtil.tar(Paths.get(hostResource), toUpload, true, dirChildrenOnly); } catch (IOException createFileIOException) { if (toUpload != null) { toUpload.toFile().delete(); } throw new DockerClientException("Unable to perform tar on host resource " + this.hostResource, createFileIOException); } try (InputStream uploadStream = Files.newInputStream(toUpload)) { this.tarInputStream = uploadStream; return super.exec(); } catch (IOException e) { throw new DockerClientException("Unable to read temp file " + toUpload.toFile().getAbsolutePath(), e); } finally { toUpload.toFile().delete(); } } else if (this.tarInputStream == null) { throw new DockerClientException("One of host resource or tar input stream must be defined to perform the copy"); } return super.exec(); }
Source:
<code>protected SlaveObjectAxisProvider getSlaveObjectAxisProvider(final TableConfiguration configuration) { SlaveObjectAxisProvider slave = null; if (0 < configuration.getRowAxisProviders().size()) { final Iterator<AbstractAxisProvider> columnAxisProvidersIterator = configuration.getColumnAxisProviders().iterator(); while (columnAxisProvidersIterator.hasNext() && null == slave) { <START> AbstractAxisProvider axisProvider = columnAxisProvidersIterator.next(); <END> if (axisProvider instanceof SlaveObjectAxisProvider) { slave = (SlaveObjectAxisProvider) axisProvider; } } } return slave; }</code><technical_language>final</technical_language>

Target:
protected SlaveObjectAxisProvider getSlaveObjectAxisProvider(final TableConfiguration configuration) { SlaveObjectAxisProvider slave = null; if (0 < configuration.getRowAxisProviders().size()) { final Iterator<AbstractAxisProvider> columnAxisProvidersIterator = configuration.getColumnAxisProviders().iterator(); while (columnAxisProvidersIterator.hasNext() && null == slave) { final AbstractAxisProvider axisProvider = columnAxisProvidersIterator.next(); if (axisProvider instanceof SlaveObjectAxisProvider) { slave = (SlaveObjectAxisProvider) axisProvider; } } } return slave; }
Source:
<code>protected boolean acquireLock() { Guid objectLockingId = getObjectLockingId(); boolean returnValue = true; if (!Guid.Empty.equals(objectLockingId)) { EngineLock lock = new EngineLock(); String currType = getClass().getName(); Map<String, Guid> exclusiveLock = Collections.singletonMap(currType, objectLockingId); lock.setExclusiveLocks(exclusiveLock); if (LockManagerFactory.getLockManager().acquireLock(lock)) { <START> log.infoFormat("Lock Aquired to object {0}", lock); <END> commandLock = lock; } else { log.infoFormat("Failed to Aquire Lock to object {0}", lock); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED); returnValue = false; } } return returnValue; }</code><technical_language>nag, i feel if change this, need fix typo (should acquired)</technical_language>

Target:
protected boolean acquireLock() { Guid objectLockingId = getObjectLockingId(); boolean returnValue = true; if (!Guid.Empty.equals(objectLockingId)) { EngineLock lock = new EngineLock(); String currType = getClass().getName(); Map<String, Guid> exclusiveLock = Collections.singletonMap(currType, objectLockingId); lock.setExclusiveLocks(exclusiveLock); if (LockManagerFactory.getLockManager().acquireLock(lock)) { log.infoFormat("Lock Acquired to object {0}", lock); commandLock = lock; } else { log.infoFormat("Failed to Acquire Lock to object {0}", lock); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED); returnValue = false; } } return returnValue; }
Source:
<code>public void testJdbcBatchingOutputFormatCloseDuringRuntime() throws Exception{ JdbcOptions options = JdbcOptions.builder() .setDBUrl(getDbMetadata().getUrl()) .setTableName(OUTPUT_TABLE) .build(); RuntimeContext context = Mockito.mock(RuntimeContext.class); ExecutionConfig executionConfig = Mockito.mock(ExecutionConfig.class); JdbcExecutionOptions jdbcExecutionOptions = Mockito.mock(JdbcExecutionOptions.class); JdbcBatchStatementExecutor executor = Mockito.mock(JdbcBatchStatementExecutor.class); doReturn(executionConfig).when(context).getExecutionConfig(); <START> doReturn(500L).when(jdbcExecutionOptions).getBatchIntervalMs(); doReturn(2).when(jdbcExecutionOptions).getBatchSize(); doReturn(3).when(jdbcExecutionOptions).getMaxRetries(); <END> doThrow(SQLException.class).when(executor).executeBatch(); JdbcBatchingOutputFormat<Tuple2<Boolean, Row>, Row, JdbcBatchStatementExecutor<Row>> format = new JdbcBatchingOutputFormat<>( new SimpleJdbcConnectionProvider(options), jdbcExecutionOptions, (ctx) -> executor, (tuple2) -> tuple2.f1); format.setRuntimeContext(context); format.open(0, 1); try { for (JdbcTestFixture.TestEntry entry : TEST_DATA) { format.writeRecord(Tuple2.of(true, toRow(entry))); } } catch (Exception e) { try { format.close(); } catch (Exception realException){ Connection connection = format.getConnection(); if (connection != null && !connection.isClosed()){ throw new RuntimeException("Resource leak!"); } } } }</code><technical_language>Mockito is a bad practice avoided possible. java JdbcExecutionOptions jdbcExecutionOptions = JdbcExecutionOptions.builder() .withBatchIntervalMs(1000_000L) .withBatchSize(1) .withMaxRetries(1) .build(); ExecutionConfig executionConfig = new ExecutionConfig(); create them</technical_language>

Target:
public void testJdbcBatchingOutputFormatCloseDuringRuntime() throws Exception{ JdbcOptions options = JdbcOptions.builder() .setDBUrl(getDbMetadata().getUrl()) .setTableName(OUTPUT_TABLE) .build(); JdbcExecutionOptions jdbcExecutionOptions = JdbcExecutionOptions.builder() .withBatchIntervalMs(1000_000L) .withBatchSize(2) .withMaxRetries(1) .build(); ExecutionConfig executionConfig = new ExecutionConfig(); RuntimeContext context = Mockito.mock(RuntimeContext.class); JdbcBatchStatementExecutor executor = Mockito.mock(JdbcBatchStatementExecutor.class); doReturn(executionConfig).when(context).getExecutionConfig(); doThrow(SQLException.class).when(executor).executeBatch(); JdbcBatchingOutputFormat<Tuple2<Boolean, Row>, Row, JdbcBatchStatementExecutor<Row>> format = new JdbcBatchingOutputFormat<>( new SimpleJdbcConnectionProvider(options), jdbcExecutionOptions, (ctx) -> executor, (tuple2) -> tuple2.f1); format.setRuntimeContext(context); format.open(0, 1); try { for (JdbcTestFixture.TestEntry entry : TEST_DATA) { format.writeRecord(Tuple2.of(true, toRow(entry))); } } catch (Exception e) { format.close(); } finally { assertNull(format.getConnection()); } }
Source:
<code>public void setTags(final List<String> tags) { <START> this.tags = tags != null ? SetUniqueList.decorate(tags) : null; <END> }</code><technical_language>For knowledge: is impact of ? multiple time in tag list</technical_language>

Target:
public void setTags(final List<String> tags) { this.tags = tags != null ? SetUniqueList.decorate(new ArrayList(tags)) : null; }