auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isInside(Object element) { if (element instanceof ASTNode) { return isInsideNode((ASTNode) element); } else if (element instanceof NodeProperty) { NodeProperty property= (NodeProperty) element; Object object= property.getNode(); if (object instanceof ASTNode) { return isInsideNode((ASTNode) object); } else if (object instanceof List) { for (Object child : <START> ((List<?>) <END> object)) { if (isInside(child)) { return true; } } } } return false; }</code><technical_language>braces unnecessary</technical_language>

Target:
private boolean isInside(Object element) { if (element instanceof ASTNode) { return isInsideNode((ASTNode) element); } else if (element instanceof NodeProperty) { NodeProperty property= (NodeProperty) element; Object object= property.getNode(); if (object instanceof ASTNode) { return isInsideNode((ASTNode) object); } else if (object instanceof List) { for (Object child : (List<?>) object) { if (isInside(child)) { return true; } } } } return false; }
Source:
<code>public static HazelcastOperation getHazelcastOperation(String name) { if (name == null) { return null; } <START> for (HazelcastOperation hazelcastOperation : values()) { <END> if (hazelcastOperation.toString().equalsIgnoreCase(name)) { return hazelcastOperation; } } throw new IllegalArgumentException(String.format("Operation '%s' is not supported by this component.", name)); }</code><technical_language>Enum.values() creates array time is invoked, cache statically iterate index avoid garbage created iterator</technical_language>

Target:
public static HazelcastOperation getHazelcastOperation(String name) { if (name == null) { return null; } for (HazelcastOperation hazelcastOperation : values) { if (hazelcastOperation.toString().equalsIgnoreCase(name) || hazelcastOperation.name().equalsIgnoreCase(name)) { return hazelcastOperation; } } throw new IllegalArgumentException(String.format("Operation '%s' is not supported by this component.", name)); }
Source:
<code>protected void init() throws IOException { <START> boolean bindWildcard = !StackProperties.getBoolean( <END> StackProperties.BIND_WILDCARD, false); Set<InetSocketAddress> addressesToBind = new HashSet<>(); for (TransportAddress transportAddress : localAddresses) { addressesToBind.add( new InetSocketAddress( bindWildcard ? null : transportAddress.getAddress(), transportAddress.getPort() ) ); } for (InetSocketAddress addressToBind : addressesToBind ) { addSocketChannel( addressToBind ); } acceptThread = new AcceptThread(); acceptThread.start(); readThread = new ReadThread(); readThread.start(); }</code><technical_language>negation</technical_language>

Target:
protected void init() throws IOException { boolean bindWildcard = StackProperties.getBoolean( StackProperties.BIND_WILDCARD, false); Set<InetSocketAddress> addressesToBind = new HashSet<>(); for (TransportAddress transportAddress : localAddresses) { addressesToBind.add( new InetSocketAddress( bindWildcard ? null : transportAddress.getAddress(), transportAddress.getPort() ) ); } for (InetSocketAddress addressToBind : addressesToBind ) { addSocketChannel( addressToBind ); } acceptThread = new AcceptThread(); acceptThread.start(); readThread = new ReadThread(); readThread.start(); }
Source:
<code><START> public BuildContextImpl(BuildContextImpl buildContext) { <END> this.context = buildContext.getContext(); this.dockerfile = buildContext.getDockerfile(); }</code><technical_language>Please copy args</technical_language>

Target:
public BuildContextImpl(BuildContextImpl buildContext) { this(buildContext.getContext(),buildContext.getDockerfile(), buildContext.getArgs()); }
Source:
<code>private boolean checkDwhConfigInEngine() { boolean isOk = true; String hostname = null; String uuid = null; try (Connection c = engineDataSource.getConnection(); Statement s = c.createStatement(); ResultSet rs = s.executeQuery("SELECT * FROM dwh_history_timekeeping WHERE var_name IN ('dwhHostname', 'dwhUuid')")) { while (rs.next()) { String varName = StringUtils.trimToNull(rs.getString("var_name")); String varValue = StringUtils.trimToNull(rs.getString("var_value")); switch (varName) { case "dwhHostname": hostname = varValue; break; case "dwhUuid": uuid = varValue; break; } } } catch (SQLException e) { log.error("Could not access <START> dwh_history_timekeeping", <END> e); } if (StringUtils.isEmpty(hostname) && StringUtils.isEmpty(uuid)) { log.warn("No valid DWH configurations were found, assuming DWH database isn't setup."); isOk = false; } return isOk; }</code><technical_language>extract DB table name a local variable String.format() needed</technical_language>

Target:
private boolean checkDwhConfigInEngine() { boolean isOk = true; String hostname = null; String uuid = null; try (Connection c = engineDataSource.getConnection(); Statement s = c.createStatement(); ResultSet rs = s.executeQuery("SELECT * FROM dwh_history_timekeeping WHERE var_name IN ('dwhHostname', 'dwhUuid')")) { while (rs.next()) { String varName = StringUtils.trimToNull(rs.getString("var_name")); String varValue = StringUtils.trimToNull(rs.getString("var_value")); switch (varName) { case "dwhHostname": hostname = varValue; break; case "dwhUuid": uuid = varValue; break; } } } catch (SQLException e) { log.error("Could not access engine's DWH configuration table", e); } if (StringUtils.isEmpty(hostname) || StringUtils.isEmpty(uuid)) { log.warn("No valid DWH configurations were found, assuming DWH database isn't setup."); isOk = false; } return isOk; }
Source:
<code><START> private static PipelineStatus getPipelineStatus(List<DriverContext> driverContexts) <END> { int queuedDrivers = 0; int runningDrivers = 0; int blockedDrivers = 0; int queuedPartitionedDrivers = 0; int runningPartitionedDrivers = 0; for (DriverContext driverContext : driverContexts) { if (!driverContext.isExecutionStarted()) { queuedDrivers++; if (driverContext.isPartitioned()) { queuedPartitionedDrivers++; } } else if (driverContext.isFullyBlocked()) { blockedDrivers++; } else { runningDrivers++; if (driverContext.isPartitioned()) { runningPartitionedDrivers++; } } } return new PipelineStatus(queuedDrivers, runningDrivers, blockedDrivers, queuedPartitionedDrivers, runningPartitionedDrivers); }</code><technical_language>need this static</technical_language>

