Issue
:app:compileDebugJavaWithJavacC:\Users\Aris\AndroidStudioProjects\weka-android-master\app\src\main\java\com\ilham1012\testweka\MainActivity.java:2077: error: too many parameters
public String classifyWeka(double cn1, double cn2, double cn3, double cn4, double cn5, double cn6, double cn7, double cn8, double cn9, double cn10, double cn11, double cn12, double cn13, double cn14, double cn15, double cn16, double cn17, double cn18, double cn19, double cn20, double cn21, double cn22, double cn23, double cn24, double cn25, double cn26, double cn27, double cn28, double cn29, double cn30, double cn31, double cn32, double cn33, double cn34, double cn35, double cn36, double cn37, double cn38, double cn39, double cn40, double cn41, double cn42, double cn43, double cn44, double cn45, double cn46, double cn47, double cn48, double cn49, double cn50, double cn51, double cn52, double cn53, double cn54, double cn55, double cn56, double cn57, double cn58, double cn59, double cn60, double cn61, double cn62, double cn63, double cn64, double cn65, double cn66, double cn67, double cn68, double cn69, double cn70, double cn71, double cn72, double cn73, double cn74, double cn75, double cn76, double cn77, double cn78, double cn79, double cn80, double cn81, double cn82, double cn83, double cn84, double cn85, double cn86, double cn87, double cn88, double cn89, double cn90, double cn91, double cn92, double cn93, double cn94, double cn95, double cn96, double cn97, double cn98, double cn99, double cn100, double cn101, double cn102, double cn103, double cn104, double cn105, double cn106, double cn107, double cn108, double cn109, double cn110, double cn111, double cn112, double cn113, double cn114, double cn115, double cn116, double cn117, double cn118, double cn119, double cn120, double cn121, double cn122, double cn123, double cn124, double cn125, double cn126, double cn127, double cn128, double cn129, double cn130, double cn131, double cn132, double cn133, double cn134, double cn135, double cn136, double cn137, double cn138, double cn139, double cn140, double cn141, double cn142, double cn143, double cn144, double cn145, double cn146, double cn147, double cn148, double cn149, double cn150, double cn151, double cn152, double cn153, double cn154, double cn155, double cn156, double cn157, double cn158, double cn159, double cn160, double cn161, double cn162, double cn163, double cn164, double cn165, double cn166, double cn167, double cn168, double cn169, double cn170, double cn171, double cn172, double cn173, double cn174, double cn175, double cn176, double cn177, double cn178, double cn179, double cn180, double cn181, double cn182, double cn183, double cn184, double cn185, double cn186, double cn187, double cn188, double cn189, double cn190, double cn191, double cn192, double cn193, double cn194, double cn195, double cn196, double cn197, double cn198, double cn199, double cn200, double cn201, double cn202, double cn203, double cn204, double cn205, double cn206, double cn207, double cn208, double cn209, double cn210, double cn211, double cn212, double cn213, double cn214, double cn215, double cn216, double cn217, double cn218, double cn219, double cn220, double cn221, double cn222, double cn223, double cn224, double cn225)
1 error FAILED
FAILURE: Build failed with an exception.
any suggestion please
Solution
Your code is close to breaking the VM specification:
4.3.3. Method Descriptors:
(...) A method descriptor is valid only if it represents method parameters with a total length of 255 or less, where that length includes the contribution for this in the case of instance or interface method invocations. (...)
You have to refactor your method, in one of three ways:
- Generate your class with no or some constructor arguments and then set the rest parameters via setters. Like using the builder pattern.
- Make simpler classes and set those simpler objects in 1 master class.
- Use
args...
construction instead of separated params.
I see your method has 225 params, but it could be still a problem for JVM. Even if your params number would be available, you should rebuild the method with clean code rules.
Answered By - M. Dudek
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.