Target:
private PipelineStatus getPipelineStatus(List<DriverContext> driverContexts) { int queuedDrivers = 0; int runningDrivers = 0; int blockedDrivers = 0; int queuedPartitionedDrivers = 0; int runningPartitionedDrivers = 0; for (DriverContext driverContext : driverContexts) { if (!driverContext.isExecutionStarted()) { queuedDrivers++; if (driverContext.isPartitioned()) { queuedPartitionedDrivers++; } } else if (driverContext.isFullyBlocked()) { blockedDrivers++; } else { runningDrivers++; if (driverContext.isPartitioned()) { runningPartitionedDrivers++; } } } return new PipelineStatus(queuedDrivers, runningDrivers, blockedDrivers, queuedPartitionedDrivers, runningPartitionedDrivers); }
Source:
<code>public RedisTestMessageBus(RedisConnectionFactory connectionFactory, MultiTypeCodec<Object> codec) { RedisMessageBus messageBus = new RedisMessageBus(connectionFactory, codec); <START> this.setMessageBus(messageBus); <END> GenericApplicationContext context = new GenericApplicationContext(); context.refresh(); messageBus.setApplicationContext(context); this.setMessageBus(messageBus); template = new StringRedisTemplate(connectionFactory); }</code><technical_language>Remove, please, this line</technical_language>

Target:
public RedisTestMessageBus(RedisConnectionFactory connectionFactory, MultiTypeCodec<Object> codec) { RedisMessageBus messageBus = new RedisMessageBus(connectionFactory, codec); GenericApplicationContext context = new GenericApplicationContext(); context.refresh(); messageBus.setApplicationContext(context); setMessageBus(messageBus); template = new StringRedisTemplate(connectionFactory); }
Source:
<code>protected void aeadOutgoingBuffer(Buffer buf, int offset, int len) throws Exception { <START> if (outCipher instanceof BaseGCMCipher) { <END> BaseGCMCipher cipher = (BaseGCMCipher) outCipher; buf.wpos(offset + Integer.BYTES + len + cipher.getAuthenticationTagSize()); byte[] data = buf.array(); cipher.incrementIV(); cipher.updateAAD(data, offset, Integer.BYTES); cipher.update(data, offset + Integer.BYTES, len); cipher.doFinal(data, offset + Integer.BYTES + len); int blocksCount = len / outCipherSize; outBlocksCount.addAndGet(Math.max(1, blocksCount)); } }</code><technical_language>I throw exception if this is a BaseGCMCipher ciphers expected reach this code</technical_language>

Target:
protected void aeadOutgoingBuffer(Buffer buf, int offset, int len) throws Exception { if (outCipher == null || outCipher.getAuthenticationTagSize() == 0) { throw new IllegalArgumentException("AEAD mode requires an AEAD cipher"); } byte[] data = buf.array(); outCipher.updateWithAAD(data, offset, Integer.BYTES, len); int blocksCount = len / outCipherSize; outBlocksCount.addAndGet(Math.max(1, blocksCount)); }
Source:
<code>public void verifyPhoneNumber(final String number, boolean force) { setResult(Resource.<Pair<String, PhoneAuthCredential>>forLoading()); getPhoneAuth().verifyPhoneNumber( number, AUTO_RETRIEVAL_TIMEOUT_SECONDS, TimeUnit.SECONDS, TaskExecutors.MAIN_THREAD, new PhoneAuthProvider.OnVerificationStateChangedCallbacks() { @Override public void onVerificationCompleted(@NonNull PhoneAuthCredential credential) { <START> setResult(Resource.forSuccess(Pair.create(number, credential))); <END> } @Override public void onVerificationFailed(FirebaseException e) { setResult(Resource.<Pair<String, PhoneAuthCredential>>forFailure(e)); } @Override public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) { mVerificationId = verificationId; mForceResendingToken = token; setResult(Resource.<Pair<String, PhoneAuthCredential>>forFailure( new PhoneNumberVerificationRequiredException(number))); } }, force ? mForceResendingToken : null); }</code><technical_language>This is case retrieval happened user interaction. ideas for send a special signal UI like</technical_language>

Target:
public void verifyPhoneNumber(final String number, boolean force) { setResult(Resource.<PhoneVerification>forLoading()); getPhoneAuth().verifyPhoneNumber( number, AUTO_RETRIEVAL_TIMEOUT_SECONDS, TimeUnit.SECONDS, TaskExecutors.MAIN_THREAD, new PhoneAuthProvider.OnVerificationStateChangedCallbacks() { @Override public void onVerificationCompleted(@NonNull PhoneAuthCredential credential) { setResult(Resource.forSuccess(new PhoneVerification( number, credential, true))); } @Override public void onVerificationFailed(FirebaseException e) { setResult(Resource.<PhoneVerification>forFailure(e)); } @Override public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) { mVerificationId = verificationId; mForceResendingToken = token; setResult(Resource.<PhoneVerification>forFailure( new PhoneNumberVerificationRequiredException(number))); } }, force ? mForceResendingToken : null); }
Source:
<code>public static ExportRow decodeRow(ExportRow previous, int partition, long startTS, byte[] rowData) throws IOException { ByteBuffer bb = ByteBuffer.wrap(rowData); bb.order(ByteOrder.LITTLE_ENDIAN); final long generation = bb.getLong(); final int partitionColIndex = bb.getInt(); final int columnCount = bb.getInt(); final byte hasSchema = bb.get(); assert(columnCount <= DDLCompiler.MAX_COLUMNS); boolean[] is_null = extractNullFlags(bb, columnCount); List<String> colNames = new ArrayList<>(); List<Integer> colLengths = new ArrayList<>(); List<VoltType> colTypes = new ArrayList<>(); String tableName = null; if (hasSchema == 1) { tableName = decodeString(bb); <START> colNames = new ArrayList<>(); <END> colLengths = new ArrayList<>(); colTypes = new ArrayList<>(); for (int i = 0; i < columnCount; i++) { colNames.add(decodeString(bb)); colTypes.add(VoltType.get(bb.get())); colLengths.add(bb.getInt()); } } else { assert(previous != null); if (previous == null) { throw new IOException("Export block with no schema found without prior block with schema."); } tableName = previous.tableName; colNames = previous.names; colTypes = previous.types; colLengths = previous.lengths; } Object[] retval = new Object[colNames.size()]; Object pval = null; for (int i = 0; i < colNames.size(); ++i) { if (is_null[i]) { retval[i] = null; } else { retval[i] = decodeNextColumn(bb, colTypes.get(i)); } if (i == partitionColIndex) { pval = retval[i]; } } return new ExportRow(tableName, colNames, colTypes, colLengths, retval, pval, partitionColIndex, partition, generation, (hasSchema == 1)); }</code><technical_language>Double initialization</technical_language>

Target:
public static ExportRow decodeRow(ExportRow previous, int partition, long startTS, byte[] rowData) throws IOException { ByteBuffer bb = ByteBuffer.wrap(rowData); bb.order(ByteOrder.LITTLE_ENDIAN); final long generation = bb.getLong(); final int partitionColIndex = bb.getInt(); final int columnCount = bb.getInt(); final byte hasSchema = bb.get(); assert(columnCount <= DDLCompiler.MAX_COLUMNS); boolean[] is_null = extractNullFlags(bb, columnCount); List<String> colNames = new ArrayList<>(); List<Integer> colLengths = new ArrayList<>(); List<VoltType> colTypes = new ArrayList<>(); String tableName = null; if (hasSchema == 1) { tableName = decodeString(bb); for (int i = 0; i < columnCount; i++) { colNames.add(decodeString(bb)); colTypes.add(VoltType.get(bb.get())); colLengths.add(bb.getInt()); } } else { assert(previous != null); if (previous == null) { throw new IOException("Export block with no schema found without prior block with schema."); } tableName = previous.tableName; colNames = previous.names; colTypes = previous.types; colLengths = previous.lengths; } Object[] retval = new Object[colNames.size()]; Object pval = null; for (int i = 0; i < colNames.size(); ++i) { if (is_null[i]) { retval[i] = null; } else { retval[i] = decodeNextColumn(bb, colTypes.get(i)); } if (i == partitionColIndex) { pval = retval[i]; } } return new ExportRow(tableName, colNames, colTypes, colLengths, retval, (pval == null ? partition : pval), partitionColIndex, partition, generation); }
Source:
<code>public void testGetNetworkFiltersByVersion() { final Version version = new Version("3.6"); final List<NetworkFilter> allNetworkFilter = dao.getNetworkFiltersByVersion(version); assertNotNull(allNetworkFilter); <START> assertEquals(1, allNetworkFilter.size()); <END> }</code><technical_language>please assert well. easy do parameterizing method expectedNetworkFilter</technical_language>

Target:
public void testGetNetworkFiltersByVersion() { final Version version = new Version("4.0"); final List<NetworkFilter> allNetworkFilter = dao.getNetworkFiltersByVersion(version); assertNotNull(allNetworkFilter); assertEquals(1, allNetworkFilter.size()); final NetworkFilter expectedNetworkFilter = expectedNetworkFilter(); assertEquals(expectedNetworkFilter, allNetworkFilter.get(0)); }
Source:
<code>protected HttpConnection httpOpen(String method, URL u) throws IOException { final Proxy proxy = HttpSupport.proxyFor(proxySelector, u); HttpConnection conn = connectionFactory.create(u, proxy); if (!http.sslVerify && "https".equals(u.getProtocol())) { disableSslVerify(conn); } conn.setRequestMethod(method); conn.setUseCaches(false); conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP); conn.setRequestProperty(HDR_PRAGMA, "no-cache"); conn.setRequestProperty(HDR_USER_AGENT, userAgent); int timeOut = getTimeout(); if (timeOut != -1) { int effTimeOut = timeOut * 1000; conn.setConnectTimeout(effTimeOut); conn.setReadTimeout(effTimeOut); } if (this.headers != null && !this.headers.isEmpty()) { <START> for (Map.Entry<String, String> entry : this.headers.entrySet()) { <END> conn.setRequestProperty(entry.getKey(), entry.getValue()); } } authMethod.configureRequest(conn); return conn; }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
protected HttpConnection httpOpen(String method, URL u) throws IOException { final Proxy proxy = HttpSupport.proxyFor(proxySelector, u); HttpConnection conn = connectionFactory.create(u, proxy); if (!http.sslVerify && "https".equals(u.getProtocol())) { disableSslVerify(conn); } conn.setRequestMethod(method); conn.setUseCaches(false); conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP); conn.setRequestProperty(HDR_PRAGMA, "no-cache"); conn.setRequestProperty(HDR_USER_AGENT, userAgent); int timeOut = getTimeout(); if (timeOut != -1) { int effTimeOut = timeOut * 1000; conn.setConnectTimeout(effTimeOut); conn.setReadTimeout(effTimeOut); } if (this.headers != null && !this.headers.isEmpty()) { for (Map.Entry<String, String> entry : this.headers.entrySet()) conn.setRequestProperty(entry.getKey(), entry.getValue()); } authMethod.configureRequest(conn); return conn; }
Source:
<code>private static Process getProcess(IngesterName name) { Environment environment; try { environment = Environment.valueOf(TelescopeConfiguration.ENVIRONMENT); } catch (IllegalArgumentException e) { <START> log.error("Could not find a telescope environment with the given name, name={}. Falling back to STAGE.", TelescopeConfiguration.ENVIRONMENT); <END> e.printStackTrace(); environment = Environment.STAGE; } return Process.create(name.getIngesterKey(), name.getIngesterName(), environment); }</code><technical_language>this necessary if people watching logs carefully enough this ingest stage realising</technical_language>

Target:
private static Process getProcess(IngesterName name) { Environment environment; try { environment = Environment.valueOf(ENVIRONMENT); } catch (IllegalArgumentException e) { environment = Environment.STAGE; log.error( "Could not find a telescope environment with the given name, name={}. Falling back to STAGE.", ENVIRONMENT, e ); } return Process.create(name.getIngesterKey(), name.getIngesterName(), environment); }
Source:
<code>public void returnsEmptyIteratorOnInvalidPartRequest() throws IOException { final String body = "443 N Wolfe Rd, Sunnyvale, CA 94085"; final RqMultipart multi = new RqMultipart.Fake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), contentLengthHeader(body.getBytes().length), contentDispositionHeader( "form-data; name=\"t5\"" ) ), new RqWithHeaders( new RqFake("", "", ""), contentLengthHeader(0), contentDispositionHeader( "form-data; name=\"data\"; filename=\"a.zip\"" ) ) ); try { MatcherAssert.assertThat( multi.part("fake").iterator().hasNext(), Matchers.is(false) ); <START> } finally { <END> multi.body().close(); } }</code><technical_language>@raphaelln convinced finally blocks... invoke multi.body().close(); finally</technical_language>

Target:
public void returnsEmptyIteratorOnInvalidPartRequest() throws IOException { final String body = "443 N Wolfe Rd, Sunnyvale, CA 94085"; final RqMultipart multi = new RqMultipart.Fake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), contentLengthHeader(body.getBytes().length), contentDispositionHeader( "form-data; name=\"t5\"" ) ), new RqWithHeaders( new RqFake("", "", ""), contentLengthHeader(0), contentDispositionHeader( "form-data; name=\"data\"; filename=\"a.zip\"" ) ) ); MatcherAssert.assertThat( multi.part("fake").iterator().hasNext(), Matchers.is(false) ); multi.body().close(); }
Source:
<code>public void activate() { <START> logger.debug("Activate"); <END> }</code><technical_language>please remove this statement enhance more context/meaningful</technical_language>

Target:
public void activate() { logger.debug("GoogleTTS service has been activated"); }
Source:
<code>public void selectRuntimeQueries() { String sql = "SELECT" + " node_id," + " query_id," + " state," + " user," + " query," + " resource_group_id," + " queued_time_ms," + " analysis_time_ms," + " distributed_planning_time_ms," + " created," + " started," + " last_heartbeat," + " 'end' " + "FROM system.runtime.queries"; if (usingTeradataJdbcDriver(defaultQueryExecutor().getConnection())) { assertThat(query(sql)) <START> .hasColumns(VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, <END> BIGINT, BIGINT, BIGINT, TIMESTAMP, TIMESTAMP, TIMESTAMP, VARCHAR) .hasAnyRows(); } else { assertThat(query(sql)) .hasColumns(VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, ARRAY, BIGINT, BIGINT, BIGINT, TIMESTAMP, TIMESTAMP, TIMESTAMP, VARCHAR) .hasAnyRows(); } }</code><technical_language>put arg in separate line</technical_language>

Target:
public void selectRuntimeQueries() { String sql = "SELECT" + " node_id," + " query_id," + " state," + " user," + " query," + " resource_group_id," + " queued_time_ms," + " analysis_time_ms," + " distributed_planning_time_ms," + " created," + " started," + " last_heartbeat," + " 'end' " + "FROM system.runtime.queries"; JDBCType arrayType = usingTeradataJdbcDriver(defaultQueryExecutor().getConnection()) ? VARCHAR : ARRAY; assertThat(query(sql)) .hasColumns(VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, arrayType, BIGINT, BIGINT, BIGINT, TIMESTAMP, TIMESTAMP, TIMESTAMP, VARCHAR) .hasAnyRows(); }
Source:
<code>public SpringAggregateSnapshotter getObject() { if (transactionManager == null) { Map<String, PlatformTransactionManager> candidates = applicationContext.getBeansOfType(PlatformTransactionManager.class); if (candidates.size() == 1) { this.transactionManager = candidates.values().iterator().next(); } } if (eventStore == null) { eventStore = applicationContext.getBean(EventStore.class); } Configuration configuration = applicationContext.getBean(Configuration.class); if (repositoryProvider == null) { repositoryProvider = configuration::repository; } if (parameterResolverFactory == null) { parameterResolverFactory = MultiParameterResolverFactory .ordered(ClasspathParameterResolverFactory.forClass(getObjectType()), new SpringBeanParameterResolverFactory(applicationContext)); } TransactionManager txManager = transactionManager == null ? NoTransactionManager.INSTANCE : new SpringTransactionManager(transactionManager, transactionDefinition); if (deadlineManager == null) { <START> DeadlineTargetLoader deadlineTargetLoader = new DefaultDeadlineTargetLoader(configuration::repository, <END> configuration::sagaRepository); deadlineManager = new SimpleDeadlineManager(txManager, deadlineTargetLoader); } SpringAggregateSnapshotter snapshotter = new SpringAggregateSnapshotter(eventStore, parameterResolverFactory, executor, txManager, repositoryProvider, deadlineManager); snapshotter.setApplicationContext(applicationContext); return snapshotter; }</code><technical_language>Nit: this point insured repositoryProvider is null, right? pass repositoryProvider i.o. calling configuration::repository</technical_language>

Target:
public SpringAggregateSnapshotter getObject() { if (transactionManager == null) { Map<String, PlatformTransactionManager> candidates = applicationContext.getBeansOfType(PlatformTransactionManager.class); if (candidates.size() == 1) { this.transactionManager = candidates.values().iterator().next(); } } if (eventStore == null) { eventStore = applicationContext.getBean(EventStore.class); } if (repositoryProvider == null) { repositoryProvider = applicationContext.getBean(Configuration.class)::repository; } if (parameterResolverFactory == null) { parameterResolverFactory = MultiParameterResolverFactory .ordered(ClasspathParameterResolverFactory.forClass(getObjectType()), new SpringBeanParameterResolverFactory(applicationContext)); } if (handlerDefinition == null) { HandlerDefinition definitions = new SpringHandlerDefinitionBean(applicationContext).getObject(); HandlerEnhancerDefinition enhancers = new SpringHandlerEnhancerDefinitionBean(applicationContext) .getObject(); handlerDefinition = MultiHandlerDefinition.ordered(enhancers, definitions); } TransactionManager txManager = transactionManager == null ? NoTransactionManager.INSTANCE : new SpringTransactionManager(transactionManager, transactionDefinition); SpringAggregateSnapshotter snapshotter = new SpringAggregateSnapshotter(eventStore, parameterResolverFactory, handlerDefinition, executor, txManager, repositoryProvider); snapshotter.setApplicationContext(applicationContext); return snapshotter; }
Source:
<code>public void methodInjectionComesAfterInflation() { Menu menu = mock(Menu.class); assertThat(injectMenuActivity.menuIsInflated).isFalse(); injectMenuActivity.onCreateOptionsMenu(menu); assertThat(injectMenuActivity.menuIsInflated).isTrue(); <START> assertThat(injectMenuActivity.methodInjectedMenu).isSameAs(menu); <END> }</code><technical_language>I this assert is needed, is checked in other tests</technical_language>

Target:
public void methodInjectionComesAfterInflation() { Menu menu = mock(Menu.class); assertThat(injectMenuActivity.menuIsInflated).isFalse(); injectMenuActivity.onCreateOptionsMenu(menu); assertThat(injectMenuActivity.menuIsInflated).isTrue(); }
Source:
<code>protected ICommand getAfterMoveCommand(final MoveRequest request) { ICommand moveCommand = super.getAfterMoveCommand(request); Set<View> viewsToDestroy = new HashSet<View>(); @SuppressWarnings("unchecked") final Iterator<EObject> it = request.getElementsToMove().keySet().iterator(); while (it.hasNext()) { final EObject eObject = it.next(); if (eObject instanceof Generalization) { viewsToDestroy.addAll(getViewsToDestroy(eObject)); viewsToDestroy.addAll(getViewsAccordingToGeneralization((Generalization) eObject)); } else if (eObject instanceof <START> Property || <END> eObject instanceof BehavioralFeature || eObject instanceof Classifier) { viewsToDestroy.addAll(getViewsAccordingToEObject(eObject, request.getTargetContainer())); } } final Iterator<View> viewToDestroyIterator = viewsToDestroy.iterator(); while (viewToDestroyIterator.hasNext()) { final View view = viewToDestroyIterator.next(); final DeleteCommand destroyViewsCommand = new DeleteCommand(request.getEditingDomain(), view); moveCommand = CompositeCommand.compose(moveCommand, destroyViewsCommand); } return moveCommand; }</code><technical_language>In fact, replace Property BehavioralFeature Feature</technical_language>

Target:
protected ICommand getAfterMoveCommand(final MoveRequest request) { ICommand moveCommand = super.getAfterMoveCommand(request); Set<View> viewsToDestroy = new HashSet<View>(); @SuppressWarnings("unchecked") final Iterator<EObject> it = request.getElementsToMove().keySet().iterator(); while (it.hasNext()) { final EObject eObject = it.next(); if (eObject instanceof Generalization) { viewsToDestroy.addAll(getViewsToDestroy(eObject)); viewsToDestroy.addAll(getViewsAccordingToGeneralization((Generalization) eObject)); } else if (eObject instanceof Feature || eObject instanceof Classifier) { viewsToDestroy.addAll(getViewsAccordingToEObject(eObject, request.getTargetContainer())); } } final Iterator<View> viewToDestroyIterator = viewsToDestroy.iterator(); while (viewToDestroyIterator.hasNext()) { final View view = viewToDestroyIterator.next(); final DeleteCommand destroyViewsCommand = new DeleteCommand(request.getEditingDomain(), view); moveCommand = CompositeCommand.compose(moveCommand, destroyViewsCommand); } return moveCommand; }
Source:
<code>public void injectInto(PhoenicisScriptEngine phoenicisScriptEngine) { final Set<String> includedScripts = new HashSet<>(); <START> phoenicisScriptEngine.put("include", (Function<String, Object>) argument -> { <END> final String script = scriptFetcher.getScript(argument); if (script == null) { throwException(new ScriptException(argument + " is not found")); } if (includedScripts.add(argument)) { return phoenicisScriptEngine.evalAndReturn(" this::throwException); } return null; }, this::throwException); }</code><technical_language>this work in cases script e.g. defines variables? affect include is in scripts</technical_language>

Target:
public void injectInto(PhoenicisScriptEngine phoenicisScriptEngine) { final Set<String> includedScripts = new HashSet<>(); phoenicisScriptEngine.put("include", (Consumer<String>) argument -> { final String script = scriptFetcher.getScript(argument); if (script == null) { throwException(new ScriptException(argument + " is not found")); } if (includedScripts.add(argument)) { phoenicisScriptEngine.eval(" this::throwException); } }, this::throwException); }
Source:
<code>public void setup(Context.OperatorContext context) { super.setup(context); apexPythonEngine = initApexPythonEngineImpl(context); Map<PythonInterpreterConfig,Object> preInitConfigurations = getPreInitConfigurations(); apexPythonEngine.preInitInterpreter(preInitConfigurations); apexPythonEngine.startInterpreter(); apexPythonEngine.postStartInterpreter(); <START> initPartitioner(); <END> processPostSetUpPythonInstructions(apexPythonEngine); }</code><technical_language>this here, partitioner is executed in master in worker container (setup is called in latter)</technical_language>

Target:
public void setup(Context.OperatorContext context) { super.setup(context); LOG.debug("Initializing the python interpreter setup"); apexPythonEngine = initApexPythonEngineImpl(context); Map<PythonInterpreterConfig,Object> preInitConfigurations = getPreInitConfigurations(); apexPythonEngine.preInitInterpreter(preInitConfigurations); apexPythonEngine.startInterpreter(); LOG.debug("Python interpreter started. Now invoking post interpreter logic"); processPostSetUpPythonInstructions(apexPythonEngine); LOG.debug("Python post interpreter logic complete"); }
Source:
<code>public void closeDropdown() { JavascriptExecutor js = (JavascriptExecutor) driver; <START> js.executeScript("arguments[0].classList.remove('active')", exploreWikiaDropdown); <END> }</code><technical_language>please method directly, need store in variable</technical_language>

Target:
public void closeDropdown() { ((JavascriptExecutor) driver) .executeScript("arguments[0].classList.remove('active')", exploreWikiaDropdown); }
Source:
<code>protected static SerializationConfig createSerializationConfig() { return new SerializationConfig() <START> .setAllowUnsafe(true) <END> .setUseNativeByteOrder(true); }</code><technical_language>do want this in example? if allow unsafe? is HDCache working</technical_language>

Target:
protected static SerializationConfig createSerializationConfig() { SerializationConfig serializationConfig = new SerializationConfig(); if (USE_NATIVE_MEMORY_SERIALIZATION) { serializationConfig = serializationConfig .setAllowUnsafe(true) .setUseNativeByteOrder(true); } return serializationConfig; }
Source:
<code>private String[] readURL(String urlIn){ List<String> outList = new ArrayList<String>(); try { URL url = new URL(urlIn); URLConnection urlConnection = url.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); String line; while ((line = bufferedReader.readLine()) != null) { outList.add(line); } bufferedReader.close(); } <START> catch(Exception e) <END> { e.printStackTrace(); } return outList.toArray(new String[0]); }</code><technical_language>I throw IOException dealt properly a stage. end empty list is showing if empty file</technical_language>

Target:
private String[] readURL(String urlIn) throws IOException{ List<String> outList = new ArrayList<String>(); URL url = new URL(urlIn); URLConnection urlConnection = url.openConnection(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); String line; while ((line = bufferedReader.readLine()) != null) { outList.add(line); } bufferedReader.close(); return outList.toArray(new String[0]); }
Source:
<code>@Override protected void beforeTestsStarted() throws Exception { <START> startGrids(1); <END> }</code><technical_language>test incomplete, of reasons: 1. checks empty cache iterators. 2. check iterate iterator() spliterator() results. suggested changes below, sense for you? (changes test fail). IgniteEx ign = startGrids(1); IgniteCache<Integer, String> cache = ign.cache(DEFAULT_CACHE_NAME); cache.put(1, "1"); cache.put(2, "2"); cache.put(3, "3");</technical_language>

Target:
@Override protected void beforeTestsStarted() throws Exception { IgniteEx ignite = startGrids(1); IgniteCache<Integer, String> cache = ignite.cache(DEFAULT_CACHE_NAME); cache.put(1, "11"); cache.put(2, "12"); cache.put(3, "13"); }
Source:
<code>public CompositeLogoutHandler(LogoutHandler... logoutHandlers) { <START> this.logoutHandlers = Arrays.asList(logoutHandlers); <END> }</code><technical_language>validate null values</technical_language>

Target:
public CompositeLogoutHandler(LogoutHandler... logoutHandlers) { Assert.notEmpty(logoutHandlers, "LogoutHandlers are required"); this.logoutHandlers = Arrays.asList(logoutHandlers); }
Source:
<code>public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST); if (isVersionSupported("2.1.0")) { command.add(LTTngControlServiceConstants.OPTION_FIELDS); } ICommandResult result = executeCommand(command, monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { return allProviders; } if <START> (result.getErrorOutput().size() <END> > 0) { if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { return allProviders; } } if (isError(result)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } IUstProviderInfo provider = null; int index = 0; while (index < result.getOutput().size()) { String line = result.getOutput().get(index); Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); if (matcher.matches()) { provider = new UstProviderInfo(matcher.group(2).trim()); provider.setPid(Integer.valueOf(matcher.group(1).trim())); List<IBaseEventInfo> events = new ArrayList<>(); index = getProviderEventInfo(result.getOutput(), ++index, events); provider.setEvents(events); allProviders.add(provider); } else { index++; } } return allProviders; }</code><technical_language>!isEmpty</technical_language>

Target:
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST); if (isVersionSupported("2.1.0")) { command.add(LTTngControlServiceConstants.OPTION_FIELDS); } ICommandResult result = executeCommand(command, monitor, false); List<IUstProviderInfo> allProviders = new ArrayList<>(); if (!isVersionSupported("2.1.0") && (result.getResult() != 0)) { return allProviders; } if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) { return allProviders; } if (isError(result)) { throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } IUstProviderInfo provider = null; int index = 0; while (index < result.getOutput().size()) { String line = result.getOutput().get(index); Matcher matcher = LTTngControlServiceConstants.UST_PROVIDER_PATTERN.matcher(line); if (matcher.matches()) { provider = new UstProviderInfo(matcher.group(2).trim()); provider.setPid(Integer.valueOf(matcher.group(1).trim())); List<IBaseEventInfo> events = new ArrayList<>(); index = getProviderEventInfo(result.getOutput(), ++index, events); provider.setEvents(events); allProviders.add(provider); } else { index++; } } return allProviders; }
Source:
<code>public IndexCapability getCapability( SchemaIndexDescriptor schemaIndexDescriptor ) { IndexCapability[] capabilities = <START> instancesAs( selector, new IndexCapability[providers.length], provider -> provider.getCapability( schemaIndexDescriptor ) ); <END> return new UnionIndexCapability( capabilities ) { @Override public IndexOrder[] orderCapability( ValueCategory... valueCategories ) { if ( valueCategories.length == 1 && valueCategories[0] == ValueCategory.UNKNOWN ) { return ORDER_NONE; } return super.orderCapability( valueCategories ); } }; }</code><technical_language>In other places INSTANCE_COUNT for array length. do to</technical_language>

Target:
public IndexCapability getCapability( SchemaIndexDescriptor schemaIndexDescriptor ) { IndexCapability[] capabilities = providers.instancesAs( new IndexCapability[INSTANCE_COUNT], provider -> provider.getCapability( schemaIndexDescriptor ) ); return new UnionIndexCapability( capabilities ) { @Override public IndexOrder[] orderCapability( ValueCategory... valueCategories ) { if ( valueCategories.length == 1 && valueCategories[0] == ValueCategory.UNKNOWN ) { return ORDER_NONE; } return super.orderCapability( valueCategories ); } }; }
Source:
<code>public static void addPeopleSave(final Context context, Set<String> emails) { Log.e(TAG, "emails: " + emails); String title = context.getResources().getString(R.string.add_contact); <START> String message = TextUtils.join(", ", emails) + context.getResources().getString(R.string.add_contact_dialog_save); <END> showDialog(context, title, message); }</code><technical_language>a placeholder in localization instead of concatenating strings</technical_language>

Target:
public static void addPeopleSave(final Context context, Set<String> emails) { Log.e(TAG, "emails: " + emails); String title = context.getResources().getString(R.string.add_contact); String message = context.getResources().getString(R.string.add_contact_dialog_save, TextUtils.join(", ", emails)); showDialog(context, title, message); }
Source:
<code>public static SimpleFeatureCollection read(SimpleFeatureSource src, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws Exception { DefaultFeatureCollection fc = new DefaultFeatureCollection(); SimpleFeatureCollection sfc = src.getFeatures(); <START> MathTransform transform = getTransform(sourceCRS, targetCRS); <END> try (SimpleFeatureIterator it = sfc.features()) { while (it.hasNext()) { SimpleFeature f = it.next(); if (transform != null) { Object g = f.getDefaultGeometry(); if (g != null) { Geometry transformed = JTS.transform((Geometry) g, transform); f.setDefaultGeometry(transformed); } } fc.add(f); } } return fc; }</code><technical_language>transform need a null check here</technical_language>

Target:
public static SimpleFeatureCollection read(SimpleFeatureSource src, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws Exception { DefaultFeatureCollection fc = new DefaultFeatureCollection(); SimpleFeatureCollection sfc = src.getFeatures(); MathTransform transform = getTransform(sourceCRS, targetCRS); try (SimpleFeatureIterator it = sfc.features()) { while (it.hasNext()) { SimpleFeature f = it.next(); Object g = f.getDefaultGeometry(); if (g != null) { Geometry transformed = JTS.transform((Geometry) g, transform); f.setDefaultGeometry(transformed); } fc.add(f); } } return fc; }
Source:
<code>public Optional<String> getString(String key) { <START> return Optional.ofNullable(getDescriptors().get(key)).map(ConfigurationPropertyDescriptor::getValue); <END> }</code><technical_language>add blank behavior directly. A blank identical absent one</technical_language>

Target:
public Optional<String> getString(String key) { return Optional.ofNullable(getDescriptors().get(key)) .map(ConfigurationPropertyDescriptor::getValue) .filter(StringUtils::isNotBlank); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(" |-- ").append(getIdentification()).append(": "); sb.append(getName()).append(" "); sb.append("(").append(getType()).append(") "); sb.append("Maj:Min=").append(getMajor()).append(":").append(getMinor()).append(", "); sb.append("size: ").append(FormatUtil.formatBytesDecimal(getSize())); <START> sb.append(getMountPoint().isEmpty() ? "" : " @ " + getMountPoint()).append("\n"); <END> return sb.toString(); }</code><technical_language>similar earlier, include newline in toString. If needed for output, add in other class (but needed there)</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getIdentification()).append(": "); sb.append(getName()).append(" "); sb.append("(").append(getType()).append(") "); sb.append("Maj:Min=").append(getMajor()).append(":").append(getMinor()).append(", "); sb.append("size: ").append(FormatUtil.formatBytesDecimal(getSize())); sb.append(getMountPoint().isEmpty() ? "" : " @ " + getMountPoint()); return sb.toString(); }
Source:
<code>public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); disableCliScheduleEditor.setVisible(false); object.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { GlusterVolumeSnapshotModel model = (GlusterVolumeSnapshotModel) sender; if ("disableCliScheduleChkBox".equals(args.propertyName)) { disableCliScheduleEditor.setVisible(model.isDisableCliScheduleChkBoxVisible()); } <START> } <END> }); updateVisibilities(object); updateTabVisibilities(object); }</code><technical_language>This done in presenter</technical_language>

Target:
public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); disableCliScheduleEditor.setVisible(false); updateVisibilities(object); updateTabVisibilities(object); }
Source:
<code>protected boolean canDoAction() { <START> if (!super.canDoAction()) { <END> return false; } if (getGlusterVolume() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); return false; } setVdsGroupId(getGlusterVolume().getClusterId()); return true; }</code><technical_language>super.canDoAction() assuming cluster id set, checking for server, need overcome this also, please of commands inheriting this command base assume same, specially in getPermissionCheckSubject is called canDoAction (this is initiate params in ctor)</technical_language>

Target:
protected boolean canDoAction() { if (getGlusterVolume() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); return false; } setVdsGroupId(getGlusterVolume().getClusterId()); if (!super.canDoAction()) { return false; } return true; }
Source:
<code>private boolean addEndpoints(MutableCapacityGraph<Vertex, Integer> capacityGraph, RangeVertex rangeVertex, boolean localDCCheck) { boolean sourceFound = false; Replicas.checkFull(rangesWithSources.get(rangeVertex.getRange())); for (Replica replica : rangesWithSources.get(rangeVertex.getRange())) { if (passFilters(replica, localDCCheck)) { sourceFound = true; <START> if (replica.getEndpoint().equals(FBUtilities.getBroadcastAddressAndPort())) <END> continue; final Vertex endpointVertex = new EndpointVertex(replica.getEndpoint()); capacityGraph.insertVertex(rangeVertex); capacityGraph.insertVertex(endpointVertex); capacityGraph.addEdge(rangeVertex, endpointVertex, Integer.MAX_VALUE); } } return sourceFound; }</code><technical_language>Crazy thought, if Replica isLocal something</technical_language>

Target:
private boolean addEndpoints(MutableCapacityGraph<Vertex, Integer> capacityGraph, RangeVertex rangeVertex, boolean localDCCheck) { boolean sourceFound = false; Replicas.checkFull(rangesWithSources.get(rangeVertex.getRange())); for (Replica replica : rangesWithSources.get(rangeVertex.getRange())) { if (passFilters(replica, localDCCheck)) { sourceFound = true; if (replica.isLocal()) continue; final Vertex endpointVertex = new EndpointVertex(replica.getEndpoint()); capacityGraph.insertVertex(rangeVertex); capacityGraph.insertVertex(endpointVertex); capacityGraph.addEdge(rangeVertex, endpointVertex, Integer.MAX_VALUE); } } return sourceFound; }
Source:
<code>public int compare(final Contentlet contentlet1, final Contentlet contentlet2) { try { Object value1 = contentlet1.get(field); Object value2 = contentlet2.get(field); int ret = 0; if (value1 == null || value2 == null) { return ret; } else if (value1 instanceof Integer) { ret = ((Integer)value1).compareTo((Integer)value2); } else if (value1 instanceof Long) { ret = ((Long)value1).compareTo((Long)value2); } else if (value1 instanceof Date) { <START> ret = ((Date)value1).compareTo((Date)value2); <END> } else if (value1 instanceof Float) { ret = ((Float)value1).compareTo((Float)value2); } else if (value1 instanceof Boolean) { ret = ((Boolean)value1).compareTo((Boolean)value2); } else { ret = ((String)value1).compareTo((String)value2); } if (direction.equals("asc")) { return ret; } return ret * -1; } catch (Exception e) { Logger.warnAndDebug(ContentMapComparator.class, "Error sorting contents using criteria: " + field + " " + direction, e); } return 0; }</code><technical_language>value2 get ClassCastExceptions - I value1 value2 instances of object type</technical_language>

Target:
public int compare(final Contentlet contentlet1, final Contentlet contentlet2) { try { Object value1 = contentlet1.get(field); Object value2 = contentlet2.get(field); int ret = 0; if (value1 == null || value2 == null) { return ret; } else if (value1 instanceof Integer && value2 instanceof Integer) { ret = ((Integer)value1).compareTo((Integer)value2); } else if (value1 instanceof Long && value2 instanceof Long) { ret = ((Long)value1).compareTo((Long)value2); } else if (value1 instanceof Date && value2 instanceof Date) { ret = ((Date)value1).compareTo((Date)value2); } else if (value1 instanceof Float && value2 instanceof Float) { ret = ((Float)value1).compareTo((Float)value2); } else if (value1 instanceof Boolean && value2 instanceof Boolean) { ret = ((Boolean)value1).compareTo((Boolean)value2); } else { ret = (String.valueOf(value1)).compareTo(String.valueOf(value2)); } if (direction.equals("asc")) { return ret; } return ret * -1; } catch (Exception e) { Logger.warnAndDebug(ContentMapComparator.class, "Error sorting contents using criteria: " + field + " " + direction, e); } return 0; }
Source:
<code>private boolean isInvalidJson(String json) { try { new JsonParser().parse(json); return false; } catch (Exception e) { <START> return false; <END> } }</code><technical_language>true</technical_language>

Target:
private boolean isInvalidJson(String json) { try { new JsonParser().parse(json); return false; } catch (Exception e) { return true; } }
Source:
<code>public void test_DnDPackageFromMC2DiagramBlank2() throws Exception { openRepresentation2(); try { openErrorLogViewByAPI(); <START> bot.views(); <END> SWTBot errorLogBot = bot.viewByPartName("Error Log").bot(); int rowCount = errorLogBot.tree().rowCount(); DndUtil util = new DndUtil(bot.getDisplay()); final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P1); util.dragAndDrop(ecoreTreeItem, editor.getCanvas()); bot.waitUntil(new DiagramWithChildrensCondition(editor, 1)); assertEquals("An error message was generated !", rowCount, errorLogBot.tree().rowCount()); IGraphicalEditPart p1EditPart = (IGraphicalEditPart) editor.getEditPart(CONTAINER_TO_DRAG_P1, DNodeContainerEditPart.class).part(); checkEditPartLocation(p1EditPart); } finally { closeErrorLogView(); } }</code><technical_language>call that? If is necessary, I guess, call is necessary in commit message</technical_language>

Target:
public void test_DnDPackageFromMC2DiagramBlank2() throws Exception { openRepresentation2(); try { openErrorLogViewByAPI(); SWTBot errorLogBot = bot.viewByPartName("Error Log").bot(); int rowCount = errorLogBot.tree().rowCount(); DndUtil util = new DndUtil(bot.getDisplay()); final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P1); util.dragAndDrop(ecoreTreeItem, editor.getCanvas()); bot.waitUntil(new DiagramWithChildrensCondition(editor, 1)); assertEquals("An error message was generated !", rowCount, errorLogBot.tree().rowCount()); IGraphicalEditPart p1EditPart = (IGraphicalEditPart) editor.getEditPart(CONTAINER_TO_DRAG_P1, DNodeContainerEditPart.class).part(); checkEditPartLocation(p1EditPart); } finally { closeErrorLogView(); } }
Source:
<code>public Animation() { <START> listeners = new ArrayList<AnimationListener>(); <END> frames = new ArrayList<Frame>(); currentState = AnimState.PRESTART; repeat = 0; elapsedTime = 0; currentFrame = 0; }</code><technical_language>assign lists in field declaration declare final. A minor issue, though</technical_language>

Target:
public Animation() { currentState = AnimState.PRESTART; currentRepeatCount = 0; repeatCount = 0; elapsedTime = 0; currentFrame = 0; repeatMode = RepeatMode.REPEAT_INFINITE; }